Fix #91489
This commit is contained in:
parent
e70e4d499d
commit
5166f68754
@ -1319,6 +1319,11 @@ pub fn with_user_facing(mut self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn without_const(mut self) -> Self {
|
||||
self.packed.set_tag(ParamTag { constness: hir::Constness::NotConst, ..self.packed.tag() });
|
||||
self
|
||||
}
|
||||
|
||||
/// Returns a new parameter environment with the same clauses, but
|
||||
/// which "reveals" the true results of projections in all cases
|
||||
/// (even for associated types that are specializable). This is
|
||||
|
@ -80,7 +80,7 @@ fn check_closure(
|
||||
|
||||
let generator_types = check_fn(
|
||||
self,
|
||||
self.param_env,
|
||||
self.param_env.without_const(),
|
||||
liberated_sig,
|
||||
decl,
|
||||
expr.hir_id,
|
||||
|
@ -0,0 +1,18 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(const_fn_trait_bound)]
|
||||
|
||||
trait Convert<T> {
|
||||
fn to(self) -> T;
|
||||
}
|
||||
|
||||
impl<A, B> const Convert<B> for A where B: ~const From<A> {
|
||||
fn to(self) -> B {
|
||||
B::from(self)
|
||||
}
|
||||
}
|
||||
|
||||
const FOO: fn() -> String = || "foo".to();
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user