mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Auto merge of #8287 - Jarcho:iter_not_returning_iterator_8285, r=Manishearth
Erase late bound regions in `iter_not_returning_iterator` fixes #8285 changelog: None
This commit is contained in:
commit
496f26c229
@ -66,7 +66,7 @@ impl<'tcx> LateLintPass<'tcx> for IterNotReturningIterator {
|
||||
|
||||
fn check_sig(cx: &LateContext<'_>, name: &str, sig: &FnSig<'_>, fn_id: LocalDefId) {
|
||||
if sig.decl.implicit_self.has_implicit_self() {
|
||||
let ret_ty = cx.tcx.fn_sig(fn_id).skip_binder().output();
|
||||
let ret_ty = cx.tcx.erase_late_bound_regions(cx.tcx.fn_sig(fn_id).output());
|
||||
let ret_ty = cx
|
||||
.tcx
|
||||
.try_normalize_erasing_regions(cx.param_env, ret_ty)
|
||||
|
@ -64,4 +64,11 @@ impl S {
|
||||
}
|
||||
}
|
||||
|
||||
struct S2([u8]);
|
||||
impl S2 {
|
||||
fn iter(&self) -> core::slice::Iter<u8> {
|
||||
self.0.iter()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user