Skip to content

Commit eb469d6

Browse files
committed
Updated E0225 to new format.
1 parent ecdd51b commit eb469d6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Diff for: src/librustc_typeck/astconv.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2091,8 +2091,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
20912091

20922092
if !trait_bounds.is_empty() {
20932093
let b = &trait_bounds[0];
2094-
span_err!(self.tcx().sess, b.trait_ref.path.span, E0225,
2095-
"only the builtin traits can be used as closure or object bounds");
2094+
let span = b.trait_ref.path.span;
2095+
struct_span_err!(self.tcx().sess, span, E0225,
2096+
"only the builtin traits can be used as closure or object bounds")
2097+
.span_label(span, &format!("non-builtin trait used as bounds"))
2098+
.emit();
20962099
}
20972100

20982101
let region_bound =

Diff for: src/test/compile-fail/E0225.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let _: Box<std::io::Read + std::io::Write>; //~ ERROR E0225
12+
let _: Box<std::io::Read + std::io::Write>;
13+
//~^ ERROR only the builtin traits can be used as closure or object bounds [E0225]
14+
//~| NOTE non-builtin trait used as bounds
1315
}

0 commit comments

Comments
 (0)