about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-15remove some known-bug that do not seem to make senseRalf Jung-11/+5
2025-01-15Auto merge of #135385 - rust-lang:cargo_update, r=clubby789bors-149/+244
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 27 packages to latest compatible versions Updating bitflags v2.6.0 -> v2.7.0 Updating clap v4.5.23 -> v4.5.26 Updating clap_builder v4.5.23 -> v4.5.26 Updating clap_complete v4.5.40 -> v4.5.42 Updating clap_derive v4.5.18 -> v4.5.24 Updating handlebars v6.2.0 -> v6.3.0 Updating libz-sys v1.1.20 -> v1.1.21 Updating linux-raw-sys v0.4.14 -> v0.4.15 Updating phf v0.11.2 -> v0.11.3 Updating phf_codegen v0.11.2 -> v0.11.3 Updating phf_generator v0.11.2 -> v0.11.3 Updating phf_shared v0.11.2 -> v0.11.3 Updating pin-project-lite v0.2.15 -> v0.2.16 Updating proc-macro2 v1.0.92 -> v1.0.93 Updating rustix v0.38.42 -> v0.38.43 Updating serde_json v1.0.134 -> v1.0.135 Adding siphasher v1.0.1 Updating syn v2.0.94 -> v2.0.96 Updating thiserror v2.0.9 -> v2.0.11 Updating thiserror-impl v2.0.9 -> v2.0.11 Updating tokio v1.42.0 -> v1.43.0 Updating uuid v1.11.0 -> v1.11.1 Updating wasm-encoder v0.222.0 -> v0.223.0 Adding wasmparser v0.223.0 Updating wast v222.0.0 -> v223.0.0 Updating wat v1.222.0 -> v1.223.0 Updating xattr v1.3.1 -> v1.4.0 note: pass `--verbose` to see 39 unchanged dependencies behind latest library dependencies: Locking 0 packages to latest compatible versions note: pass `--verbose` to see 4 unchanged dependencies behind latest rustbook dependencies: Locking 27 packages to latest compatible versions Updating bitflags v2.6.0 -> v2.7.0 Updating cc v1.2.7 -> v1.2.8 Updating clap v4.5.23 -> v4.5.26 Updating clap_builder v4.5.23 -> v4.5.26 Updating clap_complete v4.5.40 -> v4.5.42 Updating clap_derive v4.5.18 -> v4.5.24 Adding darling v0.20.10 Adding darling_core v0.20.10 Adding darling_macro v0.20.10 Adding derive_builder v0.20.2 Adding derive_builder_core v0.20.2 Adding derive_builder_macro v0.20.2 Updating handlebars v6.2.0 -> v6.3.0 Adding ident_case v1.0.1 Updating linux-raw-sys v0.4.14 -> v0.4.15 Updating phf v0.11.2 -> v0.11.3 Updating phf_codegen v0.11.2 -> v0.11.3 Updating phf_generator v0.11.2 -> v0.11.3 Updating phf_shared v0.11.2 -> v0.11.3 Updating proc-macro2 v1.0.92 -> v1.0.93 Updating rustix v0.38.42 -> v0.38.43 Updating serde_json v1.0.134 -> v1.0.135 Adding siphasher v1.0.1 Updating syn v2.0.94 -> v2.0.96 Updating thiserror v2.0.9 -> v2.0.11 Updating thiserror-impl v2.0.9 -> v2.0.11 Updating winnow v0.6.22 -> v0.6.24 ```
2025-01-14Auto merge of #135180 - tgross35:update-builtins, r=tgross35bors-6/+6
Update compiler-builtins to 0.1.141 0.1.141 syncs changes from `libm`. Most of the `libm` changes are testing- or configuration-related.
2025-01-14Auto merge of #135496 - matthiaskrgr:rollup-ps0cjzn, r=matthiaskrgrbors-92/+230
Rollup of 7 pull requests Successful merges: - #134216 (Enable "jump to def" feature on patterns) - #134880 (Made `Path::name` only have item name rather than full name) - #135466 (Leak check in `impossible_predicates` to avoid monomorphizing impossible instances) - #135476 (Remove remnant of asmjs) - #135479 (mir borrowck: cleanup late-bound region handling) - #135493 (Fix legacy symbol mangling of closures) - #135495 (Add missing closing backtick in commit hook message 🐸) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-14Update compiler-builtins to 0.1.141Trevor Gross-6/+6
0.1.141 syncs changes from `libm`. Most of the `libm` changes are testing- or configuration-related.
2025-01-14Rollup merge of #135495 - yotamofek:close-backtick, r=KobzolMatthias Krüger-1/+1
Add missing closing backtick in commit hook message 🐸 This has been really bugging me 😮‍💨
2025-01-14Rollup merge of #135493 - compiler-errors:legacy-mangle-closure, r=lqdMatthias Krüger-4/+10
Fix legacy symbol mangling of closures When this code was written, there was no `type_of` implementation for closures. That has long since been changed. In the UI test: ``` trait A where [(); (|| {}, 1).1]: Sized, { } ``` We tried to walk up the def path tree for the closure, from closure -> anon const -> trait. When we reached the trait, we tried to call `type_of` on it which obviously doesn't do the right thing and ICEs. Fixes #135418
2025-01-14Rollup merge of #135479 - lcnr:method-calls-on-opaques, r=compiler-errorsMatthias Krüger-48/+34
mir borrowck: cleanup late-bound region handling r? types
2025-01-14Rollup merge of #135476 - kleisauke:remove-asmjs-remnant, r=KobzolMatthias Krüger-24/+0
Remove remnant of asmjs See: https://github.com/rust-lang/rust/issues/131467#issuecomment-2529314603.
2025-01-14Rollup merge of #135466 - compiler-errors:leak-check-impossible, r=lcnrMatthias Krüger-3/+91
Leak check in `impossible_predicates` to avoid monomorphizing impossible instances Fixes #135462 r? lcnr
2025-01-14Rollup merge of #134880 - as1100k-forks:fix-rustdoc-json-path-name, ↵Matthias Krüger-3/+3
r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes #134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
2025-01-14Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmeaseMatthias Krüger-9/+91
Enable "jump to def" feature on patterns Part of https://github.com/rust-lang/rust/issues/89095. Pattern (as in "patterns in pattern matching") were not handled by the feature, it's now added. It all started when I realized that prelude values like `Some` or `Err` were not getting a link generated either (added support for it in the first commit). r? ``@fmease``
2025-01-14Auto merge of #135313 - compiler-errors:needs-mono, r=BoxyUwUbors-2/+48
Eagerly mono drop for structs with lifetimes That is, use `!generics.requires_monomorphization()` rather than `generics.is_empty()` like the rest of the mono collector code.
2025-01-14Add missing closing backtick in commit hook message 🐸Yotam Ofek-1/+1
2025-01-14Fix legacy symbol mangling of closuresMichael Goulet-4/+10
2025-01-14Auto merge of #135278 - tgross35:ignore-std-dep-crates, r=SparrowLiibors-44/+225
Exclude dependencies of `std` for diagnostics Currently crates in the sysroot can show up in diagnostic suggestions, such as in https://github.com/rust-lang/rust/issues/135232. To prevent this, duplicate `all_traits` into `visible_traits` which only shows traits in non-private crates. Setting `#![feature(rustc_private)]` overrides this and makes items in private crates visible as well, since `rustc_private` enables use of `std`'s private dependencies. This may be reviewed per-commit. Fixes: https://github.com/rust-lang/rust/issues/135232
2025-01-14mir borrowck: cleanup late-bound region handlinglcnr-48/+34
2025-01-14Auto merge of #135442 - antoyo:subtree-update_cg_gcc_2025_01_12, ↵bors-1530/+836
r=GuillaumeGomez Subtree update cg_gcc 2025/01/12 r? GuillaumeGomez
2025-01-14Remove remnant of asmjsKleis Auke Wolthuizen-24/+0
See: https://github.com/rust-lang/rust/issues/131467#issuecomment-2529314603.
2025-01-14add note to testlcnr-1/+1
2025-01-14Mark dependencies of the standard library as private by defaultTrevor Gross-21/+49
In order to avoid diagnostics suggesting stdlib-private dependencies, make everything that is a direct dependency of any `std` crates private by default. Note that this will be overridden, if the same crate is public elsewhere in the crate graph then that overrides the private default. It may also be feasible to do this in the library crate, marking `std`'s dependencies private via Cargo. However, given that the feature is still rather unstable, doing this within the compiler seems more straightforward. Fixes: https://github.com/rust-lang/rust/issues/135232 [1]
2025-01-14Add `tcx.visible_traits()` and use it for producing diagnosticsTrevor Gross-4/+23
Add an alternative to `tcx.all_traits()` that only shows traits that the user might be able to use, for diagnostic purposes. With this available, make use of it for diagnostics including associated type errors, which is part of the problem with [1]. Includes a few comment updates for related API. [1]: https://github.com/rust-lang/rust/issues/135232
2025-01-14Make `#[rustc_private]` override dependency visibilityTrevor Gross-0/+5
Really this is always-visible override only needs to happen when the crate is a dependency of itself. However, this is a very internal feature, so it doesn't seem worth doing any additional filtering here.
2025-01-14rustc_metadata: Rename `root` to `dep_root`Trevor Gross-26/+35
Currently `root` or `crate_root` is used to refer to an instance of `CrateRoot` (representation of a crate's serialized metadata), but the name `root` sometimes also refers to a `CratePath` representing a "root" node in the dependency graph. In order to disambiguate, rename all instances of the latter to `dep_root`.
2025-01-14Add a UI test for stdlib-private dependenciesTrevor Gross-0/+120
Introduce a test that shows stdlib-private dependencies leaking into diagnostics. This is resolved by a later commit.
2025-01-14Auto merge of #135473 - matthiaskrgr:rollup-ksnst4l, r=matthiaskrgrbors-52/+160
Rollup of 3 pull requests Successful merges: - #135381 (Add an example for `Vec::splice` inserting elements without removing) - #135451 (Remove code duplication when hashing query result and interning node) - #135464 (fix ICE with references to infinite structs in consts) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-14Rollup merge of #135464 - lukas-code:project-infinite-to-error, ↵Matthias Krüger-6/+111
r=FedericoBruzzone,oli-obk fix ICE with references to infinite structs in consts fixes https://github.com/rust-lang/rust/issues/114484 Normalizing `<Type as Pointee>::Metadata` may emit a (non-fatal) error during trait selection if finding the struct tail of `Type` hits the recursion limit. When this happens, prior this PR, we would treat the projection as rigid, i.e. don't normalize it further. This PR changes it so that we normalize to `ty::Error` instead. This is important, because to compute the layout of `&Type` we need to compute the layout of `<Type as Pointee>::Metadata` https://github.com/rust-lang/rust/blob/2ae9916816a448fcaab3b2da461de754eda0055a/compiler/rustc_ty_utils/src/layout.rs#L247-L273 and computing the layout of a rigid alias will (correctly) fail and needs to report an error to the user. For example: ```rust trait Project { type Assoc; } fn foo<T: Project>() { [(); { let _: Option<T::Assoc> = None; // ^^^^^^^^ this projection is rigid, so we can't know it's layout 0 }]; } ``` ``` error: constant expression depends on a generic parameter --> src/lib.rs:6:10 | 6 | [(); { | __________^ 7 | | let _: Option<T::Assoc> = None; 8 | | // ^^^^^^^^ this projection is rigid, so we can't know it's layout 9 | | 0 10 | | }]; | |_____^ | = note: this may fail depending on what value the parameter takes ``` For non-generic rigid projections we will currently ICE, because we incorrectly assume that `LayoutError::Unknown` means that a const must be generic (https://github.com/rust-lang/rust/issues/135138). This is being fixed and turned into a proper error in https://github.com/rust-lang/rust/pull/135158. ```rust #![feature(trivial_bounds)] trait Project { type Assoc; } fn foo() where u8: Project, { [(); { let _: Option<<u8 as Project>::Assoc> = None; // ICEs currently, but will be an error 0 }]; } ``` However, if we hit the recursion limit when normalizing `<Type as Pointee>::Metadata` we don't want to report a layout error, because we already emitted the recursion error. So by normalizing to `ty::Error` here, we get a `LayoutError::ReferencesError` instead of a `LayoutError::Unknown` and don't report the layout error to the user.
2025-01-14Rollup merge of #135451 - mzacho:code-duplication, r=oli-obkMatthias Krüger-43/+36
Remove code duplication when hashing query result and interning node Refactored the duplicated code into a function. `with_feed_task` currently passes the query key to `debug_assert!`. I believe that's a mistake, since `with_task` prints the `DepNode` which is more sensible, so this commit changes that, so it debug prints the `DepNode`.
2025-01-14Rollup merge of #135381 - cod10129:vec-splice-doc, r=tgross35Matthias Krüger-3/+13
Add an example for `Vec::splice` inserting elements without removing This example clearly showcases how `splice` can be used to insert multiple elements efficiently at an index into a vector. Fixes #135369. The added example: > Using `splice` to insert new items into a vector efficiently at a specific position indicated by an empty range: > ```rust > let mut v = vec![1, 5]; > let new = [2, 3, 4]; > v.splice(1..1, new); > assert_eq!(v, [1, 2, 3, 4, 5]); > ``` `@rustbot` label A-docs A-collections
2025-01-14Made `Path::name` only have item name rather than full nameAditya Kumar-3/+3
2025-01-14Auto merge of #135359 - RalfJung:lang-start-unwind, r=joboetbors-23/+36
use a single large catch_unwind in lang_start I originally planned to use `abort_unwind` but reading the comment in `thread_cleanup` it seems we are deliberately going for slightly nicer error messages here, so this preserves that. It still seems nice to not repeat `catch_unwind` so often.
2025-01-14Auto merge of #135465 - jhpratt:rollup-7p93bct, r=jhprattbors-79/+488
Rollup of 10 pull requests Successful merges: - #134498 (Fix cycle error only occurring with -Zdump-mir) - #134977 (Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion) - #135390 (Re-added regression test for #122638) - #135393 (uefi: helpers: Introduce OwnedDevicePath) - #135440 (rm unnecessary `OpaqueTypeDecl` wrapper) - #135441 (Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024) - #135444 (Update books) - #135450 (Fix emscripten-wasm-eh with unwind=abort) - #135452 (bootstrap: fix outdated feature name in comment) - #135454 (llvm: Allow sized-word rather than ymmword in tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-14Leak check in impossible_predicates to avoid monomorphizing impossible instancesMichael Goulet-3/+91
2025-01-13Rollup merge of #135454 - maurer:sized-word-ymmword, r=jieyouxuJacob Pratt-2/+2
llvm: Allow sized-word rather than ymmword in tests llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests. `@rustbot` label: +llvm-main
2025-01-13Rollup merge of #135452 - jieyouxu:fix-comment, r=compiler-errorsJacob Pratt-1/+1
bootstrap: fix outdated feature name in comment Follow-up to https://github.com/rust-lang/rust/pull/135391#discussion_r1912826594. I guess I updated everything else **except** the comment right next to the actual dependencies 💀 r? bootstrap
2025-01-13Rollup merge of #135450 - hoodmane:wasm-eh-abort-fix, r=workingjubileeJacob Pratt-3/+3
Fix emscripten-wasm-eh with unwind=abort If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort`. Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to #131830. r? workingjubilee
2025-01-13Rollup merge of #135444 - rustbot:docs-update, r=ehussJacob Pratt-1/+5
Update books ## rust-lang/book 10 commits in 04d06dfe541607e6419f3d028c3f9b245f3be4d9..5a65e2af063ff701ae858f1f7536ee347b3cfe63 2025-01-09 17:59:43 UTC to 2025-01-06 13:47:07 UTC - Appendix E: Update for 2024 Edition (rust-lang/book#4196) - Implement and integrate an mdBook plugin to strip markup from headings (rust-lang/book#4195) - Update appendix-06-translation.md - new persian translation added (rust-lang/book#4192) - Remove extraneous `use` statement (rust-lang/book#4193) - Take measurement inaccuracy intervals into account (rust-lang/book#4078) - Ch. 21.3: remove error ferris from working code (rust-lang/book#4183) - infra: match mdbook version in CI to rust-lang/rust (rust-lang/book#4191) - Ch. 17: Set correct heading level for the chapter (rust-lang/book#4190) - Switch back from `eprintln!` to `println!` in listing 17-12 (rust-lang/book#4178) - fix typo in Listing invocation for listing 20-14 (rust-lang/book#4184) ## rust-lang/nomicon 1 commits in 7ef05b9777c94836bc92f50f23e6e00981521a89..625b200e5b33a5af35589db0bc454203a3d46d20 2025-01-06 17:17:38 UTC to 2025-01-06 17:17:38 UTC - Fix accidental inline HTML in Markdown (rust-lang/nomicon#474) ## rust-lang/reference 3 commits in acd6794e712d5e2ef6f5c84fb95688d32a69b816..293af991003772bdccf2d6b980182d84dd055942 2025-01-07 16:31:22 UTC to 2025-01-06 17:17:15 UTC - Add spec identifiers to dynamically-sized-types.md (rust-lang/reference#1582) - fix typo in a "rule" name in type-coercions.md (rust-lang/reference#1708) - Fix unclosed `<sup>` elements (rust-lang/reference#1709) ## rust-lang/rust-by-example 2 commits in 093397535b48ae13ec76bc526b7e6eb8c096a85c..054259ed1bf01cdee4309ee764c7e103f6df3de5 2025-01-13 10:44:04 UTC to 2025-01-03 18:59:26 UTC - Fix function name in new_types.md in Japanese (rust-lang/rust-by-example#1907) - Fix typo in static_lifetime.md (rust-lang/rust-by-example#1905)
2025-01-13Rollup merge of #135441 - compiler-errors:redundant-captures-lint, r=lqdJacob Pratt-12/+16
Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024 I never got sign-off on #127672 for this lint being warn by default in edition 2024, so let's turn downgrade this lint to allow for now. Should be backported so it ships with the edition. ```@rustbot``` label: +beta-nominated
2025-01-13Rollup merge of #135440 - lcnr:yeeeeeeeeeeeeeeeeeeeeeeet, r=compiler-errorsJacob Pratt-32/+24
rm unnecessary `OpaqueTypeDecl` wrapper
2025-01-13Rollup merge of #135393 - Ayush1325:uefi-helper-path, r=thomccJacob Pratt-7/+16
uefi: helpers: Introduce OwnedDevicePath This PR is split off from #135368 to reduce noise. No real functionality changes, just some quality of life improvements. Also implement Debug for OwnedDevicePath for some quality of life improvements.
2025-01-13Rollup merge of #135390 - ranger-ross:readd-test-122638, r=BoxyUwUJacob Pratt-0/+78
Re-added regression test for #122638 Re-adds the test for #122638 :smile: fixes #122638 r? `@BoxyUwU` (please let me know if this can be improved. I am still fairly new to using compiletest)
2025-01-13Rollup merge of #134977 - estebank:issue-112357, r=BoxyUwUJacob Pratt-5/+306
Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion When a newcomer attempts to use an "out parameter" using borrows, they sometimes get confused and instead of mutating the borrow they try to mutate the function-local binding instead. This leads to either type errors (due to assigning an owned value to a mutable binding of reference type) or a multitude of lifetime errors and unused binding warnings. This change adds a suggestion to the type error ``` error[E0308]: mismatched types --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14 | LL | fn change_object(mut object: &Object) { | ------- expected due to this parameter type LL | let object2 = Object; LL | object = object2; | ^^^^^^^ expected `&Object`, found `Object` | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` and to the unused assignment lint ``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5 | LL | object = &object2; | ^^^^^^ | note: the lint level is defined here --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9 | LL | #![deny(unused_assignments, unused_variables)] | ^^^^^^^^^^^^^^^^^^ help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object2(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` Fix #112357.
2025-01-13Rollup merge of #134498 - oli-obk:push-wmxynprsyxvr, r=compiler-errorsJacob Pratt-16/+37
Fix cycle error only occurring with -Zdump-mir fixes #134205 During mir dumping, we evaluate static items to render their allocations. If a static item refers to itself, its own MIR will have a reference to itself, so during mir dumping we end up evaluating the static again, causing us to try to build MIR again (mir dumping happens during MIR building). Thus I disabled evaluation of statics during MIR dumps in case the MIR body isn't far enough along yet to be able to be guaranteed cycle free.
2025-01-14Auto merge of #135438 - matthiaskrgr:rollup-rt2zrbz, r=matthiaskrgrbors-122/+167
Rollup of 4 pull requests Successful merges: - #133752 (replace copypasted ModuleLlvm::parse) - #135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests) - #135405 (path: Move is_absolute check to sys::path) - #135426 (Assert that `Instance::try_resolve` is only used on body-like things) r? `@ghost` `@rustbot` modify labels: rollup try-job: x86_64-mingw-1
2025-01-14fix ICE with references to infinite structs in constsLukas Markeffsky-6/+111
2025-01-13Add another `Vec::splice` examplecod10129-3/+13
Add an example for using splice to insert multiple elements efficiently into a vector.
2025-01-13Fix emscripten-wasm-eh with unwind=abortHood Chatham-3/+3
If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort` Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to #131830.
2025-01-13llvm: Allow sized-word rather than ymmword in testsMatthew Maurer-2/+2
llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests.
2025-01-14bootstrap: fix outdated feature name in comment许杰友 Jieyou Xu (Joe)-1/+1
2025-01-13remove code duplication when hashing query result and interning nodeMartin Zacho-43/+36
Refactored the duplicated code into a function. `with_feed_task` currently passes the query key to `debug_assert!`. This commit changes that, so it debug prints the `DepNode`, as in `with_task`.