You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a OutlivesComponent::Alias as these use equality on the computed region constraints graph. When computing the implied bounds, the hidden type of impl Sized still has unconstrained regions, so region outlive bounds don't get added to the free_region_relations.
use std::any::Any;structOutlives<'a,T>(Option<&'aT>);traitTrait{typeAssoc;}impl<T>TraitforT{typeAssoc = T;}// Computing the implied bounds for `foo` normalizes `impl Sized` to// `Outlives::<'static, <T as Trait>::Assoc>`, adding the implied bound// `<T as Trait>::Assoc: 'static`.//// The caller does not have to prove that bound.fnfoo<T:Trait>(x: <TasTrait>::Assoc) -> (Box<dynAny>,implSized){(Box::new(x),Outlives::<'static, <TasTrait>::Assoc>(None))}fnmain(){let string = String::from("temporary");let(any, _proof) = foo::<&str>(string.as_str());drop(_proof);drop(string);println!("{}", any.downcast_ref::<&str>().unwrap());}
The text was updated successfully, but these errors were encountered:
Not sure how we're gonna do this, especially b/c now with TypingEnv being associated with an inference context it's not so easy to just swap out the reveal mode to something that keeps the opaques opaque.
This is unsound with the new solver with rust-lang/rust#136074.
I am using a
OutlivesComponent::Alias
as these use equality on the computed region constraints graph. When computing the implied bounds, the hidden type ofimpl Sized
still has unconstrained regions, so region outlive bounds don't get added to thefree_region_relations
.The text was updated successfully, but these errors were encountered: