about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-06-27Rollup merge of #140809 - bjorn3:panic_runtime_cleanup, r=petrochenkovMatthias Krüger-1/+2
Reduce special casing for the panic runtime See the individual commits for more info.
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-22/+21
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27Auto merge of #143064 - flip1995:clippy-subtree-update, r=GuillaumeGomezbors-843/+3158
Clippy subtree update r? `@Manishearth` Cargo.lock update due to version bump
2025-06-27Update dangling_pointer_to_raw_pointer.rsleopardracer-1/+1
2025-06-27Update README.mdleopardracer-1/+1
2025-06-27Update ui.rsleopardracer-1/+1
2025-06-27broken_links: Fix rustdoc API usagePhilipp Krones-1/+1
2025-06-27Merge commit 'c5dbd1de07e0407b9687619a868384d6de06253f' into ↵Philipp Krones-843/+3158
clippy-subtree-update
2025-06-27Workaround missing none group support in builtin macrosLukas Wirth-40/+22
2025-06-27Add InterpCx::layout_of with tracing, shadowing LayoutOfStypox-12/+1
2025-06-27use placeholder_snippetHayashi Mikihiro-15/+46
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-27use name_generatorHayashi Mikihiro-6/+21
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-27Insert checks for enum discriminants when debug assertions are enabledBastian Kersting-1/+1
Similar to the existing nullpointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@.
2025-06-27Split exported_symbols for generic and non-generic symbolsbjorn3-4/+4
This reduces metadata decoder overhead during the monomorphization collector.
2025-06-27Merge pull request #20110 from ChayimFriedman2/ambiguous-floatLukas Wirth-1/+50
fix: Fix completion in when typing `integer.|`
2025-06-27Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errorsbors-3/+3
Rollup of 18 pull requests Successful merges: - rust-lang/rust#137843 (make RefCell unstably const) - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - rust-lang/rust#142549 (small iter.intersperse.fold() optimization) - rust-lang/rust#142637 (Remove some glob imports from the type system) - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - rust-lang/rust#142700 (Remove incorrect comments in `Weak`) - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`) - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition) - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - rust-lang/rust#143001 (Rename run always ) - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`) - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes) - rust-lang/rust#143041 (Remove cache for citool) - rust-lang/rust#143056 (Move an ACE test out of the GCI directory) - rust-lang/rust#143059 (Fix 1.88 relnotes) - rust-lang/rust#143067 (Tracking issue number for `iter_macro`) - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains) Failed merges: - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-26Fix some fixmes that were waiting for let chainsYotam Ofek-3/+3
2025-06-27Fix completion in when typing `integer.|`Chayim Refael Friedman-1/+50
It should show integer, not floating point methods.
2025-06-26Merge pull request #20100 from ShoyuVanilla/ignore-sized-hierarchyChayim Refael Friedman-65/+142
Backport new sized-hierarchy trait bounds in old ways
2025-06-27generate new for tuple fieldHayashi Mikihiro-22/+337
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-26Backport new sized-hierarchy trait bounds in old waysShoyu Vanilla-24/+78
2025-06-26Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, ↵Matthias Krüger-2/+2
r=lolbinarycat [rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion Fixes https://github.com/rust-lang/rust/issues/141553. The problem was that we change the context for the attributes in some cases to get better error output, preventing us to detect if the attribute comes from expansion. Most of the changes are about keeping track of the "does this span comes from expansion" information. r? ```@Manishearth```
2025-06-26Rollup merge of #141311 - folkertdev:tidy-natural-sort, r=jieyouxuMatthias Krüger-2/+204
make `tidy-alphabetical` use a natural sort The idea here is that these lines should be correctly sorted, even though a naive string comparison would say they are not: ``` foo2 foo10 ``` This is the ["natural sort order"](https://en.wikipedia.org/wiki/Natural_sort_order). There is more discussion in [#t-compiler/help > tidy natural sort](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tidy.20natural.20sort/with/519111079) Unfortunately, no standard sorting tools are smart enough to to this automatically (casting some doubt on whether we should make this change). Here are some sort outputs: ``` > cat foo.txt | sort foo foo1 foo10 foo2 mp mp1e2 np", np1e2", > cat foo.txt | sort -n foo foo1 foo10 foo2 mp mp1e2 np", np1e2", > cat foo.txt | sort -V foo foo1 foo2 foo10 mp mp1e2 np1e2", np", ``` Disappointingly, "numeric" sort does not actually have the behavior we want. It only sorts by numeric value if the line starts with a number. The "version" sort looks promising, but does something very unintuitive if you look at the final 4 values. None of the other options seem to have the desired behavior in all cases: ``` -b, --ignore-leading-blanks ignore leading blanks -d, --dictionary-order consider only blanks and alphanumeric characters -f, --ignore-case fold lower case to upper case characters -g, --general-numeric-sort compare according to general numerical value -i, --ignore-nonprinting consider only printable characters -M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC' -h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G) -n, --numeric-sort compare according to string numerical value -R, --random-sort shuffle, but group identical keys. See shuf(1) --random-source=FILE get random bytes from FILE -r, --reverse reverse the result of comparisons --sort=WORD sort according to WORD: general-numeric -g, human-numeric -h, month -M, numeric -n, random -R, version -V -V, --version-sort natural sort of (version) numbers within text ``` r? ```@Noratrieb``` (it sounded like you know this code?)
2025-06-26Rename `tilde const` test files to `conditionally const`Oli Scherer-1/+0
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-21/+21
2025-06-26Merge pull request #4408 from Patrick-6/rework-thread-joinRalf Jung-104/+111
Only write join return value once join succeeds
2025-06-26Delay writing of return value of a join until after the join is successful.Patrick-6-104/+111
2025-06-26Merge pull request #20106 from Veykril/push-pytuxksnntuxLukas Wirth-129/+206
Salsa idiomize `VariantFields` query
2025-06-26Bring back the firewall queryLukas Wirth-15/+22
2025-06-26Merge pull request #20103 from ChayimFriedman2/path-transform-prettifyLukas Wirth-4/+58
fix: Prettify AST in `PathTransform` if it's coming from a macro
2025-06-26Salsa idiomize `VariantFields` queryLukas Wirth-131/+201
2025-06-26Merge pull request #20105 from Veykril/push-qtmwnuqvsruwLukas Wirth-9/+19
Parse new const trait syntax
2025-06-26Parse new const trait syntaxLukas Wirth-9/+19
2025-06-26Merge pull request #20104 from Veykril/push-nqnmmlvksytyLukas Wirth-55/+59
Cleanup `provideCodeActions` vscode hook
2025-06-26Cleanup `provideCodeActions` vscode hookLukas Wirth-55/+59
2025-06-26make size_and_align_of_mplace work on all projectableRalf Jung-4/+4
2025-06-26Prettify AST in `PathTransform` if it's coming from a macroChayim Refael Friedman-4/+58
2025-06-26refactor: enhance highlighting for control flow kws in macrosroifewu-33/+45
2025-06-26refactor: simplify functions related to branch_exit_points in highlight_relatedroifewu-72/+74
2025-06-26refactor: rename `branches` to `branch_exit_points` in highlight_relatedroifewu-11/+11
2025-06-26refactor: improve macro handling in navigation for control-flow kwsroifewu-13/+47
2025-06-26feat: highlighting of related return values while the cursor is on any ↵roifewu-9/+775
`match`, `if`, or match arm arrow (`=>`)
2025-06-26Merge pull request #20101 from ShoyuVanilla/comp-time-deps-soonerLaurențiu Nicola-1/+1
minor: Decrease minimal toolchain version for `comp-time-deps` to `1.89.0`
2025-06-26Add windows-gnullvm hosts to the manifestMateusz Mikuła-1/+3
2025-06-25make `tidy-alphabetical` use a natural sortFolkert de Vries-2/+204
2025-06-25Rollup merge of #142809 - KMJ-007:ad-type-analysis-flag, r=ZuseZ4Jana Dönszelmann-0/+0
Add PrintTAFn flag for targeted type analysis printing ## Summary This PR adds a new `PrintTAFn` flag to the `-Z autodiff` option that allows printing type analysis information for a specific function, rather than all functions. ## Changes ### New Flag - Added `PrintTAFn=<function_name>` option to `-Z autodiff` - Usage: `-Z autodiff=Enable,PrintTAFn=my_function_name` ### Implementation Details - **Rust side**: Added `PrintTAFn(String)` variant to `AutoDiff` enum - **Parser**: Updated `parse_autodiff` to handle `PrintTAFn=<function_name>` syntax with proper error handling - **FFI**: Added `set_print_type_fun` function to interface with Enzyme's `FunctionToAnalyze` command line option - **Documentation**: Updated help text and documentation for the new flag ### Files Modified - `compiler/rustc_session/src/config.rs`: Added `PrintTAFn(String)` variant - `compiler/rustc_session/src/options.rs`: Updated parser and help text (now shows `PrintTAFn` in the list) - `compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs`: Added FFI function and static variable - `compiler/rustc_codegen_llvm/src/back/lto.rs`: Added handling for new flag - `src/doc/rustc-dev-guide/src/autodiff/flags.md`: Updated documentation - `src/doc/unstable-book/src/compiler-flags/autodiff.md`: Updated documentation ## Testing The flag can be tested with: ```bash rustc +enzyme -Z autodiff=Enable,PrintTAFn=square test.rs ``` This will print type analysis information only for the function named "square" instead of all functions. ## Error Handling The parser includes proper error handling: - Missing argument: `PrintTAFn` without `=<function_name>` will show an error - Unknown options: Invalid autodiff options will be reported r? ```@ZuseZ4```
2025-06-26minor: Decrease minimal toolchain version for `comp-time-deps` by `0.1`Shoyu Vanilla-1/+1
2025-06-25Unify formatting of progress messagesVincent Esche-7/+6
2025-06-25Remove `mut`Jakub Beránek-2/+2
2025-06-25Skip more dist componentsJakub Beránek-0/+5