This commit is contained in:
Deadbeef
2021-08-26 17:58:28 +00:00
parent 703c557aaa
commit c75aeaac0b
3 changed files with 68 additions and 36 deletions

View File

@@ -0,0 +1,13 @@
#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]
pub trait A {
fn assoc() -> bool;
}
pub const fn foo<T: A>() -> bool {
T::assoc()
//~^ ERROR calls in constant functions are limited
}
fn main() {}

View File

@@ -0,0 +1,9 @@
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/issue-88155.rs:9:5
|
LL | T::assoc()
| ^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0015`.