about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-02-20Merge pull request #19151 from infiniteregrets/infi/fix-proc-macroLukas Wirth-31/+159
Use correct working directory for non-workspace proc-macro execution
2025-02-20Add explanation commentJakub Beránek-0/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-02-20Remove GitHub job summariesJakub Beránek-9/+4
They don't seem to be used by miri contributors, and they pollute job summaries in rust-lang/rust.
2025-02-20Merge pull request #19188 from lnicola/ubuntu-latestLaurențiu Nicola-3/+3
internal: Use ubuntu-latest workers for releases
2025-02-20Use ubuntu-latest workers for releasesLaurențiu Nicola-3/+3
2025-02-20Merge pull request #19185 from BenjaminBrienen/patch-3Laurențiu Nicola-1/+1
Update architecture.md
2025-02-20Merge pull request #19187 from BenjaminBrienen/patch-4Laurențiu Nicola-3/+3
Update configuration.md
2025-02-20Simplify `Postorder` customization.Nicholas Nethercote-1/+1
`Postorder` has a `C: Customization<'tcx>` parameter, that gives it flexibility about how it computes successors. But in practice, there are only two `impls` of `Customization`, and one is for the unit type. This commit simplifies things by removing the generic parameter and replacing it with an `Option`.
2025-02-20Auto merge of #137295 - matthiaskrgr:rollup-tdu3t39, r=matthiaskrgrbors-0/+75
Rollup of 9 pull requests Successful merges: - #135296 (interpret: adjust vtable validity check for higher-ranked types) - #137106 (Add customized compare for Link in rustdoc) - #137253 (Restrict `bevy_ecs` `ParamSet` hack) - #137262 (Make fewer crates depend on `rustc_ast_ir`) - #137263 (Register `USAGE_OF_TYPE_IR_INHERENT`, remove inherent usages) - #137266 (MIR visitor tweaks) - #137269 (Pattern Migration 2024: properly label `&` patterns whose subpatterns are from macro expansions) - #137277 (stabilize `inherent_str_constructors`) - #137281 (Tweak "expected ident" parse error to avoid talking about doc comments) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-20Update configuration.mdBenjamin Brienen-3/+3
fix dead links
2025-02-19missed the L for the line numberJosh Rotenberg-1/+1
2025-02-20Update architecture.mdBenjamin Brienen-1/+1
it is stable since 1.52
2025-02-20Rollup merge of #135296 - lukas-code:dyn-leak-check, r=compiler-errorsMatthias Krüger-0/+75
interpret: adjust vtable validity check for higher-ranked types ## What Transmuting between trait objects where a generic argument or associated type only differs in bound regions (not bound at or above the trait object's binder) is now UB. For example * transmuting between `&dyn Trait<for<'a> fn(&'a u8)>` and `&dyn Trait<fn(&'static u8)>` is UB. * transmuting between `&dyn Trait<Assoc = for<'a> fn(&'a u8)>` and `&dyn Trait<Assoc = fn(&'static u8)>` is UB. * transmuting between `&dyn Trait<for<'a> fn(&'a u8) -> (&'a u8, &'static u8)>` and `&dyn Trait<for<'a> fn(&'a u8) -> (&'static u8, &'a u8)>` is UB. Transmuting between subtypes (in either direction) is still allowed, which means that bound regions that are bound at or above the trait object's binder can still be changed: * transmuting between `&dyn for<'a> Trait<fn(&'a u8)>` and `&dyn for Trait<fn(&'static u8)>` is fine. * transmuting between `&dyn for<'a> Trait<dyn Trait<fn(&'a u8)>>` and `&dyn for Trait<dyn Trait<fn(&'static u8)>>` is fine. ## Why Very similar to https://github.com/rust-lang/rust/issues/120217 and https://github.com/rust-lang/rust/issues/120222, changing a trait object's generic argument to a type that only differs in bound regions can still affect the vtable layout and lead to segfaults at runtime (for an example see `src/tools/miri/tests/fail/validity/dyn-transmute-inner-binder.rs`). Since we already already require that the trait object predicates must be equal modulo bound regions, it is only natural to extend this check to also require type equality considering bound regions. However, it also makes sense to allow transmutes between a type and a subtype thereof. For example `&dyn for<'a> Trait<&'a u8>` is a subtype of `&dyn Trait<&'static ()>` and they are guaranteed to have the same vtable, so it makes sense to allow this transmute. So that's why bound lifetimes that are bound to the trait object itself are treated as free lifetime for the purpose of this check. Note that codegen already relies on the property that subtyping cannot change the the vtable and this is asserted here (note the leak check): https://github.com/rust-lang/rust/blob/251206c27b619ccf3a08e2ac4c525dc343f08492/compiler/rustc_codegen_ssa/src/base.rs#L106-L153 Furthermore, we allow some pointer-to-pointer casts like `*const dyn for<'a> Trait<&'a u8>` to `*const Wrapper<dyn Trait<&'static u8>>` that instantiate the trait object binder and are currently lowered to a single pointer-to-pointer cast in MIR (`CastKind::PtrToPtr`) and *not* an unsizing coercion (`CastKind::PointerCoercion(Unsize)`), so the current MIR lowering of these would be UB if we didn't allow subtyping transmutes. --- fixes https://github.com/rust-lang/rust/issues/135230 cc `@rust-lang/opsem` r? `@compiler-errors` for the implementation
2025-02-20Explicitly compare `TypesMap` as ptrsShoyu Vanilla-12/+17
2025-02-19Rollup merge of #136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwcoMatthias Krüger-4/+0
Lint `#[must_use]` attributes applied to methods in trait impls The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused `#[must_use]` lint, and cleans the extra attributes in portable-simd and Clippy.
2025-02-19Rollup merge of #136344 - zachs18:dot_notation_more_defkinds_3, r=davidtwcoMatthias Krüger-1/+0
Suggest replacing `.` with `::` in more error diagnostics. First commit makes the existing "help: use the path separator to refer to an item" also work when the base is a type alias, not just a trait/module/struct. The existing unconditional `DefKind::Mod | DefKind::Trait` match arm is changed to a conditional `DefKind::Mod | DefKind::Trait | DefKind::TyAlias` arm that only matches if the `path_sep` suggestion-adding closure succeeds, so as not to stop the later `DefKind::TyAlias`-specific suggestions if the path-sep suggestion does not apply. This shouldn't change behavior for `Mod` or `Trait` (due to the default arm's `return false` etc). This commit also updates `tests/ui/resolve/issue-22692.rs` to reflect this, and also renames it to something more meaningful. This commit also makes the `bad_struct_syntax_suggestion` closure take `err` as a parameter instead of capturing it, since otherwise caused borrowing errors due to the change to using `path_sep` in a pattern guard. <details> <summary> Type alias diagnostic example </summary> ```rust type S = String; fn main() { let _ = S.new; } ``` ```diff error[E0423]: expected value, found type alias `S` --> diag7.rs:4:13 | 4 | let _ = S.new; | ^ | - = note: can't use a type alias as a constructor + help: use the path separator to refer to an item + | +4 | let _ = S::new; + | ~~ ``` </details> Second commit adds some cases for `enum`s, where if there is a field/method expression where the field/method has the name of a unit/tuple variant, we assume the user intended to create that variant[^1] and suggest replacing the `.` from the field/method suggestion with a `::` path separator. If no such variant is found (or if the error is not a field/method expression), we give the existing suggestion that suggests adding `::TupleVariant(/* fields */)` after the enum. <details> <summary> Enum diagnostic example </summary> ```rust enum Foo { A(u32), B, C { x: u32 }, } fn main() { let _ = Foo.A(42); // changed let _ = Foo.B; // changed let _ = Foo.D(42); // no change let _ = Foo.D; // no change let _ = Foo(42); // no change } ``` ```diff error[E0423]: expected value, found enum `Foo` --> diag8.rs:8:13 | 8 | let _ = Foo.A(42); // changed | ^^^ | note: the enum is defined here --> diag8.rs:1:1 | 1 | / enum Foo { 2 | | A(u32), 3 | | B, 4 | | C { x: u32 }, 5 | | } | |_^ -help: you might have meant to use the following enum variant - | -8 | let _ = Foo::B.A(42); // changed - | ~~~~~~ -help: alternatively, the following enum variant is available +help: use the path separator to refer to a variant | -8 | let _ = (Foo::A(/* fields */)).A(42); // changed - | ~~~~~~~~~~~~~~~~~~~~~~ +8 | let _ = Foo::A(42); // changed + | ~~ error[E0423]: expected value, found enum `Foo` --> diag8.rs:9:13 | 9 | let _ = Foo.B; // changed | ^^^ | note: the enum is defined here --> diag8.rs:1:1 | 1 | / enum Foo { 2 | | A(u32), 3 | | B, 4 | | C { x: u32 }, 5 | | } | |_^ -help: you might have meant to use the following enum variant - | -9 | let _ = Foo::B.B; // changed - | ~~~~~~ -help: alternatively, the following enum variant is available +help: use the path separator to refer to a variant | -9 | let _ = (Foo::A(/* fields */)).B; // changed - | ~~~~~~~~~~~~~~~~~~~~~~ +9 | let _ = Foo::B; // changed + | ~~ error[E0423]: expected value, found enum `Foo` --> diag8.rs:10:13 | 10 | let _ = Foo.D(42); // no change | ^^^ | note: the enum is defined here --> diag8.rs:1:1 | 1 | / enum Foo { 2 | | A(u32), 3 | | B, 4 | | C { x: u32 }, 5 | | } | |_^ help: you might have meant to use the following enum variant | 10 | let _ = Foo::B.D(42); // no change | ~~~~~~ help: alternatively, the following enum variant is available | 10 | let _ = (Foo::A(/* fields */)).D(42); // no change | ~~~~~~~~~~~~~~~~~~~~~~ error[E0423]: expected value, found enum `Foo` --> diag8.rs:11:13 | 11 | let _ = Foo.D; // no change | ^^^ | note: the enum is defined here --> diag8.rs:1:1 | 1 | / enum Foo { 2 | | A(u32), 3 | | B, 4 | | C { x: u32 }, 5 | | } | |_^ help: you might have meant to use the following enum variant | 11 | let _ = Foo::B.D; // no change | ~~~~~~ help: alternatively, the following enum variant is available | 11 | let _ = (Foo::A(/* fields */)).D; // no change | ~~~~~~~~~~~~~~~~~~~~~~ error[E0423]: expected function, tuple struct or tuple variant, found enum `Foo` --> diag8.rs:12:13 | 12 | let _ = Foo(42); // no change | ^^^ help: try to construct one of the enum's variants: `Foo::A` | = help: you might have meant to construct the enum's non-tuple variant note: the enum is defined here --> diag8.rs:1:1 | 1 | / enum Foo { 2 | | A(u32), 3 | | B, 4 | | C { x: u32 }, 5 | | } | |_^ error: aborting due to 5 previous errors ``` </details> [^1]: or if it's a field expression and a tuple variant, that they meant to refer the variant constructor.
2025-02-19Create a generic AVR target: avr-nonePatryk Wychowaniec-0/+10
This commit removes the `avr-unknown-gnu-atmega328` target and replaces it with a more generic `avr-none` variant that must be specialized with the `-C target-cpu` flag (e.g. `-C target-cpu=atmega328p`).
2025-02-20fix: Binding wrong assoc ty when lowering trait ref boundShoyu Vanilla-10/+45
2025-02-19Merge pull request #19180 from joshrotenberg/fix-source-file-urlLukas Wirth-1/+7
doc: use fully qualified url for source path
2025-02-19Merge from rustcThe Miri Cronjob Bot-3279/+9899
2025-02-19Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-02-18Merge pull request #19179 from alibektas/19090_newChayim Refael Friedman-2/+98
Ignore assists with many results if grouping not supported
2025-02-18Auto merge of #137235 - matthiaskrgr:rollup-2kjua2t, r=matthiaskrgrbors-5/+13
Rollup of 10 pull requests Successful merges: - #135711 (Do not ICE on default_field_value const with lifetimes) - #136599 (librustdoc: more usages of `Joined::joined`) - #136876 (Locking documentation updates) - #137000 (Deeply normalize item bounds in new solver) - #137126 (fix docs for inherent str constructors) - #137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - #137191 (Update mdbook and move error_index_generator) - #137203 (Improve MIR modification) - #137206 (Make E0599 a structured error) - #137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-18Add a check_assist_* overload and move tests under assistsAli Bektas-37/+66
2025-02-18use fully qualified url for source pathJosh Rotenberg-1/+7
2025-02-18Fix 19090Ali Bektas-0/+67
2025-02-18Suggest using :: instead of . in more cases.Zachary S-1/+0
When `Foo.field` or `Foo.method()` exprs are encountered, suggest `Foo::field` or `Foo::method()` when Foo is a type alias, not just a struct, trait, or module. Also rename test for this suggestion from issue-22692.rs to something more meaningful.
2025-02-18Rollup merge of #137191 - ehuss:update-mdbook, r=jieyouxuMatthias Krüger-5/+13
Update mdbook and move error_index_generator This moves error_index_generator to the rustbook workspace so that it can share the dependency with mdbook. I had forgotten that error_index_generator is using mdbook. This includes a corresponding update to mdbook which avoids a regression in error_index_generator. Closes https://github.com/rust-lang/rust/issues/137052
2025-02-18Rollup merge of #136750 - kornelski:ub-bug, r=saethlinUrgau-0/+2
Make ub_check message clear that it's not an assert I've seen a user assume that their unsound code was *safe*, because ub_check prevented the program from performing the unsafe operation. This PR makes the panic message clearer that ub_check is a bug detector, not run-time safety protection.
2025-02-18update `cfg(bootstrap)`Josh Stone-3/+0
2025-02-18Fix dead linkBenjamin Brienen-1/+1
2025-02-18Revert "pass struct fields to chalk"Lukas Wirth-37/+20
2025-02-18Merge pull request #19157 from joshrotenberg/dev-guide-to-bookLukas Wirth-173/+201
doc: move dev docs to manual
2025-02-18Auto merge of #137162 - nnethercote:remove-Map-2, r=Zalatharbors-45/+37
Move methods from `Map` to `TyCtxt`, part 2. Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that. r? Zalathar
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-45/+37
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-17Fix what looks like an inverted messageEric Huss-1/+1
I believe this is trying to say there is something that is in the file, but shouldn't be.
2025-02-17Move error_index_generator to the rustbook workspaceEric Huss-1/+9
I had forgotten that error_index_generator is using mdbook. This moves it to be part of the rustbook workspace so that it can share the dependency with rustbook.
2025-02-17Update mdbook to 0.4.45Eric Huss-3/+3
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0445
2025-02-17move dev docs to manualJosh Rotenberg-173/+201
fix formatting
2025-02-17Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-2949/+9573
Subtree update of `rust-analyzer` r? `@ghost`
2025-02-17Rollup merge of #137020 - ferrocene:pa-vendor-sources, r=KobzolMatthias Krüger-54/+40
Pass vendored sources from bootstrap to generate-copyright In addition to doing the vendoring in bootstrap, this PR also loads the list of manifests to parse from bootstrap (instead of hardcoding a smaller list in generate-copyright). This is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/136955
2025-02-17Use correct working directory for non-workspace proc-macro executionMehul Arora-31/+159
2025-02-17Update lockfileLaurențiu Nicola-12/+12
2025-02-17Merge pull request #19169 from lnicola/sync-from-rustLaurențiu Nicola-1838/+2722
minor: Sync from downstream
2025-02-17Bump rustc cratesLaurențiu Nicola-5/+5
2025-02-17Merge pull request #19167 from ChayimFriedman2/fix-ref-patLukas Wirth-17/+64
fix: Fix detection of ref patterns for path patterns
2025-02-17Merge from rust-lang/rustLaurențiu Nicola-1832/+2716
2025-02-17Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-02-17Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgrbors-5/+19
Rollup of 7 pull requests Successful merges: - #137095 (Replace some u64 hashes with Hash64) - #137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - #137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - #137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - #137125 (Re-add missing empty lines in the releases notes) - #137145 (use add-core-stubs / minicore for a few more tests) - #137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-17generate-copyright: pass the vendored sources from bootstrapPietro Albini-44/+8