Skip to content

Commit 11022b4

Browse files
author
Jonathan Turner
authored
Rollup merge of #35421 - razielgn:updated-e0225-to-new-format, r=jonathandturner
Updated E0225 to new format. Part of #35233. Fixes #35388. r? @jonathandturner
2 parents 14163fa + eb469d6 commit 11022b4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc_typeck/astconv.rs

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

20982098
if !trait_bounds.is_empty() {
20992099
let b = &trait_bounds[0];
2100-
span_err!(self.tcx().sess, b.trait_ref.path.span, E0225,
2101-
"only the builtin traits can be used as closure or object bounds");
2100+
let span = b.trait_ref.path.span;
2101+
struct_span_err!(self.tcx().sess, span, E0225,
2102+
"only the builtin traits can be used as closure or object bounds")
2103+
.span_label(span, &format!("non-builtin trait used as bounds"))
2104+
.emit();
21022105
}
21032106

21042107
let region_bound =

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)