rust/tests/fail/issue-miri-2432.rs

20 lines
285 B
Rust
Raw Normal View History

2022-07-25 21:40:56 -05:00
#![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
}