Skip to content

Commit 46af590

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35528 - Vassah:master, r=jonathandturner
Update Error Format for E0091 and E0092 Addresses [rust-lang#35228](rust-lang#35228) and [rust-lang#35229](rust-lang#35229) as part of [rust-lang#35233](rust-lang#35233). Please let me know if there are any issues; first time contributor. r? @jonathandturner
2 parents 9da4195 + da8fed5 commit 46af590

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/librustc_typeck/check/intrinsic.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &hir::ForeignItem) {
9797
(0, Vec::new(), tcx.mk_nil())
9898
}
9999
op => {
100-
span_err!(tcx.sess, it.span, E0092,
101-
"unrecognized atomic operation function: `{}`", op);
100+
struct_span_err!(tcx.sess, it.span, E0092,
101+
"unrecognized atomic operation function: `{}`", op)
102+
.span_label(it.span, &format!("unrecognized atomic operation"))
103+
.emit();
102104
return;
103105
}
104106
};

src/librustc_typeck/check/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4648,9 +4648,11 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
46484648

46494649
for (i, b) in tps_used.iter().enumerate() {
46504650
if !*b {
4651-
span_err!(ccx.tcx.sess, tps[i].span, E0091,
4651+
struct_span_err!(ccx.tcx.sess, tps[i].span, E0091,
46524652
"type parameter `{}` is unused",
4653-
tps[i].name);
4653+
tps[i].name)
4654+
.span_label(tps[i].span, &format!("unused type parameter"))
4655+
.emit();
46544656
}
46554657
}
46564658
}

src/test/compile-fail/E0091.rs

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

1111
type Foo<T> = u32; //~ ERROR E0091
12+
//~| NOTE unused type parameter
1213
type Foo2<A, B> = Box<A>; //~ ERROR E0091
14+
//~| NOTE unused type parameter
1315

1416
fn main() {
1517
}

src/test/compile-fail/E0092.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(intrinsics)]
1212
extern "rust-intrinsic" {
1313
fn atomic_foo(); //~ ERROR E0092
14-
}
14+
} //~| NOTE unrecognized atomic operation
1515

1616
fn main() {
1717
}

0 commit comments

Comments
 (0)