Commit Graph

249118 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
64dda8c837
Fix invalid compiletest directives in tests
- Fix invalid directive in `normalize-hidden-types`
- Update legacy directive in `two-phase-reservation-sharing-interference`
2024-03-10 13:13:09 +00:00
许杰友 Jieyou Xu (Joe)
5877e7e8d2
Error on invalid compiletest directives in Rust test files 2024-03-10 13:13:09 +00:00
bors
cdb775cab5 Auto merge of #122283 - matthiaskrgr:rollup-w3sau3u, r=matthiaskrgr
Rollup of 14 pull requests

Successful merges:

 - #112136 (Add std::ffi::c_str module)
 - #113525 (Dynamically size sigaltstk in std)
 - #121567 (Avoid some interning in bootstrap)
 - #121642 (Update a test to support Symbol Mangling V0)
 - #121685 (Fixing shellcheck comments on lvi test script)
 - #121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - #121942 (std::rand: enable getrandom for dragonflybsd too.)
 - #122125 (Revert back to Git-for-Windows for MinGW CI builds)
 - #122221 (match lowering: define a convenient struct)
 - #122244 (fix: LocalWaker memory leak and some stability attributes)
 - #122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)
 - #122264 (add myself to rotation)
 - #122269 (doc/rustc: Move loongarch64-unknown-linux-musl to Tier 3)
 - #122271 (Fix legacy numeric constant diag items)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-10 11:58:22 +00:00
Ralf Jung
aa9145e6ea use Instance::expect_resolve() instead of unwraping Instance::resolve() 2024-03-10 11:49:33 +01:00
Matthias Krüger
9d03046a81
Rollup merge of #122271 - pitaj:diag_items-legacy_numeric_constants, r=Nilstrieb
Fix legacy numeric constant diag items

- missed syms for usize/isize
- missed diag items on unsigned integers

For rust-lang/rust-clippy#12312

r? ```@Nilstrieb```

Follow-up to #121272, #121361, #121667
This should be the last one 🤞 Sorry!
2024-03-10 10:58:20 +01:00
Matthias Krüger
01ce236341
Rollup merge of #122269 - heiher:fix-doc, r=workingjubilee
doc/rustc: Move loongarch64-unknown-linux-musl to Tier 3

Fixes #122266
2024-03-10 10:58:20 +01:00
Matthias Krüger
d2fbf0c299
Rollup merge of #122264 - fee1-dead-contrib:add, r=fee1-dead
add myself to rotation

Won't have too much capacity, but I am able to contribute something. Will be rotating reviews if I run out of capacity :)

r? `````@ghost`````
`````@bors````` r+ rollup
2024-03-10 10:58:19 +01:00
Matthias Krüger
8a9f3fd1be
Rollup merge of #122251 - jieyouxu:unused-lifetimes-dedup-test, r=Nadrieril
Add test to check unused_lifetimes don't duplicate "parameter is never used" error

Closes #72587.
2024-03-10 10:58:19 +01:00
Matthias Krüger
4faf535a55
Rollup merge of #122244 - tvallotton:local_waker_leak_fix, r=Nilstrieb
fix: LocalWaker memory leak and some stability attributes

fixes #122180.
2024-03-10 10:58:18 +01:00
Matthias Krüger
163573a368
Rollup merge of #122221 - Nadrieril:patextradata, r=oli-obk
match lowering: define a convenient struct

Small refactor PR: `bindings` and `ascriptions` always come together so I made a struct for them. I'll have one or two fields to add to it in a later PR as well.
2024-03-10 10:58:18 +01:00
Matthias Krüger
44c8a6acc6
Rollup merge of #122125 - majaha:mingw_ci_new, r=Mark-Simulacrum
Revert back to Git-for-Windows for MinGW CI builds

Following discussion in https://github.com/rust-lang/rust/pull/121182 it was decided to revert using MSYS2 Git for mingw builds.
2024-03-10 10:58:17 +01:00
Matthias Krüger
f6d47dd1f1
Rollup merge of #121942 - devnexen:getrandom_for_dfbsd, r=joboet
std::rand: enable getrandom for dragonflybsd too.
2024-03-10 10:58:16 +01:00
Matthias Krüger
fdcd05178d
Rollup merge of #121860 - mu001999:master, r=Nilstrieb
Add a tidy check that checks whether the fluent slugs only appear once

As ``````@Nilstrieb`````` said in https://github.com/rust-lang/rust/pull/121828#issuecomment-1972622855:
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ``````@Nilstrieb``````
2024-03-10 10:58:16 +01:00
Matthias Krüger
8b9b83b14c
Rollup merge of #121685 - fortanix:raoul/shellcheck_on_lvi_test_script, r=Mark-Simulacrum
Fixing shellcheck comments on lvi test script

Running `shellcheck` on `tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh` gives plenty of warnings. This PR fixes those issues. For completeness: #121683 fixes another warning as well
2024-03-10 10:58:16 +01:00
Matthias Krüger
e8e41877a2
Rollup merge of #121642 - TimNN:test-v0, r=Mark-Simulacrum
Update a test to support Symbol Mangling V0

Note that since this is a symbol from `std`, overriding the symbol mangling version via the `compile-flags` directive does not work.
2024-03-10 10:58:15 +01:00
Matthias Krüger
0f89faebb1
Rollup merge of #121567 - Nilstrieb:less-interning, r=albertlarsan68
Avoid some interning in bootstrap

This interning is pointless and only makes the code more complex.

The only remaining use of interning is `TargetSelection`, for which I left a comment.
2024-03-10 10:58:15 +01:00
Matthias Krüger
b81678e627
Rollup merge of #113525 - workingjubilee:handle-dynamic-minsigstksz, r=m-ou-se
Dynamically size sigaltstk in std

On modern Linux with Intel AMX and 1KiB matrices,
Arm SVE with potentially 2KiB vectors,
and RISCV Vectors with up to 16KiB vectors,
we must handle dynamic signal stack sizes.

We can do so unconditionally by using getauxval,
but assuming it may return 0 as an answer,
thus falling back to the old constant if needed.

Fixes https://github.com/rust-lang/rust/issues/107795
2024-03-10 10:58:14 +01:00
Matthias Krüger
1b44889ec2
Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviper
Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

`std::ffi` docs before change:
![Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/b2cf3534-30f9-4ef0-a655-bacdc3a19e17)

`std::ffi` docs after change:
![Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/23aa6964-da7a-4942-bbf7-42bde2146f9e)

(note: I'm omitting the `c_int`, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)
2024-03-10 10:58:14 +01:00
bors
3521a2f2f3 Auto merge of #122246 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`

`@WaffleLapkin` when this lands, setting `MIRI_TEMP` should not be needed any more on the dev desktops.
2024-03-10 09:40:39 +00:00
Laurențiu Nicola
b4e3b2e482 Bring back in-rust-tree feature to ide 2024-03-10 11:08:11 +02:00
Ralf Jung
c06f801ef6 BorrowedCursor docs clarification 2024-03-10 09:48:56 +01:00
Ralf Jung
93049bece0 io::Read trait: make it more clear when we are adressing implementations vs callers 2024-03-10 09:39:45 +01:00
Ralf Jung
1dd47e0a17 disable OOM test in Miri 2024-03-10 09:24:25 +01:00
Laurențiu Nicola
56493e4cbd Merge commit '574e23ec508064613783cba3d1833a95fd9a5080' into sync-from-ra 2024-03-10 08:47:38 +02:00
Peter Jaszkowiak
83590ac069 fix legacy numeric constant diag items
- missed syms for usize/isize
- missed diag items on unsigned integers
2024-03-09 23:33:27 -07:00
bors
094a6204f5 Auto merge of #122064 - Zoxc:dep-graph-encode-tweaks, r=cjgillot
Dep node encoding cleanups

This does some cleanups around dep node encoding.

Performance change with `-Zthreads=2`:

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Memory</td><td align="right">Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4337s</td><td align="right">0.4306s</td><td align="right"> -0.72%</td><td align="right">88.90 MiB</td><td align="right">89.04 MiB</td><td align="right"> 0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1541s</td><td align="right">0.1528s</td><td align="right"> -0.86%</td><td align="right">51.99 MiB</td><td align="right">52.03 MiB</td><td align="right"> 0.07%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3286s</td><td align="right">0.3248s</td><td align="right">💚  -1.15%</td><td align="right">71.89 MiB</td><td align="right">71.74 MiB</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.6118s</td><td align="right">0.6057s</td><td align="right">💚  -1.01%</td><td align="right">106.59 MiB</td><td align="right">106.66 MiB</td><td align="right"> 0.06%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.4570s</td><td align="right">1.4463s</td><td align="right"> -0.74%</td><td align="right">197.29 MiB</td><td align="right">197.33 MiB</td><td align="right"> 0.02%</td></tr><tr><td>Total</td><td align="right">2.9852s</td><td align="right">2.9601s</td><td align="right"> -0.84%</td><td align="right">516.66 MiB</td><td align="right">516.80 MiB</td><td align="right"> 0.03%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9911s</td><td align="right"> -0.89%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.02%</td></tr></table>

r? `@cjgillot`
2024-03-10 06:27:41 +00:00
WANG Rui
1bad698b27 doc/rustc: Move loongarch64-unknown-linux-musl to Tier 3
Fixes #122266
2024-03-10 14:01:05 +08:00
Erik Desjardins
8fdd5e044b convert codegen/repr/transparent-* tests to no_core, fix discrepancies 2024-03-09 23:16:02 -05:00
bors
5bc7b9ac8a Auto merge of #122042 - GuillaumeGomez:subtree-update_cg_gcc_2024-03-05, r=MarkSimulacrum
Subtree update cg gcc 2024 03 05

Reopening of #121390.

r? `@ghost`
2024-03-10 03:40:32 +00:00
bors
768408af12 Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung
Distinguish between library and lang UB in assert_unsafe_precondition

As described in https://github.com/rust-lang/rust/pull/121583#issuecomment-1963168186, `assert_unsafe_precondition` now explicitly distinguishes between language UB (conditions we explicitly optimize on) and library UB (things we document you shouldn't do, and maybe some library internals assume you don't do).

`debug_assert_nounwind` was originally added to avoid the "only at runtime" aspect of `assert_unsafe_precondition`. Since then the difference between the macros has gotten muddied. This totally revamps the situation.

Now _all_ preconditions shall be checked with `assert_unsafe_precondition`. If you have a precondition that's only checkable at runtime, do a `const_eval_select` hack, as done in this PR.

r? RalfJung
2024-03-10 01:23:54 +00:00
Guillaume Gomez
c5c6729c88 Use full commit hash and remove libgccjit.version file 2024-03-10 01:01:53 +01:00
Guillaume Gomez
1d058a0b06 Fix cg_gcc merge 2024-03-10 01:01:52 +01:00
bors
2d24fe591f Auto merge of #122256 - Nadrieril:rollup-rc232xh, r=Nadrieril
Rollup of 8 pull requests

Successful merges:

 - #99153 (Add Read Impl for &Stdin)
 - #114655 (Make `impl<Fd: AsFd>` impl take `?Sized`)
 - #120504 (Vec::try_with_capacity)
 - #121280 (Implement MaybeUninit::fill{,_with,_from})
 - #121403 (impl From<TryReserveError> for io::Error)
 - #121526 (on the fly type casting for `build.rustc` and `build.cargo`)
 - #121584 (bump itertools to 0.12)
 - #121711 (Implement junction_point)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-09 20:51:26 +00:00
Guillaume Boisseau
13ca978f91
Rollup merge of #121711 - ChrisDenton:junction, r=Mark-Simulacrum
Implement junction_point

Implements https://github.com/rust-lang/rust/issues/121709

We already had a private implementation that we use for tests so we could just make that public. Except it was very hacky as it was only ever intended for use in testing. I've made an improved version that at least handles path conversion correctly and has less need for things like the `Align8` hack. There's still room for further improvement though.
2024-03-09 21:40:09 +01:00
Guillaume Boisseau
bc3bc2ba6b
Rollup merge of #121584 - klensy:itertools-up, r=Mark-Simulacrum
bump itertools to 0.12

still depend on 0.11 (temporary dupes version):
* <del>clippy</del>, https://github.com/rust-lang/rust-clippy/pull/12346
* rustfmt, sigh, https://github.com/rust-lang/rustfmt/pull/6093

https://github.com/rust-itertools/itertools/blob/v0.12.1/CHANGELOG.md

removed unused `derive_more` dep from `rustc_middle`
2024-03-09 21:40:08 +01:00
Guillaume Boisseau
5d4e3d941f
Rollup merge of #121526 - onur-ozkan:minor-improvement, r=Mark-Simulacrum
on the fly type casting for `build.rustc` and `build.cargo`

self-explanatory
2024-03-09 21:40:08 +01:00
Guillaume Boisseau
9ccf798fff
Rollup merge of #121403 - kornelski:io-oom, r=dtolnay
impl From<TryReserveError> for io::Error

There's an obvious mapping between these two errors, and it makes I/O code less noisy.

I've chosen to use simple `ErrorKind::OutOfMemory` `io::Error`, without keeping `TryReserveError` for the `source()`, because:

* It matches current uses in libstd,
* `ErrorData::Custom` allocates, which is a risky proposition for handling OOM errors specifically.
* Currently `TryReserveError` has no public fields/methods, so it's usefulness is limited. How allocators should report errors, especially custom and verbose ones is still an open question.

Just in case I've added note in the doccomment that this may change.

The compiler forced me to declare stability of this impl. I think this implementation is simple enough that it doesn't need full-blown stabilization period, and I've marked it for the next release, but of course I can adjust the attribute if needed.
2024-03-09 21:40:07 +01:00
Guillaume Boisseau
cbd59d0f62
Rollup merge of #121280 - ajwock:maybeuninit_fill, r=Amanieu
Implement MaybeUninit::fill{,_with,_from}

ACP: rust-lang/libs-team#156
2024-03-09 21:40:07 +01:00
Guillaume Boisseau
e3c0158788
Rollup merge of #120504 - kornelski:try_with_capacity, r=Amanieu
Vec::try_with_capacity

Related to #91913

Implements try_with_capacity for `Vec`, `VecDeque`, and `String`. I can follow it up with more collections if desired.

`Vec::try_with_capacity()` is functionally equivalent to the current stable:

```rust
let mut v = Vec::new();
v.try_reserve_exact(n)?
```

However, `try_reserve` calls non-inlined `finish_grow`, which requires old and new `Layout`, and is designed to reallocate memory. There is benefit to using `try_with_capacity`, besides syntax convenience, because it generates much smaller code at the call site with a direct call to the allocator. There's codegen test included.

It's also a very desirable functionality for users of `no_global_oom_handling` (Rust-for-Linux), since it makes a very commonly used function available in that environment (`with_capacity` is used much more frequently than all `(try_)reserve(_exact)`).
2024-03-09 21:40:06 +01:00
Guillaume Boisseau
5b6d30a4a9
Rollup merge of #114655 - nbdd0121:io-safety, r=dtolnay
Make `impl<Fd: AsFd>` impl take `?Sized`

`@rustbot` labels: +T-libs-api +needs-fcp
2024-03-09 21:40:06 +01:00
Guillaume Boisseau
0a8ea93dd8
Rollup merge of #99153 - Dajamante:issue/95622, r=dtolnay
Add Read Impl for &Stdin

r? `@oli-obk`
fixes #95622
2024-03-09 21:40:05 +01:00
Ben Kimock
2a1f97f77f Explain why we don't use intrinsics::is_nonoverlapping 2024-03-09 13:36:36 -05:00
许杰友 Jieyou Xu (Joe)
ff1459a370
Add test to check unused_lifetimes don't duplicate "parameter is never used" error 2024-03-09 18:24:45 +00:00
Ralf Jung
9a308d45cf update lockfile 2024-03-09 18:56:52 +01:00
bors
25ee3c6a2f Auto merge of #120985 - Kobzol:linux-update-host-llvm, r=Mark-Simulacrum
Update host LLVM on x64 Linux to LLVM 18

Updates host LLVM on Linux to `18.1.0`.
2024-03-09 17:53:30 +00:00
erikdesjardins
549eac374f
once byval abi is computed, the target abi isn't used further
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-03-09 12:49:35 -05:00
Tomás Vallotton
092a1ab001 fix: remove memory leak due to missing drop implementation for local waker. Also, fix some
of the stability attributes of LocalWaker's methods.
2024-03-09 14:38:58 -03:00
Ben Kimock
af49c4df0a NonZero::from_mut_unchecked is library UB 2024-03-09 12:27:11 -05:00
Erik Desjardins
38324a1f4f improve byval abi docs 2024-03-09 12:08:48 -05:00
Guillaume Gomez
2b5b43eeb9 Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-09 18:04:39 +01:00