about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-01-06Rollup merge of #119655 - Nilstrieb:cleanup-the-error-count-monster-mess, ↵Matthias Krüger-13/+6
r=WaffleLapkin Remove ignore-stage1 that was added when changing error count msg The bootstrap bump has happened, so the bootstrap compiler now contains the new diagnostic. this was added in #118138
2024-01-06Rollup merge of #119624 - petrochenkov:dialoc4, r=compiler-errorsMatthias Krüger-27/+159
rustc_span: More consistent span combination operations Also add more tests for using `tt` in addition to `ident`, and some other minor tweaks, see individual commits. This is a part of https://github.com/rust-lang/rust/pull/119412 that doesn't yet add side tables for metavariable spans.
2024-01-06Rollup merge of #119591 - Enselic:DestinationPropagation-stable, r=cjgillotMatthias Krüger-18/+18
rustc_mir_transform: Make DestinationPropagation stable for queries By using `FxIndexMap` instead of `FxHashMap`, so that the order of visiting of locals is deterministic. We also need to bless `copy_propagation_arg.foo.DestinationPropagation.panic*.diff`. Do not review the diff of the diff. Instead look at the diff files before and after this commit. Both before and after this commit, 3 statements are replaced with nop. It's just that due to change in ordering, different statements are replaced. But the net result is the same. In other words, compare this diff (before fix): * https://github.com/rust-lang/rust/blob/090d5eac722000906cc00d991f2bf052b0e388c3/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff With this diff (after fix): * https://github.com/rust-lang/rust/blob/f603babd63a607e155609dc0277806e559626ea0/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff and you can see that both before and after the fix, we replace 3 statements with `nop`s. I find it _slightly_ surprising that the test this PR affects did not previously fail spuriously due to the indeterminism of `FxHashMap`, but I guess in can be explained with the predictability of small `FxHashMap`s with `usize` (`Local`) keys, or something along those lines. This should fix [this](https://github.com/rust-lang/rust/pull/119252#discussion_r1436101791) comment, but I wanted to make a separate PR for this fix for a simpler development and review process. Part of https://github.com/rust-lang/rust/issues/84447 which is E-help-wanted. r? `@cjgillot` who is reviewer for the highly related PR https://github.com/rust-lang/rust/pull/119252.
2024-01-06Rollup merge of #118781 - RalfJung:core-panic-feature, r=the8472Matthias Krüger-1/+1
merge core_panic feature into panic_internals I don't know why those are two separate features, but it does not seem intentional. This merge is useful because with https://github.com/rust-lang/rust/pull/118123, panic_internals is recognized as an internal feature, but core_panic is not -- but core_panic definitely should be internal.
2024-01-06Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomezMatthias Krüger-14/+486
rustdoc: search for tuples and unit by type with `()` This feature extends rustdoc to support the syntax that most users will naturally attempt to use to search for tuples. Part of https://github.com/rust-lang/rust/issues/60485 Function signature searches already support tuples and unit. The explicit name `primitive:tuple` and `primitive:unit` can be used to match a tuple or unit, while `()` will match either one. It also follows the direction set by the actual language for parens as a group, so `(u8,)` will only match a tuple, while `(u8)` will match a plain, unwrapped byte—thanks to loose search semantics, it will also match the tuple. ## Preview * [`option<t>, option<u> -> (t, u)`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=option%3Ct%3E%2C option%3Cu%3E -%3E (t%2C u)>) * [`[t] -> (t,)`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=[t] -%3E (t%2C)>) * [`(ipaddr,) -> socketaddr`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=(ipaddr%2C) -%3E socketaddr>) ## Motivation When type-based search was first landed, it was directly [described as incomplete][a comment]. [a comment]: https://github.com/rust-lang/rust/pull/23289#issuecomment-79437386 Filling out the missing functionality is going to mean adding support for more of Rust's [type expression] syntax, such as tuples (in this PR), references, raw pointers, function pointers, and closures. [type expression]: https://doc.rust-lang.org/reference/types.html#type-expressions There does seem to be demand for this sort of thing, such as [this Discord message](https://discord.com/channels/442252698964721669/443150878111694848/1042145740065099796) expressing regret at rustdoc not supporting tuples in search queries. ## Reference description (from the Rustdoc book) <table> <thead> <tr> <th>Shorthand</th> <th>Explicit names</th> </tr> </thead> <tbody> <tr><td colspan="2">Before this PR</td></tr> <tr> <td><code>[]</code></td> <td><code>primitive:slice</code> and/or <code>primitive:array</code></td> </tr> <tr> <td><code>[T]</code></td> <td><code>primitive:slice&lt;T&gt;</code> and/or <code>primitive:array&lt;T&gt;</code></td> </tr> <tr> <td><code>!</code></td> <td><code>primitive:never</code></td> </tr> <tr><td colspan="2">After this PR</td></tr> <tr> <td><code>()</code></td> <td><code>primitive:unit</code> and/or <code>primitive:tuple</code></td> </tr> <tr> <td><code>(T)</code></td> <td><code>T</code></td> </tr> <tr> <td><code>(T,)</code></td> <td><code>primitive:tuple&lt;T&gt;</code></td> </tr> </tbody> </table> A single type expression wrapped in parens is the same as that type expression, since parens act as the grouping operator. If they're empty, though, they will match both `unit` and `tuple`, and if there's more than one type (or a trailing or leading comma) it is the same as `primitive:tuple<...>`. However, since items can be left out of the query, `(T)` will still return results for types that match tuples, even though it also matches the type on its own. That is, `(u32)` matches `(u32,)` for the exact same reason that it also matches `Result<u32, Error>`. ## Future direction The [type expression grammar](https://doc.rust-lang.org/reference/types.html#type-expressions) from the Reference is given below: <pre><code>Syntax Type : TypeNoBounds | <a href="https://doc.rust-lang.org/reference/types/impl-trait.html">ImplTraitType</a> | <a href="https://doc.rust-lang.org/reference/types/trait-object.html">TraitObjectType</a> <br> TypeNoBounds : <a href="https://doc.rust-lang.org/reference/types.html#parenthesized-types">ParenthesizedType</a> | <a href="https://doc.rust-lang.org/reference/types/impl-trait.html">ImplTraitTypeOneBound</a> | <a href="https://doc.rust-lang.org/reference/types/trait-object.html">TraitObjectTypeOneBound</a> | <a href="https://doc.rust-lang.org/reference/paths.html#paths-in-types">TypePath</a> | <a href="https://doc.rust-lang.org/reference/types/tuple.html#tuple-types">TupleType</a> | <a href="https://doc.rust-lang.org/reference/types/never.html">NeverType</a> | <a href="https://doc.rust-lang.org/reference/types/pointer.html#raw-pointers-const-and-mut">RawPointerType</a> | <a href="https://doc.rust-lang.org/reference/types/pointer.html#shared-references-">ReferenceType</a> | <a href="https://doc.rust-lang.org/reference/types/array.html">ArrayType</a> | <a href="https://doc.rust-lang.org/reference/types/slice.html">SliceType</a> | <a href="https://doc.rust-lang.org/reference/types/inferred.html">InferredType</a> | <a href="https://doc.rust-lang.org/reference/paths.html#qualified-paths">QualifiedPathInType</a> | <a href="https://doc.rust-lang.org/reference/types/function-pointer.html">BareFunctionType</a> | <a href="https://doc.rust-lang.org/reference/macros.html#macro-invocation">MacroInvocation</a> </code></pre> ImplTraitType and TraitObjectType (and ImplTraitTypeOneBound and TraitObjectTypeOneBound) are not yet implemented. They would mostly desugar to `trait:`, similarly to how `!` desugars to `primitive:never`. ParenthesizedType and TuplePath are added in this PR. TypePath is already implemented (except const generics, which is not planned, and function-like trait syntax, which is planned as part of closure support). NeverType is already implemented. RawPointerType and ReferenceType require parsing and fixes to the search index to store this information, but otherwise their behavior seems simple enough. Just like tuples and slices, `&T` would be equivalent to `primitive:reference<T>`, `&mut T` would be equivalent to `primitive:reference<keyword:mut, T>`, `*T` would be equivalent to `primitive:pointer<T>`, `*mut T` would be equivalent to `primitive:pointer<keyword:mut, T>`, and `*const T` would be equivalent to `primitive:pointer<keyword:const, T>`. Lifetime generics support is not planned, because lifetime subtyping seems too complicated. ArrayType is subsumed by SliceType right now. Implementing const generics is not planned, because it seems like it would require a lot of implementation complexity for not much gain. InferredType isn't really covered right now. Its semantics in a search context are not obvious. QualifiedPathInType is not implemented, and it is not planned. I would need a use case to justify it, and act as a guide for what the exact semantics should be. BareFunctionType is not implemented. Along with function-like trait syntax, which is formally considered a TypePath, it's the biggest missing feature to be able to do structured searches over generic APIs like `Option`. MacroInvocation is not parsed (macro names are, but they don't mean the same thing here at all). Those are gone by the time Rustdoc sees the source code.
2024-01-06Remove ignore-stage1 that was added when changing error count msgNilstrieb-13/+6
The bootstrap bump has happened, so the bootstrap compiler now contains the new diagnotic.
2024-01-06Auto merge of #119478 - bjorn3:no_serialize_specialization, r=wesleywiserbors-1/+4
Avoid specialization in the metadata serialization code With the exception of a perf-only specialization for byte slices and byte vectors. This uses the same trick of introducing a new trait and having the Encodable and Decodable derives add a bound to it as used for TyEncoder/TyDecoder. The new code is clearer about which encoder/decoder uses which impl and it reduces the dependency of rustc on specialization, making it easier to remove support for specialization entirely or turn it into a construct that is only allowed for perf optimizations if we decide to do this.
2024-01-05Rollup merge of #119638 - lukas-code:suggest-constructor-cycle-error, r=cjgillotMichael Goulet-0/+37
fix cyle error when suggesting to use associated function instead of constructor Fixes https://github.com/rust-lang/rust/issues/119625. The first commit fixes the infinite recursion and makes the cycle error actually show up. We do this by making the `Display` for `ty::Instance` impl respect `with_no_queries` so that it can be used in query descriptions. The second commit fixes the cycle error `resolver_for_lowering` -> `normalize` -> `resolve_instance` (for evaluating const) -> `lang_items` (for `drop_in_place`) -> `resolver_for_lowering` (for collecting lang items). We do this by simply skipping the suggestion when encountering an unnormalized type.
2024-01-05Rollup merge of #119628 - RalfJung:duplicate-test, r=compiler-errorsMichael Goulet-23/+0
remove duplicate test This was added in https://github.com/rust-lang/rust/commit/ace6fc3646332485aeefead6b768a93450c2dd71 where overflowing-rsh-6 differed from overflowing-rsh-5 in a feature gate, but the feature has since been stabilized, making the tests 100% identical. Most of these tests in numbers-arithmetic could be put into one file rather than having so many files that all test the same lint... but it doesn't seem worth the effort. After https://github.com/rust-lang/rust/pull/119432 we might be able to remove most of them entirely as they will be covered by the new tests added there.
2024-01-05Rollup merge of #119420 - cjgillot:issue-119295, r=compiler-errorsMichael Goulet-0/+41
Handle ForeignItem as TAIT scope. Fixes #119295
2024-01-05Rollup merge of #119216 - weiznich:use_diagnostic_namespace_in_stdlib, ↵Michael Goulet-0/+48
r=compiler-errors Use diagnostic namespace in stdlib This required a minor fix to have the diagnostics shown in third party crates when the `diagnostic_namespace` feature is not enabled. See https://github.com/rust-lang/rust/pull/119216/commits/5d63f5d8d1a72167c1d5242b2e1ed5b7259fd526 for details. I've opted for having a single PR for both changes as it's really not that much code. If it is required it should be easy to split up the change into several PR's. r? `@compiler-errors`
2024-01-05Rollup merge of #119208 - Zalathar:hoist, r=WaffleLapkin,SwatinemMichael Goulet-27/+21
coverage: Hoist some complex code out of the main span refinement loop The span refinement loop in `spans.rs` takes the spans that have been extracted from MIR, and modifies them to produce more helpful output in coverage reports. It is also one of the most complicated pieces of code in the coverage instrumentor. It has an abundance of moving pieces that make it difficult to understand, and most attempts to modify it end up accidentally changing its behaviour in unacceptable ways. This PR nevertheless tries to make a dent in it by hoisting two pieces of special-case logic out of the main loop, and into separate preprocessing passes. Coverage tests show that the resulting mappings are *almost* identical, with all known differences being unimportant. This should hopefully unlock further simplifications to the refinement loop, since it now has fewer edge cases to worry about.
2024-01-05Rebase fallout.Camille GILLOT-8/+8
2024-01-05Handle ForeignItem as TAIT scope.Camille GILLOT-0/+41
2024-01-05fix cycle error for "use constructor" suggestionLukas Markeffsky-11/+11
2024-01-05fix OOM when `ty::Instance` is used in query descriptionLukas Markeffsky-0/+37
2024-01-05rustc_mir_transform: Make DestinationPropagation stable for queriesMartin Nordholts-18/+18
By using FxIndexMap instead of FxHashMap, so that the order of visiting of locals is deterministic. We also need to bless copy_propagation_arg.foo.DestinationPropagation.panic*.diff. Do not review the diff of the diff. Instead look at the diff file before and after this commit. Both before and after this commit, 3 statements are replaced with nop. It's just that due to change in ordering, different statements are replaced. But the net result is the same.
2024-01-05Rollup merge of #119622 - Nadrieril:never_patterns_macros, r=compiler-errorsMatthias Krüger-0/+54
never patterns: Document behavior of never patterns with macros-by-example `never_patterns` makes `!` parse as a pattern so I was worried about breaking macros-by-example matching. Turns out we're fine because the cases that now match `$p:pat` used to error in the past. The only tricky case is `!` by itself, which backwards-compatibly doesn't match `$p:pat`. I have no idea why tho, I didn't think of that when I was implementing parsing :sweat_smile:. This adds tests so we don't regress the current behavior. r? `@compiler-errors`
2024-01-05Rollup merge of #119563 - compiler-errors:coroutine-resume, r=oli-obkMatthias Krüger-0/+109
Check yield terminator's resume type in borrowck In borrowck, we didn't check that the lifetimes of the `TerminatorKind::Yield`'s `resume_place` were actually compatible with the coroutine's signature. That means that the lifetimes were totally going unchecked. Whoops! This PR implements this checking. Fixes #119564 r? types
2024-01-05Rollup merge of #119554 - matthewjasper:remove-guard-distinction, ↵Matthias Krüger-12/+114
r=compiler-errors Fix scoping for let chains in match guards If let guards were previously represented as a different type of guard in HIR and THIR. This meant that let chains in match guards were not handled correctly because they were treated exactly like normal guards. - Remove `hir::Guard` and `thir::Guard`. - Make the scoping different between normal guards and if let guards also check for let chains. closes #118593
2024-01-05Rollup merge of #119506 - ↵Matthias Krüger-0/+106
compiler-errors:visibilities-for-object-safety-error, r=Nilstrieb Use `resolutions(()).effective_visiblities` to avoid cycle errors in `report_object_error` Inside of `report_object_error`, using the `effective_visibilities` query causes cycles since it calls `type_of`, which itself may call `typeck`, which may end up reporting its own object-safety errors. Fixes #119346 Fixes #119502
2024-01-05Rollup merge of #119354 - fmease:negative_bounds-fixes, r=compiler-errorsMatthias Krüger-41/+143
Make `negative_bounds` internal & fix some of its issues r? compiler-errors
2024-01-05Rollup merge of #119350 - fmease:lazy-ty-aliases-implied-bounds, ↵Matthias Krüger-24/+97
r=compiler-errors Imply outlives-bounds on lazy type aliases Fixes #118479. r? types
2024-01-05Rollup merge of #119151 - Jules-Bertholet:no-foreign-doc-hidden-suggest, ↵Matthias Krüger-14/+71
r=davidtwco Hide foreign `#[doc(hidden)]` paths in import suggestions Stops the compiler from suggesting to import foreign `#[doc(hidden)]` paths. ```@rustbot``` label A-suggestion-diagnostics
2024-01-05Ignore a rustdoc testLeón Orell Valerian Liehr-0/+3
2024-01-05Document behavior of `!` with MbENadrieril-0/+54
2024-01-05remove duplicate testRalf Jung-23/+0
2024-01-05Auto merge of #119621 - compiler-errors:rollup-5mxtvuk, r=compiler-errorsbors-436/+713
Rollup of 10 pull requests Successful merges: - #119034 (Allow coverage tests to ignore test modes, and to enable color in coverage reports) - #119148 (Tweak suggestions for bare trait used as a type) - #119538 (Cleanup error handlers: round 5) - #119566 (Remove `-Zdump-mir-spanview`) - #119567 (Remove `-Zreport-delayed-bugs`.) - #119577 (Migrate memory overlap check from validator to lint) - #119583 (Make `intrinsics::assume` const stable) - #119586 ([rustdoc] Fix invalid handling for static method calls in jump to definition feature) - #119588 (Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support table) - #119601 (`Emitter` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2024-01-05macro_rules: Add more tests for using `tt` in addition to `ident`Vadim Petrochenkov-27/+159
Generally, `tt` and `ident` should behave identically, modulo the latter accepting only a subset of token trees.
2024-01-05Rollup merge of #119601 - nnethercote:Emitter-cleanups, r=oli-obkMichael Goulet-3/+423
`Emitter` cleanups Some improvements I found while looking at this code. r? `@oli-obk`
2024-01-05Rollup merge of #119586 - GuillaumeGomez:jump-to-def-static-methods, r=notriddleMichael Goulet-1/+28
[rustdoc] Fix invalid handling for static method calls in jump to definition feature I realized when working on a clippy lint that static method calls on `Self` could not give me the method `Res`. For that, we need to use `typeck` and so that's what I did in here. It fixes the linking to static method calls. r? ````@notriddle````
2024-01-05Rollup merge of #119577 - tmiasko:lint, r=oli-obkMichael Goulet-197/+55
Migrate memory overlap check from validator to lint The check attempts to identify potential undefined behaviour, rather than whether MIR is well-formed. It belongs in the lint not validator. Follow up to changes from #119077.
2024-01-05Rollup merge of #119566 - Zalathar:remove-spanview, r=Swatinem,NilstriebMichael Goulet-218/+0
Remove `-Zdump-mir-spanview` The `-Zdump-mir-spanview` flag was added back in #76074, as a development/debugging aid for the initial work on what would eventually become `-Cinstrument-coverage`. It causes the compiler to emit an HTML file containing a function's source code, with various spans highlighted based on the contents of MIR. When the suggestion was made to [triage and remove unnecessary `-Z` flags (Zulip)](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60-Z.60.20option.20triage), I noted that this flag could potentially be worth removing, but I wanted to keep it around to see whether I found it useful for my own coverage work. But when I actually tried to use it, I ran into various issues (e.g. it crashes on `tests/coverage/closure.rs`). If I can't trust it to work properly without a full overhaul, then instead of diving down a rabbit hole of trying to fix arcane span-handling bugs, it seems better to just remove this obscure old code entirely. --- ````@rustbot```` label +A-code-coverage
2024-01-05Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-errorsMichael Goulet-4/+4
Cleanup error handlers: round 5 More rustc_errors cleanups. A sequel to https://github.com/rust-lang/rust/pull/119171. r? ````@compiler-errors````
2024-01-05Rollup merge of #119148 - estebank:bare-traits, r=davidtwcoMichael Goulet-13/+161
Tweak suggestions for bare trait used as a type ``` error[E0782]: trait objects must include the `dyn` keyword --> $DIR/not-on-bare-trait-2021.rs:11:11 | LL | fn bar(x: Foo) -> Foo { | ^^^ | help: use a generic type parameter, constrained by the trait `Foo` | LL | fn bar<T: Foo>(x: T) -> Foo { | ++++++++ ~ help: you can also use `impl Foo`, but users won't be able to specify the type paramer when calling the `fn`, having to rely exclusively on type inference | LL | fn bar(x: impl Foo) -> Foo { | ++++ help: alternatively, use a trait object to accept any type that implements `Foo`, accessing its methods at runtime using dynamic dispatch | LL | fn bar(x: &dyn Foo) -> Foo { | ++++ error[E0782]: trait objects must include the `dyn` keyword --> $DIR/not-on-bare-trait-2021.rs:11:19 | LL | fn bar(x: Foo) -> Foo { | ^^^ | help: use `impl Foo` to return an opaque type, as long as you return a single underlying type | LL | fn bar(x: Foo) -> impl Foo { | ++++ help: alternatively, you can return an owned trait object | LL | fn bar(x: Foo) -> Box<dyn Foo> { | +++++++ + ``` Fix #119525: ``` error[E0038]: the trait `Ord` cannot be made into an object --> $DIR/bare-trait-dont-suggest-dyn.rs:3:33 | LL | fn ord_prefer_dot(s: String) -> Ord { | ^^^ `Ord` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: the trait cannot be made into an object because it uses `Self` as a type parameter ::: $SRC_DIR/core/src/cmp.rs:LL:COL | = note: the trait cannot be made into an object because it uses `Self` as a type parameter help: consider using an opaque type instead | LL | fn ord_prefer_dot(s: String) -> impl Ord { | ++++ ```
2024-01-05Rollup merge of #119034 - Zalathar:ignore-mode, r=davidtwcoMichael Goulet-0/+42
Allow coverage tests to ignore test modes, and to enable color in coverage reports This PR adds two new header directives to compiletest, intended for use by coverage tests (and by #119033 in particular). The new headers are: - `// ignore-mode-{mode}` causes a test to not be run in a particular compiletest mode (e.g. `ignore-mode-coverage-run`). - This can theoretically be used by any test, but coverage tests are currently the only ones that automatically run in multiple modes, so it's not very useful for other kinds of test. - `// llvm-cov-flags: --use-color` makes `coverage-run` tests pass the flag `--use-color` when generating coverage reports. - For most tests, non-coloured reports are easier to read and more portable across platforms. But for #119033 specifically, we want to test that `llvm-cov` slices up source text correctly, which only happens when colour output is enabled.
2024-01-05Use `resolutions(()).effective_visiblities` to avoid cycle errorsMichael Goulet-0/+106
2024-01-05Auto merge of #118991 - nikic:scalar-pair, r=nagisabors-34/+33
Separate immediate and in-memory ScalarPair representation Currently, we assume that ScalarPair is always represented using a two-element struct, both as an immediate value and when stored in memory. This currently works fairly well, but runs into problems with https://github.com/rust-lang/rust/pull/116672, where a ScalarPair involving an i128 type can no longer be represented as a two-element struct in memory. For example, the tuple `(i32, i128)` needs to be represented in-memory as `{ i32, [3 x i32], i128 }` to satisfy alignment requirements. Using `{ i32, i128 }` instead will result in the second element being stored at the wrong offset (prior to LLVM 18). Resolve this issue by no longer requiring that the immediate and in-memory type for ScalarPair are the same. The in-memory type will now look the same as for normal struct types (and will include padding filler and similar), while the immediate type stays a simple two-element struct type. This also means that booleans in immediate ScalarPair are now represented as i1 rather than i8, just like we do everywhere else. The core change here is to llvm_type (which now treats ScalarPair as a normal struct) and immediate_llvm_type (which returns the two-element struct that llvm_type used to produce). The rest is fixing things up to no longer assume these are the same. In particular, this switches places that try to get pointers to the ScalarPair elements to use byte-geps instead of struct-geps.
2024-01-05Add a test that emitting diagnostics does not require the crate to useGeorg Semmler-0/+39
the corresponding feature.
2024-01-05Replace some usage of `#[rustc_on_unimplemented]` withGeorg Semmler-0/+6
`#[diagnostic::on_unimplemented]` This commit replaces those `#[rustc_on_unimplemented]` attributes with their equivalent `#[diagnostic::on_unimplemented]` where this is supported (So no filter or any extended option)
2024-01-05Auto merge of #117673 - matthewjasper:thir-unsafeck-stabilization, r=cjgillotbors-4817/+845
Stabilize THIR unsafeck - Removes `-Zthir-unsafeck`, stabilizing the behaviour of `-Zthir-unsafeck=on`. - Removes MIR unsafeck. - Union patterns are now unsafe unless the field is matched to a wildcard pattern. Opening for a crater run in case we need a compatibility lint.
2024-01-05Restore if let guard temporary scoping differenceMatthew Jasper-0/+72
Match guards with an if let guard or an if let chain guard should have a temporary scope of the whole arm. This is to allow ref bindings to temporaries to borrow check.
2024-01-05Remove `thir::Guard`Matthew Jasper-0/+30
Use Expr instead. Use `ExprKind::Let` to represent if let guards.
2024-01-05Remove `hir::Guard`Matthew Jasper-12/+12
Use Expr instead. Use `ExprKind::Let` to represent if let guards.
2024-01-05Make test compatible with 32-bit as wellNikita Popov-1/+1
2024-01-05Handle context for const patterns correctlyMatthew Jasper-0/+24
2024-01-05Stabilize THIR unsafeckMatthew Jasper-303/+280
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-4667/+694
This is to make the diff when stabilizing it easier to review.
2024-01-05Auto merge of #118899 - veera-sivarajan:fix-makefile, r=Mark-Simulacrumbors-1/+0
fix(tests): remove check for `echo` fixes: #56222 Removes check for `echo` as it doesn't seem to be used anywhere.
2024-01-05Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkinbors-209/+223
Merge `unused_tuple_struct_fields` into `dead_code` This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group. [Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)