Skip to content

Commit

Permalink
Update error message for E0109
Browse files Browse the repository at this point in the history
  • Loading branch information
circuitfox committed Aug 3, 2016
1 parent a0b4e67 commit c89e278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc/middle/astconv_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn prohibit_type_params(self, segments: &[ast::PathSegment]) {
for segment in segments {
for typ in segment.parameters.types() {
span_err!(self.sess, typ.span, E0109,
"type parameters are not allowed on this type");
struct_span_err!(self.sess, typ.span, E0109,
"type parameters are not allowed on this type")
.span_label(typ.span, &format!("type parameter not allowed"))
.emit();
break;
}
for lifetime in segment.parameters.lifetimes() {
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0109.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

type X = u32<i32>; //~ ERROR E0109
//~| NOTE type parameter not allowed

fn main() {
}

0 comments on commit c89e278

Please sign in to comment.