Skip to content

Commit c89e278

Browse files
committed
Update error message for E0109
1 parent a0b4e67 commit c89e278

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc/middle/astconv_util.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2424
pub fn prohibit_type_params(self, segments: &[ast::PathSegment]) {
2525
for segment in segments {
2626
for typ in segment.parameters.types() {
27-
span_err!(self.sess, typ.span, E0109,
28-
"type parameters are not allowed on this type");
27+
struct_span_err!(self.sess, typ.span, E0109,
28+
"type parameters are not allowed on this type")
29+
.span_label(typ.span, &format!("type parameter not allowed"))
30+
.emit();
2931
break;
3032
}
3133
for lifetime in segment.parameters.lifetimes() {

src/test/compile-fail/E0109.rs

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

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

1314
fn main() {
1415
}

0 commit comments

Comments
 (0)