Skip to content

Commit 31ae3b2

Browse files
committed
Add HAS_RE_LATE_BOUND if there are bound vars
1 parent 1919b3f commit 31ae3b2

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

compiler/rustc_middle/src/ty/flags.rs

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ impl FlagComputation {
5959
{
6060
let mut computation = FlagComputation::new();
6161

62+
if !value.bound_vars().is_empty() {
63+
computation.flags = computation.flags | TypeFlags::HAS_RE_LATE_BOUND;
64+
}
65+
6266
f(&mut computation, value.skip_binder());
6367

6468
self.add_flags(computation.flags);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// build-pass
2+
// compile-flags: --edition 2018
3+
// compile-flags: --crate-type rlib
4+
5+
use std::future::Future;
6+
7+
async fn handle<F>(slf: &F)
8+
where
9+
F: Fn(&()) -> Box<dyn for<'a> Future<Output = ()> + Unpin>,
10+
{
11+
(slf)(&()).await;
12+
}
13+
14+
fn main() {}

src/test/ui/lifetimes/issue-84604.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// run-pass
2+
// compile-flags: -Zsymbol-mangling-version=v0
3+
4+
pub fn f<T: ?Sized>() {}
5+
pub trait Frob<T: ?Sized> {}
6+
fn main() {
7+
f::<dyn Frob<str>>();
8+
f::<dyn for<'a> Frob<str>>();
9+
}

0 commit comments

Comments
 (0)