rust/tests/fail/issue-miri-2432.rs
2022-07-25 22:41:12 -04:00

20 lines
285 B
Rust

#![allow(where_clauses_object_safety)]
trait Trait {}
trait X {
fn foo(&self)
where
Self: Trait;
}
impl X for () {
fn foo(&self) {}
}
impl Trait for dyn X {}
pub fn main() {
<dyn X as X>::foo(&()); //~ERROR: trying to call something that is not a method
}