mirror of https://github.com/rust-lang/book
Remove the check for unstable features
We don't use nightly Rust anymore, nor do we try to land docs for features while they're still unstable, so this check is no longer needed. The tests will just fail if we try to use a feature flag in code listings.
This commit is contained in:
parent
26f87b6aa9
commit
5b2740e64a
|
@ -4,13 +4,6 @@ set -e
|
|||
|
||||
export PATH=$PATH:/home/travis/.cargo/bin;
|
||||
|
||||
# Feature check
|
||||
cd ci/stable-check
|
||||
|
||||
cargo run -- ../../src
|
||||
|
||||
cd ../..
|
||||
|
||||
echo 'Spellchecking...'
|
||||
bash ci/spellcheck.sh list
|
||||
echo 'Testing...'
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[root]
|
||||
name = "stable-check"
|
||||
version = "0.1.0"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[package]
|
||||
name = "stable-check"
|
||||
version = "0.1.0"
|
||||
authors = ["steveklabnik <steve@steveklabnik.com>"]
|
||||
|
||||
[dependencies]
|
|
@ -1,43 +0,0 @@
|
|||
use std::error::Error;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let arg = env::args().nth(1).unwrap_or_else(|| {
|
||||
println!("Please pass a src directory as the first argument");
|
||||
std::process::exit(1);
|
||||
});
|
||||
|
||||
match check_directory(&Path::new(&arg)) {
|
||||
Ok(()) => println!("passed!"),
|
||||
Err(e) => {
|
||||
println!("Error: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn check_directory(dir: &Path) -> Result<(), Box<Error>> {
|
||||
for entry in fs::read_dir(dir)? {
|
||||
let entry = entry?;
|
||||
let path = entry.path();
|
||||
|
||||
if path.is_dir() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut file = File::open(&path)?;
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents)?;
|
||||
|
||||
if contents.contains("#![feature") {
|
||||
return Err(From::from(format!("Feature flag found in {:?}", path)));
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue