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 7 pull requests #127394

Closed
wants to merge 16 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

GuillaumeGomez and others added 16 commits July 5, 2024 14:05
…ain, r=lcnr

Split `SolverDelegate` back out from `InferCtxtLike`

This is because in order to uplift things like the `Generalizer` and other `TypeRelation`s, we want to be able to interface with `InferCtxtLike` (and `InferCtxt` as its implementation), rather that `SolverDelegate`, which only really exists as a hack to be able to define some downstream methods in `rustc_type_ir`.

r? lcnr
…adability, r=Amanieu

Improve readability of some fmt code examples

Some indent was weird. Some examples were too long (overall better to keep it to maximum 80 columns, but only changed the most outstanding ones).

r? `@Amanieu`
…r-errors

Use `ControlFlow` results for visitors that are only looking for a single value

These visitors all had a `Option<Value>` or `bool` field, that, once set, was never unset or modified again. They have been refactored by removing the field and returning `ControlFlow` directly from the visitor
Added dots at the sentence ends of rustc AST doc

Just a tiny improvement for the AST documentation by bringing consistency to sentence ends. I intentionally didn't terminate every sentence, there are still some members not having them, but at least there's no mixing style on the type level.
…021, r=Nadrieril

Match ergonomics 2024: align with RFC again

- `&` matches `&mut` on old editions
- Add some more tests

r? `@Nadrieril`

cc rust-lang#123076

`@rustbot` label A-edition-2024 A-patterns
Use verbose style when suggesting changing `const` with `let`
…rrors

Use verbose style for argument removal suggestion
@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jul 5, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Jul 5, 2024

📌 Commit f2917f7 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 Jul 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 5, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127333 (Split `SolverDelegate` back out from `InferCtxtLike`)
 - rust-lang#127363 (Improve readability of some fmt code examples)
 - rust-lang#127366 (Use `ControlFlow` results for visitors that are only looking for a single value)
 - rust-lang#127368 (Added dots at the sentence ends of rustc AST doc)
 - rust-lang#127369 (Match ergonomics 2024: align with RFC again)
 - rust-lang#127382 (Use verbose style when suggesting changing `const` with `let`)
 - rust-lang#127383 (Use verbose style for argument removal suggestion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 5, 2024

⌛ Testing commit f2917f7 with merge 0c58a06...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
324    |
- LL |     let mut foo = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const foo`
- ...
328 LL |         asm!("{}", clobber_abi("C"), const foo);
329    |                                            ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const foo = 0;
+    |     ~~~~~
---
333    |
- LL |     let mut foo = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const foo`
- ...
337 LL |         asm!("{}", options(), clobber_abi("C"), const foo);
338    |                                                       ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const foo = 0;
+    |     ~~~~~
---
342    |
- LL |     let mut foo = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const foo`
- ...
346 LL |         asm!("{a}", a = const foo, a = const bar);
347    |                               ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const foo = 0;
+    |     ~~~~~
---
351    |
- LL |     let mut bar = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const bar`
- ...
355 LL |         asm!("{a}", a = const foo, a = const bar);
356    |                                              ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const bar = 0;
+    |     ~~~~~
---
360    |
- LL |     let mut bar = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const bar`
- ...
364 LL |         asm!("{a}", in("x0") foo, a = const bar);
365    |                                             ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const bar = 0;
+    |     ~~~~~
---
369    |
- LL |     let mut bar = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const bar`
- ...
373 LL |         asm!("{a}", in("x0") foo, a = const bar);
374    |                                             ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const bar = 0;
+    |     ~~~~~
---
378    |
- LL |     let mut bar = 0;
-    |     ----------- help: consider using `const` instead of `let`: `const bar`
- ...
382 LL |         asm!("{1}", in("x0") foo, const bar);
383    |                                         ^^^ non-constant value
+ help: consider using `const` instead of `let`
+    |
+ LL |     const bar = 0;
+    |     ~~~~~
---
To only update this specific test, also pass `--test-args asm/aarch64/parse-error.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.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=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(FALSE)" "--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" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/parse-error" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/parse-error/auxiliary"
--- stderr -------------------------------
error: requires at least a template string argument
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:11:9
   |
---

error: expected `)`, found `foo`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:21:27
   |
LL |         asm!("{}", in(reg foo));
   |                           ^^^ expected `)`
error: expected expression, found end of macro arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:23:27
   |
   |
LL |         asm!("{}", in(reg));

error: expected register class or explicit register
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:25:26
   |
   |
LL |         asm!("{}", inout(=) foo => bar);

error: expected expression, found end of macro arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:27:37
   |
   |
LL |         asm!("{}", inout(reg) foo =>);


error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `=>`
   |
   |
LL |         asm!("{}", in(reg) foo => bar);

error: expected a path for argument to `sym`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:31:24
   |
   |
LL |         asm!("{}", sym foo + bar);


error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo`
   |
   |
LL |         asm!("", options(foo));


error: expected one of `)` or `,`, found `foo`
   |
   |
LL |         asm!("", options(nomem foo));
   |                                ^^^ expected one of `)` or `,`

error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo`
   |
   |
LL |         asm!("", options(nomem, foo));

error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:41:30
   |
   |
LL |         asm!("", clobber_abi(foo));


error: expected one of `)` or `,`, found `foo`
   |
   |
LL |         asm!("", clobber_abi("C" foo));
   |                                  ^^^ expected one of `)` or `,`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:45:35
   |
   |
LL |         asm!("", clobber_abi("C", foo));

error: duplicate argument named `a`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
   |
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                     -------------  ^^^^^^^^^^^^^ duplicate argument
   |                     previously here

error: argument never used
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                                    ^^^^^^^^^^^^^ argument never used
   |
   = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
error: explicit register arguments cannot have names
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:57:18
   |
   |
LL |         asm!("", a = in("x0") foo);

error: positional arguments cannot follow named arguments or explicit register arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:63:35
   |
   |
LL |         asm!("{1}", in("x0") foo, const bar);
   |                     ------------  ^^^^^^^^^ positional argument
   |                     explicit register argument


error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `""`
   |
   |
LL |         asm!("", options(), "");


error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
   |
   |
LL |         asm!("{}", in(reg) foo, "{}", out(reg) foo);

error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:70:14
   |
   |
LL |         asm!(format!("{{{}}}", 0), in(reg) foo);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: asm template must be a string literal
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:72:21
   |
LL |         asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", in(reg) _);


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", inout(reg) _);


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", inlateout(reg) _);

error: requires at least a template string argument
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:85:1
   |
   |
LL | global_asm!();

error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:87:13
   |
   |
LL | global_asm!(FOO);

error: expected token: `,`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:89:18
   |
   |
LL | global_asm!("{}" FOO);
   |                  ^^^ expected `,`
error: expected operand, options, or additional template string
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:91:19
   |
   |
LL | global_asm!("{}", FOO);
   |                   ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:93:24
   |
   |
LL | global_asm!("{}", const);


error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
   |
   |
LL | global_asm!("{}", const(reg) FOO);
   |                              ^^^ expected one of `,`, `.`, `?`, or an operator

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
   |
   |
LL | global_asm!("", options(FOO));
   |                         ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
   |
   |
LL | global_asm!("", options(nomem FOO));
   |                         ^^^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
   |
   |
LL | global_asm!("", options(nomem, FOO));
   |                         ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:104:29
   |
   |
LL | global_asm!("", clobber_abi(FOO));


error: expected one of `)` or `,`, found `FOO`
   |
   |
LL | global_asm!("", clobber_abi("C" FOO));
   |                                 ^^^ expected one of `)` or `,`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:108:34
   |
   |
LL | global_asm!("", clobber_abi("C", FOO));


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("{}", clobber_abi("C"), const FOO);


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(), clobber_abi("C"));


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);

error: duplicate argument named `a`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
   |
   |
LL | global_asm!("{a}", a = const FOO, a = const BAR);
   |                    -------------  ^^^^^^^^^^^^^ duplicate argument
   |                    previously here

error: argument never used
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
   |
LL | global_asm!("{a}", a = const FOO, a = const BAR);
   |                                   ^^^^^^^^^^^^^ argument never used
   |
   = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `""`
   |
   |
LL | global_asm!("", options(), "");
   |                            ^^ expected one of `clobber_abi`, `const`, `options`, or `sym`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `"{}"`
   |
   |
LL | global_asm!("{}", const FOO, "{}", const FOO);
   |                              ^^^^ expected one of `clobber_abi`, `const`, `options`, or `sym`
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:123:13
   |
   |
LL | global_asm!(format!("{{{}}}", 0), const FOO);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: asm template must be a string literal
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:125:20
   |
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0435]: attempt to use a non-constant value in a constant
---

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:47:44
   |
LL |         asm!("{}", clobber_abi("C"), const foo);
   |                                            ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const foo = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:50:55
   |
LL |         asm!("{}", options(), clobber_abi("C"), const foo);
   |                                                       ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const foo = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:31
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                               ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const foo = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:46
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                                              ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const bar = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:59:45
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const bar = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:61:45
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const bar = 0;
   |     ~~~~~
   |     ~~~~~

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:63:41
   |
LL |         asm!("{1}", in("x0") foo, const bar);
   |                                         ^^^ non-constant value
help: consider using `const` instead of `let`
   |
LL |     const bar = 0;
   |     ~~~~~

@bors
Copy link
Contributor

bors commented Jul 5, 2024

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 5, 2024
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 5, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-h8xj6tv branch September 1, 2024 17:35
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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants