about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-12-13Explain why an untranslatable_diagnostic occursbjorn3-2/+5
2024-12-13Remove registered_lints field from Sessionbjorn3-9/+8
It only exists to pass some information from one part of the driver to another part. We can directly pass this information to the function that needs it to reduce the amount of mutation of the Session.
2024-12-13Remove jobserver from Sessionbjorn3-23/+9
It is effectively a global resource and the jobserver::Client in Session was a clone of GLOBAL_CLIENT anyway.
2024-12-12Auto merge of #134199 - RalfJung:gitmerge, r=oli-obkbors-4/+2
Revert "Stop git from merging generated files" This reverts https://github.com/rust-lang/rust/pull/133851. "-merge" makes git not even do merges if they are entirely conflict-free, which is not the behavior we want. We sometimes have conflict-free merges in generated files and it's much better if git can handle them automatically. r? `@oli-obk` Cc `@jieyouxu` `@Urgau`
2024-12-12Auto merge of #134201 - matthiaskrgr:rollup-22b721y, r=matthiaskrgrbors-190/+475
Rollup of 11 pull requests Successful merges: - #122003 (link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets) - #133859 (Move some alloc tests to the alloctests crate) - #134070 (Some asm! diagnostic adjustments and a papercut fix) - #134144 (Properly consider APITs for never type fallback ascription fix) - #134152 (Simplify `rustc_mir_dataflow::abs_domain`.) - #134154 (suppress field expr with generics error message if it's a method) - #134155 (Forbid `unsafe_op_in_unsafe_fn` for Hurd) - #134173 (allow `symbol_intern_string_literal` lint in test modules) - #134178 (Stabilize the Rust 2024 prelude) - #134179 (Remove outdated consteval note from `<*mut T>::align_offset` docs.) - #134187 (Remove `PErr`.) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-12Rollup merge of #134187 - nnethercote:rm-PErr, r=jieyouxuMatthias Krüger-12/+11
Remove `PErr`. It's just a synonym for `Diag` that adds no value and is only used in a few places. r? ``@spastorino``
2024-12-12Rollup merge of #134179 - zachs18:align_offset_mut_ptr_doc, r=workingjubileeMatthias Krüger-9/+0
Remove outdated consteval note from `<*mut T>::align_offset` docs.
2024-12-12Rollup merge of #134178 - ehuss:stabilize-2024-prelude, ↵Matthias Krüger-6/+15
r=amanieu,traviscross,tgross35 Stabilize the Rust 2024 prelude This stabilizes the `core::prelude::rust_2024` and `std::prelude::rust_2024` modules. I missed these in the #133349 stabilization.
2024-12-12Rollup merge of #134173 - onur-ozkan:allow-symbol-intern-string-literal, ↵Matthias Krüger-6/+13
r=jieyouxu allow `symbol_intern_string_literal` lint in test modules Since #133545, `x check compiler --stage 1` no longer works because compiler test modules trigger `symbol_intern_string_literal` lint errors. Bootstrap shouldn't control when to ignore or enable this lint in the compiler tree (using `Kind != Test` was ineffective for obvious reasons). Also, conditionally adding this rustflag invalidates the build cache between `x test` and other commands. This PR removes the `Kind` check from bootstrap and handles it directly in the compiler tree in a more natural way.
2024-12-12Rollup merge of #134155 - sthibaul:unsafe_op_in_unsafe_fn, r=tgross35Matthias Krüger-0/+1
Forbid `unsafe_op_in_unsafe_fn` for Hurd Tracking issue https://github.com/rust-lang/rust/issues/127747
2024-12-12Rollup merge of #134154 - dev-ardi:field-expr-generics, r=compiler-errorsMatthias Krüger-17/+18
suppress field expr with generics error message if it's a method Don't emit "field expressions may not have generic arguments" if it's a method call without `()` r? estebank Fixes #67680 Is this the best way to go? It's by far the simplest I could come up with.
2024-12-12Rollup merge of #134152 - ↵Matthias Krüger-37/+11
nnethercote:simplify-rustc_mir_dataflow-abs_domain, r=compiler-errors Simplify `rustc_mir_dataflow::abs_domain`. `rustc_mir_dataflow` has a typedef `AbstractElem` that is equal to `ProjectionElem<AbstractOperand, AbstractType>`. `AbstractOperand` and `AbstractType` are both unit types. There is also has a trait `Lift` to convert a `PlaceElem` to an `AbstractElem`. But `rustc_mir_middle` already has a typedef `ProjectionKind` that is equal to `ProjectionElem<(), ()>`, which is equivalent to `AbstractElem`. So this commit reuses `ProjectionKind` in `rustc_mir_dataflow`, removes `AbstractElem`, and simplifies the `Lift` trait. r? ``@pnkfelix``
2024-12-12Rollup merge of #134144 - compiler-errors:fallback-apit, r=WaffleLapkinMatthias Krüger-26/+142
Properly consider APITs for never type fallback ascription fix Fixes #133842
2024-12-12Rollup merge of #134070 - oli-obk:push-nquzymupzlsq, r=jieyouxuMatthias Krüger-44/+131
Some asm! diagnostic adjustments and a papercut fix Best reviewed commit by commit. We forgot a `normalize` call in intrinsic checking, causing us to allow literal integers, but not named constants containing that literal. This can in theory affect stable code, but only if libstd contains a stable SIMD type that has an array length that is a named constant. I'd assume we'd have noticed by now due to asm! rejecting those outright. The error message left me scratching my head for a bit, so I added some extra information to the diagnostic, too.
2024-12-12Rollup merge of #133859 - bjorn3:move_tests_to_alloctests, r=tgross35Matthias Krüger-27/+123
Move some alloc tests to the alloctests crate Unit tests directly inside of standard library crates require a very fragile way of building that is hard to reproduce outside of bootstrap.
2024-12-12Rollup merge of #122003 - mati865:gnullvm-build-libunwind, r=petrochenkovMatthias Krüger-6/+10
link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets Alternative to https://github.com/rust-lang/rust/pull/121794 ``` $ cargo b -r Finished `release` profile [optimized] target(s) in 0.38s $ ntldd target/release/hello.exe | rg unwind libunwind.dll => H:\msys64\clang64\bin\libunwind.dll (0x0000020c35df0000) $ RUSTFLAGS="-C target-feature=+crt-static" cargo b -r Finished `release` profile [optimized] target(s) in 0.23s $ ntldd target/release/hello.exe | rg unwind ```
2024-12-12Revert "Stop git from merging generated files"Ralf Jung-4/+2
This reverts commit 4cbb599edf5b0762caa36ee4cbba00c5c86c1f5e. "-merge" makes git not even do merges if they are entirely conflict-free, which is not the behavior we want.
2024-12-12Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errorsbors-200/+1565
Pass end position of span through inline ASM cookie Before this PR, only the start position of the span was passed though the inline ASM cookie to diagnostics. LLVM 19 has full support for 64-bit inline ASM cookies; this PR uses that to pass the end position of the span in the upper 32 bits, meaning inline ASM diagnostics now point at the entire line the error occurred on, not just the first character of it.
2024-12-12Properly consider APITs for never type fallback ascription fixMichael Goulet-26/+142
2024-12-12Remove `PErr`.Nicholas Nethercote-12/+11
It's just a synonym for `Diag` that adds no value and is only used in a few places.
2024-12-11Auto merge of #128004 - folkertdev:naked-fn-asm, r=Amanieubors-106/+635
codegen `#[naked]` functions using global asm tracking issue: https://github.com/rust-lang/rust/issues/90957 Fixes #124375 This implements the approach suggested in the tracking issue: use the existing global assembly infrastructure to emit the body of `#[naked]` functions. The main advantage is that we now have full control over what gets generated, and are no longer dependent on LLVM not sneakily messing with our output (inlining, adding extra instructions, etc). I discussed this approach with `@Amanieu` and while I think the general direction is correct, there is probably a bunch of stuff that needs to change or move around here. I'll leave some inline comments on things that I'm not sure about. Combined with https://github.com/rust-lang/rust/pull/127853, if both accepted, I think that resolves all steps from the tracking issue. r? `@Amanieu`
2024-12-11Stabilize the Rust 2024 preludeEric Huss-6/+15
2024-12-11Clarify why a type is rejected for asm!Oli Scherer-49/+83
2024-12-11Evaluate constants in SIMD vec lengths before rejecting themOli Scherer-11/+2
2024-12-11Auto merge of #134177 - matthiaskrgr:rollup-hgp8q60, r=matthiaskrgrbors-3145/+7930
Rollup of 6 pull requests Successful merges: - #132975 (De-duplicate and improve definition of core::ffi::c_char) - #133598 (Change `GetManyMutError` to match T-libs-api decision) - #134148 (add comments in check_expr_field) - #134163 (coverage: Rearrange the code for embedding per-function coverage metadata) - #134165 (wasm(32|64): update alignment string) - #134170 (Subtree update of `rust-analyzer`) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-11Rollup merge of #134170 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-2865/+7515
Subtree update of `rust-analyzer` r? `@ghost`
2024-12-11Rollup merge of #134165 - durin42:wasm-target-string, r=jieyouxuMatthias Krüger-7/+13
wasm(32|64): update alignment string See llvm/llvm-project@c5ab70c508457eaece5d7ff4ab79a2f90bc67f06 `@rustbot` label: +llvm-main
2024-12-11Rollup merge of #134163 - Zalathar:covfun, r=SparrowLii,jieyouxuMatthias Krüger-186/+265
coverage: Rearrange the code for embedding per-function coverage metadata This is a series of refactorings to the code that prepares and embeds per-function coverage metadata records (“covfun records”) in the `__llvm_covfun` linker section of the final binary. The `llvm-cov` tool reads this metadata from the binary when preparing a coverage report. Beyond general cleanup, a big motivation behind these changes is to pave the way for re-landing an updated version of #133418. --- There should be no change in compiler output, as demonstrated by the absence of (meaningful) changes to coverage tests. The first patch is just moving code around, so I suggest looking at the other patches to see the actual changes. --- try-job: x86_64-gnu try-job: x86_64-msvc try-job: aarch64-apple
2024-12-11Rollup merge of #134148 - dev-ardi:cleanup_check_field_expr, r=compiler-errorsMatthias Krüger-6/+23
add comments in check_expr_field Nothing special, just a few comments and a couple of small cleanups.
2024-12-11Rollup merge of #133598 - ChayimFriedman2:get-many-mut-detailed-err, r=scottmcmMatthias Krüger-28/+34
Change `GetManyMutError` to match T-libs-api decision That is, differentiate between out-of-bounds and overlapping indices, and remove the generic parameter `N`. I also exported `GetManyMutError` from `alloc` (and `std`), which was apparently forgotten. Changing the error to carry additional details means LLVM no longer generates separate short-circuiting branches for the checks, instead it generates one branch at the end. I therefore changed the code to use early returns to make LLVM generate jumps. Benchmark results between the approaches are somewhat mixed, but I chose this approach because it is significantly faster with ranges and also faster with `unwrap()`. Benchmark (`jumps` refer to short-circuiting, `acc` is not short-circuiting): ```rust use criterion::{black_box, criterion_group, criterion_main, Criterion}; use my_crate::{get_many_check_valid_acc, get_many_check_valid_jumps, GetManyMutError}; mod externs { #[unsafe(no_mangle)] fn foo() {} #[unsafe(no_mangle)] fn bar() {} #[unsafe(no_mangle)] fn baz() {} } unsafe extern "C" { safe fn foo(); safe fn bar(); safe fn baz(); } fn bench_method(c: &mut Criterion) { c.bench_function("jumps two usize", |b| { b.iter(|| get_many_check_valid_jumps(&[black_box(1), black_box(5)], black_box(10))) }); c.bench_function("jumps two usize unwrap", |b| { b.iter(|| get_many_check_valid_jumps(&[black_box(1), black_box(5)], black_box(10)).unwrap()) }); c.bench_function("jumps two usize ok", |b| { b.iter(|| get_many_check_valid_jumps(&[black_box(1), black_box(5)], black_box(10)).ok()) }); c.bench_function("jumps three usize", |b| { b.iter(|| { get_many_check_valid_jumps(&[black_box(1), black_box(5), black_box(7)], black_box(10)) }) }); c.bench_function("jumps three usize match", |b| { b.iter(|| { match get_many_check_valid_jumps( &[black_box(1), black_box(5), black_box(7)], black_box(10), ) { Err(GetManyMutError::IndexOutOfBounds) => foo(), Err(GetManyMutError::OverlappingIndices) => bar(), Ok(()) => baz(), } }) }); c.bench_function("jumps two Range", |b| { b.iter(|| { get_many_check_valid_jumps( &[black_box(1)..black_box(5), black_box(7)..black_box(8)], black_box(10), ) }) }); c.bench_function("jumps two RangeInclusive", |b| { b.iter(|| { get_many_check_valid_jumps( &[black_box(1)..=black_box(5), black_box(7)..=black_box(8)], black_box(10), ) }) }); c.bench_function("acc two usize", |b| { b.iter(|| get_many_check_valid_acc(&[black_box(1), black_box(5)], black_box(10))) }); c.bench_function("acc two usize unwrap", |b| { b.iter(|| get_many_check_valid_acc(&[black_box(1), black_box(5)], black_box(10)).unwrap()) }); c.bench_function("acc two usize ok", |b| { b.iter(|| get_many_check_valid_acc(&[black_box(1), black_box(5)], black_box(10)).ok()) }); c.bench_function("acc three usize", |b| { b.iter(|| { get_many_check_valid_acc(&[black_box(1), black_box(5), black_box(7)], black_box(10)) }) }); c.bench_function("acc three usize match", |b| { b.iter(|| { match get_many_check_valid_jumps( &[black_box(1), black_box(5), black_box(7)], black_box(10), ) { Err(GetManyMutError::IndexOutOfBounds) => foo(), Err(GetManyMutError::OverlappingIndices) => bar(), Ok(()) => baz(), } }) }); c.bench_function("acc two Range", |b| { b.iter(|| { get_many_check_valid_acc( &[black_box(1)..black_box(5), black_box(7)..black_box(8)], black_box(10), ) }) }); c.bench_function("acc two RangeInclusive", |b| { b.iter(|| { get_many_check_valid_acc( &[black_box(1)..=black_box(5), black_box(7)..=black_box(8)], black_box(10), ) }) }); } criterion_group!(benches, bench_method); criterion_main!(benches); ``` Benchmark results: ```none jumps two usize time: [586.44 ps 590.20 ps 594.50 ps] jumps two usize unwrap time: [390.44 ps 393.63 ps 397.44 ps] jumps two usize ok time: [585.52 ps 591.74 ps 599.38 ps] jumps three usize time: [976.51 ps 983.79 ps 991.51 ps] jumps three usize match time: [390.82 ps 393.80 ps 397.07 ps] jumps two Range time: [1.2583 ns 1.2640 ns 1.2695 ns] jumps two RangeInclusive time: [1.2673 ns 1.2770 ns 1.2877 ns] acc two usize time: [592.63 ps 596.44 ps 600.52 ps] acc two usize unwrap time: [582.65 ps 587.07 ps 591.90 ps] acc two usize ok time: [581.59 ps 587.82 ps 595.71 ps] acc three usize time: [894.69 ps 901.23 ps 908.24 ps] acc three usize match time: [392.68 ps 395.73 ps 399.17 ps] acc two Range time: [1.5531 ns 1.5617 ns 1.5711 ns] acc two RangeInclusive time: [1.5746 ns 1.5840 ns 1.5939 ns] ```
2024-12-11Rollup merge of #132975 - arichardson:ffi-c-char, r=tgross35Matthias Krüger-53/+80
De-duplicate and improve definition of core::ffi::c_char Instead of having a list of unsigned char targets for each OS, follow the logic Clang uses and instead set the value based on architecture with a special case for Darwin and Windows operating systems. This makes it easier to support new operating systems targeting Arm/AArch64 without having to modify this config statement for each new OS. The new list does not quite match Clang since I noticed a few bugs in the Clang implementation (https://github.com/llvm/llvm-project/issues/115957). Fixes https://github.com/rust-lang/rust/issues/129945 Closes https://github.com/rust-lang/rust/pull/131319
2024-12-11Remove consteval note from <*mut T>::align_offset docs.Zachary S-9/+0
2024-12-11remove `Kind` check for `symbol_intern_string_literal`onur-ozkan-6/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-11allow `symbol_intern_string_literal` lint in test modulesonur-ozkan-0/+12
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-11Add regression testsOli Scherer-0/+62
2024-12-11Auto merge of #134164 - jhpratt:rollup-s7z0vcc, r=jhprattbors-72/+174
Rollup of 8 pull requests Successful merges: - #134079 (Add a note saying that `{u8,i8}::from_{be,le,ne}_bytes` is meaningless) - #134105 (Validate self in host predicates correctly) - #134136 (Exercise const trait interaction with default fields) - #134139 ([AIX] keep profile-rt symbol alive) - #134141 (Remove more traces of anonymous ADTs) - #134142 (Rudimentary heuristic to insert parentheses when needed for RPIT overcaptures lint) - #134158 (Rename `projection_def_id` to `item_def_id`) - #134160 (Add vacation entry for myself in triagebot.toml) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-11Don't emit "field expressions may not have generic arguments" if it's a ↵Orion Gonzalez-17/+18
method call without ()
2024-12-11document check_expr_fieldOrion Gonzalez-6/+23
2024-12-11wasm(32|64): update alignment stringAugie Fackler-7/+13
See llvm/llvm-project@c5ab70c508457eaece5d7ff4ab79a2f90bc67f06 @rustbot label: +llvm-main
2024-12-11coverage: Store intermediate region tables in `CovfunRecord`Zalathar-55/+77
This defers the call to `llvm_cov::write_function_mappings_to_buffer` until just before its enclosing global variable is created.
2024-12-11coverage: Only generate a CGU's covmap record if it has covfun recordsZalathar-4/+14
2024-12-11coverage: Adjust a codegen test to ignore the order of covmap/covfun globalsZalathar-4/+2
2024-12-11Merge pull request #18663 from Veykril/push-syoklzkntyknLukas Wirth-0/+4
fix: Swallow rustfmt parsing panics
2024-12-11Merge pull request #18662 from lnicola/sync-from-rustLaurențiu Nicola-24276/+34382
internal: Sync from downstream
2024-12-11fix: Swallow rustfmt parsing panicsLukas Wirth-0/+4
2024-12-11Bump rustc cratesLaurențiu Nicola-18/+17
2024-12-11Merge from rust-lang/rustLaurențiu Nicola-24257/+34364
2024-12-11Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-12-11Rollup merge of #134160 - celinval:chores-vacation, r=jieyouxuJacob Pratt-0/+1
Add vacation entry for myself in triagebot.toml It's that wonderful time of the year. :smiley:
2024-12-11Rollup merge of #134158 - compiler-errors:item-def-id, r=jackh726Jacob Pratt-9/+9
Rename `projection_def_id` to `item_def_id` Renames `projection_def_id` to `item_def_id`, since `item_def_id` is what we call the analogous method for ~~`AliasTerm`/`AliasTy`~~ `PolyExistentialProjection`. I keep forgetting that this one is not called `item_def_id`.