rust/tests/ui/traits/const-traits/call-generic-method-fail.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
217 B
Rust
Raw Normal View History

2024-06-30 17:08:45 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2021-08-25 14:30:09 +00:00
pub const fn equals_self<T: PartialEq>(t: &T) -> bool {
*t == *t
//~^ ERROR cannot call non-const operator in constant functions
}
fn main() {}