Skip to content

Commit 28daee4

Browse files
committed
Rustup
1 parent 547d9ca commit 28daee4

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

Cargo.toml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,41 @@ 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+
# keep in sync with `cargo`'s `Cargo.toml'
58+
"handleapi",
59+
"jobapi",
60+
"jobapi2",
61+
"minwindef",
62+
"ntdef",
63+
"ntstatus",
64+
"processenv",
65+
"processthreadsapi",
66+
"psapi",
67+
"synchapi",
68+
"winerror",
69+
"winbase",
70+
"wincon",
71+
"winnt",
72+
# no idea where these come from
73+
"lmcons",
74+
"minschannel",
75+
"minwinbase",
76+
"ntsecapi",
77+
"profileapi",
78+
"schannel",
79+
"securitybaseapi",
80+
"synchapi",
81+
"sysinfoapi",
82+
"timezoneapi",
83+
"wincrypt",
84+
]
85+
5486
[dev-dependencies]
5587
cargo_metadata = "0.5"
5688
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)