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
+
1
5
fn main ( ) {
2
6
let _: Box < std:: io:: Read + std:: io:: Write > ;
3
7
//~^ 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]
4
10
}
Original file line number Diff line number Diff line change 1
1
error[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
3
3
|
4
4
LL | let _: Box<std::io::Read + std::io::Write>;
5
5
| ^^^^^^^^^^^^^^ non-auto additional trait
6
6
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
8
17
9
18
For more information about this error, try `rustc --explain E0225`.
You can’t perform that action at this time.
0 commit comments