Fix #91489
This commit is contained in:
parent
e70e4d499d
commit
5166f68754
3 changed files with 24 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue