-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 8 pull requests #122830
Rollup of 8 pull requests #122830
Conversation
This makes it consistent with `is_whole_expr` and `is_whole_block`.
It can't use `maybe_whole`, but it can match `maybe_whole` more closely. Also add a test for a case that wasn't previously covered.
This requires changing `maybe_whole!` so it allows the value to be modified.
It has no effect on anything in the test suite.
This commit combines `MatchedTokenTree` and `MatchedNonterminal`, which are often considered together, into a single `MatchedSingle`. It shares a representation with the newly-parameterized `ParseNtResult`. This will also make things much simpler if/when variants from `Interpolated` start being moved to `ParseNtResult`.
It uses very old language that is more confusing today than helpful, including references to `SubstNt` that no longer exists. The comment above `TokenStream` is better, and suffices for a basic understanding of these types.
Backend and target selection is a mess: the target can override the backend (via `Target::default_codegen_backend`), *and* the backend can override the target (via `CodegenBackend::target_override`). The code that handles this is ugly. It calls `build_target_config` twice, once before getting the backend and once again afterward. It also must check that both overrides aren't triggering at the same time. This commit removes the latter override. It's used in rust-gpu but @eddyb said via Zulip that removing it would be ok. This simplifies the code greatly, and will allow some nice follow-up refactorings.
Because the underlying type is called `Target`. (There is also a separate type called `TargetCfg`.)
This commit fixes several issues with the format string parsing of the `#[diagnostic::on_unimplemented]` attribute that were pointed out by @ehuss. In detail it fixes: * Appearing format specifiers (display, etc). For these we generate a warning that the specifier is unsupported. Otherwise we ignore them * Positional arguments. For these we generate a warning that positional arguments are unsupported in that location and replace them with the format string equivalent (so `{}` or `{n}` where n is the index of the positional argument) * Broken format strings with enclosed }. For these we generate a warning about the broken format string and set the emitted message literally to the provided unformatted string * Unknown format specifiers. For these we generate an additional warning about the unknown specifier. Otherwise we emit the literal string as message. This essentially makes those strings behave like `format!` with the minor difference that we do not generate hard errors but only warnings. After that we continue trying to do something unsuprising (mostly either ignoring the broken parts or falling back to just giving back the literal string as provided). Fix rust-lang#122391
…er in the hidden type to the generic parameters of the definition of the opaque
Stop using `box PAT` syntax for deref patterns, as it's misleading and also causes their semantics being tangled up.
…rors Make `#[diagnostic::on_unimplemented]` format string parsing more robust This commit fixes several issues with the format string parsing of the `#[diagnostic::on_unimplemented]` attribute that were pointed out by `@ehuss.` In detail it fixes: * Appearing format specifiers (display, etc). For these we generate a warning that the specifier is unsupported. Otherwise we ignore them * Positional arguments. For these we generate a warning that positional arguments are unsupported in that location and replace them with the format string equivalent (so `{}` or `{n}` where n is the index of the positional argument) * Broken format strings with enclosed }. For these we generate a warning about the broken format string and set the emitted message literally to the provided unformatted string * Unknown format specifiers. For these we generate an additional warning about the unknown specifier. Otherwise we emit the literal string as message. This essentially makes those strings behave like `format!` with the minor difference that we do not generate hard errors but only warnings. After that we continue trying to do something unsuprising (mostly either ignoring the broken parts or falling back to just giving back the literal string as provided). Fix rust-lang#122391 r? `@compiler-errors`
…iler-errors pattern analysis: add a custom test harness There are two features of the pattern analysis code that are hard to test: the newly-added pattern complexity limit, and the computation of arm intersections. This PR adds some crate-specific tests for that, including an unmaintainable but pretty macro to help construct patterns. r? `````@compiler-errors`````
Strip placeholders from hidden types before remapping generic parameter When remapping generic parameters in the hidden type to the generic parameters of the definition of the opaque, we assume that placeholders cannot exist. Instead of just patching that site, I decided to handle it earlier, directly in `infer_opaque_types`, where we are already doing all the careful lifetime handling. fixes rust-lang#122694 the reason that ICE now occurred was that we stopped treating `operation` as being in the defining scope, so the TAIT became part of the hidden type of the `async fn`'s opaque type instead of just bailing out as ambiguos I think ```rust use std::future::Future; mod foo { type FutNothing<'a> = impl 'a + Future<Output = ()>; //~^ ERROR: unconstrained opaque type } async fn operation(_: &mut ()) -> () { //~^ ERROR: concrete type differs from previous call(operation).await //~^ ERROR: concrete type differs from previous } async fn call<F>(_f: F) where for<'any> F: FnMut(&'any mut ()) -> foo::FutNothing<'any>, { //~^ ERROR: expected generic lifetime parameter, found `'any` } ``` would have already had the same ICE before rust-lang#121796
… r=petrochenkov Interpolated cleanups Various cleanups I made while working on attempts to remove `Interpolated`, that are worth merging now. Best reviewed one commit at a time. r? `@petrochenkov`
add some comments to hir::ModuleItems I've definitely been bitten by this in the past, where I assumed `items()` would give me *all* the items.
…r=Nadrieril Implement macro-based deref!() syntax for deref patterns Stop using `box PAT` syntax for deref patterns, and instead use a perma-unstable macro. Blocked on rust-lang#122222 r? `@Nadrieril`
…WaffleLapkin Remove `target_override` Because the "target can override the backend" and "backend can override the target" situation is a mess. Details in the individual commits. r? `@WaffleLapkin`
…eLapkin Remove unnecessary braces from `bug`/`span_bug` They make never fallback weird and are unnecessary r? `@WaffleLapkin`
@bors r+ rollup=never p=8 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 7d01878bd0 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (a0569fa): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.198s -> 670.84s (-0.20%) |
With only small regressions on stress tests, I think it's fine if we don't investigate this too deeply. @rustbot label: +perf-regression-triaged |
Successful merges:
#[diagnostic::on_unimplemented]
format string parsing more robust #122402 (Make#[diagnostic::on_unimplemented]
format string parsing more robust)target_override
#122810 (Removetarget_override
)bug
/span_bug
#122827 (Remove unnecessary braces frombug
/span_bug
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup