Skip to content

Commit f0d2061

Browse files
committed
rewrote error messages for #[rustc_error]
1 parent fff3c25 commit f0d2061

26 files changed

+38
-32
lines changed

src/librustc_codegen_utils/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ pub mod symbol_names_test;
2929

3030

3131
pub fn trigger_delay_span_bug(tcx: TyCtxt<'_>, key: DefId) {
32-
tcx.sess.delay_span_bug(tcx.def_span(key), "compilation successful");
32+
tcx.sess.delay_span_bug(
33+
tcx.def_span(key),
34+
"delayed span bug triggered by #[rustc_error(delay_span_bug_from_inside_query)]"
35+
);
3336
}
3437

3538
/// check for the #[rustc_error] annotation, which forces an
@@ -53,7 +56,10 @@ pub fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) {
5356
}
5457
// bare #[rustc_error]
5558
None => {
56-
tcx.sess.span_fatal(tcx.def_span(def_id), "compilation successful");
59+
tcx.sess.span_fatal(
60+
tcx.def_span(def_id),
61+
"fatal error triggered by #[rustc_error]"
62+
);
5763
}
5864
}
5965
}

src/test/incremental/delayed_span_bug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// revisions: cfail1 cfail2
22
// should-ice
3-
// error-pattern: compilation successful
3+
// error-pattern: fatal error triggered by #[rustc_error]
44

55
#![feature(rustc_attrs)]
66

src/test/ui/associated-types/bound-lifetime-constrained.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ fn clause2<T>() where T: for<'a> Fn() -> <() as Foo<'a>>::Item {
4545
}
4646

4747
#[rustc_error]
48-
fn main() { } //[ok]~ ERROR compilation successful
48+
fn main() { } //[ok]~ ERROR fatal error triggered by #[rustc_error]

src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: compilation successful
1+
error: fatal error triggered by #[rustc_error]
22
--> $DIR/bound-lifetime-in-binding-only.rs:71:1
33
|
44
LL | fn main() { }

src/test/ui/associated-types/bound-lifetime-in-binding-only.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ fn ok3<T>() where for<'a> Parameterized<'a>: Foo<Item=&'a i32> {
6868
}
6969

7070
#[rustc_error]
71-
fn main() { } //[ok]~ ERROR compilation successful
71+
fn main() { } //[ok]~ ERROR fatal error triggered by #[rustc_error]

src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: compilation successful
1+
error: fatal error triggered by #[rustc_error]
22
--> $DIR/bound-lifetime-in-return-only.rs:49:1
33
|
44
LL | fn main() { }

src/test/ui/associated-types/bound-lifetime-in-return-only.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ fn ok2(_: &dyn for<'a,'b> Fn<(&'b Parameterized<'a>,), Output=&'a i32>) {
4646
}
4747

4848
#[rustc_error]
49-
fn main() { } //[ok]~ ERROR compilation successful
49+
fn main() { } //[ok]~ ERROR fatal error triggered by #[rustc_error]

src/test/ui/associated-types/cache/project-fn-ret-contravariant.ok.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: compilation successful
1+
error: fatal error triggered by #[rustc_error]
22
--> $DIR/project-fn-ret-contravariant.rs:50:1
33
|
44
LL | fn main() { }

src/test/ui/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: compilation successful
1+
error: fatal error triggered by #[rustc_error]
22
--> $DIR/project-fn-ret-contravariant.rs:50:1
33
|
44
LL | fn main() { }

src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
4848

4949
#[rustc_error]
5050
fn main() { }
51-
//[ok]~^ ERROR compilation successful
52-
//[oneuse]~^^ ERROR compilation successful
51+
//[ok]~^ ERROR fatal error triggered by #[rustc_error]
52+
//[oneuse]~^^ ERROR fatal error triggered by #[rustc_error]

0 commit comments

Comments
 (0)