about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-05Rollup merge of #131299 - RalfJung:lang-item-track-caller, r=compiler-errorsMatthias Krüger-2/+2
fix typo in 'lang item with track_caller' message Revival of https://github.com/rust-lang/rust/pull/124912
2024-10-05Rollup merge of #131285 - RalfJung:mir-projection-sem, r=cjgillotMatthias Krüger-4/+8
clarify semantics of ConstantIndex MIR projection This documents what Miri does: https://github.com/rust-lang/rust/blob/c4ce8c114b06840c3521a189ee44958b713fb33a/compiler/rustc_const_eval/src/interpret/projection.rs#L272-L275 I am not sure what exactly the purpose of this `min_length` field is, TBH... but this seems like the most obvious meaning it could have?
2024-10-05Rollup merge of #131281 - RalfJung:const-cell, r=AmanieuMatthias Krüger-6/+12
make Cell unstably const Now that we can do interior mutability in `const`, most of the Cell API can be `const fn`. :) The main exception is `set`, because it drops the old value. So from const context one has to use `replace`, which delegates the responsibility for dropping to the caller. Tracking issue: https://github.com/rust-lang/rust/issues/131283 `as_array_of_cells` is itself still unstable to I added the const-ness to the feature gate for that function and not to `const_cell`, Cc #88248. r? libs-api
2024-10-05Rollup merge of #131280 - ↵Matthias Krüger-1/+0
ismailarilik:handle-potential-query-instability-lint-for-rustc-interface, r=cjgillot Handle `rustc_interface` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` occurrences from [`compiler/rustc_interface/`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_interface/) <s>and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors</s> (was not necessary for this PR). A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447 r? `@compiler-errors`
2024-10-05Rollup merge of #130555 - hegza:rv32e, r=workingjubileeMatthias Krüger-1/+825
Initial support for riscv32{e|em|emc}_unknown_none_elf We have a research prototype of an RV32EMC target and have been successfully running the e, em, emc programs on it. I'm hoping upstreaming this configuration would make the target maintenance slightly easier. Configuration is based on the respective {i, im, imc} variants. As defined in RISC-V Unprivileged Spec. 20191213, the only change in RVE wrt. RVI is to reduce the number of integer registers to 16 (x0-x15), which also implies - 2 callee saved registers instead of 12 - 32-bit / 4-byte stack alignment instead of 128 bits / 16 bytes My initial presumption is that this will not impact how the target is defined for the compiler but only becomes relevant at the runtime level. I am willing to investigate, though. EDIT: LLVM is now told about the presumed 32-bit stack alignment. `@Disasm` `@romancardenas`
2024-10-05fix typo in 'lang item with track_caller' messageRalf Jung-2/+2
2024-10-05Auto merge of #131188 - Kobzol:remove-libstd-so-from-sysroot, r=onur-ozkanbors-2/+18
Do not copy libstd dynamic library to sysroot Since https://github.com/rust-lang/rust/pull/122362, rustc links statically to libstd.[so|dll]. Which means that the libstd.[so|dll] file no longer has to be in the rustc sysroot. However, we are currently still shipping this file, in every new release of Rust, for no reason, it's just wasted bytes. This PR removes the dynamic library file from the built sysroot. However, it is not yet performed on Windows, because stage0 incremental tests start failing there (see description of the issue [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064)). This is an extended version of https://github.com/rust-lang/rust/pull/128986. CC `@Zoxc`
2024-10-05Auto merge of #131288 - matthiaskrgr:rollup-h0t0v2h, r=matthiaskrgrbors-724/+1516
Rollup of 5 pull requests Successful merges: - #130428 (Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk`) - #131094 (std: replace `LazyBox` with `OnceBox`) - #131256 (move f16/f128 const fn under f16/f128 feature gate) - #131278 (remove outdated contribution direction) - #131286 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-05Rollup merge of #131286 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-402/+1293
Miri subtree update r? `@ghost`
2024-10-05Rollup merge of #131278 - onur-ozkan:update-outdated-doc, r=KobzolMatthias Krüger-4/+2
remove outdated contribution direction
2024-10-05Rollup merge of #131256 - RalfJung:f16-f128-const, r=ibraheemdevMatthias Krüger-26/+22
move f16/f128 const fn under f16/f128 feature gate The `*_const` features were added to work around https://github.com/rust-lang/rust/issues/129656, which should not be needed any more.
2024-10-05Rollup merge of #131094 - joboet:lazy_once_box, r=ibraheemdevMatthias Krüger-284/+185
std: replace `LazyBox` with `OnceBox` This PR replaces the `LazyBox` wrapper used to allocate the pthread primitives with `OnceBox`, which has a more familiar API mirroring that of `OnceLock`. This cleans up the code in preparation for larger changes like #128184 (from which this PR was split) and allows some neat optimizations, like avoid an acquire-load of the allocation pointer in `Mutex::unlock`, where the initialization of the allocation must have already been observed. Additionally, I've gotten rid of the TEEOS `Condvar` code, it's just a duplicate of the pthread one anyway and I didn't want to repeat myself.
2024-10-05Rollup merge of #130428 - ink-feather-org:stabilize-const-split-at-mut, ↵Matthias Krüger-8/+14
r=RalfJung Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk` Stabilizes #101804 and the remainder of #111774. FCP proposed in the tracking issue. Requires #130403 (or it would need a rustc_allow_const_fn_unstable for it) Stabilized const API: ```rust // slice impl [T] { pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]); pub const fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]); pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])>; pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>; pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>; pub const fn split_first_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>; pub const fn split_last_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>; } ``` Closes #101804 Closes #111774 cc `@RalfJung`
2024-10-05clarify semantics of ConstantIndex MIR projectionRalf Jung-4/+8
2024-10-05Auto merge of #3940 - rust-lang:refutable_slice, r=RalfJungbors-33/+34
Prefer refutable slice patterns over len check + index op Just something I noticed while reviewing other PRs We do it for shim arguments almost everywhere, but when the size is not statically known, we didn't use the helpers as they rely on array ops. But we can avoid a len check followed by several index ops by just using a refutable slice pattern with `let else`. The pattern is so common, it seems almost worth a dedicated macro
2024-10-05Add platform support doc for rv32eHenri Lunnikivi-1/+31
2024-10-05Add UI test to verify invalid loads are not generatedHenri Lunnikivi-0/+673
2024-10-05Add assembly tests to satisfy 'tidy'Henri Lunnikivi-0/+9
2024-10-05Work around the stage0 sanity checkHenri Lunnikivi-0/+3
Add rv32e-targets to 'stage0 missing targets'. This prevents the error "no such target exists in the target list".
2024-10-05doc: platform-support.md: Document portHenri Lunnikivi-0/+3
2024-10-05Update target fns to latest mainHenri Lunnikivi-3/+21
2024-10-05Add comment: data_layoutHenri Lunnikivi-0/+9
2024-10-05Add targets: riscv32{e|em|emc}Henri Lunnikivi-0/+79
- Based on riscv32{i|im|imc} - Set data_layout stack alignment: S32 (bits) - Set llvm_abiname = ilp32e
2024-10-05make Cell unstably constRalf Jung-6/+12
2024-10-05Auto merge of #3943 - RalfJung:pthread-mutex-reentrant, r=RalfJungbors-15/+51
pthread mutex: better error in reentrant-locking-UB Also test reentrant locking of PTHREAD_MUTEX_INITIALIZER
2024-10-05pthread mutex: better error in reentrant-locking-UB, also test ↵Ralf Jung-15/+51
PTHREAD_MUTEX_INITIALIZER
2024-10-05move f16/f128 const fn under f16/f128 feature gateRalf Jung-26/+22
2024-10-05Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk`onestacked-8/+14
2024-10-05Handle `rustc_interface` cases of `rustc::potential_query_instability` lintismailarilik-1/+0
2024-10-05Auto merge of #129244 - cjgillot:opaque-hir, r=compiler-errorsbors-1072/+1016
Make opaque types regular HIR nodes Having opaque types as HIR owner introduces all sorts of complications. This PR proposes to make them regular HIR nodes instead. I haven't gone through all the test changes yet, so there may be a few surprises. Many thanks to `@camelid` for the first draft. Fixes https://github.com/rust-lang/rust/issues/129023 Fixes #129099 Fixes #125843 Fixes #119716 Fixes #121422
2024-10-05remove outdated contribution directiononur-ozkan-4/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-05Auto merge of #131275 - workingjubilee:rollup-4yxqio3, r=workingjubileebors-94/+559
Rollup of 9 pull requests Successful merges: - #129517 (Compute array length from type for unconditional panic lint. ) - #130367 (Check elaborated projections from dyn don't mention unconstrained late bound lifetimes) - #130403 (Stabilize `const_slice_from_raw_parts_mut`) - #130633 (Add support for reborrowing pinned method receivers) - #131105 (update `Literal`'s intro) - #131194 (Fix needless_lifetimes in stable_mir) - #131260 (rustdoc: cleaner errors on disambiguator/namespace mismatches) - #131267 (Stabilize `BufRead::skip_until`) - #131273 (Account for `impl Trait {` when `impl Trait for Type {` was intended) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-04Rollup merge of #131273 - estebank:issue-131051, r=compiler-errorsJubilee-8/+158
Account for `impl Trait {` when `impl Trait for Type {` was intended On editions where bare traits are never allowed, detect if the user has written `impl Trait` with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type: ``` error[E0782]: trait objects must include the `dyn` keyword --> $DIR/missing-for-type-in-impl.rs:8:6 | LL | impl Foo<i64> { | ^^^^^^^^ | help: add `dyn` keyword before this trait | LL | impl dyn Foo<i64> { | +++ help: you might have intended to implement this trait for a given type | LL | impl Foo<i64> for /* Type */ { | ++++++++++++++ ``` CC #131051.
2024-10-04Rollup merge of #131267 - okaneco:bufread_skip_until, r=tgross35Jubilee-3/+1
Stabilize `BufRead::skip_until` FCP completed https://github.com/rust-lang/rust/issues/111735#issuecomment-2393893069 Closes #111735
2024-10-04Rollup merge of #131260 - notriddle:notriddle/disambiguator-error, ↵Jubilee-23/+34
r=GuillaumeGomez rustdoc: cleaner errors on disambiguator/namespace mismatches Resolves https://github.com/rust-lang/rust/pull/131224#pullrequestreview-2348407077 r? `@jyn514`
2024-10-04Rollup merge of #131194 - practicalrs:fix_needless_lifetimes, r=celinvalJubilee-2/+2
Fix needless_lifetimes in stable_mir Hi, This PR fixes the following clippy warning in stable_mir ``` warning: the following explicit lifetimes could be elided: 'a --> compiler/stable_mir/src/mir/visit.rs:79:30 | 79 | fn visit_projection_elem<'a>( | ^^ 80 | &mut self, 81 | place_ref: PlaceRef<'a>, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 79 ~ fn visit_projection_elem( 80 | &mut self, 81 ~ place_ref: PlaceRef<'_>, | ``` Best regards, Michal
2024-10-04Rollup merge of #131105 - slanterns:literal_c_str, r=petrochenkovJubilee-1/+1
update `Literal`'s intro Just something missd when adding c_str to it.
2024-10-04Rollup merge of #130633 - eholk:pin-reborrow-self, r=compiler-errorsJubilee-22/+171
Add support for reborrowing pinned method receivers This builds on #130526 to add pinned reborrowing for method receivers. This enables the folllowing examples to work: ```rust #![feature(pin_ergonomics)] #![allow(incomplete_features)] use std::pin::Pin; pub struct Foo; impl Foo { fn foo(self: Pin<&mut Self>) { } fn baz(self: Pin<&Self>) { } } pub fn bar(x: Pin<&mut Foo>) { x.foo(); x.foo(); x.baz(); // Pin<&mut Foo> is downgraded to Pin<&Foo> } pub fn baaz(x: Pin<&Foo>) { x.baz(); x.baz(); } ``` This PR includes the original one, which is currently in the commit queue, but the only code changes are in the latest commit (d3c53aaa5c6fcb1018c58d229bc5d92202fa6880). #130494 r? `@compiler-errors`
2024-10-04Rollup merge of #130403 - ↵Jubilee-5/+7
eduardosm:stabilize-const_slice_from_raw_parts_mut, r=workingjubilee Stabilize `const_slice_from_raw_parts_mut` Stabilizes https://github.com/rust-lang/rust/issues/67456, since https://github.com/rust-lang/rust/issues/57349 has been stabilized. Stabilized const API: ```rust // core::ptr pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T]; // core::slice pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T]; // core::ptr::NonNull pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self ``` Closes https://github.com/rust-lang/rust/issues/67456. r? libs-api
2024-10-04Rollup merge of #130367 - compiler-errors:super-unconstrained, r=spastorinoJubilee-18/+149
Check elaborated projections from dyn don't mention unconstrained late bound lifetimes Check that the projections that are *not* explicitly written but which we deduce from elaborating the principal of a `dyn` *also* do not reference unconstrained late-bound lifetimes, just like the ones that the user writes by hand. That is to say, given: ``` trait Foo<T>: Bar<Assoc = T> {} trait Bar { type Assoc; } ``` The type `dyn for<'a> Foo<&'a T>` (basically) elaborates to `dyn for<'a> Foo<&'a T> + for<'a> Bar<Assoc = &'a T>`[^1]. However, the `Bar` projection predicate is not well-formed, since `'a` must show up in the trait's arguments to be referenced in the term of a projection. We must error in this situation[^well], or else `dyn for<'a> Foo<&'a T>` is unsound. We already detect this for user-written projections during HIR->rustc_middle conversion, so this largely replicates that logic using the helper functions that were already conveniently defined. --- I'm cratering this first to see the fallout; if it's minimal or zero, then let's land it as-is. If not, the way that this is implemented is very conducive to an FCW. --- Fixes #130347 [^1]: We don't actually elaborate it like that in rustc; we only keep the principal trait ref `Foo<&'a T>` and the projection part of `Bar<Assoc = ...>`, but it's useful to be a bit verbose here for the purpose of explaining the issue. [^well]: Well, we could also make `dyn for<'a> Foo<&'a T>` *not* implement `for<'a> Bar<Assoc = &'a T>`, but this is inconsistent with the case where the user writes `Assoc = ...` in the type itself, and it overly complicates the implementation of trait objects' built-in impls.
2024-10-04Rollup merge of #129517 - cjgillot:known-panic-array, r=pnkfelixJubilee-12/+36
Compute array length from type for unconditional panic lint. Fixes https://github.com/rust-lang/rust/issues/98444 The cases that involve slicing are harder, so https://github.com/rust-lang/rust/issues/38035 remains open.
2024-10-05Auto merge of #131124 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 17 commits in 80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a..ad074abe3a18ce8444c06f962ceecfd056acfc73 2024-09-27 17:56:01 +0000 to 2024-10-04 18:18:15 +0000 - test: Remove the last of our custom json assertions (rust-lang/cargo#14576) - docs(ref): Expand on MSRV (rust-lang/cargo#14636) - docs: Minor re-grouping of pages (rust-lang/cargo#14620) - docs(ref): Highleft whats left for msrv-policy (rust-lang/cargo#14638) - Fix `cargo:version_number` - has only one `:` (rust-lang/cargo#14637) - docs: Declare support level for each crate in our Charter / docs (rust-lang/cargo#14600) - chore(deps): update tar to 0.4.42 (rust-lang/cargo#14632) - docs(charter): Declare new Intentional Artifacts as 'small' changes (rust-lang/cargo#14599) - fix: Remove implicit feature removal (rust-lang/cargo#14630) - docs(config): make `--config &lt;PATH&gt;` more prominent (rust-lang/cargo#14631) - chore(deps): update rust crate unicode-width to 0.2.0 (rust-lang/cargo#14624) - chore(deps): update embarkstudios/cargo-deny-action action to v2 (rust-lang/cargo#14628) - docs(ref): Clean up language for `package.rust-version` (rust-lang/cargo#14619) - docs: clarify `target.'cfg(...)'` doesnt respect cfg from build script (rust-lang/cargo#14312) - test: relax compiler panic assertions (rust-lang/cargo#14618) - refactor(compiler): zero-copy deserialization when possible (rust-lang/cargo#14608) - test: add support for features in the sat resolver (rust-lang/cargo#14583)
2024-10-05Bless clippy.Camille GILLOT-5/+9
2024-10-05Compute array length from type for unconditional panic.Camille GILLOT-7/+27
2024-10-04Adapt clippy.Camille GILLOT-38/+13
2024-10-04Bless incremental tests.Camille GILLOT-2/+2
2024-10-04Promote crash tests to ui.Camille GILLOT-35/+124
2024-10-04Simplify bound var resolution.Camille GILLOT-44/+39
2024-10-04Remove stray fixmes.Camille GILLOT-3/+0
2024-10-04Bless ui tests.Camille GILLOT-519/+454