Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unstable check. #743

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/types/never.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The never type `!` is a type with no values, representing the result of
computations that never complete. Expressions of type `!` can be coerced into
any other type.

```rust,should_panic
#![feature(never_type)]
<!-- ignore: unstable -->
```rust,ignore
let x: ! = panic!();
// Can be coerced into any type.
let y: u32 = x;
Expand Down
4 changes: 3 additions & 1 deletion stable-check/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions stable-check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ fn check_directory(dir: &Path) -> Result<(), Box<dyn Error>> {
let path = entry.path();

if path.is_dir() {
continue;
return check_directory(&path);
}

let mut file = File::open(&path)?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;

if contents.contains("#![feature") {
// `attributes.md` contains this and it is legitimate.
if !contents.contains("#![feature(feature1, feature2, feature3)]") {
return Err(From::from(format!("Feature flag found in {:?}", path)));
}
return Err(From::from(format!("Feature flag found in {:?}", path)));
}
}

Expand Down