Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bf62d59
Give `TRACK_DIAGNOSTIC` a return value.
nnethercote Feb 9, 2024
ecd3718
Inline and remove `Level::get_diagnostic_id`.
nnethercote Feb 13, 2024
272e60b
Move `DelayedBug` handling into the `match`.
nnethercote Feb 13, 2024
c81767e
Reorder `has_future_breakage` handling.
nnethercote Feb 13, 2024
aec4bdb
Move `Expect`/`ForceWarning` handling into the `match`.
nnethercote Feb 13, 2024
a7d9262
Add comments about `TRACK_DIAGNOSTIC` use.
nnethercote Feb 13, 2024
7ef605b
Make the `match` in `emit_diagnostic` complete.
nnethercote Mar 1, 2024
71080dd
Document how removing a type's field can be bad and what to do instead
shepmaster Mar 2, 2024
15b71f4
Add CStr::bytes iterator
clarfonthey Nov 13, 2022
7f427f8
rustdoc-search: parse and search with ML-style HOF
notriddle Jan 6, 2024
d38527e
rustdoc: clean up search.js by removing empty sort case
notriddle Jan 6, 2024
23e931f
rustdoc: use `const` for the special type name ids
notriddle Jan 6, 2024
7b92655
rustdoc-search: add search query syntax `Fn(T) -> U`
notriddle Jan 6, 2024
c076509
Add methods to create constants
celinval Mar 1, 2024
893a910
Add a test to SMIR body transformation
celinval Mar 12, 2024
a38a556
Reduce unsafe code, use more NonNull APIs per @cuviper review
clarfonthey Mar 12, 2024
f2fcfe8
Various style improvements to `rustc_lint::levels`
Zalathar Mar 13, 2024
c527ec7
Improve Step docs
CAD97 Mar 13, 2024
514b274
const-eval: organize and extend tests for required-consts
RalfJung Mar 13, 2024
be33586
fix unsoundness in Step::forward_unchecked for signed integers
the8472 Mar 13, 2024
d3cab9f
update virtual clock in miri test since signed loops now execute more…
the8472 Mar 13, 2024
1ae69ae
Rollup merge of #104353 - clarfonthey:cstr-bytes-iter, r=cuviper
matthiaskrgr Mar 14, 2024
6694918
Rollup merge of #119676 - notriddle:notriddle/rustdoc-search-hof, r=G…
matthiaskrgr Mar 14, 2024
fce6e75
Rollup merge of #120699 - nnethercote:rm-useless-TRACK_DIAGNOSTIC-cal…
matthiaskrgr Mar 14, 2024
7a744af
Rollup merge of #121899 - shepmaster:dead-code-docs, r=wesleywiser
matthiaskrgr Mar 14, 2024
bd53d1e
Rollup merge of #122405 - celinval:smir-new-const, r=oli-obk
matthiaskrgr Mar 14, 2024
0286591
Rollup merge of #122416 - Zalathar:levels, r=petrochenkov
matthiaskrgr Mar 14, 2024
a0e50a4
Rollup merge of #122421 - CAD97:step-trait-docs, r=jhpratt
matthiaskrgr Mar 14, 2024
bdf84ea
Rollup merge of #122440 - RalfJung:required-consts, r=oli-obk
matthiaskrgr Mar 14, 2024
75dc99b
Rollup merge of #122461 - the8472:fix-step-forward-unchecked, r=Amanieu
matthiaskrgr Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comments about TRACK_DIAGNOSTIC use.
Also add an assertion for the levels allowed with `has_future_breakage`.
  • Loading branch information
nnethercote committed Mar 1, 2024
commit a7d926265f25abfd05b13a3a0144f2ad9dd02dd7
17 changes: 16 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,10 +1360,13 @@ impl DiagCtxtInner {
// Future breakages aren't emitted if they're Level::Allow,
// but they still need to be constructed and stashed below,
// so they'll trigger the must_produce_diag check.
self.suppressed_expected_diag = true;
assert!(matches!(diagnostic.level, Error | Warning | Allow));
self.future_breakage_diagnostics.push(diagnostic.clone());
}

// We call TRACK_DIAGNOSTIC with an empty closure for the cases that
// return early *and* have some kind of side-effect, except where
// noted.
match diagnostic.level {
Fatal | Error if self.treat_next_err_as_bug() => {
// `Fatal` and `Error` can be promoted to `Bug`.
Expand All @@ -1387,6 +1390,9 @@ impl DiagCtxtInner {
return if let Some(guar) = self.has_errors() {
Some(guar)
} else {
// No `TRACK_DIAGNOSTIC` call is needed, because the
// incremental session is deleted if there is a delayed
// bug. This also saves us from cloning the diagnostic.
let backtrace = std::backtrace::Backtrace::capture();
// This `unchecked_error_guaranteed` is valid. It is where the
// `ErrorGuaranteed` for delayed bugs originates. See
Expand All @@ -1401,11 +1407,17 @@ impl DiagCtxtInner {
}
Warning if !self.flags.can_emit_warnings => {
if diagnostic.has_future_breakage() {
// The side-effect is at the top of this method.
TRACK_DIAGNOSTIC(diagnostic, &mut |_| None);
}
return None;
}
Allow => {
if diagnostic.has_future_breakage() {
// The side-effect is at the top of this method.
TRACK_DIAGNOSTIC(diagnostic, &mut |_| None);
self.suppressed_expected_diag = true;
}
return None;
}
Expect(expect_id) | ForceWarning(Some(expect_id)) => {
Expand All @@ -1414,6 +1426,9 @@ impl DiagCtxtInner {
// buffered until the `LintExpectationId` is replaced by a
// stable one by the `LintLevelsBuilder`.
if let LintExpectationId::Unstable { .. } = expect_id {
// We don't call TRACK_DIAGNOSTIC because we wait for the
// unstable ID to be updated, whereupon the diagnostic will
// be passed into this method again.
self.unstable_expect_diagnostics.push(diagnostic);
return None;
}
Expand Down