Don't just check params
This commit is contained in:
parent
c2da21063f
commit
f9e14af7f0
@ -301,7 +301,6 @@ fn check_gat_where_clauses(
|
||||
sig.output().visit_with(&mut visitor);
|
||||
let mut wf_tys = FxHashSet::default();
|
||||
wf_tys.extend(sig.inputs());
|
||||
// FIXME: normalize and add normalized inputs?
|
||||
|
||||
for (region, region_idx) in &visitor.regions {
|
||||
for (ty, ty_idx) in &visitor.types {
|
||||
@ -423,12 +422,9 @@ fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
GenericArgKind::Lifetime(lt) => {
|
||||
self.regions.insert((lt, idx));
|
||||
}
|
||||
GenericArgKind::Type(t) => match t.kind() {
|
||||
ty::Param(_) => {
|
||||
self.types.insert((t, idx));
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
GenericArgKind::Type(t) => {
|
||||
self.types.insert((t, idx));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ trait Deserializer4 {
|
||||
|
||||
struct Wrap<T>(T);
|
||||
|
||||
// Even though we might theoretically want `D: 'x`, because we pass `Wrap<T>` and
|
||||
// we see `&'z Wrap<T>`, we are conservative and only add bounds for direct params
|
||||
// We pass `Wrap<T>` and we see `&'z Wrap<T>`, so we require `D: 'x`
|
||||
trait Des {
|
||||
type Out<'x, D>;
|
||||
//~^ Missing required bounds
|
||||
fn des<'z, T>(&self, data: &'z Wrap<T>) -> Self::Out<'z, Wrap<T>>;
|
||||
}
|
||||
/*
|
||||
|
@ -30,6 +30,14 @@ LL | type Out<'x, 'y>;
|
||||
| |
|
||||
| help: add the required where clauses: `where U: 'y, T: 'x`
|
||||
|
||||
error: Missing required bounds on Out
|
||||
--> $DIR/self-outlives-lint.rs:59:5
|
||||
|
|
||||
LL | type Out<'x, D>;
|
||||
| ^^^^^^^^^^^^^^^-
|
||||
| |
|
||||
| help: add the required where clauses: `where D: 'x`
|
||||
|
||||
error: Missing required bounds on Out
|
||||
--> $DIR/self-outlives-lint.rs:75:5
|
||||
|
|
||||
@ -46,5 +54,5 @@ LL | type Out<'x, D>;
|
||||
| |
|
||||
| help: add the required where clauses: `where D: 'x`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user