Commit Graph

247203 Commits

Author SHA1 Message Date
bors
55dcf9c0ce Auto merge of #3318 - RalfJung:compiletest-rebuilds, r=oli-obk
compiletest: call cargo-miri directly rather than via 'cargo run'

Fixes https://github.com/rust-lang/miri/issues/3297. Thanks to `@bjorn3` for figuring out the cause of this.

r? `@oli-obk`
2024-02-24 19:46:12 +00:00
bors
6bdb8a4a96 Auto merge of #121523 - matthiaskrgr:comp_comp, r=Nilstrieb
compiler: clippy::complexity fixes
2024-02-24 19:07:20 +00:00
bors
4db9a3652a Auto merge of #3312 - RossSmyth:miri-clean, r=RalfJung
Add "cargo miri clean" command

My first reaction when my miri cache was messed up was to attempt run this, which obviously failed. This helps paper over platform differences and such.
2024-02-24 18:00:29 +00:00
Ralf Jung
cd36cda60c compiletest: call cargo-miri directly rather than via 'cargo run' 2024-02-24 18:27:38 +01:00
Ross Smyth
3e7c2e1f6d Add "cargo miri clean" command 2024-02-24 11:58:40 -05:00
bors
2f1c9db3cf Auto merge of #3316 - RossSmyth:windows-script, r=RalfJung
Windows miri-script execution egronomics

This allows for Windows users to use miri-script without pain. As working on miri earlier I was doing
`.\miri-script\target\debug\miri-script.exe { install | build | ... }` which wasn't fun.
2024-02-24 16:30:37 +00:00
Ross Smyth
c7be4439ad Windows miri-script execution egronomics
This allows for Windows users to use miri-script without pain
2024-02-24 11:16:15 -05:00
Pavel Grigorenko
613cb3262d
compiler: use addr_of! 2024-02-24 18:53:48 +03:00
Martin Nordholts
f5b9eaf18f Don't unnecessarily change SIGPIPE disposition in unix_sigpipe tests
In `auxiliary/sigpipe-utils.rs`, all we want to know is the current
`SIGPIPE` disposition. We should not change it. So use `libc::sigaction`
instead of `libc::signal`. That way we can also remove the code that
restores it.
2024-02-24 16:18:34 +01:00
Gary Guo
f08e2d4137 Forbid use of extern "C-unwind" inside standard library
Those libraries are build with `-C panic=unwind` and is expected to
be linkable to `-C panic=abort` library. To ensure unsoundness
compiler needs to prevent a `C-unwind` call to exist, as doing so may leak
foreign exceptions into `-C panic=abort`.
2024-02-24 14:53:04 +00:00
Matthias Krüger
ee23b78161
Rollup merge of #121542 - RalfJung:stdarch, r=Amanieu
update stdarch

r? `@Amanieu`
2024-02-24 15:35:15 +01:00
Matthias Krüger
7e8fa8fb24
Rollup merge of #121539 - Enselic:fix-large-move, r=Nilstrieb
compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move

Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`

Part of https://github.com/rust-lang/rust/issues/83518

The goal is to enable the lint by default at one point. There are many cases where it needs to be allowed. But here we don't need to allow it. We can simply fix it.

I don't want to enable the lint in the file, because I don't want the "default size threshold for when a value is OK to move" to be duplicated in many places. We'll want the threshold in one central place once we enable it by default.
2024-02-24 15:35:15 +01:00
Matthias Krüger
d978a1c671
Rollup merge of #121531 - saethlin:ignore-less-debug, r=compiler-errors
Ignore less tests in debug builds

Since https://github.com/rust-lang/rust/pull/120594 and https://github.com/rust-lang/rust/pull/120863, nearly all UB-detecting debug assertions get compiled out of code that is monomorphized by a crate built with debug assertions disabled.

Which means that if we default all our codegen tests to `-Cdebug-assertions=no`, most of them work just fine against a sysroot built with debug assertions.

I also tried to explain a bit better why some tests need to be skipped, for those that still need to be skipped.
2024-02-24 15:35:14 +01:00
Matthias Krüger
b87a713b9d
Rollup merge of #121522 - RalfJung:insert-extract-boundscheck, r=oli-obk
check that simd_insert/extract indices are in-bounds

Fixes https://github.com/rust-lang/rust/issues/77477
r? `@oli-obk`
2024-02-24 15:35:14 +01:00
Matthias Krüger
3b827731d0
Rollup merge of #121520 - matthiaskrgr:cloned, r=jackh726
delay cloning of iterator items
2024-02-24 15:35:13 +01:00
Matthias Krüger
dbe33982cc
Rollup merge of #121490 - gurry:121106-broken-usize-link-in-docs, r=notriddle
Rustdoc: include crate name in links for local primitives

Fixes #121106.

This change makes links to primitives easier to use when the path of the page where they will be embedded is not known beforehand such as when we generate impls dynamically from the `register_type_impls` method in `main.js`, which is exactly what is happening in #121106.

An example to show the effect of this change: earlier, if the current page in `cx.current` inside `primitive_link_fragment()` was `std::simd::prelude::Simd` the generated path would be `../../primitive.<prim>.html`. Now it would be `../../../std/primitive.<prim>.html` instead.

A side effect of the change is that local primitive links _everywhere_ will now contain the crate name, even outside of the dynamic situation mentioned above. I'm not sure if there are any major downsides of that other than making the links a bit longer. Ideally I wanted to restrict this behaviour change to only the dynamic cases. We could have achieved that by passing an additional bool arg to `primitive_link_fragment()`, but it felt awkward to do so. Any alternative suggestions are welcome.
2024-02-24 15:35:13 +01:00
Matthias Krüger
b10ef3c6bc
Rollup merge of #121435 - estebank:rpitit-static-119773, r=compiler-errors
Account for RPITIT in E0310 explicit lifetime constraint suggestion

When given

```rust
trait Original {
    fn f() -> impl Fn();
}

trait Erased {
    fn f(&self) -> Box<dyn Fn()>;
}

impl<T: Original> Erased for T {
    fn f(&self) -> Box<dyn Fn()> {
        Box::new(<T as Original>::f())
    }
}
```

emit do not emit an invalid suggestion restricting the `Trait::{opaque}` type in a `where` clause:

```
error[E0310]: the associated type `<T as Original>::{opaque#0}` may not live long enough
  --> $DIR/missing-static-bound-from-impl.rs:11:9
   |
LL |         Box::new(<T as Original>::f())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         the associated type `<T as Original>::{opaque#0}` must be valid for the static lifetime...
   |         ...so that the type `impl Fn()` will meet its required lifetime bounds
```

Partially address #119773. Ideally we'd suggest modifying `Erased::f` instead.

r? `@compiler-errors`
2024-02-24 15:35:12 +01:00
Pavel Grigorenko
ff187a92d8
library: use addr_of! 2024-02-24 16:02:17 +03:00
Ralf Jung
f32095cd8d promotion: don't promote int::MIN / -1 2024-02-24 12:17:37 +01:00
Ralf Jung
55ee14005f update stdarch 2024-02-24 12:15:21 +01:00
bors
4a8d0f7f56 Auto merge of #16654 - graemer957:feature/short_version_flag, r=lnicola
Add short flag -V for consistency with other rust tooling

Minor change to add the `-V` short flag to `rust-analyzer` to bring it in-line with other rust tooling such as:

> rustc -V
```bash
rustc 1.76.0 (07dca489a 2024-02-04)
```

> rustup -V
```bash
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.76.0 (07dca489a 2024-02-04)`
```

> cargo -V
```bash
cargo 1.76.0 (c84b36747 2024-01-18)
```
2024-02-24 09:51:32 +00:00
Martin Nordholts
ff930d4fed compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move
Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`
2024-02-24 09:46:18 +01:00
Guillaume Boisseau
de4efa5e46
Tweak debug!() call
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2024-02-24 09:17:26 +01:00
Graeme Read
30429f8ece
feat: Add short flag -V for consistency with other rust tooling 2024-02-24 06:45:00 +00:00
Gurinder Singh
e0bfa5c294 Rustdoc: include crate name in links for local primitives
It makes the link easier to use in cases in which
the path of the page where it will be embedded is not
known beforehand such as when we generate impls
dynamically from `register_type_impls` method in
`main.js`

Earlier for local primitives we would generate a path
that was relative to the current page depth passed in `cx.current`
. e.g if the current page was `std::simd::prelude::Simd` the
generated path would be `../../primitive.<prim>.html`  After this
change the path will first take you to the the wesite root and add
the crate name. e.g. for `std::simd::prelude::Simd` the path now
will be `../../../std/primitive.<prim>.html`
2024-02-24 10:34:09 +05:30
zachs18
8aaa04b5c5
Apply suggestions from code review
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2024-02-23 20:18:04 -06:00
Ben Kimock
2f3c0b9859 Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
Wojciech Geisler
7234c9893d Fix incorrect doc of ScopedJoinHandle::is_finished
Fixes the explanation how to use is_finished to achieve a non-blocking
join. The updated version matches the documentation of the non-scoped
JoinHandle::is_finished.
2024-02-24 00:39:00 +02:00
bors
8f359beca4 Auto merge of #119536 - Jules-Bertholet:const-barrier, r=dtolnay
Make `Barrier::new()` const

I guess this was just missed in #97791?

`@rustbot` label T-libs-api -T-libs
2024-02-23 20:54:02 +00:00
bors
03b3cb6be9 Auto merge of #16652 - davidbarsky:david/deadlock-fix-for-16643, r=Veykril
internal: fix deadlock introduced by #16643

This fixes a deadlock introduced by #16643 ([backtrace](https://gist.github.com/davidbarsky/00f17598f5496a9c41aff31fec1c42d6)). `maybe_changed_after` calls back into other queries, so the cloning here is unfortunately inevitable.

(Zulip conversation: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Fixing.20proc-macro.20dirtying.20with.20unindexed.20projects)
2024-02-23 20:39:13 +00:00
David Barsky
64779737db internal: fix deadlock introduced by #16643 2024-02-23 15:34:23 -05:00
bors
12144045fe Auto merge of #16650 - Veykril:metrics-rustc, r=Veykril
Fix: Fix metrics CI failing
2024-02-23 19:23:45 +00:00
Lukas Wirth
0c3a524acb Fix: Fix metrics CI failing 2024-02-23 20:22:01 +01:00
bors
40dc2b4bd2 Auto merge of #3314 - RalfJung:up, r=RalfJung
cargo update
2024-02-23 19:21:01 +00:00
Ralf Jung
7bc0435c9a cargo update 2024-02-23 20:19:00 +01:00
Matthias Krüger
86a7fc840f compiler: clippy::complexity fixes 2024-02-23 19:56:35 +01:00
bors
2dbd6233cc Auto merge of #121303 - GrigorenkoPV:static_mut_refs, r=oli-obk,RalfJung
Get rid of some `#![allow(static_mut_refs)]`
2024-02-23 18:52:47 +00:00
bors
838523dcc2 Auto merge of #16621 - txase:no-build-with-bootstrap, r=Veykril
fix: Recompiles due to RUSTC_BOOTSTRAP

Some packages (e.g. thiserror) force a recompile if the value of the `RUSTC_BOOTSTRAP` env var changes. RA sets the variable to 1 in order to enable rustc / cargo unstable options. This causes flapping recompiles when building outside of RA.

Fixes #15057
2024-02-23 18:46:33 +00:00
Ralf Jung
134e2b2056 interpret: do no ICE on OOB shuffle/insert/extract indices 2024-02-23 19:43:59 +01:00
Ralf Jung
8e0dd993d6 check that simd_insert/extract indices are in-bounds 2024-02-23 19:43:59 +01:00
bors
c45b3550c3 Auto merge of #16649 - Veykril:metrics-rustc, r=Veykril
internal: Disable rustc test metrics

The CI job for them frequently gets stuck and I am unsure why
2024-02-23 18:33:46 +00:00
Lukas Wirth
d9a08624aa internal: Disable rustc test metrics 2024-02-23 19:31:53 +01:00
Matthias Krüger
62cb9d1a97 delay cloning of iterator items 2024-02-23 19:07:42 +01:00
bors
84c5481349 Auto merge of #16648 - Veykril:metrics-rustc, r=Veykril
internal: Pin commit of rust-lang/rust for rustc-test metrics
2024-02-23 16:27:56 +00:00
bors
21033f637e Auto merge of #121514 - matthiaskrgr:rollup-5f0vhv7, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #120742 (mark `min_exhaustive_patterns` as complete)
 - #121470 (Don't ICE on anonymous struct in enum variant)
 - #121492 (coverage: Rename `is_closure` to `is_hole`)
 - #121495 (remove repetitive words)
 - #121498 (Make QNX/NTO specific "timespec capping" public to crate::sys)
 - #121510 (lint-overflowing-ops: unify cases and remove redundancy)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-23 16:26:49 +00:00
Lukas Wirth
c6a6e63a45 internal: Pin commit of rust-lang/rust for rustc-test metrics 2024-02-23 17:24:29 +01:00
Matthias Krüger
06e54f8d49
Rollup merge of #121510 - RalfJung:lint-overflowing-ops, r=oli-obk
lint-overflowing-ops: unify cases and remove redundancy

Follow-up to https://github.com/rust-lang/rust/pull/121432
r? `@oli-obk`
2024-02-23 17:02:06 +01:00
Matthias Krüger
2e8177a208
Rollup merge of #121498 - flba-eb:make_timespec_capping_public, r=Nilstrieb
Make QNX/NTO specific "timespec capping" public to crate::sys

It is used in:

- `library/std/src/sys/locks/condvar/pthread.rs`
- `library/std/src/sys/pal/unix/thread_parking/pthread.rs`

This is probably required due to introduction of `sys/pal` and #121177

`@rustbot` label +O-neutrino
CC: `@jonathanpallant` `@japaric` `@gh-tr`
2024-02-23 17:02:05 +01:00
Matthias Krüger
15b77953d7
Rollup merge of #121495 - cuishuang:master, r=clubby789
remove repetitive words
2024-02-23 17:02:05 +01:00
Matthias Krüger
13b9bf5024
Rollup merge of #121492 - Zalathar:hole, r=fmease
coverage: Rename `is_closure` to `is_hole`

Extracted from #121433, since I was having second thoughts about some of the other changes bundled in that PR, but these changes are still fine.

---

When refining covspans, we don't specifically care which ones represent closures; we just want to know which ones represent "holes" that should be carved out of other spans and then discarded.

(Closures are currently the only source of hole spans, but in the future we might want to also create hole spans for nested items and inactive `#[cfg(..)]` regions.)

``@rustbot`` label +A-code-coverage
2024-02-23 17:02:04 +01:00