rust/compiler/rustc_middle/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
..
dep_graph Adopt let_else in even more places 2022-02-16 22:43:39 +01:00
hir resolve: Fix incorrect results of opt_def_kind query for some built-in macros 2022-02-24 22:54:36 +03:00
infer Inline UnifyKey::index and UnifyKey::from_index 2022-02-15 19:07:06 +01:00
middle Auto merge of #90253 - Kobzol:hash-stable-sort-index-map, r=cjgillot 2022-03-11 16:37:55 +00:00
mir Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead 2022-03-12 07:02:05 +00:00
query Queryify is_doc_hidden 2022-03-12 14:27:51 -08:00
thir mention ignored fields of ExprKind::StaticRef 2022-03-08 15:44:06 +01:00
traits Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
ty Rollup merge of #93977 - compiler-errors:sized-generic-metadata, r=wesleywiser 2022-03-14 17:24:57 +01:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
lib.rs add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
lint.rs Handle #[expect(unfulfilled_lint_expectations)] with a lint message 2022-03-07 19:59:10 +01:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00