about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-08-19remove redundant var rebindingsMatthias Krüger-7/+2
2023-08-18Auto merge of #114591 - joboet:thread_parking_ordering_fix, r=thomccbors-11/+6
Synchronize with all calls to `unpark` in id-based thread parker [The documentation for `thread::park`](https://doc.rust-lang.org/nightly/std/thread/fn.park.html#memory-ordering) guarantees that "park synchronizes-with all prior unpark operations". In the id-based thread parking implementation, this is not implemented correctly, as the state variable is reset with a simple store, so there will not be a *synchronizes-with* edge if an `unpark` happens just before the reset. This PR corrects this, replacing the load-check-reset sequence with a single `compare_exchange`.
2023-08-18Auto merge of #114915 - nnethercote:Nonterminal-cleanups, r=petrochenkovbors-92/+120
`Nonterminal`-related cleanups In #114647 I am trying to remove `Nonterminal`. It has a number of preliminary cleanups that are worth merging even if #114647 doesn't merge, so let's do them in this PR. r? `@petrochenkov`
2023-08-18Auto merge of #113814 - ChoKyuWon:master, r=davidtwcobors-1/+16
Replace the \01__gnu_mcount_nc to LLVM intrinsic for ARM Current `-Zinstrument-mcount` for ARM32 use the `\01__gnu_mcount_nc` directly for its instrumentation function. However, the LLVM does not use this mcount function directly, but it wraps it to intrinsic, `llvm.arm.gnu.eabi.mcount` and the transform pass also only handle the intrinsic. As a result, current `-Zinstrument-mcount` not work on ARM32. Refer: https://github.com/namhyung/uftrace/issues/1764 This commit replaces the mcount name from native function to the LLVM intrinsic so that the transform pass can handle it.
2023-08-18Auto merge of #111908 - c410-f3r:yetegdfqwer, r=petrochenkovbors-1/+44
[RFC-3086] Restrict the parsing of `count` Fix #111904 The original RFC didn't mention the possibility of using `${count(t,)}` and such thing isn't very semantically accurate which can lead to confusion.
2023-08-18Auto merge of #114948 - compiler-errors:normalize-before-freeze, r=lcnrbors-1/+185
Normalize before checking if local is freeze in `deduced_param_attrs` Not normalizing the local type eagerly results in possibly exponential amounts of normalization happening downstream in `is_freeze_raw`. Fixes #113372
2023-08-18Rename `NtOrTt` as `ParseNtResult`.Nicholas Nethercote-8/+8
It's more descriptive, and future-proofs it if/when additional variants get added.
2023-08-18Make enum decoding errors more informative.Nicholas Nethercote-2/+2
By printing the actual value, as long as the expected range. I found this helpful when I encountered one of these errors.
2023-08-18Use `interpolated_or_expr_span` in one suitable place.Nicholas Nethercote-7/+1
2023-08-18Refactor `interpolated_or_expr_span`.Nicholas Nethercote-20/+12
It's much more complicated than it needs to be, and it doesn't modify the expression. We can do the `Result` handling outside of it, and change it to just return a span. Also fix an errant comma that makes the comment hard to read.
2023-08-18Auto merge of #114611 - nnethercote:type-system-chess, r=compiler-errorsbors-10/+27
Speed up compilation of `type-system-chess` [`type-system-chess`](https://github.com/rust-lang/rustc-perf/pull/1680) is an unusual program that implements a compile-time chess position solver in the trait system(!) This PR is about making it compile faster. r? `@ghost`
2023-08-18Auto merge of #114938 - flip1995:clippy_backport, r=matthiaskrgrbors-36/+201
Clippy backport r? `@Manishearth` This is the accompanying PR to https://github.com/rust-lang/rust/pull/114937. This needs to be merged before tomorrow, so that it gets into master, before beta is branched. The second commit is pretty much an out-of cycle sync, so that we don't get backport-debt for next release cycle right away. cc `@Mark-Simulacrum` also mentioning you here, to make sure this is included in the beta branching.
2023-08-18Auto merge of #114951 - cuviper:rollup-iitoep5, r=cuviperbors-338/+223
Rollup of 5 pull requests Successful merges: - #113715 (Unstable Book: update `lang_items` page and split it) - #114897 (Partially revert #107200) - #114913 (Fix suggestion for attempting to define a string with single quotes) - #114931 (Revert PR #114052 to fix invalid suggestion) - #114944 (update `thiserror` to version >= 1.0.46) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-17Rollup merge of #114944 - lqd:fix-thiserror, r=RalfJungJosh Stone-4/+4
update `thiserror` to version >= 1.0.46 1.0.46 version is the one with [the workaround](https://github.com/dtolnay/thiserror/pull/248) for #114839. I'm also encountering this issue, so let's update the dependency so that everyone doesn't have to `./x clean`. Fixes #114839. r? `@RalfJung`
2023-08-17Rollup merge of #114931 - Urgau:revert-114052, r=compiler-errorsJosh Stone-61/+73
Revert PR #114052 to fix invalid suggestion This PR reverts https://github.com/rust-lang/rust/pull/114052 to fix the invalid suggestion produced by the PR. Unfortunately the invalid suggestion cannot be improved from the current position where it's emitted since we lack enough information (is an assignment?, left or right?, ...) to be able to fix it here. Furthermore the previous wasn't wrong, just suboptimal, contrary to the current one which is just wrong. Added a regression test and commented out some code instead of removing it so we can use it later. Reopens https://github.com/rust-lang/rust/issues/114050 Fixes https://github.com/rust-lang/rust/issues/114925
2023-08-17Rollup merge of #114913 - beetrees:escape-double-quote, r=davidtwcoJosh Stone-15/+22
Fix suggestion for attempting to define a string with single quotes Currently attempting to compile `fn main() { let _ = '\\"'; }` will result in the following error message: ``` error: character literal may only contain one codepoint --> src/main.rs:1:21 | 1 | fn main() { let _ = '\\"'; } | ^^^^^ | help: if you meant to write a `str` literal, use double quotes | 1 | fn main() { let _ = "\\""; } | ~~~~~ ``` The suggestion is invalid as it fails to escape the `"`. This PR fixes the suggestion so that it now reads: ``` help: if you meant to write a `str` literal, use double quotes | 1 | fn main() { let _ = "\\\""; } | ~~~~~~ ``` The relevant test is also updated to ensure that this does not regress in future.
2023-08-17Rollup merge of #114897 - joshtriplett:partial-revert-ok-0, r=m-ou-seJosh Stone-3/+3
Partially revert #107200 `Ok(0)` is indeed something the caller may interpret as an error, but that's the *correct* thing to return if the writer can't accept any more bytes.
2023-08-17Rollup merge of #113715 - kadiwa4:lang_items_doc, r=JohnTitorJosh Stone-255/+121
Unstable Book: update `lang_items` page and split it [`lang_items` rendered](https://github.com/kadiwa4/rust/blob/lang_items_doc/src/doc/unstable-book/src/language-features/lang-items.md), [`start` rendered](https://github.com/kadiwa4/rust/blob/lang_items_doc/src/doc/unstable-book/src/language-features/start.md) Closes #110274 Rustonomicon PR: rust-lang/nomicon#413, Rust Book PR: rust-lang/book#3705 A lot of information doesn't belong on the `lang_items` page. I added a separate page for the `start` feature and moved some text into the Rustonomicon because the `lang_items` page should not be a tutorial on how to build a `#![no_std]` executable. The list of existing lang items is too long/unstable, so I removed it. The doctests still don't work. :(
2023-08-17Auto merge of #114904 - cjgillot:no-ref-debuginfo, r=wesleywiserbors-626/+787
Remove references in VarDebugInfo The codegen implementation is broken, and attempted to read uninitialized memory. Fixes https://github.com/rust-lang/rust/issues/114488
2023-08-17Normalize before checking if local is freeze in deduced_param_attrsMichael Goulet-1/+185
2023-08-17update `thsiserror` to release >= 1.0.46Rémy Rakic-4/+4
this version is the one containing the workaround for the provider API changes on nightly
2023-08-17Bless codegen tests.Camille GILLOT-16/+16
2023-08-17Auto merge of #114802 - chenyukang:yukang-fix-114979-bad-parens-dyn, r=estebankbors-28/+105
Fix bad suggestion when wrong parentheses around a dyn trait Fixes #114797
2023-08-17Bless mir-opt tests.Camille GILLOT-362/+531
2023-08-17Add test.Camille GILLOT-0/+57
2023-08-17Revert "Implement references VarDebugInfo."Camille GILLOT-248/+183
This reverts commit 2ec007191348ef7cc13eb55e44e007b02cf75cf3.
2023-08-18Replace the \01__gnu_mcount_nc to LLVM intrinsic for ARMChoKyuWon-1/+16
Current `-Zinstrument-mcount` for ARM32 use the `\01__gnu_mcount_nc` directly for its instrumentation function. However, the LLVM does not use this mcount function directly, but it wraps it to intrinsic, `llvm.arm.gnu.eabi.mcount` and the transform pass also only handle the intrinsic. As a result, current `-Zinstrument-mcount` not work on ARM32. Refer: https://github.com/namhyung/uftrace/issues/1764 This commit replaces the mcount name from native function to the LLVM intrinsic so that the transform pass can handle it. Signed-off-by: ChoKyuWon <kyuwoncho18@gmail.com>
2023-08-17Auto merge of #11314 - GuillaumeGomez:needless_ref_mut_async_block, r=Centri3bors-23/+129
Correctly handle async blocks for NEEDLESS_PASS_BY_REF_MUT Fixes https://github.com/rust-lang/rust-clippy/issues/11299. The problem was that the `async block`s are popping a closure which we didn't go into, making it miss the mutable access to the variables. cc `@Centri3` changelog: none
2023-08-17Auto merge of #11070 - y21:issue11065, r=flip1995bors-13/+72
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro Fixes #11065 (which is actually two issues: an ICE and a false positive) It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099). It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore) changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP) r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-17Auto merge of #114932 - RalfJung:miri, r=RalfJungbors-177/+472
update Miri r? `@ghost`
2023-08-17Revert PR #114052 to fix invalid suggestionUrgau-61/+73
2023-08-17[RFC-3086] Restrict the parsing of `count`Caio-1/+44
2023-08-17Auto merge of #114799 - RalfJung:less-transmute, r=m-ou-sebors-2/+2
avoid transmuting Box when we can just cast raw pointers instead Always better to avoid a transmute, in particular when the layout assumptions it is making are not clearly documented. :)
2023-08-17Auto merge of #114922 - matthiaskrgr:rollup-qktdihi, r=matthiaskrgrbors-11/+100
Rollup of 5 pull requests Successful merges: - #112751 (rustdoc: Fixes with --test-run-directory and relative paths.) - #114749 (Update `mpsc::Sender` doc to reflect that it implements `Sync`) - #114876 (Don't ICE in `is_trivially_sized` when encountering late-bound self ty) - #114881 (clarify CStr lack of layout guarnatees) - #114921 (Remove Folyd from librustdoc static files) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-17Rollup merge of #114921 - Folyd:Folyd-patch-1, r=compiler-errorsMatthias Krüger-1/+0
Remove Folyd from librustdoc static files r?`@GuillaumeGomez`
2023-08-17Rollup merge of #114881 - RalfJung:cstr, r=cuviperMatthias Krüger-4/+4
clarify CStr lack of layout guarnatees Follow-up to https://github.com/rust-lang/rust/pull/114800 r? `@cuviper`
2023-08-17Rollup merge of #114876 - compiler-errors:non-lifetime-binders-sized, ↵Matthias Krüger-2/+32
r=wesleywiser Don't ICE in `is_trivially_sized` when encountering late-bound self ty We can see a bound ty var here: https://github.com/rust-lang/rust/blob/b531630f4255216fce1400c45976e04f1ab35a84/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs#L13-L34 Fixes #114872
2023-08-17Rollup merge of #114749 - gurry:issue-114722, r=thomccMatthias Krüger-3/+2
Update `mpsc::Sender` doc to reflect that it implements `Sync` Fixes #114722
2023-08-17Rollup merge of #112751 - ehuss:persist-test-run-directory, r=jshaMatthias Krüger-1/+62
rustdoc: Fixes with --test-run-directory and relative paths. Fixes #112191 Fixes #112210 This fixes some issues with `--test-run-directory` and its interaction with `--runtool` and `--persist-doctests`. Relative directories don't work with `Command::current_dir` very well because it has platform-specific behavior with relative paths. This fixes it by avoiding the use of relative paths. This is needed because cargo is switching to use `--test-run-directory`, and it uses relative paths when interacting with rustdoc/rustc.
2023-08-17Auto merge of #114875 - Zalathar:line-numbers, r=ozkanonurbors-2655/+2672
coverage: Anonymize line numbers in `run-coverage` test snapshots LLVM's coverage reporter always prints line numbers in its coverage reports. For testing purposes this is slightly inconvenient, because it means that adding or removing a line in a test file causes all subsequent lines in the snapshot to change. That makes it harder to see the actually meaningful changes in the re-blessed snapshot. --- This change fixes that by adding another normalization pass that replaces all line numbers in the coverage reports with `LL`, which is similar to what UI tests tell the compiler to do when emitting line numbers in error messages.
2023-08-17Remove Folyd from librustdoc static filesFolyd-1/+0
2023-08-17Auto merge of #114892 - Zoxc:sharded-cfg-cleanup, r=cjgillotbors-49/+7
Remove conditional use of `Sharded` from query caches `Sharded` is already a zero cost abstraction, so it shouldn't affect the performance of the single thread compiler if LLVM does its job. r? `@cjgillot`
2023-08-17coverage: Anonymize line numbers in `run-coverage` test snapshotsZalathar-2655/+2672
This makes the test snapshots less sensitive to lines being added/removed.
2023-08-16Auto merge of #111555 - cjgillot:elaborate-drops, r=tmiaskobors-1288/+1420
Only run MaybeInitializedPlaces dataflow once to elaborate drops This pass allows forward dataflow analyses to modify the CFG depending on the dataflow state. This possibility is used for the `MaybeInitializedPlace` analysis in drop elaboration, to skip the dataflow effect of dead unwinds without having to compute dataflow twice.
2023-08-17Simplify a `match`.Nicholas Nethercote-4/+1
`may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to check for them separately.
2023-08-17Make some `match`es exhaustive in `nonterminal.rs`.Nicholas Nethercote-5/+20
For ones matching more than one or two variants, this is easier to think about.
2023-08-17Use `Nonterminal::*` in `nonterminal.rs`.Nicholas Nethercote-26/+17
It makes the code more readable.
2023-08-17Remove unnecessary braces on `PatWithOr` patterns.Nicholas Nethercote-5/+5
2023-08-17Add a failing case to `tests/ui/macros/macro-interpolation`.Nicholas Nethercote-2/+18
This test currently tests the successful paths for the `Interpolated`/`NtTy`/`Path` case in `parse_path_inner`, but it doesn't test the failure path.
2023-08-17Add some useful comments to `Parser::look_ahead`.Nicholas Nethercote-8/+23