Commit Graph

249522 Commits

Author SHA1 Message Date
Nicholas Nethercote
a09b1d33a7 Rename IntoDiagnosticArg as IntoDiagArg.
Also rename `into_diagnostic_arg` as `into_diag_arg`, and
`NotIntoDiagnosticArg` as `NotInotDiagArg`.
2024-03-11 09:12:19 +11:00
Nicholas Nethercote
256d802233 Remove unused impls from some subdiagnostics. 2024-03-11 09:08:33 +11:00
Nicholas Nethercote
4e38ef9e1a Remove unused impls for some diagnostics. 2024-03-11 09:08:29 +11:00
erer1243
3af28f0b70 Fix 32-bit overflows in LLVM composite constants 2024-03-10 17:54:55 -04:00
Nicholas Nethercote
567744c10e Remove Default derive from MacroExpectedFound.
It's the only diagnostic in the entire project that impls `Default`, and
the code is clearer without it.
2024-03-11 08:52:50 +11:00
Matthias Krüger
16ffeb208d
Rollup merge of #122304 - lukas-code:dyn-star-meta, r=compiler-errors
fix metadata for dyn-star in new solver

The pointee metadata of `dyn* Trait` types is `()` and not a vtable.
2024-03-10 22:16:45 +01:00
Matthias Krüger
97f3b3383a
Rollup merge of #122302 - ratmice:issue122234, r=cuviper
docs: Correct ptr/ref verbiage in SliceIndex docs.

Fixes #122234
2024-03-10 22:16:45 +01:00
Matthias Krüger
2a3a8dbdbf
Rollup merge of #122297 - RalfJung:bootstrap-build, r=onur-ozkan
bootstrap: document what the triples in 'Build' mean

Thanks to ``@onur-ozkan``  for pointing this out to me.
2024-03-10 22:16:44 +01:00
Matthias Krüger
c4b159c4a0
Rollup merge of #122293 - Enselic:no-bare-unix_sigpipe, r=fmease
diagnostics: Do not suggest using `#[unix_sigpipe]` without a value

Remove `Word` from the `unix_sigpipe` attribute template so that plain `#[unix_sigpipe]` is not included in suggestions of valid forms of the attribute. Also re-arrange diagnostics code slightly to avoid duplicate diagnostics.

Tracking issue is https://github.com/rust-lang/rust/issues/97889.
2024-03-10 22:16:44 +01:00
Matthias Krüger
9ccbbda6ac
Rollup merge of #122290 - RalfJung:mir-printing, r=compiler-errors
MIR printing: print the path of uneval'd const

Currently it just prints `const _` which makes it impossible to say which constant is being referred to.

Also refer to promoteds in a consistent way; previously MIR printing would do
```
promoted[0] in C1: &Option<Cell<i32>> = {
    // ...
}
```
Now that should be
```
const C1::promoted[0]: &Option<Cell<i32>> = {
    // ...
}
```

We don't seem to have a test for that so I tried it by hand, it seems to work:
```
const main::promoted[12]: &[&str; 3] = {
    let mut _0: &[&str; 3];
    let mut _1: [&str; 3];
    let mut _2: &str;
    let mut _3: &str;
    let mut _4: &str;
    let mut _5: &str;

    bb0: {
        _3 = const "b";
        _2 = &(*_3);
        _5 = const "c";
        _4 = &(*_5);
        _1 = [const "a", move _2, move _4];
        _0 = &_1;
        return;
    }
}
```
2024-03-10 22:16:43 +01:00
Matthias Krüger
b02f2a0e76
Rollup merge of #122286 - RalfJung:resolve, r=compiler-errors
use Instance::expect_resolve() instead of unwraping Instance::resolve()
2024-03-10 22:16:43 +01:00
Matthias Krüger
ff09d32d83
Rollup merge of #122277 - RalfJung:BorrowedCursor, r=cuviper
BorrowedCursor docs clarification

If one reads the `BorrowedCursor` docs without having seen `BorrowedBuf` before, it is quite easy to assume that "unfilled" and "uninit" are synonyms.
2024-03-10 22:16:42 +01:00
Matthias Krüger
0c73b2db41
Rollup merge of #122276 - RalfJung:io-read, r=Nilstrieb
io::Read trait: make it more clear when we are adressing implementations vs callers

Inspired by [this](https://github.com/rust-lang/rust/issues/72186#issuecomment-1987076295) comment.

For some reason we only have that `buf` warning in `read` and `read_exact`, even though it affects a bunch of other functions of this trait as well. It doesn't seem worth copy-pasting the same text everywhere though so I did not change this.
2024-03-10 22:16:42 +01:00
Matthias Krüger
217d00494f
Rollup merge of #122275 - RalfJung:std-oom, r=workingjubilee
disable OOM test in Miri

Needed for https://github.com/rust-lang/miri-test-libstd
2024-03-10 22:16:42 +01:00
ltdk
15b71f491f Add CStr::bytes iterator 2024-03-10 17:04:04 -04:00
bors
3b1717c052 Auto merge of #122306 - workingjubilee:backtrace-0.3.70, r=workingjubilee
Update backtrace submodule to 0.3.70

r? `@ghost`
2024-03-10 20:18:56 +00:00
Erik Desjardins
f18c2f83e9 add -O to some tests which depend on attributes being added 2024-03-10 16:04:12 -04:00
Jubilee Young
caae03c659 Update backtrace submodule to 0.3.70 2024-03-10 12:52:23 -07:00
Nilstrieb
5bcb66cfb3 Add metadata to targets
This adds four pieces of metadata to every target:
- description
- tier
- host tools
- std

This information is currently scattered across target docs and both
- not machine readable, making validation harder
- sometimes subtly encoding by the table it's in, causing mistakes and
  making it harder to review changes to the properties

By putting it in the compiler, we improve this. Later, we will use this
canonical information to generate target documentation from it.
2024-03-10 20:46:08 +01:00
Lukas Markeffsky
e4bafa2b8c fix metadata for dyn-star in new solver 2024-03-10 20:24:00 +01:00
matt rice
dd2cda731a docs: Correct ptr/ref verbiage in SliceIndex docs.
Fixes #122234
2024-03-10 11:50:05 -07:00
Ralf Jung
a7443f5542 test into_boxed_slice with custom allocator in Miri 2024-03-10 18:07:34 +01:00
Ralf Jung
81ebaf27cb RawVec::into_box: avoid unnecessary intermediate reference 2024-03-10 18:07:34 +01:00
bors
af69f4c48c Auto merge of #121561 - jieyouxu:compiletest-directive-typo-check, r=onur-ozkan
Detect typos for compiletest test directives

Checks directives against a known list of compiletest directives collected during migration from legacy-style compiletest directives. A suggestion for the best matching known directive will be made if an invalid directive is found.

This PR does not attempt to implement checks for Makefile directives because they still have the problem of regular comments and directives sharing the same comment prefix `#`.

Closes #83551.
2024-03-10 16:26:18 +00:00
Ralf Jung
89ed992d86 bootstrap: document what the triples in 'Build' mean 2024-03-10 17:14:28 +01:00
onur-ozkan
e5e1fa610b skip sanity check for non-host targets in check builds
For `check` builds, since we only need to perform a sanity check on
the host target, this patch skips target sanity checks on non-host targets.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-10 18:52:21 +03:00
r0cky
c73a7f0bec Remove unused structs in clippy 2024-03-10 23:33:00 +08:00
r0cky
1299aa7c18 Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
bors
9bd88ef612 Auto merge of #122272 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? ghost
2024-03-10 14:29:05 +00:00
Martin Nordholts
ee428c55b2 diagnostics: Do not suggest using #[unix_sigpipe] without a value
Remove `Word` from the `unix_sigpipe` attribute template so that plain
`#[unix_sigpipe]` is not included in suggestions of valid forms of the
attribute. Also re-arrange diagnostics code slightly to avoid duplicate
diagnostics.
2024-03-10 15:12:50 +01:00
Ralf Jung
7d99e80c55 MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
Ralf Jung
d765fb8faf add comments explaining where post-mono const eval errors abort compilation 2024-03-10 14:39:26 +01:00
许杰友 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
39db6a0972 add test ensuring simd codegen checks don't run when a static assertion failed 2024-03-10 12:37:10 +01: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