Matthias Krüger
531e578ee5
Rollup merge of #134170 - lnicola:sync-from-ra, r=lnicola
...
Subtree update of `rust-analyzer`
r? `@ghost`
2024-12-11 20:00:22 +01:00
Matthias Krüger
eefefbea2f
Rollup merge of #134165 - durin42:wasm-target-string, r=jieyouxu
...
wasm(32|64): update alignment string
See llvm/llvm-project@c5ab70c508
`@rustbot` label: +llvm-main
2024-12-11 20:00:21 +01:00
Matthias Krüger
13c13ee4ec
Rollup merge of #134163 - Zalathar:covfun, r=SparrowLii,jieyouxu
...
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-11 20:00:18 +01:00
Matthias Krüger
90a42c2519
Rollup merge of #134148 - dev-ardi:cleanup_check_field_expr, r=compiler-errors
...
add comments in check_expr_field
Nothing special, just a few comments and a couple of small cleanups.
2024-12-11 20:00:15 +01:00
Matthias Krüger
2e60288ce0
Rollup merge of #133598 - ChayimFriedman2:get-many-mut-detailed-err, r=scottmcm
...
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-11 20:00:14 +01:00
Matthias Krüger
fe516ef9f4
Rollup merge of #132975 - arichardson:ffi-c-char, r=tgross35
...
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-11 20:00:12 +01:00
Orion Gonzalez
55806e5655
document check_expr_field
2024-12-11 13:48:50 +01:00
Augie Fackler
48b883287a
wasm(32|64): update alignment string
...
See llvm/llvm-project@c5ab70c508
@rustbot label: +llvm-main
2024-12-11 05:52:59 -05:00
Zalathar
3f3a9bf7f5
coverage: Store intermediate region tables in CovfunRecord
...
This defers the call to `llvm_cov::write_function_mappings_to_buffer` until
just before its enclosing global variable is created.
2024-12-11 21:35:45 +11:00
Zalathar
512f3fdebe
coverage: Only generate a CGU's covmap record if it has covfun records
2024-12-11 21:35:44 +11:00
Zalathar
9e6b7c17c8
coverage: Adjust a codegen test to ignore the order of covmap/covfun globals
2024-12-11 21:34:48 +11:00
Lukas Wirth
a18e38e6e2
Merge pull request #18663 from Veykril/push-syoklzkntykn
...
fix: Swallow rustfmt parsing panics
2024-12-11 10:06:28 +00:00
Laurențiu Nicola
81720881ae
Merge pull request #18662 from lnicola/sync-from-rust
...
internal: Sync from downstream
2024-12-11 10:05:39 +00:00
Lukas Wirth
e6fbb5c8e6
fix: Swallow rustfmt parsing panics
2024-12-11 10:52:04 +01:00
Laurențiu Nicola
884f57f9fc
Bump rustc crates
2024-12-11 11:50:19 +02:00
Laurențiu Nicola
5db2aa865c
Merge from rust-lang/rust
2024-12-11 11:49:08 +02:00
Laurențiu Nicola
1649eb6dd7
Preparing for merge from rust-lang/rust
2024-12-11 11:48:46 +02:00
Zalathar
6a8c016266
coverage: Reify CovfunRecord
as an intermediate step
2024-12-11 18:25:10 +11:00
Lukas Wirth
536eea39e8
Merge pull request #18458 from Giga-Bowser/master
...
feat: Add diagnostic fix to remove unnecessary wrapper in type mismatch
2024-12-11 07:09:15 +00:00
Lukas Wirth
e1a27b8708
Merge pull request #18653 from SomeoneToIgnore/hash-completions
...
Hash completion items to properly match them during /resolve
2024-12-11 07:08:33 +00:00
Lukas Wirth
b20d1b80bb
Merge pull request #18657 from Giga-Bowser/generate-enum-variant
...
minor: Migrate `generate_enum_variant` to `SyntaxEditor`
2024-12-11 07:07:22 +00:00
Lukas Wirth
611c72f2f0
Merge pull request #18656 from roife/fix-issue-18639
...
feat: preserve order of parameters in extract_functions
2024-12-11 07:00:17 +00:00
Zalathar
7c4ac71ad1
coverage: Extract function metadata handling to a covfun
submodule
2024-12-11 17:49:44 +11:00
bors
5a6036a180
Auto merge of #134137 - fmease:rollup-u1p7swx, r=fmease
...
Rollup of 9 pull requests
Successful merges:
- #133583 (Fix type (exit → exist))
- #134042 (Add the `power8-crypto` target feature)
- #134094 (Tweak wording of non-const traits used as const bounds)
- #134100 (Remove rustc_const_stable attribute on const NOOP)
- #134103 (Don't ICE when encountering never in range pattern)
- #134113 (run-make: Fix `assert_stderr_not_contains_regex`)
- #134115 (rustc_target: ppc64 target string fixes for LLVM 20)
- #134116 (stabilize const_nonnull_new)
- #134120 (Remove Felix from ping groups and review rotation)
r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-11 05:31:46 +00:00
León Orell Valerian Liehr
e60f6cdd3d
Rollup merge of #134120 - oli-obk:push-vryonyoqmonv, r=oli-obk
...
Remove Felix from ping groups and review rotation
2024-12-10 20:16:07 +01:00
León Orell Valerian Liehr
e822dfc415
Rollup merge of #134116 - RalfJung:const_nonnull_new, r=jhpratt
...
stabilize const_nonnull_new
FCP passed in https://github.com/rust-lang/rust/issues/93235
Closes #93235
2024-12-10 20:16:06 +01:00
León Orell Valerian Liehr
6d17cb833d
Rollup merge of #134115 - durin42:ppc64-target-string, r=jieyouxu
...
rustc_target: ppc64 target string fixes for LLVM 20
LLVM continues to clean these up, and we continue to make this consistent. This is similar to 9caced7bad
, e985396145
, and
a10e744faf
.
```@rustbot``` label: +llvm-main
2024-12-10 20:16:05 +01:00
León Orell Valerian Liehr
0b9e74af2e
Rollup merge of #134113 - jyn514:run-make-contains, r=jieyouxu
...
run-make: Fix `assert_stderr_not_contains_regex`
It asserted on **stdout**, not stderr.
r? ``@jieyouxu``
2024-12-10 20:16:04 +01:00
León Orell Valerian Liehr
c5a83862a2
Rollup merge of #134103 - compiler-errors:never-pat-range, r=oli-obk
...
Don't ICE when encountering never in range pattern
Fixes #133947
r? oli-obk
2024-12-10 20:16:04 +01:00
León Orell Valerian Liehr
f621be4ecc
Rollup merge of #134100 - eholk:noop-rustc-const-stable, r=dtolnay
...
Remove rustc_const_stable attribute on const NOOP
This was accidentally reintroduced while editing #133089 .
r? dtolnay
2024-12-10 20:16:03 +01:00
León Orell Valerian Liehr
185440a375
Rollup merge of #134094 - estebank:const-trait-errors, r=compiler-errors
...
Tweak wording of non-const traits used as const bounds
Use verbose suggestions and add additional labels/notes.
r? ``@compiler-errors``
2024-12-10 20:16:02 +01:00
León Orell Valerian Liehr
0064e731a6
Rollup merge of #134042 - sayantn:power8-crypto, r=jieyouxu
...
Add the `power8-crypto` target feature
Add the `power8-crypto` target feature. This will enable adding some new PPC intrinsics in stdarch (specifically AES, SHA and CLMUL intrinsics). The implied target feature is from [here](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPC.td )
```@rustbot``` label A-target-feature O-PowerPC
2024-12-10 20:16:01 +01:00
León Orell Valerian Liehr
5bd9602e33
Rollup merge of #133583 - tbu-:pr_fix_typo2, r=compiler-errors
...
Fix type (exit → exist)
2024-12-10 20:16:00 +01:00
roife
0b121ef846
feat: preserve order of parameters in extract_functions
2024-12-11 02:26:58 +08:00
Giga Bowser
3b781667eb
minor: Migrate generate_enum_variant
to SyntaxEditor
2024-12-10 13:11:33 -05:00
Giga Bowser
26e7e4f748
minor: Add ty_infer
constructor to SyntaxFactory
2024-12-10 12:33:32 -05:00
Giga Bowser
d9bb8fcab1
minor: Add whitespace
constructor to SyntaxFactory
2024-12-10 12:25:13 -05:00
Alex Richardson
dd3e98c58b
Add references to the specific ABI documents
...
Expcept for L4RE and Xtensa these were obtained from #131319
I could not find an open link to the Xtensa documentation, but the
signedness was confirmed by on of the Xtensa developers in
https://github.com/llvm/llvm-project/pull/115967#issuecomment-2506292323
Co-authored-by: Taiki Endo <te316e89@gmail.com>
2024-12-10 08:33:29 -08:00
Alex Richardson
e8bcce77bb
Remove l4re from the unsigned char operating system list
...
As noted in https://github.com/rust-lang/rust/pull/132975#issuecomment-2484645240 ,
the default for userland apps is to follow the architecture defaults, the
-funsigned-char flag only applies to kernel builds.
2024-12-10 08:33:29 -08:00
Alex Richardson
028ca8e616
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
2024-12-10 08:33:29 -08:00
Giga Bowser
3bc26ba4aa
minor: Add item_enum
constructor to SyntaxFactory
...
I recursively added all constructors it depends on. I also changed the old `make::` constructors to support more of the grammar.
2024-12-10 11:12:44 -05:00
Oli Scherer
e1689e6807
Remove Felix from ping groups and review rotation
2024-12-10 17:06:45 +01:00
Tobias Bucher
bab1fcb30c
Fix type (exit → exist)
2024-12-10 16:20:29 +01:00
bors
33c245b9e9
Auto merge of #134125 - fmease:rollup-u38o3ob, r=fmease
...
Rollup of 11 pull requests
Successful merges:
- #133478 (jsondocck: Parse, don't validate commands.)
- #133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
- #133970 ([AIX] Replace sa_sigaction with sa_union.__su_sigaction for AIX)
- #133980 ([AIX] Remove option "-n" from AIX "ln" command)
- #134008 (Make `Copy` unsafe to implement for ADTs with `unsafe` fields)
- #134017 (Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction)
- #134023 (handle cygwin environment in `install::sanitize_sh`)
- #134041 (Use SourceMap to load debugger visualizer files)
- #134065 (Move `write_graphviz_results`)
- #134106 (Add compiler-maintainers who requested to be on review rotation)
- #134123 (bootstrap: Forward cargo JSON output to stdout, not stderr)
Failed merges:
- #134120 (Remove Felix from ping groups and review rotation)
r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-10 13:16:09 +00:00
León Orell Valerian Liehr
c42c248009
Rollup merge of #134123 - Zalathar:json-output, r=jieyouxu,clubby789
...
bootstrap: Forward cargo JSON output to stdout, not stderr
This fixes the RA errors I've been seeing on proc-macros after the re-landing of #134040 .
r? clubby789
2024-12-10 13:51:14 +01:00
León Orell Valerian Liehr
0f1b827881
Rollup merge of #134106 - wesleywiser:update_compiler_review_queue_maintainers, r=jieyouxu
...
Add compiler-maintainers who requested to be on review rotation
r? ``@davidtwco``
cc ``@Noratrieb`` ``@SparrowLii``
2024-12-10 13:51:13 +01:00
León Orell Valerian Liehr
06107a20e3
Rollup merge of #134065 - nnethercote:mv-write_graphviz_results, r=tmiasko
...
Move `write_graphviz_results`
r? ``@tmiasko``
2024-12-10 13:51:12 +01:00
León Orell Valerian Liehr
599ff4d248
Rollup merge of #134041 - clubby789:debugvis-sourcemap, r=jieyouxu
...
Use SourceMap to load debugger visualizer files
2024-12-10 13:51:12 +01:00
León Orell Valerian Liehr
8e9953fc5c
Rollup merge of #134023 - onur-ozkan:132507, r=jieyouxu
...
handle cygwin environment in `install::sanitize_sh`
Resolves #132507
2024-12-10 13:51:11 +01:00
León Orell Valerian Liehr
193a95d30b
Rollup merge of #134017 - compiler-errors:call-once-deduction, r=jieyouxu
...
Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction
We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that.
This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable.
Fixes #134015
2024-12-10 13:51:10 +01:00