Add HAS_RE_LATE_BOUND if there are bound vars
This commit is contained in:
parent
1919b3f227
commit
31ae3b2bdb
3 changed files with 27 additions and 0 deletions
|
@ -59,6 +59,10 @@ impl FlagComputation {
|
|||
{
|
||||
let mut computation = FlagComputation::new();
|
||||
|
||||
if !value.bound_vars().is_empty() {
|
||||
computation.flags = computation.flags | TypeFlags::HAS_RE_LATE_BOUND;
|
||||
}
|
||||
|
||||
f(&mut computation, value.skip_binder());
|
||||
|
||||
self.add_flags(computation.flags);
|
||||
|
|
14
src/test/ui/lifetimes/issue-83737-erasing-bound-vars.rs
Normal file
14
src/test/ui/lifetimes/issue-83737-erasing-bound-vars.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// build-pass
|
||||
// compile-flags: --edition 2018
|
||||
// compile-flags: --crate-type rlib
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
async fn handle<F>(slf: &F)
|
||||
where
|
||||
F: Fn(&()) -> Box<dyn for<'a> Future<Output = ()> + Unpin>,
|
||||
{
|
||||
(slf)(&()).await;
|
||||
}
|
||||
|
||||
fn main() {}
|
9
src/test/ui/lifetimes/issue-84604.rs
Normal file
9
src/test/ui/lifetimes/issue-84604.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// run-pass
|
||||
// compile-flags: -Zsymbol-mangling-version=v0
|
||||
|
||||
pub fn f<T: ?Sized>() {}
|
||||
pub trait Frob<T: ?Sized> {}
|
||||
fn main() {
|
||||
f::<dyn Frob<str>>();
|
||||
f::<dyn for<'a> Frob<str>>();
|
||||
}
|
Loading…
Add table
Reference in a new issue