Commit Graph

240172 Commits

Author SHA1 Message Date
Camille GILLOT
8e9b912c4c FileCheck issue_67019. 2023-12-02 20:38:07 +00:00
Camille GILLOT
ce9b1e23a5 FileCheck issue_66971. 2023-12-02 20:37:05 +00:00
Camille GILLOT
218d8ccf43 FileCheck inherit_overflow. 2023-12-02 20:31:27 +00:00
Camille GILLOT
6086dd6766 FileCheck indirect. 2023-12-02 20:29:47 +00:00
Camille GILLOT
bf5d114da8 FileCheck discriminant. 2023-12-02 20:28:33 +00:00
Camille GILLOT
043d29b58a FileCheck and rename const_prop_fails_gracefully. 2023-12-02 20:23:16 +00:00
Camille GILLOT
7f328d2a44 FileCheck checked_add. 2023-12-02 20:18:58 +00:00
Camille GILLOT
e6a1b77cd1 FileCheck cast. 2023-12-02 20:18:47 +00:00
Camille GILLOT
b8f2f63931 FileCheck boxes. 2023-12-02 20:18:21 +00:00
Camille GILLOT
3fc03948a8 FileCheck boolean_identities. 2023-12-02 20:18:14 +00:00
Camille GILLOT
e8e35c8127 FileCheck bad_op_unsafe_oob_for_slices. 2023-12-02 20:18:02 +00:00
Camille GILLOT
97f03cb898 FileCheck bad_op_mod_by_zero. 2023-12-02 20:17:49 +00:00
Camille GILLOT
0d5bc872a9 FileCheck bad_op_div_by_zero. 2023-12-02 20:17:37 +00:00
Camille GILLOT
9f01d9d1b6 FileCheck array_index. 2023-12-02 20:17:20 +00:00
Camille GILLOT
6564bac532 FileCheck aggregate. 2023-12-02 20:17:04 +00:00
Camille GILLOT
378abbc604 FileCheck address_of_pair. 2023-12-02 20:16:49 +00:00
bors
0908f173fd Auto merge of #118543 - matthiaskrgr:rollup-0kl4o90, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #118514 (rustc_hir_typeck: Fix ICE when probing for non-ASCII function alternative)
 - #118524 (Add more information to StableMIR Instance)
 - #118528 (replace `once_cell::sync::OnceCell` with std `OnceLock`)
 - #118539 (move packed-struct tests into packed/ folder)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-02 16:06:01 +00:00
Matthias Krüger
613f4ec97d
Rollup merge of #118539 - RalfJung:packed-struct-tests, r=lqd
move packed-struct tests into packed/ folder

We already have a bunch of other tests named `packed/packed-struct*`, no reason to have these two tests be separate.
2023-12-02 16:58:41 +01:00
Matthias Krüger
99aadedfe6
Rollup merge of #118528 - onur-ozkan:use-std-once-lock, r=clubby789
replace `once_cell::sync::OnceCell` with std `OnceLock`

> 0919ad1838/src/bootstrap/src/core/builder.rs (L28-L33)

Partially resolves that.
2023-12-02 16:58:41 +01:00
Matthias Krüger
b384767b0a
Rollup merge of #118524 - celinval:smir-instance-def, r=ouz-a
Add more information to StableMIR Instance

Allow stable MIR users to retrieve an instance function signature, the index for a VTable instance and more information about its underlying definition.

These are needed to properly interpret function calls, either via VTable or direct calls. The `CrateDef` implementation will also allow users to emit diagnostic messages.

I also fixed a few issues that we had identified before with how we were retrieving body of things that may not have a body available.
2023-12-02 16:58:40 +01:00
Matthias Krüger
c0f37fa5cf
Rollup merge of #118514 - Enselic:ice-probe, r=cjgillot
rustc_hir_typeck: Fix ICE when probing for non-ASCII function alternative

Closes #118499

Apparently triggered by https://github.com/rust-lang/rust/pull/118381
2023-12-02 16:58:40 +01:00
Ralf Jung
253d61714d move packed-struct tests into packed/ folder 2023-12-02 14:48:07 +01:00
bors
4e3dc976e7 Auto merge of #117912 - GeorgeWort:master, r=petrochenkov
Name explicit registers in conflict register errors for inline assembly
2023-12-02 13:38:47 +00:00
bors
7be0546bd1 Auto merge of #118507 - flip1995:clippy-subtree-sync, r=matthiaskrgr
Clippy subtree sync

r? `@Manishearth`
2023-12-02 11:41:55 +00:00
onur-ozkan
b7e6da80af replace once_cell::sync::OnceCell with std OnceLock
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-02 12:45:23 +03:00
bors
4eede98056 Auto merge of #118498 - RalfJung:valtree-ice, r=lcnr
fix an ICE when a valtree failed to evaluate

Fixes https://github.com/rust-lang/rust/issues/118285

r? `@lcnr`
2023-12-02 09:41:52 +00:00
Ralf Jung
1d120e6169 fix an ICE when a valtree failed to evaluate 2023-12-02 10:38:42 +01:00
bors
0919ad1838 Auto merge of #117754 - matthewjasper:subtype-overflow, r=lcnr
Handle recursion limit for subtype and well-formed predicates

Adds a recursion limit check for subtype predicates and well-formed predicates.
`-Ztrait-solver=next` currently panics with unimplemented for these cases.
These cases are arguably bugs in the occurs check but:
- I could not find a simple way to fix the occurs check
- There should still be a recursion limit check to prevent hangs anyway.

closes #117151

r? types
2023-12-02 06:51:23 +00:00
bors
0355477d19 Auto merge of #118465 - ehuss:update-mdbook, r=Mark-Simulacrum
Update mdbook to 0.4.36

Just a routine update that makes some minor fixes and changes.

Changlog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0436
2023-12-02 04:52:33 +00:00
bors
2da59b8676 Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errors
Cleanup error handlers

Mostly by making function naming more consistent. More to do after this, but this is enough for one PR.

r? compiler-errors
2023-12-02 02:48:34 +00:00
Celina G. Val
c997c6d822 Add more information to stable Instance
- Retrieve `FnSig`.
  - Implement CrateDef for InstanceDef.
  - Add VTable index for Virtual instances.
2023-12-01 16:22:06 -08:00
bors
bd3a22115f Auto merge of #118175 - lqd:unify-live-loans, r=matthewjasper
Centralize live loans maintenance to fix scope differences due to liveness

As found in the recent [polonius crater run](https://github.com/rust-lang/rust/pull/117593#issuecomment-1801398892), NLLs and the location-insensitive polonius computed different scopes on some specific CFG shapes, e.g. the following.

![image](https://github.com/rust-lang/rust/assets/247183/c3649f5e-3058-454e-854e-1a6b336bdd5e)

I had missed that liveness data was pushed from different sources than just the liveness computation: there are a few places that do this -- and some of them may be unneeded or at the very least untested, as no tests changed when I tried removing some of them.

Here, `_6` is e.g. dead on entry to `bb2[0]` during `liveness::trace`, but its regions will be marked as live later during "constraint generation" (which I plan to refactor away and put in the liveness module soon). This should cause the inflowing loans to be marked live, but they were only computed in `liveness::trace`.

Therefore, this PR moves live loan maintenance to `LivenessValues`, so that the various places pushing liveness data will all also update live loans at the same time -- except for promoteds which I don't believe need them, and their liveness handling is already interesting/peculiar.

All the regressions I saw in the initial crater run were related to this kind of shapes, and this change did fix all of them on the [next run](https://github.com/rust-lang/rust/pull/117593#issuecomment-1826132145).

r? `@matthewjasper`

(This will conflict with #117880 but whichever lands first is fine by me, the end goal is the same for both)
2023-12-02 00:04:04 +00:00
Nicholas Nethercote
61f93563d8 Inline and remove LoweringContext::handler().
It has a single call site.
2023-12-02 09:01:35 +11:00
Nicholas Nethercote
8be1d253d2 Remove unnecessary qualifiers. 2023-12-02 09:01:35 +11:00
Nicholas Nethercote
31ac4efb31 Use Session::diagnostic in more places. 2023-12-02 09:01:35 +11:00
Nicholas Nethercote
a179a53565 Use Session::diagnostic in more places. 2023-12-02 09:01:35 +11:00
Nicholas Nethercote
6e9573936f Handler tweaks.
- Avoid unnecessary `inner` local variables.
- Use `borrow_mut` everywhere (instead of the synonym `lock`).
2023-12-02 09:01:34 +11:00
Nicholas Nethercote
cb91235131 Rename LayoutCalculator::delay_bug as LayoutCalculator::delayed_bug.
To match with the previous commits.
2023-12-02 09:01:34 +11:00
Nicholas Nethercote
c9008c6c8b Rename Handler::delay_good_path_bug as Handler::good_path_delayed_bug.
In line with the previous commits.
2023-12-02 09:01:34 +11:00
Nicholas Nethercote
2c337a072c Rename HandlerInner::delayed_span_bugs as HandlerInner::span_delayed_bugs.
For reasons similar to the previous commit.
2023-12-02 09:01:34 +11:00
Nicholas Nethercote
5d1d384443 Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
Nicholas Nethercote
57d6f840b9 Rename *note_without_error as *note.
Because the variant name in `Level` is `Note`, and the `without_error`
suffix is omitted in similar cases like `struct_allow` and
`struct_help`.
2023-12-02 08:58:25 +11:00
Nicholas Nethercote
c3628bb970 Rename HandlerInner::failure as HandlerInner::failure_note.
To match the `FailureNote` variant of `Level`.
2023-12-02 08:58:25 +11:00
Nicholas Nethercote
7138845f61 Rename Handler::span_note_diag as struct_span_note.
Because `span_note_diag` doesn't follow the naming structure used for
the error reporting functions.
2023-12-02 08:58:25 +11:00
Nicholas Nethercote
95be8b2189 Remove an unnecessary local variable. 2023-12-02 08:58:25 +11:00
Nicholas Nethercote
b2a856ea3c Return ErrorGuaranteed from span_err_with_code methods.
`ErrorGuaranteed` should be used for all error methods involving the
`Error` level, e.g. as is done for the corresponding `span_err` methods.
2023-12-02 08:58:24 +11:00
Nicholas Nethercote
f7e3d05aa7 Inline and remove DiagnosticBuilder::new_diagnostic_fatal.
It has a single call site.
2023-12-02 08:58:24 +11:00
bors
8c2b577217 Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix
Restore `#![no_builtins]` crates participation in LTO.

After #113716, we can make `#![no_builtins]` crates participate in LTO again.

`#![no_builtins]` with LTO does not result in undefined references to the error. I believe this type of issue won't happen again.

Fixes #72140.  Fixes #112245. Fixes #110606.  Fixes #105734. Fixes #96486. Fixes #108853. Fixes #108893. Fixes #78744. Fixes #91158. Fixes https://github.com/rust-lang/cargo/issues/10118. Fixes https://github.com/rust-lang/compiler-builtins/issues/347.

 The `nightly-2023-07-20` version does not always reproduce problems due to changes in compiler-builtins, core, and user code. That's why this issue recurs and disappears.
Some issues were not tested due to the difficulty of reproducing them.

r? pnkfelix

cc `@bjorn3` `@japaric` `@alexcrichton` `@Amanieu`
2023-12-01 21:45:18 +00:00
DianQK
b9f53be1e9
Put $(LLVM_BIN_DIR) in quotes to prevent missing backslashes 2023-12-02 04:40:12 +08:00
Martin Nordholts
5c8c3a2c49 rustc_hir_typeck: Fix ICE when probing for non-ASCII function alternative 2023-12-01 21:37:43 +01:00