about summary refs log tree commit diff
path: root/tests/ui-fulldeps
AgeCommit message (Collapse)AuthorLines
2025-08-19Auto merge of #145599 - jieyouxu:rollup-523cxhm, r=jieyouxubors-9/+38
Rollup of 15 pull requests Successful merges: - rust-lang/rust#139345 (Extend `QueryStability` to handle `IntoIterator` implementations) - rust-lang/rust#140740 (Add `-Zindirect-branch-cs-prefix`) - rust-lang/rust#142079 (nll-relate: improve hr opaque types support) - rust-lang/rust#142938 (implement std::fs::set_permissions_nofollow on unix) - rust-lang/rust#143730 (fmt of non-decimal radix untangled) - rust-lang/rust#144767 (Correct some grammar in integer documentation) - rust-lang/rust#144906 (Require approval from t-infra instead of t-release on tier bumps) - rust-lang/rust#144983 (Rehome 37 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`) - rust-lang/rust#145025 (run spellcheck as a tidy extra check in ci) - rust-lang/rust#145099 (rustc_target: Add the `32s` target feature for LoongArch) - rust-lang/rust#145166 (suggest using `pub(crate)` for E0364) - rust-lang/rust#145255 (dec2flt: Provide more valid inputs examples) - rust-lang/rust#145306 (Add tracing to various miscellaneous functions) - rust-lang/rust#145336 (Hide docs for `core::unicode`) - rust-lang/rust#145585 (Miri: fix handling of in-place argument and return place handling) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-17Add `//@ ignore-stage1` to query_stability.rs testSamuel Moelius-10/+11
2025-08-15Extend `QueryStability` to handle `IntoIterator` implementationsSamuel Moelius-1/+29
Fix adjacent code Fix duplicate warning; merge test into `tests/ui-fulldeps/internal-lints` Use `rustc_middle::ty::FnSig::inputs` Address two review comments - https://github.com/rust-lang/rust/pull/139345#discussion_r2109006991 - https://github.com/rust-lang/rust/pull/139345#discussion_r2109058588 Use `Instance::try_resolve` Import `rustc_middle::ty::Ty` as `Ty` rather than `MiddleTy` Simplify predicate handling Add more `#[allow(rustc::potential_query_instability)]` following rebase Remove two `#[allow(rustc::potential_query_instability)]` following rebase Address review comment Update compiler/rustc_lint/src/internal.rs Co-authored-by: lcnr <rust@lcnr.de>
2025-08-15Detect missing `derive` on unresolved attribute even when not importedEsteban Küber-0/+6
``` error: cannot find attribute `sede` in this scope --> $DIR/missing-derive-3.rs:20:7 | LL | #[sede(untagged)] | ^^^^ | help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute | LL | #[serde(untagged)] | + error: cannot find attribute `serde` in this scope --> $DIR/missing-derive-3.rs:14:7 | LL | #[serde(untagged)] | ^^^^^ | note: `serde` is imported here, but it is a crate, not an attribute --> $DIR/missing-derive-3.rs:4:1 | LL | extern crate serde; | ^^^^^^^^^^^^^^^^^^^ help: `serde` is an attribute that can be used by the derive macros `Deserialize` and `Serialize`, you might be missing a `derive` attribute | LL + #[derive(Deserialize, Serialize)] LL | enum B { | ```
2025-08-09remove `P`Deadbeef-13/+18
2025-07-18use `RustcPublic` instead of `StableMir`Makai-22/+22
2025-07-18rename `ui-fulldeps/stable-mir`Makai-0/+0
2025-07-14rename `stable_mir` to `rustc_public`, and `rustc_smir` to `rustc_public_bridge`Makai-165/+173
2025-07-08Expose nested bodies in rustc_borrowck::consumersNico Lehmann-8/+18
2025-07-07remove `rustc_smir` from testsMakai-53/+43
2025-06-30Stop backends from needing to support nullary intrinsicsOli Scherer-37/+23
2025-06-26Rollup merge of #142884 - makai410:coroutine-body, r=celinvalMatthias Krüger-0/+105
StableMIR: Add method to retrieve body of coroutine It would be handy if we can retrieve body of a coroutine in StableMIR.
2025-06-24rustc_session: Add a structure for keeping both explicit and default sysrootsVadim Petrochenkov-3/+3
Also avoid creating and cloning sysroot unnecessarily.
2025-06-22add method to retrieve body of coroutineMakai-0/+105
2025-06-22Auto merge of #142706 - fee1-dead-contrib:push-zsznlqyrzsqo, r=oli-obkbors-2/+4
completely deduplicate `Visitor` and `MutVisitor` r? oli-obk This closes rust-lang/rust#127615. ### Discussion > * Give every `MutVisitor::visit_*` method a corresponding `flat_map_*` method. Not every AST node exists in a location where they can be mapped to multiple instances of themselves. Not every AST node exists in a location where they can be removed from existence (e.g. `filter_map_expr`). I don't think this is doable. > * Give every `MutVisitor::visit_*` method a corresponding `Visitor` method and vice versa The only three remaining method-level asymmetries after this PR are `visit_stmt` and `visit_nested_use_tree` (only on `Visitor`) and `visit_span` (only on `MutVisitor`). `visit_stmt` doesn't seem applicable to `MutVisitor` because `walk_flat_map_stmt_kind` will ask `flat_map_item` / `filter_map_expr` to potentially turn a single `Stmt` to multiple based on what a visitor wants. So only using `flat_map_stmt` seems appropriate. `visit_nested_use_tree` is used for `rustc_resolve` to track stuff. Not useful for `MutVisitor` for now. `visit_span` is currently not used for `MutVisitor` already, it was just kept in case we want to revive rust-lang/rust#127241. cc `@cjgillot` maybe we could remove for now and re-insert later if we find a use-case? It does involve some extra effort to maintain. * Remaining FIXMEs `visit_lifetime` has an extra param for `Visitor` that's not in `MutVisitor`. This is again something only used by `rustc_resolve`. I think we can keep that symmetry for now.
2025-06-20Add an attribute-related parenthesization edge caseDavid Tolnay-0/+6
2025-06-20Add AST pretty-printer tests involving attr on binary operationDavid Tolnay-0/+9
This test currently fails (as expected). --- stderr ------------------------------- Pretty-printer lost necessary parentheses BEFORE: #[attr] (1 + 1) AFTER: #[attr] 1 + 1 Pretty-printer lost necessary parentheses BEFORE: #[attr] (1 as T) AFTER: #[attr] 1 as T Pretty-printer lost necessary parentheses BEFORE: #[attr] (x = 1) AFTER: #[attr] x = 1 Pretty-printer lost necessary parentheses BEFORE: #[attr] (x += 1) AFTER: #[attr] x += 1 ------------------------------------------
2025-06-19Preserve Paren expression's attributes during UnparenthesizeDavid Tolnay-0/+5
2025-06-19completely deduplicate `Visitor` and `MutVisitor`Deadbeef-2/+4
2025-06-18Rollup merge of #142377 - Urgau:unremap-rustc-dev, r=jieyouxuUrgau-0/+63
Try unremapping compiler sources See [#t-compiler/help > Span pointing to wrong file location (`rustc-dev` component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083). This PR is a follow-up to rust-lang/rust#141751 regarding the compiler side. Specifically we now take into account the `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` env from rust-lang/rust#141751 when trying to unremap sources from `$sysroot/lib/rustlib/rustc-src/rust` (the `rustc-dev` component install directory). Best reviewed commit by commit. cc ``@samueltardieu`` r? ``@jieyouxu``
2025-06-18Implement lint against direct uses of rustc_type_ir in compiler cratesRomain Perier-0/+65
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
2025-06-17Rollup merge of #142371 - fee1-dead-contrib:push-xqlkumzurkus, r=petrochenkovJacob Pratt-6/+5
avoid `&mut P<T>` in `visit_expr` etc methods trying a different way than rust-lang/rust#141636 r? ghost
2025-06-16Fix test descriptionNotLebedev-2/+2
2025-06-16Add test for `AdtDef::discriminant_for_variant` polymorphic over parameterNotLebedev-0/+29
2025-06-16Add test for `AdtDef::discriminant_for_variant`NotLebedev-0/+154
2025-06-15Rollup merge of #141769 - bjorn3:codegen_metadata_module_rework, ↵León Orell Valerian Liehr-9/+8
r=workingjubilee,saethlin Move metadata object generation for dylibs to the linker code This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time. Prerequisite of https://github.com/rust-lang/rust/issues/96708.
2025-06-15Rollup merge of #134661 - dtolnay:prefixattr, r=fmeaseLeón Orell Valerian Liehr-4/+43
Reduce precedence of expressions that have an outer attr Previously, `-Zunpretty=expanded` would expand this program as follows: ```rust #![feature(stmt_expr_attributes)] macro_rules! repro { ($e:expr) => { #[allow(deprecated)] $e }; } #[derive(Default)] struct Thing { #[deprecated] field: i32, } fn main() { let thing = Thing::default(); let _ = repro!(thing).field; } ``` ```rs #![feature(prelude_import)] #![feature(stmt_expr_attributes)] #[prelude_import] use std::prelude::rust_2021::*; #[macro_use] extern crate std; struct Thing { #[deprecated] field: i32, } #[automatically_derived] impl ::core::default::Default for Thing { #[inline] fn default() -> Thing { Thing { field: ::core::default::Default::default() } } } fn main() { let thing = Thing::default(); let _ = #[allow(deprecated)] thing.field; } ``` This is not the correct expansion. The correct output would have `(#[allow(deprecated)] thing).field` with the attribute applying only to `thing`, not to `thing.field`.
2025-06-15Un-remap `rustc-dev` component pathsUrgau-0/+63
2025-06-13Auto merge of #134841 - estebank:serde-attr-4, r=wesleywiserbors-0/+14
Look at proc-macro attributes when encountering unknown attribute ``` error: cannot find attribute `sede` in this scope --> $DIR/missing-derive-2.rs:22:7 | LL | #[sede(untagged)] | ^^^^ | help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute | LL | #[serde(untagged)] | + error: cannot find attribute `serde` in this scope --> $DIR/missing-derive-2.rs:16:7 | LL | #[serde(untagged)] | ^^^^^ | note: `serde` is imported here, but it is a crate, not an attribute --> $DIR/missing-derive-2.rs:5:1 | LL | extern crate serde; | ^^^^^^^^^^^^^^^^^^^ help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute | LL + #[derive(Serialize, Deserialize)] LL | enum B { | ``` Partially address #47608. This PR doesn't find [macros that haven't yet been imported by name](https://github.com/rust-lang/rust/pull/109278/commits/af945cb86e03b44a4b6dc4d54ec1424b00a2349e).
2025-06-13Add AST pretty-printer tests involving attr precedenceDavid Tolnay-4/+43
This test currently fails (as expected). --- stderr ------------------------------- Pretty-printer lost necessary parentheses BEFORE: (#[attr] loop {}).field AFTER: #[attr] loop {}.field ------------------------------------------
2025-06-13Rollup merge of #134847 - dtolnay:asymmetrical, r=fmeaseMatthias Krüger-2/+2
Implement asymmetrical precedence for closures and jumps I have been through a series of asymmetrical precedence designs in Syn, and finally have one that I like and is worth backporting into rustc. It is based on just 2 bits of state: `next_operator_can_begin_expr` and `next_operator_can_continue_expr`. Asymmetrical precedence is the thing that enables `(return 1) + 1` to require parentheses while `1 + return 1` does not, despite `+` always having stronger precedence than `return` [according to the Rust Reference](https://doc.rust-lang.org/1.83.0/reference/expressions.html#expression-precedence). This is facilitated by `next_operator_can_continue_expr`. Relatedly, it is the thing that enables `(return) - 1` to require parentheses while `return + 1` does not, despite `+` and `-` having exactly the same precedence. This is facilitated by `next_operator_can_begin_expr`. **Example:** ```rust macro_rules! repro { ($e:expr) => { $e - $e; $e + $e; }; } fn main() { repro!{return} repro!{return 1} } ``` `-Zunpretty=expanded` **Before:** ```console fn main() { (return) - (return); (return) + (return); (return 1) - (return 1); (return 1) + (return 1); } ``` **After:** ```console fn main() { (return) - return; return + return; (return 1) - return 1; (return 1) + return 1; } ```
2025-06-12Detect when attribute is provided by missing `derive` macroEsteban Küber-0/+14
``` error: cannot find attribute `empty_helper` in this scope --> $DIR/derive-helper-legacy-limits.rs:17:3 | LL | #[empty_helper] | ^^^^^^^^^^^^ | help: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute | LL + #[derive(Empty)] LL | struct S2; | ``` Look at proc-macro attributes when encountering unknown attribute ``` error: cannot find attribute `sede` in this scope --> src/main.rs:18:7 | 18 | #[sede(untagged)] | ^^^^ | help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute | 18 | #[serde(untagged)] | ~~~~~ error: cannot find attribute `serde` in this scope --> src/main.rs:12:7 | 12 | #[serde(untagged)] | ^^^^^ | = note: `serde` is in scope, but it is a crate, not an attribute help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute | 10 | #[derive(Serialize, Deserialize)] | ```
2025-06-12avoid `&mut P<T>` in `visit_expr` etc methodsDeadbeef-6/+5
2025-06-12Rollup merge of #141307 - b-naber:closure-body, r=celinvalMatthias Krüger-0/+180
Add method to retrieve body of closure in stable-mir fixes https://github.com/rust-lang/project-stable-mir/issues/85 r? `@celinval`
2025-06-10Implement representation options to smirShoyu Vanilla-1/+36
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-9/+8
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-06-02add doc comment and a test with a generic closureb-naber-0/+90
2025-06-02add `body` to `ClosureDef`b-naber-0/+90
2025-05-29remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`Deadbeef-12/+6
`visit_clobber` is not really useful except for one niche purpose involving generic code. We should just use the replace logic where we can.
2025-05-05Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obkbors-12/+12
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct `DisambiguatorState` instances must ensure that that the def paths are unique without its help. Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer. `DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those. cc `@oli-obk`
2025-05-03Implement asymmetrical precedence for closures and jumpsDavid Tolnay-2/+2
2025-05-03Improve hir pretty-printing of attributes.Nicholas Nethercote-2/+2
2025-04-30ast: Remove token visiting from AST visitorVadim Petrochenkov-2/+0
It's no longer necessary after the removal of nonterminal tokens in #124141.
2025-04-29Update stable-mir testJohn Kåre Alsaker-12/+12
2025-04-24Refactor `StableMir` to avoid some clones.Nicholas Nethercote-34/+36
Pass `args` to `run` instead of storing it in a field. This avoids the need to clone it within `run`. Also, change `args` from `Vec<String>` to `&[String]`, avoiding the need for some vecs and clones.
2025-04-16Move eager translation to a method on `Diag`Jake Goulding-14/+12
This will allow us to eagerly translate messages on a top-level diagnostic, such as a `LintDiagnostic`. As a bonus, we can remove the awkward closure passed into Subdiagnostic and make better use of `Into`.
2025-04-13Rollup merge of #139760 - petrochenkov:noerrpat2, r=jieyouxuJacob Pratt-2/+6
UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible There's a number of cases in which `error-pattern` is still necessary even for compile time checking. - It checks something that compiler writes directly into stderr as text, and not to the structured json output. This includes some stuff reported during compiler panics, and also diagnostics that happen very early, for example when parsing the command line. - It checks something that exists only in the full rendered diagnostic test, but not in its structured components, for example code fragments or output of `-Ztrack-diagnostics`. (The latter can probably be converted to structured form though.) This is continuation of https://github.com/rust-lang/rust/pull/139137. r? `@jieyouxu`
2025-04-13UI tests: migrate remaining compile time `error-pattern`s to line annotationsVadim Petrochenkov-2/+6
when possible.
2025-04-13import rustc_smir::rustc_internal in run_driver!zjp-21/+0
2025-04-11Rollup merge of #139662 - nnethercote:tweak-DefPathData, r=compiler-errorsJacob Pratt-2/+2
Tweak `DefPathData` Some improvements in and around `DefPathData`, following on from #137977. r? `@spastorino`