rust/compiler/rustc_errors/src
Matthias Krüger 6548a368c8
Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser
Improve `expect` impl and handle `#[expect(unfulfilled_lint_expectations)]` (RFC 2383)

This PR updates unstable `ExpectationIds` in stashed diagnostics and adds some asserts to ensure that the stored expectations are really empty in the end. Additionally, it handles the `#[expect(unfulfilled_lint_expectations)]` case.

According to the [Errors and lints docs](https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels) the `error` level should only be used _"when the compiler detects a problem that makes it unable to compile the program"_. As this isn't the case with `#[expect(unfulfilled_lint_expectations)]` I decided to only create a warning. To avoid adding a new lint only for this case, I simply emit a `unfulfilled_lint_expectations` diagnostic with an additional note.

---

r? `@wesleywiser` I'm requesting a review from you since you reviewed the previous PR https://github.com/rust-lang/rust/pull/87835. You are welcome to reassign it if you're busy 🙃

rfc: [RFC-2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html)

tracking issue: https://github.com/rust-lang/rust/issues/85549

cc: `@flip1995` In case you're also interested in this :)
2022-03-14 17:24:58 +01:00
..
json Remove support for JSON deserialization to Rust 2022-02-20 18:58:21 -05:00
annotate_snippet_emitter_writer.rs Added Expect lint level and attribute (RFC-2383) 2022-03-02 17:46:05 +01:00
diagnostic_builder.rs diagnostics: only talk about Cargo.toml if running under Cargo 2022-03-07 10:54:17 -07:00
diagnostic.rs Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
emitter.rs Account for suggestions for complete removal of lines 2022-03-09 23:51:10 +00:00
json.rs Avoid emitting full macro body into JSON 2022-02-24 11:16:45 -05:00
lib.rs Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
lock.rs
registry.rs
snippet.rs Compute most of Public/Exported access level in rustc_resolve 2022-01-09 21:33:14 +00:00
styled_buffer.rs