Skip to content

Commit

Permalink
Merge pull request #743 from ehuss/fix-unstable-check
Browse files Browse the repository at this point in the history
Fix unstable check.
  • Loading branch information
Centril committed Apr 8, 2020
2 parents ee509d5 + 91486df commit e32eac4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/types/never.md
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
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

0 comments on commit e32eac4

Please sign in to comment.