Skip to content

Commit 4bc593e

Browse files
committed
Rename occurrences of 'delay_span_bug' to 'span_delayed_bug'
since this method has been renamed in rustc. Also remove a link to documentation in error-guaranteed.md because it was unused
1 parent fd6ed0d commit 4bc593e

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Diff for: src/compiler-debugging.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ stack backtrace:
108108

109109
If you want to get a backtrace to the point where the compiler emits an
110110
error message, you can pass the `-Z treat-err-as-bug=n`, which will make
111-
the compiler panic on the `nth` error on `delay_span_bug`. If you leave
111+
the compiler panic on the `nth` error on `span_delayed_bug`. If you leave
112112
off `=n`, the compiler will assume `1` for `n` and thus panic on the
113113
first error it encounters.
114114

115-
This can also help when debugging `delay_span_bug` calls - it will make
116-
the first `delay_span_bug` call panic, which will give you a useful backtrace.
115+
This can also help when debugging `span_delayed_bug` calls - it will make
116+
the first `span_delayed_bug` call panic, which will give you a useful backtrace.
117117

118118
For example:
119119

Diff for: src/diagnostics/error-guaranteed.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error code path leads to a failure.
1414
There are some important considerations about the usage of `ErrorGuaranteed`:
1515

1616
* It does _not_ convey information about the _kind_ of error. For example, the
17-
error may be due (indirectly) to a `delay_span_bug` or other compiler error.
17+
error may be due (indirectly) to a `span_delayed_bug` or other compiler error.
1818
Thus, you should not rely on
1919
`ErrorGuaranteed` when deciding whether to emit an error, or what kind of error
2020
to emit.
@@ -30,5 +30,4 @@ Thankfully, in most cases, it should be statically impossible to abuse
3030

3131
[errorguar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.ErrorGuaranteed.html
3232
[rerrors]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/index.html
33-
[dsp]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Handler.html#method.delay_span_bug
3433
[emit]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic_builder/struct.DiagnosticBuilder.html#method.emit

Diff for: src/ty.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,18 @@ compilation might inadvertently succeed!
343343

344344
Sometimes there is a third case. You believe that an error has been reported, but you believe it
345345
would've been reported earlier in the compilation, not locally. In that case, you can invoke
346-
[`delay_span_bug`] This will make a note that you expect compilation to yield an error -- if however
347-
compilation should succeed, then it will trigger a compiler bug report.
346+
[`span_delayed_bug`] This will make a note that you expect compilation to yield an error -- if
347+
however compilation should succeed, then it will trigger a compiler bug report.
348348

349-
[`delay_span_bug`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/struct.Session.html#method.delay_span_bug
349+
[`span_delayed_bug`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.DiagCtxt.html#method.span_delayed_bug
350350

351351
For added safety, it's not actually possible to produce a `TyKind::Error` value
352352
outside of [`rustc_middle::ty`][ty]; there is a private member of
353353
`TyKind::Error` that prevents it from being constructable elsewhere. Instead,
354354
one should use the [`TyCtxt::ty_error`][terr] or
355355
[`TyCtxt::ty_error_with_message`][terrmsg] methods. These methods automatically
356-
call `delay_span_bug` before returning an interned `Ty` of kind `Error`. If you
357-
were already planning to use [`delay_span_bug`], then you can just pass the
356+
call `span_delayed_bug` before returning an interned `Ty` of kind `Error`. If you
357+
were already planning to use [`span_delayed_bug`], then you can just pass the
358358
span and message to [`ty_error_with_message`][terrmsg] instead to avoid
359359
delaying a redundant span bug.
360360

0 commit comments

Comments
 (0)