Commit Graph

251001 Commits

Author SHA1 Message Date
Matthias Krüger
1fd3ee0660
Rollup merge of #123066 - maurer:cfi-erased-lifetime-ice, r=compiler-errors
CFI: (actually) check that methods are object-safe before projecting their receivers to `dyn Trait` in CFI

`trait_object_ty` assumed that associated types would be fully determined by the trait. This is *almost* true - const parameters and type parameters are no longer allowed, but lifetime parameters are. Since we erase all lifetime parameters anyways, instantiate it with as many erased regions as it needs.

Fixes: #123053

r? `@compiler-errors`
2024-03-26 17:06:40 +01:00
Matthias Krüger
6ecbc343f7
Rollup merge of #123047 - ehuss:triagebot-edition-2024, r=fmease
triagebot: Add notification of 2024 issues

This adds a notification for 2024 issues to Zulip.
2024-03-26 17:06:40 +01:00
Matthias Krüger
d549d4f5a7
Rollup merge of #122996 - RalfJung:simplify_branches, r=cjgillot
simplify_branches: add comment

I am not quite sure why this simplification is done here and not in InstSimplify but 🤷

r? `@cjgillot`
2024-03-26 17:06:39 +01:00
Matthias Krüger
03f5c4f05f
Rollup merge of #122766 - bvanjoi:fix-115185, r=petrochenkov
store segment and module in `UnresolvedImportError`

Fixes #115185

An easy fix. r? `@Nilstrieb`
2024-03-26 17:06:38 +01:00
clubby789
c2de5aff71 Revert cargo update changes 2024-03-26 15:36:12 +00:00
Michael Goulet
950b40f111 Don't check match scrutinee of postfix match for unused parens 2024-03-26 11:16:49 -04:00
Samuel Thibault
7b4e507961 unix fs: Make hurd and horizon using explicit new rather than From
408c0ea216 ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.

Fixes #123032
2024-03-26 15:58:00 +01:00
bors
536606bc5d Auto merge of #122939 - joboet:proc_macro_bridge_state, r=petrochenkov
Simplify proc macro bridge state

Currently, `proc_macro` uses a `ScopedCell` to store the client-side proc-macro bridge. Unfortunately, this requires the `Bridge`, which has non-negligible size, to be copied out and back again on every access. In some cases, the optimizer might be able to elide these copies, but in general, this is suboptimal.

This PR removes `ScopedCell` and employs a similar trick as in [`scoped_tls`](https://crates.io/crates/scoped-tls), meaning that the only thing stored in TLS is a pointer to the state, which now is a `RefCell`. Access to the pointer is then scoped so that it is always within the lifetime of the reference to the state. Unfortunately, `scoped_tls` requires the referenced type to be `'static`, which `Bridge` is not, therefore we cannot simply copy that macro but have to reimplement its TLS trick.

This removes the `#[forbid(unsafe_code)]` on the `client` module so that we do not have to export `Bridge`, which currently is private, to the whole crate. I can change that, if necessary.
2024-03-26 13:05:59 +00:00
bjorn3
cfd7325f20
Merge pull request #1469 from rust-lang/fix_some_rustc_tests
Fix a bunch of rustc tests
2024-03-26 12:19:01 +01:00
bjorn3
34d0f6a1d4 Re-enable fixed rustc test 2024-03-26 11:03:50 +00:00
Oli Scherer
3b94f33c23 Remove CacheSelector trait now that we can use GATs 2024-03-26 11:03:23 +00:00
Bryanskiy
17c6101864 Delegation: fix ICE on wrong self resolution 2024-03-26 14:00:51 +03:00
bjorn3
23868af850 Correctly implement --emit 2024-03-26 10:55:46 +00:00
bors
519d892f95 Auto merge of #121387 - oli-obk:eager_const_failures_regression, r=lcnr
Avoid some unnecessary query invocations.

Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything.

should fix the perf regression from https://github.com/rust-lang/rust/pull/121087
2024-03-26 10:52:11 +00:00
bjorn3
ad1886a5f0 Fix rustdoc help message when no args are passed 2024-03-26 10:27:19 +00:00
bjorn3
dc6595ddbc Implement nearbyintf32 and nearbyintf64 and remove two test ignores 2024-03-26 10:18:44 +00:00
bjorn3
60921608f7 Rustup to rustc 1.79.0-nightly (5f2c7d2bf 2024-03-25) 2024-03-26 09:56:55 +00:00
bjorn3
d183a5186f Sync from rust 5f2c7d2bfd 2024-03-26 09:50:48 +00:00
Benoît du Garreau
ff6d9f79ae Unix: Support more platforms with preadv and pwritev 2024-03-26 10:39:14 +01:00
Ali MJ Al-Nasrawy
4e1999d387 ignore uncaptured lifetimes when checking opaques 2024-03-26 09:26:23 +00:00
Ali MJ Al-Nasrawy
92f40b8059 fix ICE in check_unique 2024-03-26 09:26:23 +00:00
Benoît du Garreau
bff13e98ad UnixStream: override read_buf 2024-03-26 10:11:29 +01:00
ding-young
a241ffc6b6 Fix link to BufWriter 2024-03-26 18:04:19 +09:00
bors
b13a71a2e7 Auto merge of #123081 - Muscraft:update-cargo, r=Muscraft,workingjubilee
Update cargo

5 commits in a510712d05c6c98f987af24dd73cdfafee8922e6..499a61ce7a0fc6a72040084862a68b2603e770e8
2024-03-25 03:45:54 +0000 to 2024-03-26 04:17:04 +0000
- fix: do not borrow shell across registry query (rust-lang/cargo#13647)
- Do not strip debuginfo by default for MSVC (rust-lang/cargo#13630)
- chore(deps): update msrv (rust-lang/cargo#13577)
- Fix doc collision for lib/bin with a dash in the inferred name. (rust-lang/cargo#13640)
- refactor: Make lint names snake_case (rust-lang/cargo#13635)

r? ghost
2024-03-26 08:49:46 +00:00
Havard Eidnes
1ad3954668 std library unix/thread.rs: fix NetBSD code for ILP32 CPUs. 2024-03-26 08:39:42 +00:00
onur-ozkan
69af113f44 enable cargo miri test doctests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-26 10:27:34 +03:00
bors
73476d4990 Auto merge of #122849 - clubby789:no-metadata, r=petrochenkov
Don't emit load metadata in debug mode

r? `@ghost`
2024-03-26 06:46:43 +00:00
Scott Schafer
3d58ef9e3c
Update cargo 2024-03-26 00:06:06 -06:00
Matthew Maurer
2c0a8de0b9 CFI: Enable KCFI testing of run-pass tests
This enables KCFI-based testing for all the CFI run-pass tests in the
suite today. We can add the test header on top of in-flight CFI tests
once they land.

It also enables KCFI as a sanitizer for x86_64 and aarch64 Linux to make
this possible. The sanitizer should likely be available for all aarch64,
x86_64, and riscv targets, but that isn't critical for initial testing.
2024-03-26 03:16:41 +00:00
bors
8b9e47c136 Auto merge of #123065 - workingjubilee:rollup-bve45ex, r=workingjubilee
Rollup of 10 pull requests

Successful merges:

 - #122707 (Fix a typo in the alloc::string::String docs)
 - #122769 (extend comments for reachability set computation)
 - #122892 (fix(bootstrap/dist): use versioned dirs when vendoring)
 - #122896 (Update stdarch submodule)
 - #122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.)
 - #122950 (Add regression tests for #101903)
 - #123039 (Update books)
 - #123042 (Import the 2021 prelude in the core crate)
 - #123044 (`Instance` is `Copy`)
 - #123051 (did I mention that tests are super cool? )

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-26 02:07:49 +00:00
Kevin Reid
22da5e0082
Add my former address to .mailmap 2024-03-25 18:48:54 -07:00
Zalathar
1cca2529d1 coverage: Re-enable UnreachablePropagation for coverage builds 2024-03-26 11:46:04 +11:00
Zalathar
54116c8cae coverage: Detect functions that have lost all their coverage statements
If a function was instrumented for coverage, but all of its coverage statements
have been removed by later MIR transforms, it should be treated as "unused"
even if the compiler generates an unreachable stub for it.
2024-03-26 11:46:04 +11:00
Zalathar
e3f66b2493 coverage: Overhaul the search for unused functions 2024-03-26 11:46:04 +11:00
Zalathar
5ddc4f24cc coverage: Inline creating a dummy instance for unused functions 2024-03-26 11:29:38 +11:00
Eric Huss
d0bf6e6948 triagebot: Add notification of 2024 issues 2024-03-25 17:29:04 -07:00
bors
c98ea0d808 Auto merge of #111769 - saethlin:ctfe-backtrace-ctrlc, r=RalfJung
Print a backtrace in const eval if interrupted

Demo:
```rust
#![feature(const_eval_limit)]
#![const_eval_limit = "0"]

const OW: u64 = {
    let mut res: u64 = 0;
    let mut i = 0;
    while i < u64::MAX {
        res = res.wrapping_add(i);
        i += 1;
    }
    res
};

fn main() {
    println!("{}", OW);
}
```
```
╭ ➜ ben@archlinux:~/rust
╰ ➤ rustc +stage1 spin.rs
^Cerror[E0080]: evaluation of constant value failed
 --> spin.rs:8:33
  |
8 |         res = res.wrapping_add(i);
  |                                 ^ Compilation was interrupted

note: erroneous constant used
  --> spin.rs:15:20
   |
15 |     println!("{}", OW);
   |                    ^^

note: erroneous constant used
  --> spin.rs:15:20
   |
15 |     println!("{}", OW);
   |                    ^^
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
```
2024-03-26 00:04:03 +00:00
Michael Goulet
fc1d7d275b Extract helper, fix comment on DerefPure 2024-03-25 19:39:45 -04:00
Michael Goulet
5fdc7555c1 Require DerefMut if deref pattern has nested ref mut binding 2024-03-25 19:39:45 -04:00
Michael Goulet
b56279569b Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
Nadrieril
d1d9aa3108 Consistently merge simplifiable or-patterns 2024-03-25 23:52:17 +01:00
Matthew Maurer
70e1d23895 CFI: Pad out associated type resolution with erased lifetimes
`trait_object_ty` assumed that associated types would be fully
determined by the trait. This is *almost* true - const parameters and
type parameters are no longer allowed, but lifetime parameters are.
Since we erase all lifetime parameters anyways, instantiate it with as
many erased regions as it needs.

Fixes: #123053
2024-03-25 22:46:21 +00:00
Nadrieril
08d7379961 Use the correct span for simplifying or-patterns
We have to make sure we set it everywhere that we set `subcandidates`.
2024-03-25 23:46:18 +01:00
Lukas Wirth
3d65c92040 Replace implementation with @RUSTC_BUILTIN prefix substitution var 2024-03-25 22:20:13 +00:00
Lukas Wirth
2fae4ee92e Make sysroot mandatory for rustdoc 2024-03-25 22:19:41 +00:00
Lukas Wirth
9ae4e3eb7c Make use of sysroot in librustdoc/config.rs for builtin:$path 2024-03-25 22:18:32 +00:00
Lukas Wirth
91547573af Implement -L builtin:$path 2024-03-25 22:18:31 +00:00
Jubilee
56e8f67c87
Rollup merge of #123051 - matthiaskrgr:casetest, r=workingjubilee
did I mention that tests are super cool?

Fixes https://github.com/rust-lang/rust/issues/81974
Fixes https://github.com/rust-lang/rust/issues/84727
Fixes https://github.com/rust-lang/rust/issues/92979
2024-03-25 14:35:38 -07:00
Jubilee
77de550c61
Rollup merge of #123044 - compiler-errors:instance, r=oli-obk
`Instance` is `Copy`

No reason to take it by value; it was confusing ``@rcvalle`` to see it being mutated when it's also being passed by ref in some places.
2024-03-25 14:35:37 -07:00
Jubilee
ac0a9c58e8
Rollup merge of #123042 - dpaoliello:prelude, r=Nilstrieb
Import the 2021 prelude in the core crate

The `core` crate currently imports the v1 prelude
b3df0d7e5e/library/core/src/lib.rs (L285-L287)

This recently caused an issue when updating the `portable-simd` subtree since it was using a trait that was added to the 2021 prelude: https://github.com/rust-lang/rust/pull/122905#discussion_r1536228822

To make it easier to have a consistent build environment for subtrees and submodules that get included in `core`, we will now import the 2021 prelude into `core`.

Fixes #122912

r? `@Nilstrieb`
2024-03-25 14:35:37 -07:00