Rollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr
Opaque types' generic params do not imply anything about their hidden type's lifetimes fixes #97104 cc ```@aliemjay```
This commit is contained in:
commit
d392838b69
9 changed files with 127 additions and 9 deletions
|
@ -666,7 +666,7 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
|
|||
// ignore the inputs to a projection, as they may not appear
|
||||
// in the normalized form
|
||||
if self.just_constrained {
|
||||
if let ty::Projection(..) = t.kind() {
|
||||
if let ty::Projection(..) | ty::Opaque(..) = t.kind() {
|
||||
return ControlFlow::CONTINUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2940,8 +2940,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
// though we can easily give a hint that ought to be
|
||||
// relevant.
|
||||
err.note(
|
||||
"lifetimes appearing in an associated type are not considered constrained",
|
||||
"lifetimes appearing in an associated or opaque type are not considered constrained",
|
||||
);
|
||||
err.note("consider introducing a named lifetime parameter");
|
||||
}
|
||||
|
||||
err.emit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue