about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-06-29Rollup merge of #143155 - yotamofek:pr/rustdoc/housekeeping, r=GuillaumeGomezMatthias Krüger-12/+8
`librustdoc` house-keeping 🧹 This PR mostly removes a bunch of crate-level attributes that were added at some point, but then later on became unnecessary: - some `#[feature]` gates - some `#[allow]`s - a `#[recursion_limit]` Then I went ahead and sprinkled some tidy sorting on the remaining attrs, and `Cargo.toml`. Trying to give my anal retentiveness some peace of mind 😅
2025-06-29Rollup merge of #142021 - HamidrezaSK:fix-lint-precedence-doc, r=ehussMatthias Krüger-1/+102
Doc: clarify priority of lint level sources This updates the rustc book to clearly document how conflicting lint configurations are resolved across different sources, including command-line flags, crate-level attributes, in-line attributes, and `--cap-lints`. It also explains the special behavior of `forbid` and `force_warn`. Fixes rust-lang/rust#124088
2025-06-29Auto merge of #143160 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 7 commits in 409fed7dc1553d49cb9a8c0637d12d65571346ce..930b4f62cfcd1f0eabdb30a56d91bf6844b739bf 2025-06-23 15:55:04 +0000 to 2025-06-28 14:58:43 +0000 - Use a different lint for the `fix_only_once_for_duplicates` test (rust-lang/cargo#15713) - chore: bump to 0.91.0; update changelog (rust-lang/cargo#15710) - Add `http.proxy-cainfo` config for proxy certs (rust-lang/cargo#15374) - chore(deps): update msrv (3 versions) to v1.86 (rust-lang/cargo#15709) - chore(deps): update msrv (1 version) to v1.88 (rust-lang/cargo#15706) - Rework `cargo-test-support` & `testsuite` to use `CARGO_BIN_EXE_*` for Cargo (rust-lang/cargo#15692) - fix: Expand error messages around path dependency on `cargo package` and `cargo publish` (rust-lang/cargo#15705)
2025-06-28Update cargoEric Huss-0/+0
2025-06-28Rollup merge of #143114 - leopardracer:master, r=RalfJungMatthias Krüger-3/+3
Minor Documentation Improvements --- ## Description - Fixed typos and improved clarity in comments and documentation. ---
2025-06-28Rollup merge of #143031 - mati865:push-mutywntmvomx, r=Mark-SimulacrumMatthias Krüger-1/+3
Add windows-gnullvm hosts to the manifest I made a mistake testing https://github.com/rust-lang/rust/pull/140772 only with `rustup-toolchain-install-master` which doesn't care about the manifests. This means windows-gnullvm self-hosting will have to wait one more release, unless this change is backported to beta and a new beta release is made, which doesn't seem worth the trouble.
2025-06-28Rollup merge of #142987 - lolbinarycat:rustdoc-non_exhaustive-enum-v-142599, ↵Matthias Krüger-0/+1
r=GuillaumeGomez rustdoc: show attributes on enum variants mostly for #[non_exhaustive] unsure if there's any attributes we should take care to *not* include, it could use `render_code_attribute` and `is_non_exhaustive` instead, if that is a concern. fixes rust-lang/rust#142599
2025-06-28Rollup merge of #142963 - Kobzol:try-build-skip, r=jieyouxuMatthias Krüger-3/+29
Skip unnecessary components in x64 try builds We unnecessarily rebuild `wasm-component-ld`, `llvm-bitcode-linker` and Cranelift during the intermediate PGO builds several times times, which is unnecessarily and increases the duration of try builds. This PR also disables some unnecessary dist components. r? `````@jieyouxu`````
2025-06-28librustdoc: use tidy for sorting attrs and depsYotam Ofek-4/+8
2025-06-28librustdoc: remove unused feature gatesYotam Ofek-4/+0
2025-06-28librustdoc: remove unneeded `#[recursion_limit]`Yotam Ofek-1/+0
2025-06-28librustdoc: remove unneeded `#[allow]`sYotam Ofek-3/+0
2025-06-28Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlinbors-1/+1
Insert checks for enum discriminants when debug assertions are enabled Similar to the existing null-pointer 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@. r? `@saethlin`
2025-06-27Auto merge of #143116 - matthiaskrgr:rollup-zy9ez06, r=matthiaskrgrbors-31/+31
Rollup of 9 pull requests Successful merges: - rust-lang/rust#139858 (New const traits syntax) - rust-lang/rust#140809 (Reduce special casing for the panic runtime) - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined) - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver) - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell) - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology) - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv) - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`) - rust-lang/rust#143106 (gce: don't ICE on non-local const) Failed merges: - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-27Rollup merge of #143046 - RalfJung:zst-unsafe-cell, r=lcnr,oli-obkMatthias Krüger-4/+4
const validation: properly ignore zero-sized UnsafeCell Fixes https://github.com/rust-lang/rust/issues/142948 r? `@oli-obk`
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-26/+25
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-844/+3161
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-27Rollup merge of #142721 - Stypox:tracing-layout-of, r=RalfJungGuillaume Gomez-12/+1
Add tracing to `InterpCx::layout_of()` This PR adds tracing calls to `instantiate_from_frame_and_normalize_erasing_regions` and to `InterpCx::layout_of()`. The latter is done by shadowing `LayoutOf`'s trait method with an inherent method on `InterpCx`. <details><summary>Previous attempt by overriding the `layout_of` query (includes downloadable `.diff` patch)</summary> This PR is meant for Miri, but requires a few changes in `rustc` code, hence why it's here. It adds tracing capabilities to the `layout_of` function in `tcx` by overriding the `layout_of` query (under `local_providers`) with a wrapper that opens a tracing span and then calls the actual `layout_of`. To make this possible, I had to make `rustc_ty_utils::layout::layout_of` public. I added an assert to ensure the `providers.layout_of` value I am replacing is actually `rustc_ty_utils::layout::layout_of`, just in case. I also considered taking the previous value in `providers.layout_of` and calling that one instead, to avoid making `layout_of` public. But then the closure would not be castable to a function pointer anymore (`providers.layout_of` is a function pointer), because it would depend on the local variable storing the previous value of `providers.layout_of`. Using a global variable would work but would rely on `unsafe` or on `Mutex`es, so I wanted to avoid it. Here is some tracing output when Miri is run on `src/tools/miri/tests/pass/hello.rs`, visualizable in https://ui.perfetto.dev: [trace-1750338860374637.json](https://github.com/user-attachments/files/20820392/trace-1750338860374637.json) Another place where I could have added tracing calls is to the `rustc_middle::ty::layout::LayoutCx` struct / `spanned_layout_of()` function, however there is no simple way to disable the tracing calls with compile-time boolean constants there (since `LayoutCx::new()` is used everywhere and referenced directly), and in any case it seems like `spanned_layout_of()` just calls `tcx.layout_of()` anyway. For completeness' sake, here is tracing output for when a tracing call is added to `spanned_layout_of()`: [trace-1750340887920584.json](https://github.com/user-attachments/files/20820609/trace-1750340887920584.json) Patch to override `layout_of` query: [tracing-layout_of-query-override.diff.txt](https://github.com/user-attachments/files/20944497/tracing-layout_of-query-override.diff.txt) </details> **Note: obtaining tracing output depends on https://github.com/rust-lang/miri/pull/4406, but this PR is standalone and can be merged without waiting for https://github.com/rust-lang/miri/pull/4406.** r? `@RalfJung`
2025-06-27Rollup merge of #142270 - lolbinarycat:rustdoc-search-Results-type, ↵Guillaume Gomez-77/+43
r=GuillaumeGomez Rustdoc js: even more typechecking improvements I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff. Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string. r? ``@notriddle``
2025-06-27Use `.is_multiple_of()` in bootstrapSamuel Tardieu-1/+3
This makes the intent clear, and silences Clippy.
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-27Add InterpCx::layout_of with tracing, shadowing LayoutOfStypox-12/+1
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-27disable caching for cargo commandsbit-aloo-3/+6
2025-06-27move execution context inside exec and prune execution context, use command ↵bit-aloo-353/+345
directly from bootstrap command inside start, and not via as_command_mut
2025-06-27make DeferredCommand a must use and move mark_as_executed inside finish processbit-aloo-1/+4
2025-06-27add caching info on bootstrap commandbit-aloo-6/+4
2025-06-27refactor deferred command and make it compatible with new commandstate, ↵bit-aloo-90/+100
remove extra caching logic from run and re-structure the changes
2025-06-27add new command state in execution contextbit-aloo-0/+11
2025-06-27add do_not_cache method and update the warning on as_command_mutbit-aloo-3/+9
2025-06-27use metadata for command cache key spawning directly from commandbit-aloo-20/+25
2025-06-27add command cache key, move to osstring, add should cache to bootstrap commandbit-aloo-19/+76
2025-06-27add caching fields inside Bootstrap commandbit-aloo-1/+26
2025-06-27Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errorsbors-29/+35
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-26Rollup merge of #143073 - yotamofek:pr/fix-let-chains-fixmes, r=compiler-errorsMichael Goulet-3/+3
Fix some fixmes that were waiting for let chains Was inspired by looking at rust-lang/rust#143066 and spotting two fixmes that were missed, so... r? `@compiler-errors` 😅 Yay, let chains!
2025-06-26Rollup merge of #143010 - GuillaumeGomez:update-browser-ui-test, r=KobzolMichael Goulet-1/+1
Update `browser-ui-test` version to `0.20.7` This new version fixes some bugs and improve error messages. r? `````@Kobzol`````
2025-06-26Rollup merge of #143001 - Shourya742:2025-06-25-rename-run-always, r=KobzolMichael Goulet-24/+27
Rename run always This PR renames run_always to run_to_dry_run for better clarity, making the field's purpose more explicit and avoiding confusion with command caching behavior. r? ``````@Kobzol``````
2025-06-26Rollup merge of #142986 - JonathanBrouwer:export_name_parser, r=jdonszelmannMichael Goulet-1/+4
Port `#[export_name]` to the new attribute parsing infrastructure This PR contains two changes, in separate commits for reviewability: - Ports `export_name` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 - Moves the check for mixing export_name/no_mangle to check_attr.rs and improve the error message, which previously had a mix of 2021/2024 edition syntax r? ``@jdonszelmann``
2025-06-26Fix some fixmes that were waiting for let chainsYotam Ofek-3/+3
2025-06-26rustdoc: show attributes on enum variantsbinarycat-0/+1
mostly for #[non_exhaustive]
2025-06-26Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-2/+8
2025-06-26rustdoc js: several typechecking improvmentsbinarycat-77/+43
non-exhaustive list of changes: * rustdoc.Results has a max_dist field * improve typechecking around pathDist and addIntoResults * give handleNameSearch a type signature * typecheck sortQ * currentCrate is string and not optional * searchState is referenced as a global, not through window
2025-06-26Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, ↵Matthias Krüger-28/+67
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-7/+209
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