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 10 pull requests #93491

Closed
wants to merge 26 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

pierwill and others added 26 commits November 6, 2021 20:59
Previously the pretty printer would compute indentation always relative
to whatever column a block begins at, like this:

    fn demo(arg1: usize,
            arg2: usize);

This is never the thing to do in the dominant contemporary Rust style.
Rustfmt's default and the style used by the vast majority of Rust
codebases is block indentation:

    fn demo(
        arg1: usize,
        arg2: usize,
    );

where every indentation level is a multiple of 4 spaces and each level
is indented relative to the indentation of the previous line, not the
position that the block starts in.
The `print_expr` method already places an `ibox(INDENT_UNIT)` around
every expr that gets printed. Some exprs were then using `self.head`
inside of that, which does its own `cbox(INDENT_UNIT)`, resulting in two
levels of indentation:

    while true {
            stuff;
        }

This commit fixes those cases to produce the expected single level of
indentation within every expression containing a block.

    while true {
        stuff;
    }
New implementation takes into account contents of `self.buf` and rounds
lower bound up instead of down.
`self.buf` can contain a surrogate, but only a leading one.
When `DirEntry::file_type` fails to match a known `d_type`, we should
fall back to `DirEntry::metadata` instead of a bare `lstat`, because
this is faster and more reliable on targets with `fstatat`.
There are cases, when data in the buf might or might not be an error.
The documentation has been restructured to split out a brief summary
paragraph out from the following elaborating paragraphs.

I also attempted my hand at wording improvements and adding articles
where I felt them missing, but being non-native english speaker these
may need more thorough review.
… r=jackh726

Improve terminology around "after typeck"

Closes rust-lang#70258.
… r=jackh726

Make `span_extend_to_prev_str()` more robust

Fixes rust-lang#91560. The logic in `span_extend_to_prev_str()` is currently quite brittle and fails if there is extra whitespace or something else in between, and it also should return an `Option` but doesn't currently.
…lision, r=jackh726

Allow eliding GATs in expression position

Thoughts on whether this is worthwhile?

Fixes rust-lang#92836

r? `@jackh726`
Switch pretty printer to block-based indentation

This PR backports dtolnay/prettyplease@401d60c from the `prettyplease` crate into `rustc_ast_pretty`.

A before and after:

```diff
- let res =
-     ((::alloc::fmt::format as
-          for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
-                                                             as
-                                                             fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
-                                                                                                                                          as
-                                                                                                                                          &str)]
-                                                                                                                                        as
-                                                                                                                                        [&str; 1])
-                                                                                                                                      as
-                                                                                                                                      &[&str; 1]),
-                                                                                                                                  (&([]
-                                                                                                                                        as
-                                                                                                                                        [ArgumentV1; 0])
-                                                                                                                                      as
-                                                                                                                                      &[ArgumentV1; 0]))
-                                                            as
-                                                            Arguments))
-         as String);
+ let res =
+     ((::alloc::fmt::format as
+             for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
+                 as
+                 fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
+                             as &str)] as [&str; 1]) as
+                 &[&str; 1]),
+             (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
+             Arguments)) as String);
```

Previously the pretty printer would compute indentation always relative to whatever column a block begins at, like this:

```rust
fn demo(arg1: usize,
        arg2: usize);
```

This is never the thing to do in the dominant contemporary Rust style. Rustfmt's default and the style used by the vast majority of Rust codebases is block indentation:

```rust
fn demo(
    arg1: usize,
    arg2: usize,
);
```

where every indentation level is a multiple of 4 spaces and each level is indented relative to the indentation of the previous line, not the position that the block starts in.

By itself this PR doesn't get perfect formatting in all cases, but it is the smallest possible step in clearly the right direction. More backports from `prettyplease` to tune the ibox/cbox indent levels around various AST node types are upcoming.
…16_size_hint, r=dtolnay

Make `char::DecodeUtf16::size_hist` more precise

New implementation takes into account contents of `self.buf` and rounds lower bound up instead of down.

Fixes rust-lang#88762
Revival of rust-lang#88763
…lett

review the total_cmp documentation

The documentation has been restructured to split out a brief summary
paragraph out from the following elaborating paragraphs.

I also attempted my hand at wording improvements and adding articles
where I felt them missing, but being non-native english speaker these
may need more thorough review.

cc rust-lang#72599
…lett

Document `SystemTime` platform precision

Fixes rust-lang#88822
…the8472

unix: Use metadata for `DirEntry::file_type` fallback

When `DirEntry::file_type` fails to match a known `d_type`, we should
fall back to `DirEntry::metadata` instead of a bare `lstat`, because
this is faster and more reliable on targets with `fstatat`.
core: Remove some redundant {}s from the sorting code
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 30, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=10

@bors
Copy link
Contributor

bors commented Jan 30, 2022

📌 Commit 060bfcf has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 30, 2022
@bors
Copy link
Contributor

bors commented Jan 30, 2022

⌛ Testing commit 060bfcf with merge 603f0c32bb9fe89d2b8e34689ae9f6a713039d5f...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

382   --> $DIR/parse-error.rs:39:37
383    |
384 LL |     let mut foo = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const foo`
+    |     ----------- help: consider using `const` instead of `let`: `const foo`
387 LL |         asm!("{}", options(), const foo);
388    |                                     ^^^ non-constant value

391   --> $DIR/parse-error.rs:48:44
391   --> $DIR/parse-error.rs:48:44
392    |
393 LL |     let mut foo = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const foo`
+    |     ----------- help: consider using `const` instead of `let`: `const foo`
395 ...
396 LL |         asm!("{}", clobber_abi("C"), const foo);
397    |                                            ^^^ non-constant value
400   --> $DIR/parse-error.rs:55:31
401    |
402 LL |     let mut foo = 0;
402 LL |     let mut foo = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const foo`
+    |     ----------- help: consider using `const` instead of `let`: `const foo`
404 ...
405 LL |         asm!("{a}", a = const foo, a = const bar);
406    |                               ^^^ non-constant value
409   --> $DIR/parse-error.rs:55:46
410    |
411 LL |     let mut bar = 0;
411 LL |     let mut bar = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const bar`
+    |     ----------- help: consider using `const` instead of `let`: `const bar`
413 ...
414 LL |         asm!("{a}", a = const foo, a = const bar);
415    |                                              ^^^ non-constant value
418   --> $DIR/parse-error.rs:62:45
419    |
420 LL |     let mut bar = 0;
420 LL |     let mut bar = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const bar`
+    |     ----------- help: consider using `const` instead of `let`: `const bar`
422 ...
423 LL |         asm!("{a}", in("x0") foo, a = const bar);
424    |                                             ^^^ non-constant value
427   --> $DIR/parse-error.rs:65:45
428    |
429 LL |     let mut bar = 0;
429 LL |     let mut bar = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const bar`
+    |     ----------- help: consider using `const` instead of `let`: `const bar`
431 ...
432 LL |         asm!("{a}", in("x0") foo, a = const bar);
433    |                                             ^^^ non-constant value
436   --> $DIR/parse-error.rs:68:41
437    |
438 LL |     let mut bar = 0;
438 LL |     let mut bar = 0;
-    |      ---------- help: consider using `const` instead of `let`: `const bar`
+    |     ----------- help: consider using `const` instead of `let`: `const bar`
440 ...
441 LL |         asm!("{1}", in("x0") foo, const bar);
442    |                                         ^^^ non-constant value

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/parse-error/parse-error.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
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: "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/asm/aarch64/parse-error.rs" "-Zthreads=1" "--target=aarch64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/parse-error" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/parse-error/auxiliary"
------------------------------------------

------------------------------------------
stderr:
---
   |
LL |         asm!("{}" foo);
   |                   ^^^ expected `,`

error: expected operand, clobber_abi, options, or additional template string
   |
LL |         asm!("{}", foo);
LL |         asm!("{}", foo);
   |                    ^^^ expected operand, clobber_abi, options, or additional template string

error: expected `(`, found `foo`
   |
LL |         asm!("{}", in foo);
   |                       ^^^ expected `(`


error: expected `)`, found `foo`
   |
   |
LL |         asm!("{}", in(reg foo));
   |                           ^^^ expected `)`
error: expected expression, found end of macro arguments
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:23:27
   |
   |
LL |         asm!("{}", in(reg));
   |                           ^ expected expression
error: expected register class or explicit register
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:25:26
   |
   |
LL |         asm!("{}", inout(=) foo => bar);

error: expected expression, found end of macro arguments
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:27:37
   |
   |
LL |         asm!("{}", inout(reg) foo =>);
   |                                     ^ expected expression

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

error: argument to `sym` must be a path expression
   |
   |
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));
   |                          ^^^ expected one of 10 possible tokens

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));
   |                                 ^^^ expected one of 10 possible tokens
error: arguments are not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:39:31
   |
LL |         asm!("{}", options(), const foo);
LL |         asm!("{}", options(), const foo);
   |                    ---------  ^^^^^^^^^ argument
   |                    previous options

error: expected string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:42:30
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:42:30
   |
LL |         asm!("", clobber_abi(foo));
Some tests failed in compiletest suite=ui mode=ui host=aarch64-unknown-linux-gnu target=aarch64-unknown-linux-gnu


error: expected one of `)` or `,`, found `foo`
   |
   |
LL |         asm!("", clobber_abi("C" foo));
   |                                  ^^^ expected one of `)` or `,`
error: expected string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:46:35
   |
   |
LL |         asm!("", clobber_abi("C", foo));

error: arguments are not allowed after clobber_abi
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:48:38
   |
   |
LL |         asm!("{}", clobber_abi("C"), const foo);
   |                    ----------------  ^^^^^^^^^ argument
   |                    clobber_abi

error: clobber_abi is not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:51:29
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:51:29
   |
LL |         asm!("", options(), clobber_abi("C"));
   |                  ---------  ^^^^^^^^^^^^^^^^
   |                  options

error: clobber_abi is not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:53:31
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:53:31
   |
LL |         asm!("{}", options(), clobber_abi("C"), const foo);
   |                    ---------  ^^^^^^^^^^^^^^^^
   |                    options

error: duplicate argument named `a`
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55:36
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55:36
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                     -------------  ^^^^^^^^^^^^^ duplicate argument
   |                     previously here

error: argument never used
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55:36
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:60:18
   |
   |
LL |         asm!("", a = in("x0") foo);


error: named arguments cannot follow explicit register arguments
   |
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                     ------------  ^^^^^^^^^^^^^ named argument
   |                     explicit register argument


error: named arguments cannot follow explicit register arguments
   |
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                     ------------  ^^^^^^^^^^^^^ named argument
   |                     explicit register argument

error: positional arguments cannot follow named arguments or explicit register arguments
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:68:35
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:68:35
   |
LL |         asm!("{1}", in("x0") foo, const bar);
   |                     ------------  ^^^^^^^^^ positional argument
   |                     explicit register argument


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

error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
   |
   |
LL |         asm!("{}", in(reg) foo, "{}", out(reg) foo);
   |                                 ^^^^ expected one of 9 possible tokens
error: asm template must be a string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:75: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:77: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:90:1
   |
   |
LL | global_asm!();

error: asm template must be a string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:92:13
   |
   |
LL | global_asm!(FOO);

error: expected token: `,`
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:94:18
   |
   |
LL | global_asm!("{}" FOO);
   |                  ^^^ expected `,`
error: expected operand, options, or additional template string
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:96:19
   |
   |
LL | global_asm!("{}", FOO);
   |                   ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:98:24
   |
   |
LL | global_asm!("{}", const);
   |                        ^ expected expression

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`, `may_unwind`, or `raw`, found `FOO`
   |
   |
LL | global_asm!("", options(FOO));
   |                         ^^^ expected one of `)`, `att_syntax`, `may_unwind`, or `raw`

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

error: expected one of `)`, `att_syntax`, `may_unwind`, or `raw`, found `nomem`
   |
   |
LL | global_asm!("", options(nomem, FOO));
   |                         ^^^^^ expected one of `)`, `att_syntax`, `may_unwind`, or `raw`
error: arguments are not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:108:30
   |
   |
LL | global_asm!("{}", options(), const FOO);
   |                   ---------  ^^^^^^^^^ argument
   |                   previous options

error: expected string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:110:29
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:110: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:114:34
   |
   |
LL | global_asm!("", clobber_abi("C", FOO));

error: arguments are not allowed after clobber_abi
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:116:37
   |
   |
LL | global_asm!("{}", clobber_abi("C"), const FOO);
   |                   ----------------  ^^^^^^^^^ argument
   |                   clobber_abi


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

error: clobber_abi is not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:119:28
   |
   |
LL | global_asm!("", options(), clobber_abi("C"));
   |                 ---------  ^^^^^^^^^^^^^^^^
   |                 options

error: clobber_abi is not allowed after options
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:121:30
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:121:30
   |
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
   |                   ---------  ^^^^^^^^^^^^^^^^
   |                   options

error: duplicate argument named `a`
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:123:35
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:123:35
   |
LL | global_asm!("{a}", a = const FOO, a = const BAR);
   |                    -------------  ^^^^^^^^^^^^^ duplicate argument
   |                    previously here

error: argument never used
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:123:35
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:123: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`, or `options`, found `""`
   |
   |
LL | global_asm!("", options(), "");
   |                            ^^ expected one of `clobber_abi`, `const`, or `options`

error: expected one of `clobber_abi`, `const`, or `options`, found `"{}"`
   |
   |
LL | global_asm!("{}", const FOO, "{}", const FOO);
   |                              ^^^^ expected one of `clobber_abi`, `const`, or `options`
error: asm template must be a string literal
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:130: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:132: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
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:39:37
   |
LL |     let mut foo = 0;
   |     ----------- help: consider using `const` instead of `let`: `const foo`
LL |         asm!("{}", options(), const foo);
   |                                     ^^^ non-constant value

error[E0435]: attempt to use a non-constant value in a constant
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:48:44
   |
LL |     let mut foo = 0;
   |     ----------- help: consider using `const` instead of `let`: `const foo`
...
LL |         asm!("{}", clobber_abi("C"), const foo);
   |                                            ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55:31
   |
LL |     let mut foo = 0;
LL |     let mut foo = 0;
   |     ----------- help: consider using `const` instead of `let`: `const foo`
...
LL |         asm!("{a}", a = const foo, a = const bar);
   |                               ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:55:46
   |
LL |     let mut bar = 0;
LL |     let mut bar = 0;
   |     ----------- help: consider using `const` instead of `let`: `const bar`
...
LL |         asm!("{a}", a = const foo, a = const bar);
   |                                              ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:62:45
   |
LL |     let mut bar = 0;
LL |     let mut bar = 0;
   |     ----------- help: consider using `const` instead of `let`: `const bar`
...
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:65:45
   |
LL |     let mut bar = 0;
LL |     let mut bar = 0;
   |     ----------- help: consider using `const` instead of `let`: `const bar`
...
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
  --> /checkout/src/test/ui/asm/aarch64/parse-error.rs:68:41
   |
LL |     let mut bar = 0;
LL |     let mut bar = 0;
   |     ----------- help: consider using `const` instead of `let`: `const bar`
...
LL |         asm!("{1}", in("x0") foo, const bar);
   |                                         ^^^ non-constant value
error: aborting due to 64 previous errors

For more information about this error, try `rustc --explain E0435`.

---
test result: FAILED. 12419 passed; 1 failed; 150 ignored; 0 measured; 0 filtered out; finished in 149.02s



command did not execute successfully: "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-aarch64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "aarch64-unknown-linux-gnu" "--host" "aarch64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/aarch64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--llvm-version" "13.0.0-rust-1.60.0-nightly" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwp engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink libdriver lineeditor linker lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always"


Build completed unsuccessfully in 0:19:54

@bors
Copy link
Contributor

bors commented Jan 31, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 31, 2022
@bors
Copy link
Contributor

bors commented Jan 31, 2022

☔ The latest upstream changes (presumably #90891) made this pull request unmergeable. Please resolve the merge conflicts.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.