Skip to content

Commit d49b130

Browse files
Rollup merge of rust-lang#35266 - circuitfox:35247-E0109-update-error-format, r=jonathandturner
E0109 Update error format Fixes rust-lang#35247 as part of rust-lang#35233. r? @jonathandturner
2 parents 0388f40 + c89e278 commit d49b130

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: 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() {

Diff for: 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)