Skip to content
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 6 pull requests #118432

Closed
wants to merge 25 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 25 commits November 17, 2023 18:59
…aren't likely to appear in for head or match arm
When encountering match arm (pat if expr) => {}, recover and suggest removing parentheses. Fix rust-lang#100825.
Use the same approach used for match arm patterns.
…unction with target features outside an unsafe block
Tweak parsing recovery of enums, for exprs and match arm patterns

Tweak recovery of `for (pat in expr) {}` for more accurate spans.

When encountering `match` arm `(pat if expr) => {}`, recover and suggest removing parentheses. Fix rust-lang#100825.

When encountering malformed enums, try more localized per-variant parse recovery.

Move parser recovery tests to subdirectory.
Name explicit registers in conflict register errors for inline assembly
…r=compiler-errors

Add `never_patterns` feature gate

This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (rust-lang#118155) for details on the experiment.

`@scottmcm` has agreed to be my lang-team liaison for this experiment.
…cuviper

also add is_empty to const raw slices

We have this on mutable raw slices but not const raw slices, which makes little sense.

Cc rust-lang#71146
…tebank

Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always

It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`.

Related to but doesn't fix rust-lang#118225. That needs a separate fix.
…tures, r=est31

Print list of missing target features when calling a function with target features outside an unsafe block

Fixes rust-lang#108680

Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different.

r? `@est31`
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 29, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Nov 29, 2023

📌 Commit 3cd61b2 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 29, 2023
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_b0527b97-b1c4-4b25-b0de-37f1af9673d7
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=rollup-cj3vhgd
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_b0527b97-b1c4-4b25-b0de-37f1af9673d7
GITHUB_REF=refs/pull/118432/merge
GITHUB_REF_NAME=118432/merge
GITHUB_REF_PROTECTED=false
---

---- [ui] tests/ui/pattern/pattern-bad-ref-box-order.rs stdout ----
diff of stderr:

4 LL |         Some(ref box _i) => {},
5    |              ^^^^^^^ help: swap them: `box ref`
- error: aborting due to 1 previous error
- error: aborting due to 1 previous error
+ error: expected one of `)`, `,`, or `|`, found `_i`
+    |
+    |
+ LL |         Some(ref box _i) => {},
+    |                     -^^ expected one of `)`, `,`, or `|`
+    |                     help: missing `,`
8 
+ error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
+   --> $DIR/pattern-bad-ref-box-order.rs:8:22
+   --> $DIR/pattern-bad-ref-box-order.rs:8:22
+    |
+ LL |         Some(ref box _i) => {},
+    |                      ^^ expected 1 field, found 2
+   --> $SRC_DIR/core/src/option.rs:LL:COL
+    = note: tuple variant has 1 field
+ 
+ error: aborting due to 3 previous errors
+ 
---
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/pattern-bad-ref-box-order/pattern-bad-ref-box-order.stderr
diff of fixed:

5 
6 fn foo(f: Option<Box<i32>>) {
7     match f {
-         Some(box ref _i) => {},
+         Some(box ref, _i) => {},
9         //~^ ERROR switch the order of `ref` and `box`
11     }


The actual fixed differed from the expected fixed.
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/pattern/pattern-bad-ref-box-order.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/pattern-bad-ref-box-order" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/pattern-bad-ref-box-order/auxiliary"
stdout: none
--- stderr -------------------------------
error: switch the order of `ref` and `box`
   |
   |
LL |         Some(ref box _i) => {},
   |              ^^^^^^^ help: swap them: `box ref`

error: expected one of `)`, `,`, or `|`, found `_i`
   |
   |
LL |         Some(ref box _i) => {},
   |                     -^^ expected one of `)`, `,`, or `|`
   |                     help: missing `,`

error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
##[error]  --> /checkout/tests/ui/pattern/pattern-bad-ref-box-order.rs:8:22
##[error]  --> /checkout/tests/ui/pattern/pattern-bad-ref-box-order.rs:8:22
   |
LL |         Some(ref box _i) => {},
   |                      ^^ expected 1 field, found 2
  --> /rustc/FAKE_PREFIX/library/core/src/option.rs:578:56
   = note: tuple variant has 1 field

error: aborting due to 3 previous errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants