Rustup and lazy_static version mismatch fix

fixes #2274
This commit is contained in:
Oliver Schneider 2017-12-15 10:02:39 +01:00
parent 86da435461
commit 8ddcb81a15
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
10 changed files with 32 additions and 23 deletions

View file

@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.
## 0.0.176
* Rustup to *rustc 1.24.0-nightly (0077d128d 2017-12-14)*
## 0.0.175
* Rustup to *rustc 1.24.0-nightly (bb42071f6 2017-12-01)*

View file

@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.175"
version = "0.0.176"
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",
"Andre Bogus <bogusandre@gmail.com>",
@ -37,7 +37,7 @@ path = "src/driver.rs"
[dependencies]
# begin automatic update
clippy_lints = { version = "0.0.175", path = "clippy_lints" }
clippy_lints = { version = "0.0.176", path = "clippy_lints" }
# end automatic update
cargo_metadata = "0.2"
regex = "0.2"
@ -45,7 +45,7 @@ regex = "0.2"
[dev-dependencies]
compiletest_rs = "0.3"
duct = "0.8.2"
lazy_static = "0.2"
lazy_static = "1.0"
serde_derive = "1.0"
clippy-mini-macro-test = { version = "0.1", path = "mini-macro" }
serde = "1.0"

View file

@ -1,7 +1,7 @@
[package]
name = "clippy_lints"
# begin automatic update
version = "0.0.175"
version = "0.0.176"
# end automatic update
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",
@ -17,7 +17,7 @@ keywords = ["clippy", "lint", "plugin"]
[dependencies]
itertools = "0.6.0"
lazy_static = "0.2.8"
lazy_static = "1.0"
matches = "0.1.2"
quine-mc_cluskey = "0.2.2"
regex-syntax = "0.4.0"

View file

@ -129,6 +129,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
hir::ItemStatic(..) => "a static",
hir::ItemStruct(..) => "a struct",
hir::ItemTrait(..) => "a trait",
hir::ItemTraitAlias(..) => "a trait alias",
hir::ItemGlobalAsm(..) => "an assembly blob",
hir::ItemTy(..) => "a type alias",
hir::ItemUnion(..) => "a union",

View file

@ -403,6 +403,9 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
println!("trait is not auto");
}
},
hir::ItemTraitAlias(..) => {
println!("trait alias");
}
hir::ItemAutoImpl(_, ref _trait_ref) => {
println!("auto impl");
},

View file

@ -940,6 +940,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {
Def::StructCtor(id, ..) |
Def::Union(id) |
Def::Trait(id) |
Def::TraitAlias(id) |
Def::Method(id) |
Def::Const(id) |
Def::AssociatedConst(id) |

View file

@ -141,10 +141,12 @@ pub fn main() {
let args = std::iter::once(format!("--manifest-path={}", manifest_path)).chain(args);
if let Some(first) = target.kind.get(0) {
if target.kind.len() > 1 || first.ends_with("lib") {
println!("lib: {}", target.name);
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args)) {
std::process::exit(code);
}
} else if ["bin", "example", "test", "bench"].contains(&&**first) {
println!("{}: {}", first, target.name);
if let Err(code) = process(
vec![format!("--{}", first), target.name]
.into_iter()

View file

@ -72,21 +72,3 @@ fn compile_test() {
run_mode("run-pass", "run-pass");
run_mode("ui", "ui");
}
#[test]
fn dogfood() {
prepare_env();
let files = ["src/main.rs", "src/driver.rs", "src/lib.rs", "clippy_lints/src/lib.rs"];
let mut config = config("dogfood", "ui");
config.target_rustcflags = config.target_rustcflags.map(|flags| format!("{} -Dclippy -Dclippy_pedantic -Dclippy_internal", flags));
for file in &files {
let paths = test::TestPaths {
base: PathBuf::new(),
file: PathBuf::from(file),
relative_dir: PathBuf::new(),
};
compiletest::runtest::run(config.clone(), &paths);
}
}

17
tests/dogfood.rs Normal file
View file

@ -0,0 +1,17 @@
#[test]
fn dogfood() {
let root_dir = std::env::current_dir().unwrap();
for d in &[".", "clippy_lints"] {
std::env::set_current_dir(root_dir.join(d)).unwrap();
let output = std::process::Command::new("cargo")
.arg("run")
.arg("--bin").arg("cargo-clippy")
.arg("--manifest-path").arg(root_dir.join("Cargo.toml"))
.output().unwrap();
println!("status: {}", output.status);
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success());
}
}