Skip to content

Commit 6412661

Browse files
committed
Rustup
1 parent 547d9ca commit 6412661

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

Cargo.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,28 @@ semver = "0.9"
4848
# Not actually needed right now but required to make sure that clippy/ and cargo build
4949
# with the same set of features in rust-lang/rust
5050
num-traits = "0.2" # enable the default feature
51-
winapi = "0.3"
5251
backtrace = "0.3"
5352

53+
# keep in sync with `cargo`'s `Cargo.toml'
54+
[target.'cfg(windows)'.dependencies.winapi]
55+
version = "0.3"
56+
features = [
57+
"handleapi",
58+
"jobapi",
59+
"jobapi2",
60+
"minwindef",
61+
"ntdef",
62+
"ntstatus",
63+
"processenv",
64+
"processthreadsapi",
65+
"psapi",
66+
"synchapi",
67+
"winerror",
68+
"winbase",
69+
"wincon",
70+
"winnt",
71+
]
72+
5473
[dev-dependencies]
5574
cargo_metadata = "0.5"
5675
compiletest_rs = "0.3.7"

clippy_lints/src/lifetimes.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,23 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
342342
self.record(&None);
343343
},
344344
TyPath(ref path) => {
345-
self.collect_anonymous_lifetimes(path, ty);
346-
},
347-
TyImplTraitExistential(exist_ty_id, _, _) => {
348-
if let ItemExistential(ref exist_ty) = self.cx.tcx.hir.expect_item(exist_ty_id.id).node {
349-
for bound in &exist_ty.bounds {
350-
if let GenericBound::Outlives(_) = *bound {
351-
self.record(&None);
345+
if let QPath::Resolved(_, ref path) = *path {
346+
if let Def::Existential(def_id) = path.def {
347+
let node_id = self.cx.tcx.hir.as_local_node_id(def_id).unwrap();
348+
if let ItemExistential(ref exist_ty) = self.cx.tcx.hir.expect_item(node_id).node {
349+
for bound in &exist_ty.bounds {
350+
if let GenericBound::Outlives(_) = *bound {
351+
self.record(&None);
352+
}
353+
}
354+
} else {
355+
unreachable!()
352356
}
357+
walk_ty(self, ty);
358+
return;
353359
}
354360
}
361+
self.collect_anonymous_lifetimes(path, ty);
355362
}
356363
TyTraitObject(ref bounds, ref lt) => {
357364
if !lt.is_elided() {

0 commit comments

Comments
 (0)