Skip to content

Commit d4b77f6

Browse files
committed
Tweak delayed bug mentions.
Now that we have both `delayed_bug` and `span_delayed_bug`, it makes sense to use the generic term "delayed bug" more.
1 parent e0a0cc2 commit d4b77f6

File tree

15 files changed

+34
-34
lines changed

15 files changed

+34
-34
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ impl CodeSuggestion {
411411
/// or `.span_bug` rather than a failed assertion, etc.
412412
pub struct ExplicitBug;
413413

414-
/// Signifies that the compiler died with an explicit call to `.delay_*_bug`
415-
/// rather than a failed assertion, etc.
414+
/// Signifies that the compiler died due to a delayed bug rather than a failed
415+
/// assertion, etc.
416416
pub struct DelayedBugPanic;
417417

418418
/// A `DiagCtxt` deals with errors and other compiler output.
@@ -1446,7 +1446,7 @@ impl DiagCtxtInner {
14461446
{
14471447
let _ = write!(
14481448
&mut out,
1449-
"delayed span bug: {}\n{}\n",
1449+
"delayed bug: {}\n{}\n",
14501450
bug.inner
14511451
.messages
14521452
.iter()

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
806806
rustc_attr!(TEST, rustc_regions, Normal, template!(Word), WarnFollowing),
807807
rustc_attr!(
808808
TEST, rustc_error, Normal,
809-
template!(Word, List: "span_delayed_bug_from_inside_query"), WarnFollowingWordOnly
809+
template!(Word, List: "delayed_bug_from_inside_query"), WarnFollowingWordOnly
810810
),
811811
rustc_attr!(TEST, rustc_dump_user_args, Normal, template!(Word), WarnFollowing),
812812
rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ where
118118
return Err(err);
119119
} else {
120120
// HACK(oli-obk): tests/ui/specialization/min_specialization/specialize_on_type_error.rs
121-
// causes an error (span_delayed_bug) during normalization, without reporting an error,
122-
// so we need to act as if no error happened, in order to let our callers continue and
123-
// report an error later in check_impl_items_against_trait.
121+
// causes an delayed bug during normalization, without reporting an error, so we need
122+
// to act as if no error happened, in order to let our callers continue and report an
123+
// error later in check_impl_items_against_trait.
124124
return Ok(());
125125
}
126126
}

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl CanonicalizeMode for CanonicalizeQueryResponse {
191191
//
192192
// rust-lang/rust#57464: `impl Trait` can leak local
193193
// scopes (in manner violating typeck). Therefore, use
194-
// `span_delayed_bug` to allow type error over an ICE.
194+
// `delayed_bug` to allow type error over an ICE.
195195
canonicalizer
196196
.tcx
197197
.dcx()

compiler/rustc_interface/src/queries.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,16 @@ impl<'tcx> Queries<'tcx> {
194194
let Some((def_id, _)) = tcx.entry_fn(()) else { return };
195195
for attr in tcx.get_attrs(def_id, sym::rustc_error) {
196196
match attr.meta_item_list() {
197-
// Check if there is a `#[rustc_error(span_delayed_bug_from_inside_query)]`.
197+
// Check if there is a `#[rustc_error(delayed_bug_from_inside_query)]`.
198198
Some(list)
199199
if list.iter().any(|list_item| {
200200
matches!(
201201
list_item.ident().map(|i| i.name),
202-
Some(sym::span_delayed_bug_from_inside_query)
202+
Some(sym::delayed_bug_from_inside_query)
203203
)
204204
}) =>
205205
{
206-
tcx.ensure().trigger_span_delayed_bug(def_id);
206+
tcx.ensure().trigger_delayed_bug(def_id);
207207
}
208208

209209
// Bare `#[rustc_error]`.

compiler/rustc_middle/src/query/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ pub use plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsure, TyCtxtEnsureWithValue
108108
// Queries marked with `fatal_cycle` do not need the latter implementation,
109109
// as they will raise an fatal error on query cycles instead.
110110
rustc_queries! {
111-
/// This exists purely for testing the interactions between span_delayed_bug and incremental.
112-
query trigger_span_delayed_bug(key: DefId) {
113-
desc { "triggering a span delayed bug for testing incremental" }
111+
/// This exists purely for testing the interactions between delayed bugs and incremental.
112+
query trigger_delayed_bug(key: DefId) {
113+
desc { "triggering a delayed bug for testing incremental" }
114114
}
115115

116116
/// Collects the list of all tools registered using `#![register_tool]`.

compiler/rustc_middle/src/ty/region.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ impl<'tcx> Region<'tcx> {
8282
tcx.intern_region(ty::ReError(reported))
8383
}
8484

85-
/// Constructs a `RegionKind::ReError` region and registers a `span_delayed_bug` to ensure it
86-
/// gets used.
85+
/// Constructs a `RegionKind::ReError` region and registers a delayed bug to ensure it gets
86+
/// used.
8787
#[track_caller]
8888
pub fn new_error_misc(tcx: TyCtxt<'tcx>) -> Region<'tcx> {
8989
Region::new_error_with_message(
@@ -93,8 +93,8 @@ impl<'tcx> Region<'tcx> {
9393
)
9494
}
9595

96-
/// Constructs a `RegionKind::ReError` region and registers a `span_delayed_bug` with the given
97-
/// `msg` to ensure it gets used.
96+
/// Constructs a `RegionKind::ReError` region and registers a delayed bug with the given `msg`
97+
/// to ensure it gets used.
9898
#[track_caller]
9999
pub fn new_error_with_message<S: Into<MultiSpan>>(
100100
tcx: TyCtxt<'tcx>,

compiler/rustc_middle/src/ty/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub trait TypeVisitableExt<'tcx>: TypeVisitable<TyCtxt<'tcx>> {
5555
}
5656
fn error_reported(&self) -> Result<(), ErrorGuaranteed> {
5757
if self.references_error() {
58-
// We must include lint errors and span delayed bugs here.
58+
// We must include lint errors and delayed bugs here.
5959
if let Some(reported) =
6060
ty::tls::with(|tcx| tcx.dcx().has_errors_or_lint_errors_or_delayed_bugs())
6161
{

compiler/rustc_middle/src/util/bug.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ fn opt_span_bug_fmt<S: Into<MultiSpan>>(
3838
})
3939
}
4040

41-
/// A query to trigger a `span_delayed_bug`. Clearly, if one has a `tcx` one can already trigger a
42-
/// `span_delayed_bug`, so what is the point of this? It exists to help us test `span_delayed_bug`'s
43-
/// interactions with the query system and incremental.
44-
pub fn trigger_span_delayed_bug(tcx: TyCtxt<'_>, key: rustc_hir::def_id::DefId) {
41+
/// A query to trigger a delayed bug. Clearly, if one has a `tcx` one can already trigger a
42+
/// delayed bug, so what is the point of this? It exists to help us test the interaction of delayed
43+
/// bugs with the query system and incremental.
44+
pub fn trigger_delayed_bug(tcx: TyCtxt<'_>, key: rustc_hir::def_id::DefId) {
4545
tcx.dcx().span_delayed_bug(
4646
tcx.def_span(key),
47-
"delayed span bug triggered by #[rustc_error(span_delayed_bug_from_inside_query)]",
47+
"delayed bug triggered by #[rustc_error(delayed_bug_from_inside_query)]",
4848
);
4949
}
5050

5151
pub fn provide(providers: &mut crate::query::Providers) {
52-
*providers = crate::query::Providers { trigger_span_delayed_bug, ..*providers };
52+
*providers = crate::query::Providers { trigger_delayed_bug, ..*providers };
5353
}

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ symbols! {
655655
default_method_body_is_const,
656656
default_type_parameter_fallback,
657657
default_type_params,
658+
delayed_bug_from_inside_query,
658659
deny,
659660
deprecated,
660661
deprecated_safe,
@@ -1579,7 +1580,6 @@ symbols! {
15791580
slice_patterns,
15801581
slicing_syntax,
15811582
soft,
1582-
span_delayed_bug_from_inside_query,
15831583
specialization,
15841584
speed,
15851585
spotlight,

src/tools/clippy/tests/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn integration_test() {
7777
// the repo basically just contains a span_delayed_bug that forces rustc/clippy to panic:
7878
/*
7979
#![feature(rustc_attrs)]
80-
#[rustc_error(span_delayed_bug_from_inside_query)]
80+
#[rustc_error(delayed_bug_from_inside_query)]
8181
fn main() {}
8282
*/
8383

src/tools/rust-analyzer/crates/hir-def/src/attr/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
650650
rustc_attr!(TEST, rustc_regions, Normal, template!(Word), WarnFollowing),
651651
rustc_attr!(
652652
TEST, rustc_error, Normal,
653-
template!(Word, List: "span_delayed_bug_from_inside_query"), WarnFollowingWordOnly
653+
template!(Word, List: "delayed_bug_from_inside_query"), WarnFollowingWordOnly
654654
),
655655
rustc_attr!(TEST, rustc_dump_user_args, Normal, template!(Word), WarnFollowing),
656656
rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing),

tests/incremental/delayed_span_bug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// revisions: cfail1 cfail2
22
// should-ice
3-
// error-pattern: delayed span bug triggered by #[rustc_error(span_delayed_bug_from_inside_query)]
3+
// error-pattern: delayed bug triggered by #[rustc_error(delayed_bug_from_inside_query)]
44

55
#![feature(rustc_attrs)]
66

7-
#[rustc_error(span_delayed_bug_from_inside_query)]
7+
#[rustc_error(delayed_bug_from_inside_query)]
88
fn main() {}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// compile-flags: -Ztreat-err-as-bug -Zeagerly-emit-delayed-bugs
22
// failure-status: 101
33
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
4-
// error-pattern: [trigger_span_delayed_bug] triggering a span delayed bug for testing incremental
4+
// error-pattern: [trigger_delayed_bug] triggering a delayed bug for testing incremental
55
// normalize-stderr-test "note: .*\n\n" -> ""
66
// normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> ""
77
// rustc-env:RUST_BACKTRACE=0
88

99
#![feature(rustc_attrs)]
1010

11-
#[rustc_error(span_delayed_bug_from_inside_query)]
11+
#[rustc_error(delayed_bug_from_inside_query)]
1212
fn main() {}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: internal compiler error: delayed span bug triggered by #[rustc_error(span_delayed_bug_from_inside_query)]
1+
error: internal compiler error: delayed bug triggered by #[rustc_error(delayed_bug_from_inside_query)]
22
--> $DIR/span_delayed_bug.rs:12:1
33
|
44
LL | fn main() {}
@@ -7,5 +7,5 @@ LL | fn main() {}
77
error: the compiler unexpectedly panicked. this is a bug.
88

99
query stack during panic:
10-
#0 [trigger_span_delayed_bug] triggering a span delayed bug for testing incremental
10+
#0 [trigger_delayed_bug] triggering a delayed bug for testing incremental
1111
end of query stack

0 commit comments

Comments
 (0)