Skip to content

Commit

Permalink
Rollup merge of rust-lang#35421 - razielgn:updated-e0225-to-new-forma…
Browse files Browse the repository at this point in the history
…t, r=jonathandturner

Updated E0225 to new format.

Part of rust-lang#35233.
Fixes rust-lang#35388.

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 7, 2016
2 parents 85bf1b6 + eb469d6 commit 6a720fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2097,8 +2097,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {

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

let region_bound =
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0225.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
// except according to those terms.

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

0 comments on commit 6a720fb

Please sign in to comment.