about summary refs log tree commit diff
path: root/tests/ui/thir-print
AgeCommit message (Collapse)AuthorLines
2025-08-17Rehome tests/ui/issues/ tests [5/?]Oneirical-0/+15
2025-08-14use ty::Value instead of manual pairs of types and valtreesRalf Jung-4/+2
2025-08-14pattern testing: store constants as valtreesRalf Jung-0/+2
2025-08-14PatKind: store constants as valtreesRalf Jung-2/+2
2025-07-17Auto merge of #142903 - cjgillot:local-def-path-hash, r=compiler-errorsbors-4/+4
Only inherit local hash for paths `DefPathHash`, as the counterpart of `DefId` that is stable across compiler invocations, is comprised of 2 parts. The first one is the `StableCrateId`, stable form of `CrateNum`. The second is 64 complementary bits to identify the crate-local definition. The current implementation always hashes the full 128 bits when (1) trying to create a new child `DefPathHash` or (2) hashing a `CrateNum` or a `LocalDefId`. But we only need half that information: `LocalDefId` means that the `StableCrateId` is always the current crate's ; `CrateNum` means that we do not care about the local part. As stable hashing is very hot in the query system, in particular hashing definitions, this is a big deal. We still want the local part to change when the `StableCrateId` changes, to make incr-compilation errors less painful, ie. increase the likelihood that if will magically disappear by changing some code. This PR sprinkles some `#[inline]` attributes on small functions that appeared in profiles.
2025-07-01loop match: run exhaustiveness checkFolkert de Vries-133/+157
2025-06-23Add `#[loop_match]` for improved DFA codegenbjorn3-0/+323
Co-authored-by: Folkert de Vries <folkert@folkertdev.nl>
2025-06-22Only inherit local hash for paths.Camille GILLOT-4/+4
2025-01-29Eliminate PatKind::PathOli Scherer-26/+26
2024-12-09Introduce `default_field_values` featureEsteban Küber-3/+3
Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681. Support default fields in enum struct variant Allow default values in an enum struct variant definition: ```rust pub enum Bar { Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Allow using `..` without a base on an enum struct variant ```rust Bar::Foo { .. } ``` `#[derive(Default)]` doesn't account for these as it is still gating `#[default]` only being allowed on unit variants. Support `#[derive(Default)]` on enum struct variants with all defaulted fields ```rust pub enum Bar { #[default] Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Check for missing fields in typeck instead of mir_build. Expand test with `const` param case (needs `generic_const_exprs` enabled). Properly instantiate MIR const The following works: ```rust struct S<A> { a: Vec<A> = Vec::new(), } S::<i32> { .. } ``` Add lint for default fields that will always fail const-eval We *allow* this to happen for API writers that might want to rely on users' getting a compile error when using the default field, different to the error that they would get when the field isn't default. We could change this to *always* error instead of being a lint, if we wanted. This will *not* catch errors for partially evaluated consts, like when the expression relies on a const parameter. Suggestions when encountering `Foo { .. }` without `#[feature(default_field_values)]`: - Suggest adding a base expression if there are missing fields. - Suggest enabling the feature if all the missing fields have optional values. - Suggest removing `..` if there are no missing fields.
2024-11-21Implement the unsafe-fields RFC.Luca Versari-3/+3
Co-Authored-By: Jacob Pratt <jacob@jhpratt.dev>
2024-11-20reduce false positives of tail-expr-drop-order from consumed valuesDing Xiang Fei-76/+136
take 2 open up coroutines tweak the wordings the lint works up until 2021 We were missing one case, for ADTs, which was causing `Result` to yield incorrect results. only include field spans with significant types deduplicate and eliminate field spans switch to emit spans to impl Drops Co-authored-by: Niko Matsakis <nikomat@amazon.com> collect drops instead of taking liveness diff apply some suggestions and add explantory notes small fix on the cache let the query recurse through coroutine new suggestion format with extracted variable name fine-tune the drop span and messages bugfix on runtime borrows tweak message wording filter out ecosystem types earlier apply suggestions clippy check lint level at session level further restrict applicability of the lint translate bid into nop for stable mir detect cycle in type structure
2024-10-28Lower AST node id only onceAdwin White-23/+23
2024-07-11report pat no field error no recoverd struct variantyukang-4/+4
2024-04-17Rename `BindingAnnotation` to `BindingMode`Jules Bertholet-1/+1
2024-03-27Implement `mut ref`/`mut ref mut`Jules Bertholet-2/+1
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-8/+8
2023-12-30Update to bitflags 2 in the compilerNilstrieb-8/+8
This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually. Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.
2023-12-21Give temporaries in if let guards correct scopesMatthew Jasper-6/+6
- Make temporaries in if-let guards be the same variable in MIR when the guard is duplicated due to or-patterns. - Change the "destruction scope" for match arms to be the arm scope rather than the arm body scope. - Add tests.
2023-12-04Don't include destruction scopes in THIRMatthew Jasper-306/+163
They are not used by anyone, and add memory/performance overhead.
2023-09-18make more prettyBoxy-90/+26
2023-09-11Disentangle `Debug` and `Display` for `Ty`.Nicholas Nethercote-26/+90
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This is surprising and annoying. In particular, it means `Debug` doesn't show as much information as `Debug` for `TyKind` does. And `Debug` is used in some user-facing error messages, which seems bad. This commit changes the `Debug` impl for `Ty` to call the `Debug` impl for `TyKind`. It also does a number of follow-up changes to preserve existing output, many of which involve inserting `with_no_trimmed_paths!` calls. It also adds `Display` impls for `UserType` and `Canonical`. Some tests have changes to expected output: - Those that use the `rustc_abi(debug)` attribute. - Those that use the `EMIT_MIR` annotation. In each case the output is slightly uglier than before. This isn't ideal, but it's pretty weird (particularly for the attribute) that the output is using `Debug` in the first place. They're fairly obscure attributes (I hadn't heard of them) so I'm not worried by this. For `async-is-unwindsafe.stderr`, there is one line that now lacks a full path. This is a consistency improvement, because all the other mentions of `Context` in this test lack a path.
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-8/+8
2023-07-01add thir-print testEric Mark Martin-0/+417
2023-05-26better `TyKind::Debug`Boxy-1/+1
2023-04-05Bless testsThom Chiovoloni-31/+31
2023-03-02Make `ExprKind` the first field in `thir::Expr`Nilstrieb-9/+9
This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-02-26Store the body type in THIR.Camille GILLOT-0/+3
2023-01-27address reviewb-naber-0/+472