mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
18 lines
373 B
Rust
18 lines
373 B
Rust
//@ run-rustfix
|
|
#![allow(dead_code)]
|
|
mod first {
|
|
trait Foo { fn m(self: Box<Self>); }
|
|
fn foo<T: Foo>(a: T) {
|
|
Box::new(a).m(); //~ ERROR no method named `m` found
|
|
}
|
|
}
|
|
mod second {
|
|
use std::sync::Arc;
|
|
trait Bar { fn m(self: Arc<Self>); }
|
|
fn bar(b: impl Bar) {
|
|
Arc::new(b).m(); //~ ERROR no method named `m` found
|
|
}
|
|
}
|
|
|
|
fn main() {}
|