rust/tests/ui/traits/object/auto-dedup-in-impl.rs

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

20 lines
444 B
Rust
Raw Normal View History

2018-06-01 10:52:07 -05:00
// Checks to make sure that `dyn Trait + Send` and `dyn Trait + Send + Send` are the same type.
// Issue: #47010
struct Struct;
impl Trait for Struct {}
trait Trait {}
2019-05-28 13:46:13 -05:00
type Send1 = dyn Trait + Send;
type Send2 = dyn Trait + Send + Send;
2018-06-01 10:52:07 -05:00
fn main () {}
2019-05-28 13:46:13 -05:00
impl dyn Trait + Send {
2018-06-01 10:52:07 -05:00
fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
}
2019-05-28 13:46:13 -05:00
impl dyn Trait + Send + Send {
2018-06-01 10:52:07 -05:00
fn test(&self) { println!("two"); }
}