about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-19Rollup merge of #131925 - clubby789:redundant-revision-cfg, r=jieyouxuMatthias Krüger-12/+22
Warn on redundant `--cfg` directive when revisions are used r? ``@jieyouxu`` Fixes #131390 Not sure of the best way to test this
2024-10-19Rollup merge of #131921 - klensy:statx_all, r=ChrisDentonMatthias Krüger-5/+5
replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecated STATX_ALL was deprecated in https://github.com/torvalds/linux/commit/581701b7efd60ba13d8a7eed60cbdd7fefaf6696 and suggested to use equivalent (STATX_BASIC_STATS | STATX_BTIME) combination, to prevent future surprises.
2024-10-19Rollup merge of #131920 - clubby789:108395-test, r=jieyouxuMatthias Krüger-0/+27
Add codegen test for branchy bool match Closes #108395
2024-10-19Rollup merge of #131795 - compiler-errors:expectation, r=NadrierilMatthias Krüger-82/+48
Stop inverting expectation in normalization errors We have some funky special case logic to invert the expectation and actual type for normalization errors depending on their cause code. IMO most of the error messages get better, except for `try {}` blocks' type expectations. I think that these need to be special cased in some other way, rather than via this hack. Fixes #131763
2024-10-19Rollup merge of #131789 - compiler-errors:capture-more, r=fmeaseMatthias Krüger-69/+102
Make sure that outer opaques capture inner opaques's lifetimes even with precise capturing syntax When lowering an opaque, we must capture and duplicate all of the lifetimes in the opaque's bounds to correctly lower the opaque's bounds. We do this *even if* the lifetime is not captured according to the `+ use<>` precise capturing bound; in that case, we will later reject that captured lifetime. For example, Given an opaque like `impl Sized + 'a + use<>`, we will still duplicate `'a` but later error that it is not mentioned in the `use<>` bound. The current heuristic was not properly handling cases like: ``` //@ edition: 2024 fn foo<'a>() -> impl Trait<Assoc = impl Trait2> + use<> {} ``` Which forces the outer `impl Trait` to capture `'a` since `impl Trait2` *implicitly* captures `'a` due to the new lifetime capture rules for edition 2024. We were only capturing lifetimes syntactically mentioned in the bounds. (Note that this still is an error; we just need to capture `'a` so it is handled later in the compiler correctly -- hence the ICE in #131769 where a late-bound lifetime was being referenced outside of its binder). This PR reworks the way we collect lifetimes to capture and duplicate in AST lowering to fix this. Fixes #131769
2024-10-19Rollup merge of #131772 - GnomedDev:remove-proc_macro-todo, r=petrochenkovMatthias Krüger-20/+11
Remove `const_refs_to_static` TODO in proc_macro Noticed this TODO, and with `const_refs_to_static` being stable now we can sort it out.
2024-10-19Rollup merge of #127675 - chenyukang:yukang-fix-127562-addr, r=petrochenkovMatthias Krüger-12/+37
Remove invalid help diagnostics for const pointer Partially addresses #127562
2024-10-19Rollup merge of #116863 - workingjubilee:non-exhaustive-is-not-ffi-unsafe, ↵Matthias Krüger-26/+91
r=jieyouxu warn less about non-exhaustive in ffi Bindgen allows generating `#[non_exhaustive] #[repr(u32)]` enums. This results in nonintuitive nonlocal `improper_ctypes` warnings, even when the types are otherwise perfectly valid in C. Adjust for actual tooling expectations by avoiding warning on simple enums with only unit variants. Closes https://github.com/rust-lang/rust/issues/116831
2024-10-19Make sure that outer opaques capture inner opaques's lifetimes even with ↵Michael Goulet-69/+102
precise capturing syntax
2024-10-19Auto merge of #131934 - matthiaskrgr:rollup-pd3dwxu, r=matthiaskrgrbors-176/+396
Rollup of 8 pull requests Successful merges: - #127462 (std: uefi: Add basic Env variables) - #131537 (Fix range misleading field access) - #131838 (bootstrap: allow setting `--jobs` in config.toml) - #131890 (Update `use` keyword docs to describe precise capturing) - #131899 (Mark unexpected variant res suggestion as having placeholders) - #131908 (rustdoc: Switch from FxHash to sha256 for static file hashing.) - #131916 (small interpreter error cleanup) - #131919 (zero-sized accesses are fine on null pointers) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-19Rollup merge of #131919 - RalfJung:zero-sized-accesses, r=jhprattMatthias Krüger-13/+16
zero-sized accesses are fine on null pointers We entirely forgot to update all the function docs when changing the central docs. That's the problem with helpfully repeating shared definitions in tons of places...
2024-10-19Rollup merge of #131916 - RalfJung:interpret-err, r=jieyouxuMatthias Krüger-95/+108
small interpreter error cleanup - Add `InterpretResult::map_err_kind` for the common case of swapping out the error kind (while preserving the backtrace pointing to the original error source) - Rename `InterpError` -> `InterpErrorKind` to be consistent with the `kind` field name, and make it more clear that this is not the final error type
2024-10-19Rollup merge of #131908 - aDotInTheVoid:rustdoc-gamer-hashing, ↵Matthias Krüger-15/+16
r=notriddle,GuillaumeGomez rustdoc: Switch from FxHash to sha256 for static file hashing. Fixes https://github.com/rust-lang/rust/pull/129533#issuecomment-2422891519 fxhash isn't well defined, and it's implementation is being changed in #129533. But because rustdoc uses it for static files (and encodes that hashing in rustdoc.css), this broke our tests. Given that this isn't performace critical, I think the right fix is to used a well-defined hash that will never change its definition. I've picked (rather arbitrarily) sha256.
2024-10-19Rollup merge of #131899 - compiler-errors:placeholder, r=lqdMatthias Krüger-1/+1
Mark unexpected variant res suggestion as having placeholders Fixes #131878
2024-10-19Rollup merge of #131890 - printfn:precise-capturing-docs, r=traviscrossMatthias Krüger-7/+39
Update `use` keyword docs to describe precise capturing I noticed that the standard library keyword docs for the `use` keyword haven't been updated yet to describe the new precise capturing syntax.
2024-10-19Rollup merge of #131838 - jieyouxu:boopjob, r=onur-ozkanMatthias Krüger-3/+73
bootstrap: allow setting `--jobs` in config.toml Allow setting `--jobs` in config.toml's `[build]` section. ```toml [build] jobs = 0 ``` If this is unset or set to zero in config.toml, we look at `--jobs` flag. If that is also unset, then we fallback to `std::thread::available_parallelism`. If that is not available, then we default to `1`. The flags and `available_parallelism` fallback are already setup, this PR just adds a config.toml option to wire that up. Closes #131836. r? bootstrap
2024-10-19Rollup merge of #131537 - hirschenberger:master, r=compiler-errorsMatthias Krüger-0/+18
Fix range misleading field access Fixes #131471 by checking if the range-start is a literal.
2024-10-19Rollup merge of #127462 - Ayush1325:uefi-env, r=joboetMatthias Krüger-42/+125
std: uefi: Add basic Env variables - Implement environment variable functions - Using EFI Shell protocol.
2024-10-19Auto merge of #131211 - bjorn3:rust_abi_follow_c_rules, r=nikic,jieyouxubors-74/+216
Return values larger than 2 registers using a return area pointer LLVM and Cranelift disagree about how to return values that don't fit in the registers designated for return values. LLVM will force the entire return value to be passed by return area pointer, while Cranelift will look at each IR level return value independently and decide to pass it in a register or not, which would result in the return value being passed partially in registers and partially through a return area pointer. While Cranelift may need to be fixed as the LLVM behavior is generally more correct with respect to the surface language, forcing this behavior in rustc itself makes it easier for other backends to conform to the Rust ABI and for the C ABI rustc already handles this behavior anyway. In addition LLVM's decision to pass the return value in registers or using a return area pointer depends on how exactly the return type is lowered to an LLVM IR type. For example `Option<u128>` can be lowered as `{ i128, i128 }` in which case the x86_64 backend would use a return area pointer, or it could be passed as `{ i32, i128 }` in which case the x86_64 backend would pass it in registers by taking advantage of an LLVM ABI extension that allows using 3 registers for the x86_64 sysv call conv rather than the officially specified 2 registers. This adjustment is only necessary for the Rust ABI as for other ABI's the calling convention implementations in rustc_target already ensure any return value which doesn't fit in the available amount of return registers is passed in the right way for the current target. Helps with https://github.com/rust-lang/rustc_codegen_cranelift/issues/1525 cc https://github.com/bytecodealliance/wasmtime/issues/9250
2024-10-19Fix test expectations for 32bit x86bjorn3-16/+12
2024-10-19Warn on redundant `--cfg` directive when revisions are usedclubby789-12/+22
2024-10-19Auto merge of #131816 - Zalathar:profiler-feature, r=Kobzolbors-4/+3
Make `profiler_builtins` an optional dependency of sysroot, not std This avoids unnecessary rebuilds of std (and the compiler) when `build.profiler` is toggled off or on. Fixes #131812. --- Background: The `profiler_builtins` crate has been an optional dependency of std (behind a cargo feature) ever since it was added back in #42433. But as far as I can tell that has only ever been a convenient way to force the crate to be built, not a genuine dependency. The side-effect of this false dependency is that toggling `build.profiler` causes a rebuild of std and the compiler, which shouldn't be necessary. This PR therefore makes `profiler_builtins` an optional dependency of the dummy sysroot crate (#108865), rather than a dependency of std. What makes this change so small is that all of the necessary infrastructure already exists. Previously, bootstrap would enable the `profiler` feature on the sysroot crate, which would forward that feature to std. Now, enabling that feature directly enables sysroot's `profiler_builtins` dependency instead. --- I believe this is more of a bootstrap change than a libs change, so tentatively: r? bootstrap
2024-10-19replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecatedklensy-5/+5
2024-10-19Add codegen test for branchy bool matchclubby789-0/+27
2024-10-19zero-sized accesses are fine on null pointersRalf Jung-13/+16
2024-10-19interpret errors: add map_err_kind, rename InterpError -> InterpErrorKindRalf Jung-95/+108
2024-10-19bootstrap: allow setting `--jobs` in config.toml许杰友 Jieyou Xu (Joe)-3/+73
2024-10-18compiler: Embed consensus in `lint::types::improper_ctypes`Jubilee Young-28/+65
Extracting this logic into a module makes it easier to write down, and more importantly, later find, the actual decisions we've made.
2024-10-19Auto merge of #131910 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 7 commits in 8c30ce53688e25f7e9d860b33cc914fb2957ca9a..cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5 2024-10-15 16:43:16 +0000 to 2024-10-18 13:56:15 +0000 - feat: Stabilize MSRV-aware resolver config (rust-lang/cargo#14639) - Help with `[patch.crates.io]` (rust-lang/cargo#14700) - test: Migrate publish snapshotting to snapbox (rust-lang/cargo#14642) - Bump to 0.85.0; update changelog (rust-lang/cargo#14695) - Fix typo in faq.md (rust-lang/cargo#14696) - fix(registry): `HttpRegistry` `block_until_ready` returns early when work is still pending (rust-lang/cargo#14694) - fix(resolver): avoid cloning when iterating using RcVecIter (rust-lang/cargo#14690)
2024-10-19rustdoc: Switch from FxHash to sha256 for static file hashing.Alona Enraght-Moony-15/+16
2024-10-18Update cargoWeihang Lo-0/+0
2024-10-18Update `use` keyword docs to describe precise capturingprintfn-7/+39
2024-10-18Auto merge of #131892 - flip1995:clippy-subtree-update, r=Manishearthbors-1779/+4036
Clippy subtree update One day late with the sync, as I was sick yesterday. Cargo.lock update includes Clippy version bump and some deps cleanup we did in Clippy to match more versions used in the Rust repo. r? `@Manishearth`
2024-10-18std: uefi: Use common function for UEFI shellAyush Singh-36/+2
- Since in almost all cases, there will only be 1 UEFI shell, share the shell handle between all functions that require it. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-18std: uefi: Add basic Env variablesAyush Singh-15/+132
- Implement environment variable functions - Using EFI Shell protocol. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-18Auto merge of #131895 - jieyouxu:rollup-jyt3pic, r=jieyouxubors-121/+135
Rollup of 3 pull requests Successful merges: - #126207 (std::unix::stack_overflow::drop_handler addressing todo through libc …) - #131864 (Never emit `vptr` for empty/auto traits) - #131870 (compiletest: Store test collection context/state in two structs) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-18Mark unexpected variant res suggestion as having placeholdersMichael Goulet-1/+1
2024-10-18Fix #131471, range misleading field accessFalco Hirschenberger-0/+18
Fixes #131471 by checking if the range-start is a literal.
2024-10-18Rollup merge of #131870 - Zalathar:test-collector, r=jieyouxu许杰友 Jieyou Xu (Joe)-104/+98
compiletest: Store test collection context/state in two structs This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
2024-10-18Rollup merge of #131864 - lrh2000:upcast_reorder, r=WaffleLapkin许杰友 Jieyou Xu (Joe)-14/+36
Never emit `vptr` for empty/auto traits Emiting `vptr`s for empty/auto traits is unnecessary (#114942) and causes unsoundness in `trait_upcasting` (#131813). This PR should ensure that we never emit vtables for such traits. See the linked issues for more details. I'm not sure if I can add tests for the vtable layout. So this PR only adds tests for the soundness hole (i.e., the segmentation fault will disappear after this PR). Fixes #114942 Fixes #131813 Cc #65991 (tracking issue for `trait_upcasting`) r? `@WaffleLapkin` (per https://github.com/rust-lang/rust/issues/131813#issuecomment-2419969745)
2024-10-18Rollup merge of #126207 - devnexen:stack_overflow_libc_upd, r=joboet许杰友 Jieyou Xu (Joe)-3/+1
std::unix::stack_overflow::drop_handler addressing todo through libc … …update
2024-10-18Auto merge of #131841 - paulmenage:futex-abstraction, r=joboetbors-66/+83
Abstract the state type for futexes In the same way that we expose `SmallAtomic` and `SmallPrimitive` to allow Windows to use a value other than an `AtomicU32` for its futex state, switch the primary futex state type from `AtomicU32` to `futex::Futex`. The `futex::Futex` type should be usable as an atomic value with underlying primitive type equal to `futex::Primitive`. (`SmallAtomic` is also renamed to `SmallFutex`). This allows supporting the futex API on systems where the underlying kernel futex implementation requires more user state than simply an `AtomicU32`. All in-tree futex implementations simply define {`Futex`,`Primitive`} directly as {`AtomicU32`,`u32`}.
2024-10-18Hotfix TRAIT_METHODS static->constPhilipp Krones-1/+2
2024-10-18Update Cargo.lockPhilipp Krones-35/+11
2024-10-18Merge commit 'a109190d7060236e655fc75533373fa274ec5343' into ↵Philipp Krones-1745/+4025
clippy-subtree-update
2024-10-18Auto merge of #13561 - flip1995:rustup, r=flip1995bors-156/+138
Rustup r? `@ghost` changelog: none
2024-10-18Bump nightly version -> 2024-10-18Philipp Krones-1/+1
2024-10-18Bump Clippy version -> 0.1.84Philipp Krones-4/+4
2024-10-18Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1768/+4078
2024-10-18Auto merge of #131887 - jieyouxu:rollup-ftik4ni, r=jieyouxubors-60/+287
Rollup of 9 pull requests Successful merges: - #130136 (Partially stabilize const_pin) - #131755 (Regression test for AVR `rjmp` offset) - #131774 (Add getentropy for RTEMS) - #131802 (Dont ICE when computing coverage of synthetic async closure body) - #131809 (Fix predicate signatures in retain_mut docs) - #131858 (Remove outdated documentation for `repeat_n`) - #131866 (Avoid use imports in `thread_local_inner!`) - #131874 (Default to the medium code model on OpenHarmony LoongArch target) - #131877 (checktools.sh: add link to issue for more context about disabled Miri tests) r? `@ghost` `@rustbot` modify labels: rollup