Fix #88155
This commit is contained in:
13
src/test/ui/rfc-2632-const-trait-impl/issue-88155.rs
Normal file
13
src/test/ui/rfc-2632-const-trait-impl/issue-88155.rs
Normal 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() {}
|
||||
9
src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr
Normal file
9
src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr
Normal 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`.
|
||||
Reference in New Issue
Block a user