Skip to content

Commit abbfb1f

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

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,8 +2101,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
21012101

21022102
if !trait_bounds.is_empty() {
21032103
let b = &trait_bounds[0];
2104-
span_err!(self.tcx().sess, b.trait_ref.path.span, E0225,
2105-
"only the builtin traits can be used as closure or object bounds");
2104+
let span = b.trait_ref.path.span;
2105+
struct_span_err!(self.tcx().sess, span, E0225,
2106+
"only the builtin traits can be used as closure or object bounds")
2107+
.span_label(span, &format!("non-builtin trait used as bounds"))
2108+
.emit();
21062109
}
21072110

21082111
let region_bound =

src/test/compile-fail/E0225.rs

Lines changed: 3 additions & 1 deletion
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)