File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( trait_alias) ]
2+
3+ trait Foo = std: : io:: Read + std:: io:: Write ;
4+
15fn main ( ) {
26 let _: Box < std:: io:: Read + std:: io:: Write > ;
37 //~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
8+ let _: Box < Foo > ;
9+ //~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
410}
Original file line number Diff line number Diff line change 11error[E0225]: only auto traits can be used as additional traits in a trait object
2- --> $DIR/E0225.rs:2 :32
2+ --> $DIR/E0225.rs:6 :32
33 |
44LL | let _: Box<std::io::Read + std::io::Write>;
55 | ^^^^^^^^^^^^^^ non-auto additional trait
66
7- error: aborting due to previous error
7+ error[E0225]: only auto traits can be used as additional traits in a trait object
8+ --> $DIR/E0225.rs:8:16
9+ |
10+ LL | trait Foo = std::io::Read + std::io::Write;
11+ | -------------- non-auto additional trait
12+ ...
13+ LL | let _: Box<Foo>;
14+ | ^^^ expanded from this alias
15+
16+ error: aborting due to 2 previous errors
817
918For more information about this error, try `rustc --explain E0225`.
You can’t perform that action at this time.
0 commit comments