about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-03-17Auto merge of #122637 - matthiaskrgr:rollup-bczj5bp, r=matthiaskrgrbors-31/+137
Rollup of 3 pull requests Successful merges: - #121236 (Don't show suggestion if slice pattern is not top-level) - #121787 (run change tracker even when config parse fails) - #122633 (avoid unnecessary collect()) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-17Rollup merge of #122633 - matthiaskrgr:col, r=fmeaseMatthias Krüger-4/+1
avoid unnecessary collect()
2024-03-17Rollup merge of #121787 - onur-ozkan:improve-change-tracker, r=albertlarsan68Matthias Krüger-14/+66
run change tracker even when config parse fails Please note that we are currently validating the build configuration on two entry points (e.g., profile validation is handled on the python side), and change tracker system is handled on the rust side. Once #94829 is completed (scheduled for 2024), we will be able to handle this more effectively. Fixes #121756
2024-03-17Rollup merge of #121236 - long-long-float:rust-fix-consider-slicing, r=NadrierilMatthias Krüger-13/+70
Don't show suggestion if slice pattern is not top-level Close #120605 Don't show suggestion to add slicing (`[..]`) if the slice pattern is enclosed by struct like `Struct { a: [] }`. For example, current rustc makes a suggestion as a comment. However, the pattern `a: []` is wrong, not scrutinee `&self.a`. In this case, the structure type `a: Vec<Struct>` and the pattern `a: []` are different so I think the pattern should be fixed, not the scrutinee. If the parent of the pattern that was the target of the error is a structure, I made the compiler not show a suggestion. ```rs pub struct Struct { a: Vec<Struct>, } impl Struct { pub fn test(&self) { if let [Struct { a: [] }] = &self.a { // ^^^^^^^^^^^^^^^^^^ ------- help: consider slicing here: `&self.a[..]` println!("matches!") } } } ``` Note: * ~~I created `PatInfo.history` to store parent-child relationships for patterns, but this may be inefficient.~~ * I use two fields `parent_kind` and `current_kind` instead of vec. It may not performance issue. * Currently only looking at direct parents, but may need to look at deeper ancestry.
2024-03-17Auto merge of #122628 - lnicola:sync-from-ra, r=lnicolabors-1917/+3374
Subtree update of `rust-analyzer`
2024-03-17avoid unnecessary collect()Matthias Krüger-4/+1
2024-03-17Don't show suggestion if slice pattern is enclosed by any patternslong-long-float-13/+70
2024-03-17Merge commit '5ecace48f693afaa6adf8cb23086b651db3aec96' into sync-from-raLaurențiu Nicola-1917/+3374
2024-03-17Auto merge of #122625 - matthiaskrgr:rollup-ue4dmnx, r=matthiaskrgrbors-309/+456
Rollup of 5 pull requests Successful merges: - #119411 (Add as_(mut_)ptr and as_(mut_)slice to raw array pointers) - #122248 (Respect stage0 sysroot when compiling rmake.rs with COMPILETEST_FORCE_STAGE0) - #122295 (mir-opt: always run tests for the current target) - #122574 (Register LLVM handlers for bad-alloc / OOM) - #122608 (Move check-cfg diagnostic logic into a separate file) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-17Rollup merge of #122608 - Urgau:check-cfg-move-diagnostic-logic, r=fmeaseMatthias Krüger-274/+291
Move check-cfg diagnostic logic into a separate file as well as adding some triagebot mentions (for me) for check-cfg related files. ``@rustbot`` label +F-check-cfg
2024-03-17Rollup merge of #122574 - cuviper:llvm-oom, r=nikicMatthias Krüger-3/+26
Register LLVM handlers for bad-alloc / OOM LLVM's default bad-alloc handler may throw if exceptions are enabled, and `operator new` isn't hooked at all by default. Now we register our own handler that prints a message similar to fatal errors, then aborts. We also call the function that registers the C++ `std::new_handler`. Fixes #121305 Cc llvm/llvm-project#85281 r? ``@nikic``
2024-03-17Rollup merge of #122295 - Nadrieril:mir-opt-run-current-target, ↵Matthias Krüger-2/+4
r=Mark-Simulacrum mir-opt: always run tests for the current target Currently, `./x.py test tests/mir-opt` runs only the tests for the current target, and `./x.py test tests/mir-opt --bless` runs tests for a representative set of targets. That representative set does not include the current target however, which means `--bless` can succeed when tests fail without it. This PR ensures we run the current target always. Fixes https://github.com/rust-lang/rust/issues/122292 cc ``@RalfJung``
2024-03-17Rollup merge of #122248 - jieyouxu:rmake-sysroot, r=Mark-SimulacrumMatthias Krüger-30/+36
Respect stage0 sysroot when compiling rmake.rs with COMPILETEST_FORCE_STAGE0 Context: <https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/stage0.20compiletest.20broken>. > cg_clif uses `COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0` for running the rustc test suite. With the introduction of rmake.rs this broke. `librun_make_support.rlib` is compiled using the bootstrap rustc wrapper which sets `--sysroot build/aarch64-unknown-linux-gnu/stage0-sysroot`, but then compiletest will compile `rmake.rs` using the sysroot of the bootstrap compiler causing it to not find the `libstd.rlib` against which `librun_make_support.rlib` is compiled. cc ``@bjorn3`` Fixes #122196.
2024-03-17Rollup merge of #119411 - yotamofek:array-ptr-get, r=NilstriebMatthias Krüger-0/+99
Add as_(mut_)ptr and as_(mut_)slice to raw array pointers Hey, first time contributing to the standard libraries so not completely sure about the process. These functions are complementary to the ones being added in #74265 . I found them missing on array pointers. See also: - ACP: https://github.com/rust-lang/libs-team/issues/321 - Tracking issue: #119834
2024-03-17Auto merge of #122611 - rust-lang:cargo_update, r=clubby789bors-93/+105
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: ```txt Updating ahash v0.8.10 -> v0.8.11 Updating anyhow v1.0.80 -> v1.0.81 Updating basic-toml v0.1.8 -> v0.1.9 Updating bumpalo v3.15.3 -> v3.15.4 Adding cfg_aliases v0.1.1 Updating chrono v0.4.34 -> v0.4.35 Updating clap v4.5.1 -> v4.5.3 Updating clap_builder v4.5.1 -> v4.5.2 Updating clap_derive v4.5.0 -> v4.5.3 Updating color-eyre v0.6.2 -> v0.6.3 Updating ctrlc v3.4.2 -> v3.4.4 Updating env_logger v0.11.2 -> v0.11.3 Updating h2 v0.3.24 -> v0.3.25 Adding heck v0.5.0 Updating http v0.2.11 -> v0.2.12 Updating js-sys v0.3.68 -> v0.3.69 Updating libloading v0.8.2 -> v0.8.3 Updating new_debug_unreachable v1.0.4 -> v1.0.6 Updating nix v0.27.1 -> v0.28.0 Updating proc-macro2 v1.0.78 -> v1.0.79 Updating reqwest v0.11.24 -> v0.11.26 Updating syn v2.0.52 -> v2.0.53 Updating sysinfo v0.30.6 -> v0.30.7 Updating thiserror v1.0.57 -> v1.0.58 Updating thiserror-impl v1.0.57 -> v1.0.58 Updating wasm-bindgen v0.2.91 -> v0.2.92 Updating wasm-bindgen-backend v0.2.91 -> v0.2.92 Updating wasm-bindgen-futures v0.4.41 -> v0.4.42 Updating wasm-bindgen-macro v0.2.91 -> v0.2.92 Updating wasm-bindgen-macro-support v0.2.91 -> v0.2.92 Updating wasm-bindgen-shared v0.2.91 -> v0.2.92 Updating web-sys v0.3.68 -> v0.3.69 ```
2024-03-17Auto merge of #122321 - majaha:mingw_ci_new, r=Mark-Simulacrumbors-13/+16
`mv` tools off the path instead of `rm -r`-ing them in `install-msys2.sh` This is a follow up patch to https://github.com/rust-lang/rust/pull/121182 r? `@Mark-Simulacrum`
2024-03-17Auto merge of #121885 - reitermarkus:generic-nonzero-inner, ↵bors-1818/+1843
r=oli-obk,wesleywiser Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? `@dtolnay`
2024-03-17cargo updategithub-actions-93/+105
Updating ahash v0.8.10 -> v0.8.11 Updating anyhow v1.0.80 -> v1.0.81 Updating basic-toml v0.1.8 -> v0.1.9 Updating bumpalo v3.15.3 -> v3.15.4 Adding cfg_aliases v0.1.1 Updating chrono v0.4.34 -> v0.4.35 Updating clap v4.5.1 -> v4.5.3 Updating clap_builder v4.5.1 -> v4.5.2 Updating clap_derive v4.5.0 -> v4.5.3 Updating color-eyre v0.6.2 -> v0.6.3 Updating ctrlc v3.4.2 -> v3.4.4 Updating env_logger v0.11.2 -> v0.11.3 Updating h2 v0.3.24 -> v0.3.25 Adding heck v0.5.0 Updating http v0.2.11 -> v0.2.12 Updating js-sys v0.3.68 -> v0.3.69 Updating libloading v0.8.2 -> v0.8.3 Updating new_debug_unreachable v1.0.4 -> v1.0.6 Updating nix v0.27.1 -> v0.28.0 Updating proc-macro2 v1.0.78 -> v1.0.79 Updating reqwest v0.11.24 -> v0.11.26 Updating syn v2.0.52 -> v2.0.53 Updating sysinfo v0.30.6 -> v0.30.7 Updating thiserror v1.0.57 -> v1.0.58 Updating thiserror-impl v1.0.57 -> v1.0.58 Updating wasm-bindgen v0.2.91 -> v0.2.92 Updating wasm-bindgen-backend v0.2.91 -> v0.2.92 Updating wasm-bindgen-futures v0.4.41 -> v0.4.42 Updating wasm-bindgen-macro v0.2.91 -> v0.2.92 Updating wasm-bindgen-macro-support v0.2.91 -> v0.2.92 Updating wasm-bindgen-shared v0.2.91 -> v0.2.92 Updating web-sys v0.3.68 -> v0.3.69
2024-03-17Auto merge of #122607 - fmease:rollup-ozl1eeq, r=fmeasebors-104/+454
Rollup of 9 pull requests Successful merges: - #117918 (Add `wasm_c_abi` `future-incompat` lint) - #121545 (fix attribute validation on associated items in traits) - #121720 (Split refining_impl_trait lint into _reachable, _internal variants) - #122270 (fix `long-linker-command-lines` failure caused by `rust.rpath=false`) - #122564 (Delegation: fix ICE on duplicated associative items) - #122577 (Remove obsolete parameter `speculative` from `instantiate_poly_trait_ref`) - #122601 (Optimize `ptr::replace`) - #122604 (Mention jieyouxu for changes to compiletest, run-make tests and the run-make-support library) - #122605 (rustc-metadata: Store crate name in self-profile of metadata_register_crate) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-16Add some mentions for Urgau for check-cfg related filesUrgau-0/+9
2024-03-16Move check-cfg diagnostic logic into it's own moduleUrgau-274/+282
2024-03-16Rollup merge of #122605 - ↵León Orell Valerian Liehr-1/+2
osiewicz:metadata-register-crate-store-crate-name-in-profile, r=Nadrieril rustc-metadata: Store crate name in self-profile of metadata_register_crate When profiling a build of Zed, I found myself in need of names of crates that take the longest to register in downstream crates.
2024-03-16Rollup merge of #122604 - jieyouxu:triagebot-mention-compiletest-run-make, ↵León Orell Valerian Liehr-0/+11
r=Nilstrieb Mention jieyouxu for changes to compiletest, run-make tests and the run-make-support library
2024-03-16Rollup merge of #122601 - joboet:ptr_replace, r=workingjubileeLeón Orell Valerian Liehr-3/+2
Optimize `ptr::replace` #83022 optimized `mem::replace` to reduce the number of `memcpy`s. `ptr::replace`, which is [documented to behave just like `mem::replace`](https://doc.rust-lang.org/nightly/std/ptr/fn.replace.html), was not optimized however, leading to [worse code](https://godbolt.org/z/T3hdEEdfe) and missed optimizations. This PR simply forwards `ptr::replace` to `mem::replace` to take advantage of the better implementation.
2024-03-16Rollup merge of #122577 - fmease:speculative-say-what, r=compiler-errorsLeón Orell Valerian Liehr-58/+48
Remove obsolete parameter `speculative` from `instantiate_poly_trait_ref` In #122527 I totally missed that `speculative` has become obsolete with the removal of `hir_trait_to_predicates` / due to #113671. Fixes #114635. r? `@compiler-errors`
2024-03-16Rollup merge of #122564 - Bryanskiy:delegation-fixes, r=compiler-errorsLeón Orell Valerian Liehr-8/+52
Delegation: fix ICE on duplicated associative items Currently, functions delegation is only supported for delegation items with early resolved paths e.g. free functions and trait methods. During name resolution, information about function signatures is collected, including the number of parameters and whether there are self arguments. This information is then used when lowering from a delegation item into a regular function(`rustc_ast_lowering/src/delegation.rs`). The signature is usually inherited from path resolution id(`path_id`). However, in the case of trait impls `path_id` and `item_id` may be different: ```rust trait Trait { fn foo(&self) -> u32 { 0 } } struct S; mod to_reuse { use crate::S; pub fn foo(_: &S) -> u32 { 0 } } impl Trait for S { reuse to_reuse::foo { self } //~^ The signature should be inherited from item id instead of resolution id } ``` Let's now consider an example from [issue](https://github.com/rust-lang/rust/issues/119920). Due to duplicated associative elements partial resolution for one of them will not be recorded: https://github.com/rust-lang/rust/blob/9023f908cfbe7a475f369717a61cb8eb865cfd25/compiler/rustc_resolve/src/late.rs#L3153-L3162 Which leads to an incorrect `is_in_trait_impl` https://github.com/rust-lang/rust/blob/9023f908cfbe7a475f369717a61cb8eb865cfd25/compiler/rustc_ast_lowering/src/item.rs#L981-L986 Which leads to an incorrect id for signature inheritance https://github.com/rust-lang/rust/blob/9023f908cfbe7a475f369717a61cb8eb865cfd25/compiler/rustc_ast_lowering/src/delegation.rs#L99-L105 Which lead to an ICE from original issue. This patch fixes wrong `is_in_trait_impl` calculation. fixes https://github.com/rust-lang/rust/issues/119920
2024-03-16Rollup merge of #122270 - onur-ozkan:fix-rmake-test-with-rpath-false, ↵León Orell Valerian Liehr-0/+2
r=Mark-Simulacrum fix `long-linker-command-lines` failure caused by `rust.rpath=false` Fixes `long-linker-command-lines` test failure (which happens when `rust.rpath` is set to `false`) by adjusting `LD_LIBRARY_PATH`. Fixes https://github.com/rust-lang/rust/issues/90921
2024-03-16Rollup merge of #121720 - tmandry:split-refining, r=compiler-errorsLeón Orell Valerian Liehr-33/+239
Split refining_impl_trait lint into _reachable, _internal variants As discussed in https://github.com/rust-lang/rust/issues/119535#issuecomment-1909352040: > We discussed this today in triage and developed a consensus to: > > * Add a separate lint against impls that refine a return type defined with RPITIT even when the trait is not crate public. > * Place that in a lint group along with the analogous crate public lint. > * Create an issue to solicit feedback on these lints (or perhaps two separate ones). > * Have the warnings displayed with each lint reference this issue in a similar manner to how we do that today with the required `Self: '0'` bound on GATs. > * Make a note to review this feedback on 2-3 release cycles. This points users to https://github.com/rust-lang/rust/issues/121718 to leave feedback.
2024-03-16Rollup merge of #121545 - ↵León Orell Valerian Liehr-0/+16
gvozdvmozgu:fix-attribute-validation-associated-items, r=fmease fix attribute validation on associated items in traits #121537, fixed attribute validation on associated items in traits
2024-03-16Rollup merge of #117918 - daxpedda:wasm-c-abi-warning, r=workingjubileeLeón Orell Valerian Liehr-1/+82
Add `wasm_c_abi` `future-incompat` lint This is a warning that will tell users to update to `wasm-bindgen` v0.2.88, which supports spec-compliant C ABI. The idea is to prepare for a future where Rust will switch to the spec-compliant C ABI by default; so not to break everyone's world, this warning is introduced. Addresses #71871.
2024-03-16Auto merge of #122594 - Mark-Simulacrum:bump-version, r=Mark-Simulacrumbors-1/+1
Bump to 1.79.0 r? `@Mark-Simulacrum`
2024-03-16rustc-metadata: Store crate name in self-profile of metadata_register_cratePiotr Osiewicz-1/+2
When profiling a build of Zed, I found myself in need of names of crates that take the longest to register in downstream crates.
2024-03-16Add as_(mut_)ptr and as_(mut_)slice to raw array pointersYotam Ofek-0/+99
2024-03-16Auto merge of #122602 - ChrisDenton:rollup-f0vumtg, r=ChrisDentonbors-296/+330
Rollup of 7 pull requests Successful merges: - #122323 (configure.py: add flag for loongarch64 musl-root) - #122372 (prevent notifying the same changes more than once) - #122390 (Bump windows-bindgen to 0.55.0) - #122401 (Check library crates for all tier 1 targets in PR CI) - #122489 (Bump `cargo update` PR more often) - #122583 (Use `UnsafeCell` for fast constant thread locals) - #122590 (bootstrap: Don't name things copy that are not copies) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-16Mention @jieyouxu for changes to compiletest, run-make tests and the ↵许杰友 Jieyou Xu (Joe)-0/+11
run-make-support library
2024-03-16Rollup merge of #122590 - ↵Chris Denton-63/+79
Nilstrieb:bootstrap-do-you-know-what-the-word-copy-means, r=Mark-Simulacrum bootstrap: Don't name things copy that are not copies The bootstrap copy methods don't actually copy, they just hard link. Simply lying about it being "copying" can be very confusing! (ask me how I know!). I'm not sure whether the name I chose is the ideal name, but it's definitely better than before.
2024-03-16Rollup merge of #122583 - Zoxc:tls-non-mut, r=joboetChris Denton-8/+7
Use `UnsafeCell` for fast constant thread locals This uses `UnsafeCell` instead of `static mut` for fast constant thread locals. This changes the type of the TLS shims to return `&UnsafeCell<T>` instead of `*mut T` which means they are always non-null so LLVM can optimize away the check for `Some` in `LocalKey::with` if `T` has no destructor. LLVM is currently unable to do this optimization as we lose the fact that `__getit` always returns `Some` as it gets optimized to just returning the value of the TLS shim.
2024-03-16Rollup merge of #122489 - clubby789:more-cargo-update, r=Mark-SimulacrumChris Denton-2/+4
Bump `cargo update` PR more often r? `@Mark-Simulacrum` (https://github.com/rust-lang/rust/pull/121923#issuecomment-1986879572)
2024-03-16Rollup merge of #122401 - ChrisDenton:check-tier1, r=Mark-SimulacrumChris Denton-0/+4
Check library crates for all tier 1 targets in PR CI Let's try checking all tier 1 targets. Shouldn't take much time. Not sure if this is the right place to put it or not but let's see if it works first.
2024-03-16Rollup merge of #122390 - ChrisDenton:bindgen, r=Mark-SimulacrumChris Denton-218/+219
Bump windows-bindgen to 0.55.0 windows-bindgen is the crate used to generate std's Windows API bindings. Not many changes for us, it's mostly just simplifying the generate code (e.g. no more `-> ()`). The one substantial change is some structs now use `i8` byte arrays instead of `u8`. However, this only impacts one test.
2024-03-16Rollup merge of #122372 - onur-ozkan:change-id-improvement, r=Mark-SimulacrumChris Denton-5/+15
prevent notifying the same changes more than once Prevents re-reporting of previously notified changes by using the .last-warned-change-id value for change detection. Resolves #122344
2024-03-16Rollup merge of #122323 - heiher:loongarch64-musl-root, r=Mark-SimulacrumChris Denton-0/+2
configure.py: add flag for loongarch64 musl-root
2024-03-16Auto merge of #122599 - bjorn3:sync_cg_clif-2024-03-16, r=bjorn3bors-30/+83
Subtree sync for rustc_codegen_cranelift The main highlight this time is a fix for a recently introduced ICE. Fixes https://github.com/rust-lang/rust/issues/122399 r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-03-16Delegation: fix ICE on duplicated associative itemsBryanskiy-8/+52
2024-03-16Auto merge of #16846 - roife:fix-issue16826, r=Veykrilbors-410/+340
fix: incorrect handling of `use` and panic issue in `extract_module`. fix #16826 This PR includes the following changes: 1. Simplify the implementation partially, removing many unnecessary loops and `clone()`. 2. When it is found that the top level of the selection contains a `use` statement, a copy of the `use` will be reinserted before extraction. (#16826) 3. Fixed an issue during `extract_module`, where if the top level of the selected part contains `A` and `use A::B`, it caused a duplication of `use A`.
2024-03-16Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into ↵bjorn3-30/+83
sync_cg_clif-2024-03-16
2024-03-16Auto merge of #16856 - Veykril:macarons, r=Veykrilbors-108/+210
fix: Fix wrong where clause rendering on hover We were not accounting for proper newline indentation in some places making the hover look weird (or just straight up wrong for type aliases)
2024-03-16core: optimize `ptr::replace`joboet-3/+2
2024-03-16fix: Fix wrong where clause rendering on hoverLukas Wirth-108/+210
2024-03-16Fix rustc test suitebjorn3-0/+1