| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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.
|
|
It is effectively a global resource and the jobserver::Client in Session
was a clone of GLOBAL_CLIENT anyway.
|
|
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`
|
|
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
|
|
Remove `PErr`.
It's just a synonym for `Diag` that adds no value and is only used in a few places.
r? ``@spastorino``
|
|
Remove outdated consteval note from `<*mut T>::align_offset` docs.
|
|
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.
|
|
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.
|
|
Forbid `unsafe_op_in_unsafe_fn` for Hurd
Tracking issue https://github.com/rust-lang/rust/issues/127747
|
|
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.
|
|
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``
|
|
Properly consider APITs for never type fallback ascription fix
Fixes #133842
|
|
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.
|
|
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.
|
|
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
```
|
|
This reverts commit 4cbb599edf5b0762caa36ee4cbba00c5c86c1f5e.
"-merge" makes git not even do merges if they are entirely conflict-free,
which is not the behavior we want.
|
|
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.
|
|
|
|
It's just a synonym for `Diag` that adds no value and is only used in a
few places.
|
|
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`
|
|
|
|
|
|
|
|
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
|
|
Subtree update of `rust-analyzer`
r? `@ghost`
|
|
wasm(32|64): update alignment string
See llvm/llvm-project@c5ab70c508457eaece5d7ff4ab79a2f90bc67f06
`@rustbot` label: +llvm-main
|
|
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
|
|
add comments in check_expr_field
Nothing special, just a few comments and a couple of small cleanups.
|
|
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]
```
|
|
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
|
|
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
|
|
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
|
|
method call without ()
|
|
|
|
See llvm/llvm-project@c5ab70c508457eaece5d7ff4ab79a2f90bc67f06
@rustbot label: +llvm-main
|
|
This defers the call to `llvm_cov::write_function_mappings_to_buffer` until
just before its enclosing global variable is created.
|
|
|
|
|
|
fix: Swallow rustfmt parsing panics
|
|
internal: Sync from downstream
|
|
|
|
|
|
|
|
|
|
Add vacation entry for myself in triagebot.toml
It's that wonderful time of the year. :smiley:
|
|
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`.
|