rust-lang / rust-lang/rust-by-example
Function - diverging example code does not compile at all on stable release channel
Nobody has claimed this yet.
- Dominant language
- Handlebars
- Stars
- 8.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Link to page: https://doc.rust-lang.org/stable/rust-by-example/fn/diverging.html
Code in question:
#![feature(never_type)]
fn main() {
let x: ! = panic!("This call never returns.");
println!("You will never see this line!");
}
This results in the following error:
error[E0554]: `#![feature]` may not be used on the stable release channel
--> src/main.rs:1:1
|
1 | #![feature(never_type)]
| ^^^^^^^^^^^^^^^^^^^^^^^
I'm guessing this example was written before this limitation was introduced (or feature flag removed) from the stable channel? Or is it not meant to compile at all? Should it be removed?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the stable Rust by Example page at fn/diverging.html and run the displayed snippet on the stable release channel. Check the never_type feature requirement and determine whether the example should be revised or removed; done means the page no longer presents code that fails to compile on stable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100