about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-02Rollup merge of #118528 - onur-ozkan:use-std-once-lock, r=clubby789Matthias Krüger-15/+14
replace `once_cell::sync::OnceCell` with std `OnceLock` > https://github.com/rust-lang/rust/blob/0919ad18381f6f4fcaddc809e786553e028bbde0/src/bootstrap/src/core/builder.rs#L28-L33 Partially resolves that.
2023-12-02Rollup merge of #118524 - celinval:smir-instance-def, r=ouz-aMatthias Krüger-20/+134
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-02Rollup merge of #118514 - Enselic:ice-probe, r=cjgillotMatthias Krüger-4/+14
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-02Auto merge of #117912 - GeorgeWort:master, r=petrochenkovbors-22/+43
Name explicit registers in conflict register errors for inline assembly
2023-12-02Auto merge of #118507 - flip1995:clippy-subtree-sync, r=matthiaskrgrbors-1174/+3660
Clippy subtree sync r? `@Manishearth`
2023-12-02replace `once_cell::sync::OnceCell` with std `OnceLock`onur-ozkan-15/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-02Auto merge of #118498 - RalfJung:valtree-ice, r=lcnrbors-2/+25
fix an ICE when a valtree failed to evaluate Fixes https://github.com/rust-lang/rust/issues/118285 r? `@lcnr`
2023-12-02fix an ICE when a valtree failed to evaluateRalf Jung-2/+25
2023-12-02Auto merge of #117754 - matthewjasper:subtype-overflow, r=lcnrbors-5/+130
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-02Auto merge of #118465 - ehuss:update-mdbook, r=Mark-Simulacrumbors-6/+27
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-02Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errorsbors-517/+495
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-01Add more information to stable InstanceCelina G. Val-20/+134
- Retrieve `FnSig`. - Implement CrateDef for InstanceDef. - Add VTable index for Virtual instances.
2023-12-02Auto merge of #118175 - lqd:unify-live-loans, r=matthewjasperbors-102/+144
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-02Inline and remove `LoweringContext::handler()`.Nicholas Nethercote-6/+2
It has a single call site.
2023-12-02Remove unnecessary qualifiers.Nicholas Nethercote-3/+3
2023-12-02Use `Session::diagnostic` in more places.Nicholas Nethercote-40/+33
2023-12-02Use `Session::diagnostic` in more places.Nicholas Nethercote-66/+51
2023-12-02`Handler` tweaks.Nicholas Nethercote-8/+6
- Avoid unnecessary `inner` local variables. - Use `borrow_mut` everywhere (instead of the synonym `lock`).
2023-12-02Rename `LayoutCalculator::delay_bug` as `LayoutCalculator::delayed_bug`.Nicholas Nethercote-5/+5
To match with the previous commits.
2023-12-02Rename `Handler::delay_good_path_bug` as `Handler::good_path_delayed_bug`.Nicholas Nethercote-25/+28
In line with the previous commits.
2023-12-02Rename `HandlerInner::delayed_span_bugs` as `HandlerInner::span_delayed_bugs`.Nicholas Nethercote-21/+21
For reasons similar to the previous commit.
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-278/+309
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-12-02Rename `*note_without_error` as `*note`.Nicholas Nethercote-45/+25
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-02Rename `HandlerInner::failure` as `HandlerInner::failure_note`.Nicholas Nethercote-4/+4
To match the `FailureNote` variant of `Level`.
2023-12-02Rename `Handler::span_note_diag` as `struct_span_note`.Nicholas Nethercote-4/+4
Because `span_note_diag` doesn't follow the naming structure used for the error reporting functions.
2023-12-02Remove an unnecessary local variable.Nicholas Nethercote-2/+1
2023-12-02Return `ErrorGuaranteed` from `span_err_with_code` methods.Nicholas Nethercote-3/+4
`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-02Inline and remove `DiagnosticBuilder::new_diagnostic_fatal`.Nicholas Nethercote-9/+1
It has a single call site.
2023-12-01Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelixbors-89/+133
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-02Put `$(LLVM_BIN_DIR)` in quotes to prevent missing backslashesDianQK-1/+1
2023-12-01rustc_hir_typeck: Fix ICE when probing for non-ASCII function alternativeMartin Nordholts-4/+14
2023-12-01Auto merge of #117248 - ChrisDenton:ci-symlink, r=m-ou-sebors-1/+1
Error if symlinks are not supported in CI In CI we want to run as many tests as possible and be alerted if a test isn't run for any reason.
2023-12-01Handle recursion limit for subtype and well-formed predicatesMatthew Jasper-5/+130
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-1174/+3660
2023-12-01Auto merge of #11903 - flip1995:rustup, r=flip1995bors-242/+257
Rustup r? `@ghost` changelog: none
2023-12-01Bump nightly version -> 2023-12-01Philipp Krones-1/+1
2023-12-01Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1214/+3715
2023-12-01Auto merge of #115993 - bvanjoi:fix-115966, r=petrochenkovbors-32/+118
vis note for no pub reexports glob import Fixes #115966 Only trigger the `unused_import` lint when it's not being used. r? `@petrochenkov`
2023-12-01Fix link name for `extern "C"` in msvcDianQK-1/+2
2023-12-01improve NLL/polonius scope equality assertionRémy Rakic-1/+2
2023-12-01add tests from crater for liveness causing scope differencesRémy Rakic-0/+46
2023-12-01move and maintain live loans in `LivenessValues`Rémy Rakic-97/+94
Liveness data is pushed from multiple parts of NLL. Instead of changing the call sites to maintain live loans, move the latter to `LivenessValues` where this liveness data is pushed to, and maintain live loans there. This fixes the differences in polonius scopes on some CFGs where a variable was dead in tracing but as a MIR terminator its regions were marked live from "constraint generation"
2023-12-01rename a couple of trivial variablesRémy Rakic-3/+3
for consistency with how they're named everywhere else
2023-12-01remove useless debug logRémy Rakic-2/+0
2023-12-01Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstriebbors-90/+41
Stabilize C string literals RFC: https://rust-lang.github.io/rfcs/3348-c-str-literal.html Tracking issue: https://github.com/rust-lang/rust/issues/105723 Documentation PR (reference manual): https://github.com/rust-lang/reference/pull/1423 # Stabilization report Stabilizes C string and raw C string literals (`c"..."` and `cr#"..."#`), which are expressions of type [`&CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html). Both new literals require Rust edition 2021 or later. ```rust const HELLO: &core::ffi::CStr = c"Hello, world!"; ``` C strings may contain any byte other than `NUL` (`b'\x00'`), and their in-memory representation is guaranteed to end with `NUL`. ## Implementation Originally implemented by PR https://github.com/rust-lang/rust/pull/108801, which was reverted due to unintentional changes to lexer behavior in Rust editions < 2021. The current implementation landed in PR https://github.com/rust-lang/rust/pull/113476, which restricts C string literals to Rust edition >= 2021. ## Resolutions to open questions from the RFC * Adding C character literals (`c'.'`) of type `c_char` is not part of this feature. * Support for `c"..."` literals does not prevent `c'.'` literals from being added in the future. * C string literals should not be blocked on making `&CStr` a thin pointer. * It's possible to declare constant expressions of type `&'static CStr` in stable Rust (as of v1.59), so C string literals are not adding additional coupling on the internal representation of `CStr`. * The unstable `concat_bytes!` macro should not accept `c"..."` literals. * C strings have two equally valid `&[u8]` representations (with or without terminal `NUL`), so allowing them to be used in `concat_bytes!` would be ambiguous. * Adding a type to represent C strings containing valid UTF-8 is not part of this feature. * Support for a hypothetical `&Utf8CStr` may be explored in the future, should such a type be added to Rust.
2023-12-01Auto merge of #118216 - lqd:constraint-generation-non-non, r=matthewjasperbors-432/+454
Refactor NLL constraint generation and most of polonius fact generation As discussed in #118175, NLL "constraint generation" is only about liveness, but currently also contains legacy polonius fact generation. The latter is quite messy, and this PR cleans this up to prepare for its future removal: - splits polonius fact generation out of NLL constraint generation - merges NLL constraint generation to its more natural place, liveness - extracts all of the polonius fact generation from NLLs apart from MIR typeck (as fact generation is somewhat in a single place there already, but should be cleaned up) into its own explicit module, with a single entry point instead of many. There should be no behavior changes, and tests seem to behave the same as master: without polonius, with legacy polonius, with the in-tree polonius. I've split everything into smaller logical commits for easier review, as it required quite a bit of code to be split and moved around, but it should all be trivial changes. r? `@matthewjasper`
2023-12-01Auto merge of #118493 - TaKO8Ki:rollup-jfkdbyo, r=TaKO8Kibors-124/+116
Rollup of 3 pull requests Successful merges: - #118483 (rustdoc: `div.where` instead of fmt-newline class) - #118486 (generic_const_exprs: suggest to add the feature, not use it) - #118489 (Wesley is on vacation) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-01Auto merge of #11898 - clubby789:upper_case_acronyms_variants, r=Manishearthbors-14/+41
Allow `allow`ing `upper_case_acronyms` on enum variants Fixes #7708 changelog: [`upper_case_acronyms`]: allow `allow`ing on enum variants
2023-12-01Rollup merge of #118489 - wesleywiser:vacation, r=wesleywiserTakayuki Maeda-1/+1
Wesley is on vacation OOF until Dec-11 🏖️
2023-12-01Rollup merge of #118486 - RalfJung:add-feature, r=compiler-errorsTakayuki Maeda-74/+74
generic_const_exprs: suggest to add the feature, not use it Usually our missing feature messages look something like ``` = help: add `#![feature(inline_const)]` to the crate attributes to enable ``` However `generic_const_exprs` used a different verb. That's inconsistent and it also means playground won't add that nice hyperlink to add the feature automatically. So let's use the same verb as everywhere else.