summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-10-29Fix testsMark Rousskov-1/+3
2022-10-29No need to probe when relating opaques in nll_relateMichael Goulet-0/+24
2022-10-29Only ban duplication across parameters.Camille GILLOT-0/+3
2022-10-29Do not consider repeated lifetime params for elision.Camille GILLOT-1/+16
2022-10-29Add test validating successful backportMark Rousskov-0/+35
2022-10-29Add normalize hack backMichael Goulet-0/+31
2022-10-27Revert "Do not consider method call receiver as an argument in AST."Michael Goulet-46/+0
This reverts commit 970184528718d7c10579cac7b7e7e66ef2e2a3f5.
2022-10-20Do anonymous lifetimes remapping correctly for nested rpitsSantiago Pastorino-0/+23
(cherry picked from commit 49ce8a22b05d779da4ffc531a44380656d51404b)
2022-10-20Fix `TyKind::is_simple_path`.Nicholas Nethercote-0/+44
PR #98758 introduced code to avoid redundant assertions in derived code like this: ``` let _: ::core::clone::AssertParamIsClone<u32>; let _: ::core::clone::AssertParamIsClone<u32>; ``` But the predicate `is_simple_path` introduced as part of this failed to account for generic arguments. Therefore the deriving code erroneously considers types like `Option<bool>` and `Option<f32>` to be the same. This commit fixes `is_simple_path`. Fixes #103157. (cherry picked from commit 9a23f60f9c801dd0b4686cc75c6a9979bd8928fa)
2022-10-20Tweak `deriving-all-codegen.rs`.Nicholas Nethercote-3/+5
To include some `Option<>` fields of different types in a single enum. The test output is currently buggy, but the next commit will fix that. (cherry picked from commit dfa9d5c971d74aa5bdf6b99253fe4b7db39f9b67)
2022-10-20Add test for issue 102389Gary Guo-0/+17
(cherry picked from commit f1452fc1c99bc6d126a096694b0f70d9fe4734b6)
2022-10-20Better binder treatmentMichael Goulet-0/+41
(cherry picked from commit 83e6128b577649384ef4bd137223bcffe5c8a5b0)
2022-10-06Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"Camille GILLOT-74/+19
This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c. (cherry picked from commit fc43df0333d5862a219f16d294ae38b14b9191d3)
2022-10-06Support bindings with anon consts in genericsMichael Goulet-0/+15
(cherry picked from commit 92561f43f185b54c81167ddc89fbe2dcd94b4efb)
2022-10-05use build-pass for the testX-1/+1
(cherry picked from commit 5131e9db07fb6cd158cf5bf2aa9fefbad3af1d2b)
2022-10-05fix unwind drop glue for if-then scopesDing Xiang Fei-0/+44
(cherry picked from commit 4a2c1a12b662eb590dbe78f7f9d13c2f327d3bb6)
2022-10-04Deny associated type bindings within associated type bindingsMichael Goulet-2/+73
(cherry picked from commit ca2e0bb51ad1a00190430134c67da5cda356745e)
2022-10-04Bless test output changesFrank Steffahn-4/+4
(cherry picked from commit 07767784ad667f4763e3ad6d7914849f3a43c65f)
2022-10-04add testlcnr-0/+50
(cherry picked from commit 72a21027f5bee367bd9ccbeecc2528986f85d90b)
2022-10-04Use Predicate ConstraintCategory when normalizingJack Huey-0/+133
(cherry picked from commit e7ca6e1b47ce31ad544cd8f0eb7e5cd47b325e63)
2022-10-04Final bitsJack Huey-0/+67
(cherry picked from commit e09242d5b82953652b5a898257d7c8f249d34bea)
2022-10-04add miri test via const fnDing Xiang Fei-0/+19
(cherry picked from commit eb36f5ee5b71cbe3eb356f8e56e9c9a69b6d649d)
2022-09-17Rollup merge of #101807 - jackh726:no-gat-defaults, r=lcnrDylan DPC-0/+54
Disallow defaults on type GATs Fixes #99205
2022-09-17Rollup merge of #101790 - ↵Dylan DPC-0/+28
TaKO8Ki:do-not-suggest-placeholder-to-const-and-static-without-type, r=compiler-errors Do not suggest a placeholder to const and static without a type Fixes #101755
2022-09-17Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obkDylan DPC-0/+33
Implement simd_as for pointers Expands `simd_as` (and `simd_cast`) to handle pointer-to-pointer, pointer-to-integer, and integer-to-pointer conversions. cc ``@programmerjake`` ``@thomcc``
2022-09-17Rollup merge of #93628 - est31:stabilize_let_else, r=joshtriplettDylan DPC-105/+78
Stabilize `let else` :tada: **Stabilizes the `let else` feature, added by [RFC 3137](https://github.com/rust-lang/rfcs/pull/3137).** :tada: Reference PR: https://github.com/rust-lang/reference/pull/1156 closes #87335 (`let else` tracking issue) FCP: https://github.com/rust-lang/rust/pull/93628#issuecomment-1029383585 ---------- ## Stabilization report ### Summary The feature allows refutable patterns in `let` statements if the expression is followed by a diverging `else`: ```Rust fn get_count_item(s: &str) -> (u64, &str) { let mut it = s.split(' '); let (Some(count_str), Some(item)) = (it.next(), it.next()) else { panic!("Can't segment count item pair: '{s}'"); }; let Ok(count) = u64::from_str(count_str) else { panic!("Can't parse integer: '{count_str}'"); }; (count, item) } assert_eq!(get_count_item("3 chairs"), (3, "chairs")); ``` ### Differences from the RFC / Desugaring Outside of desugaring I'm not aware of any differences between the implementation and the RFC. The chosen desugaring has been changed from the RFC's [original](https://rust-lang.github.io/rfcs/3137-let-else.html#reference-level-explanations). You can read a detailed discussion of the implementation history of it in `@cormacrelf` 's [summary](https://github.com/rust-lang/rust/pull/93628#issuecomment-1041143670) in this thread, as well as the [followup](https://github.com/rust-lang/rust/pull/93628#issuecomment-1046598419). Since that followup, further changes have happened to the desugaring, in #98574, #99518, #99954. The later changes were mostly about the drop order: On match, temporaries drop in the same order as they would for a `let` declaration. On mismatch, temporaries drop before the `else` block. ### Test cases In chronological order as they were merged. Added by df9a2e0687895731e12f4a2651e8d70acd08872d (#87688): * [`ui/pattern/usefulness/top-level-alternation.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/pattern/usefulness/top-level-alternation.rs) to ensure the unreachable pattern lint visits patterns inside `let else`. Added by 5b95df4bdc330f34213812ad65cae86ced90d80c (#87688): * [`ui/let-else/let-else-bool-binop-init.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-bool-binop-init.rs) to ensure that no lazy boolean expressions (using `&&` or `||`) are allowed in the expression, as the RFC mandates. * [`ui/let-else/let-else-brace-before-else.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-brace-before-else.rs) to ensure that no `}` directly preceding the `else` is allowed in the expression, as the RFC mandates. * [`ui/let-else/let-else-check.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-check.rs) to ensure that `#[allow(...)]` attributes added to the entire `let` statement apply for the `else` block. * [`ui/let-else/let-else-irrefutable.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-irrefutable.rs) to ensure that the `irrefutable_let_patterns` lint fires. * [`ui/let-else/let-else-missing-semicolon.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-missing-semicolon.rs) to ensure the presence of semicolons at the end of the `let` statement. * [`ui/let-else/let-else-non-diverging.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-non-diverging.rs) to ensure the `else` block diverges. * [`ui/let-else/let-else-run-pass.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-run-pass.rs) to ensure the feature works in some simple test case settings. * [`ui/let-else/let-else-scope.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-scope.rs) to ensure the bindings created by the outer `let` expression are not available in the `else` block of it. Added by bf7c32a4477a76bfd18fdcd8f45a939cbed82d34 (#89965): * [`ui/let-else/issue-89960.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/issue-89960.rs) as a regression test for the ICE-on-error bug #89960 . Later in 102b9125e1cefbb8ed8408d2db3f9f7d5afddbf0 this got removed in favour of more comprehensive tests. Added by 856541963ce95ef4f7d4a81784bb5002ccf63c93 (#89974): * [`ui/let-else/let-else-if.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-if.rs) to test for the improved error message that points out that `let else if` is not possible. Added by 9b45713b6c1775f0103a1ebee6ab7c6d9b781a21: * [`ui/let-else/let-else-allow-unused.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-allow-unused.rs) as a regression test for #89807, to ensure that `#[allow(...)]` attributes added to the entire `let` statement apply for bindings created by the `let else` pattern. Added by 61bcd8d3075471b3867428788c49f54fffe53f52 (#89841): * [`ui/let-else/let-else-non-copy.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-non-copy.rs) to ensure that a copy is performed out of non-copy wrapper types. This mirrors `if let` behaviour. The test case bases on rustc internal changes originally meant for #89933 but then removed from the PR due to the error prior to the improvements of #89841. * [`ui/let-else/let-else-source-expr-nomove-pass.rs `](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs) to ensure that while there is a move of the binding in the successful case, the `else` case can still access the non-matching value. This mirrors `if let` behaviour. Added by 102b9125e1cefbb8ed8408d2db3f9f7d5afddbf0 (#89841): * [`ui/let-else/let-else-ref-bindings.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-ref-bindings.rs) and [`ui/let-else/let-else-ref-bindings-pass.rs `](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-ref-bindings-pass.rs) to check `ref` and `ref mut` keywords in the pattern work correctly and error when needed. Added by 2715c5f984fda7faa156d1c9cf91aa4934f0e00f (#89841): * Match ergonomic tests adapted from the `rfc2005` test suite. Added by fec8a507a27de1b08a0b95592dc8ec93bf0a321a (#89841): * [`ui/let-else/let-else-deref-coercion-annotated.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-deref-coercion-annotated.rs) and [`ui/let-else/let-else-deref-coercion.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-deref-coercion.rs) to check deref coercions. #### Added since this stabilization report was originally written (2022-02-09) Added by 76ea56667703ac06689ff1d6fba5d170fa7392a7 (#94211): * [`ui/let-else/let-else-destructuring.rs`](https://github.com/rust-lang/rust/blob/1.63.0/src/test/ui/let-else/let-else-destructuring.rs) to give a nice error message if an user tries to do an assignment with a (possibly refutable) pattern and an `else` block, like asked for in #93995. Added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da (#94208): * [`ui/let-else/let-else-allow-in-expr.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-allow-in-expr.rs) to test whether `#[allow(unused_variables)]` works in the expr, as well as its non presence, as well as putting it on the entire `let else` *affects* the expr, too. This was adding a missing test as pointed out by the stabilization report. * Expansion of `ui/let-else/let-else-allow-unused.rs` and `ui/let-else/let-else-check.rs` to ensure that non-presence of `#[allow(unused)]` does issue the unused lint. This was adding a missing test case as pointed out by the stabilization report. Added by 5bd71063b3810d977aa376d1e6dd7cec359330cc (#94208): * [`ui/let-else/let-else-slicing-error.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-slicing-error.rs), a regression test for #92069, which got fixed without addition of a regression test. This resolves a missing test as pointed out by the stabilization report. Added by 5374688e1d8cbcff7d1d14bb34e38fe6fe7c233e (#98574): * [`src/test/ui/async-await/async-await-let-else.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-await-let-else.rs) to test the interaction of async/await with `let else` Added by 6c529ded8674b89c46052da92399227c3b764c6a (#98574): * [`src/test/ui/let-else/let-else-temporary-lifetime.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) as a (partial) regression test for #98672 Added by 9b566401068cb8450912f6ab48f3d0e60f5cb482 (#99518): * [`src/test/ui/let-else/let-else-temp-borrowck.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) as a regression test for #93951 * Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a partial regression test for #98672 (especially regarding `else` drop order) Added by baf9a7cb57120ec1411196214fd0d1c33fb18bf6 (#99518): * Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a partial regression test for #93951, similar to `let-else-temp-borrowck.rs` Added by 60be2de8b7b8a1c4eee7e065b8cef38ea629a6a3 (#99518): * Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a program that can now be compiled thanks to borrow checker implications of #99518 Added by 47a7a91c969ed2edd12c674ca05c1baf867f6f6f (#100132): * [`src/test/ui/let-else/issue-100103.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-100103.rs), as a regression test for #100103, to ensure that there is no ICE when doing `Err(...)?` inside else blocks. Added by e3c5bd617d040b5ee0bc79e6e7f01772adce791b (#100443): * [`src/test/ui/let-else/let-else-then-diverge.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-then-diverge.rs), to verify that there is no unreachable code error with the current desugaring. Added by 981852677c531d52f701b870bb27b45668a44d52 (#100443): * [`src/test/ui/let-else/issue-94176.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-94176.rs), to make sure that a correct span is emitted for a missing trailing expression error. Regression test for #94176. Added by e182d12a8493b40a557394325a3a713b6528de60 (#100434): * [src/test/ui/unpretty/pretty-let-else.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/unpretty/pretty-let-else.rs), as a regression test to ensure pretty printing works for `let else` (this bug surfaced in many different ways) Added by e26285603ca8b83b9d06e56f74e10e3d410553ff (#99954): * [`src/test/ui/let-else/let-else-temporary-lifetime.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) extended to contain & borrows as well, as this was identified as an earlier issue with the desugaring: https://github.com/rust-lang/rust/issues/98672#issuecomment-1200196921 Added by 2d8460ef43d902f34ba2133fe38f66ee8d2fdafc (#99291): * [`src/test/ui/let-else/let-else-drop-order.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-drop-order.rs) a matrix based test for various drop order behaviour of `let else`. Especially, it verifies equality of `let` and `let else` drop orders, [resolving](https://github.com/rust-lang/rust/pull/93628#issuecomment-1238498468) a [stabilization blocker](https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523). Added by 1b87ce0d4092045728c1c68282769d555706f273 (#101410): * Edit to `src/test/ui/let-else/let-else-temporary-lifetime.rs` to add the `-Zvalidate-mir` flag, as a regression test for #99228 Added by af591ebe4d0cf2097a5fdc0bb710442d0f2e7876 (#101410): * [`src/test/ui/let-else/issue-99975.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-99975.rs) as a regression test for the ICE #99975. Added by this PR: * `ui/let-else/let-else.rs`, a simple run-pass check, similar to `ui/let-else/let-else-run-pass.rs`. ### Things not currently tested * ~~The `#[allow(...)]` tests check whether allow works, but they don't check whether the non-presence of allow causes a lint to fire.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da* * ~~There is no `#[allow(...)]` test for the expression, as there are tests for the pattern and the else block.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da* * ~~`let-else-brace-before-else.rs` forbids the `let ... = {} else {}` pattern and there is a rustfix to obtain `let ... = ({}) else {}`. I'm not sure whether the `.fixed` files are checked by the tooling that they compile. But if there is no such check, it would be neat to make sure that `let ... = ({}) else {}` compiles.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da* * ~~#92069 got closed as fixed, but no regression test was added. Not sure it's worth to add one.~~ → *test added by 5bd71063b3810d977aa376d1e6dd7cec359330cc* * ~~consistency between `let else` and `if let` regarding lifetimes and drop order: https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523~~ → *test added by 2d8460ef43d902f34ba2133fe38f66ee8d2fdafc* Edit: they are all tested now. ### Possible future work / Refutable destructuring assignments [RFC 2909](https://rust-lang.github.io/rfcs/2909-destructuring-assignment.html) specifies destructuring assignment, allowing statements like `FooBar { a, b, c } = foo();`. As it was stabilized, destructuring assignment only allows *irrefutable* patterns, which before the advent of `let else` were the only patterns that `let` supported. So the combination of `let else` and destructuring assignments gives reason to think about extensions of the destructuring assignments feature that allow refutable patterns, discussed in #93995. A naive mapping of `let else` to destructuring assignments in the form of `Some(v) = foo() else { ... };` might not be the ideal way. `let else` needs a diverging `else` clause as it introduces new bindings, while assignments have a default behaviour to fall back to if the pattern does not match, in the form of not performing the assignment. Thus, there is no good case to require divergence, or even an `else` clause at all, beyond the need for having *some* introducer syntax so that it is clear to readers that the assignment is not a given (enums and structs look similar). There are better candidates for introducer syntax however than an empty `else {}` clause, like `maybe` which could be added as a keyword on an edition boundary: ```Rust let mut v = 0; maybe Some(v) = foo(&v); maybe Some(v) = foo(&v) else { bar() }; ``` Further design discussion is left to an RFC, or the linked issue.
2022-09-16Rollup merge of #101741 - andrewpollack:add-needs-unwind-ui-tests, r=tmandryMichael Howell-11/+21
Adding needs-unwind arg to applicable compiler ui tests Adding `needs-unwind` arg to applicable compiler ui tests
2022-09-16Auto merge of #97800 - ↵bors-0/+39
pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext, r=wesleywiser Aarch64 call abi does not zeroext (and one cannot assume it does so) Fix #97463
2022-09-16Adding needs-unwind arg to applicable compiler ui testsAndrew Pollack-11/+21
2022-09-16fix typo in comment noted by bjorn3.Felix S. Klock II-1/+1
2022-09-16Auto merge of #101902 - jackh726:revert-static-hrtb-error, r=nikomatsakisbors-200/+73
Partially revert #101433 reverts #101433 to fix #101844 We should get this into the beta cut, since the ICE is getting hit quite a bit.
2022-09-16Add test for #101844Jack Huey-0/+73
2022-09-16Revert "Better errors for implied static bound"Jack Huey-67/+0
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
2022-09-16Revert "Use Predicate ConstraintCategory when normalizing"Jack Huey-133/+0
This reverts commit aae37f87632dd74856d55c0cd45d2c192379c990.
2022-09-16Rollup merge of #101843 - chenyukang:fix-101797, r=oli-obkGuillaume Gomez-0/+28
Suggest associated const for incorrect use of let in traits Fixes #101797
2022-09-16Rollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errorsDylan DPC-8/+47
Prefer explict closure sig types over expected ones fixes #100800 Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
2022-09-16do not suggest a placeholder to const and static without a typeTakayuki Maeda-0/+28
2022-09-15Auto merge of #101831 - compiler-errors:issue-75899, r=jackh726bors-0/+39
Normalize struct field types in `confirm_builtin_unsize_candidate` Fixes #75899 --- edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.
2022-09-15Remove the let_else feature gate from the testsuiteest31-78/+62
Result of running: rg -l "feature.let_else" src/test/ | xargs sed -s -i "s#^...feature.let_else..\$##" Plus manual tidy fixes.
2022-09-15Remove feature gate from let else suggestionest31-8/+8
The let else suggestion added by 0d92752b8aac53e033541d04fc7d9677d8bca227 does not need a feature gate any more.
2022-09-15Stabilize the let_else featureest31-19/+8
2022-09-16tweak suggestionyukang-1/+1
2022-09-15Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726bors-1/+22
Reorder nesting scopes and declare bindings without drop schedule Fix #99228 Fix #99975 Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected. This MR fixes this issue by not scheduling the drops for those storages. cc `@est31`
2022-09-15fix #101797: Suggest associated const for incorrect use of let in traitsyukang-0/+28
2022-09-15Rollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandryMatthias Krüger-0/+6
Adding ignore-fuchsia arg to non-applicable compiler ui tests Adding `ignore-fuchsia` flag to tests involving `std::process::Command` calls, and `execve` calls
2022-09-15enclose else block in terminating scopeDing Xiang Fei-2/+1
2022-09-15add test for #99975Ding Xiang Fei-0/+20
2022-09-15reorder nesting scopes and declare bindings without drop scheduleDing Xiang Fei-1/+3
2022-09-15Normalize struct types in confirm_builtin_unsize_candidateMichael Goulet-0/+39
2022-09-15Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obkbors-19/+74
Compute lint levels by definition Lint levels are currently computed once for the whole crate. Any code that wants to emit a lint depends on this single `lint_levels(())` query. This query contains the `Span` for each attribute that participates in the lint level tree, so any code that wants to emit a lint basically depends on the spans in all files in the crate. Contrary to hard errors, we do not clear the incremental session on lints, so this implicit world dependency pessimizes incremental reuse. (And is furthermore invisible for allowed lints.) This PR completes https://github.com/rust-lang/rust/pull/99634 (thanks for the initial work `@fee1-dead)` and includes it in the dependency graph. The design is based on 2 queries: 1. `lint_levels_on(HirId) -> FxHashMap<LintId, LevelAndSource>` which accesses the attributes at the given `HirId` and processes them into lint levels. The `TyCtxt` is responsible for probing the HIR tree to find the user-visible level. 2. `lint_expectations(())` which lists all the `#[expect]` attributes in the crate. This PR also introduces the ability to reconstruct a `HirId` from a `DepNode` by encoding the local part of the `DefPathHash` and the `ItemLocalId` in the two `u64` of the fingerprint. This allows for the dep-graph to directly recompute `lint_levels_on` directly, without having to force the calling query. Closes https://github.com/rust-lang/rust/issues/95094. Supersedes https://github.com/rust-lang/rust/pull/99634.