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 11 pull requests #122466

Closed
wants to merge 47 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercote and others added 30 commits March 1, 2024 13:27
This means `DiagCtxtInner::emit_diagnostic` can return its result
directly, rather than having to modify a local variable.
It has a single call site, and this will enable subsequent refactorings.
It results in a tiny bit of duplication (another
`self.treat_next_err_as_bug()` condition) but I think it's worth it to
get more code into the main `match`.
This will enable additional refactorings.
Note that `self.suppressed_expected_diag` is no longer set for
`ForceWarning`, which is good. Nor is `TRACK_DIAGNOSTIC` called for
`Allow`, which is also good.
Also add an assertion for the levels allowed with `has_future_breakage`.
This match is complex enough that it's a good idea to enumerate every
variant.

This also means `can_be_top_or_sub` can just be `can_be_subdiag`.
Option::map, for example, looks like this:

    option<t>, (t -> u) -> option<u>

This syntax searches all of the HOFs in Rust: traits Fn, FnOnce,
and FnMut, and bare fn primitives.
It's going to be a no-op on the empty list anyway
(we have plenty of test cases that return nothing)
so why send extra code?
Initialize them before the search index is loaded.
This is implemented, in addition to the ML-style one,
because Rust does it. If we don't, we'll never hear the end of it.

This commit also refactors some duplicate parts of the parser
into a dedicated function.
I've been experimenting with transforming the StableMIR to instrument
the code with potential UB checks. The modified body will only
be used by our analysis tool, however, constants in StableMIR must be
backed by rustc constants. Thus, I'm adding a few functions to build
constants, such as building string and other primitives.
- Replace some nested if-let with let-chains
- Tweak a match pattern to allow shorthand struct syntax
- Fuse an `is_empty` check with getting the last element
- Merge some common code that emits `MalformedAttribute` and continues
- Format `"{tool}::{name}"` in a way that's consistent with other match arms
- Replace if-let-else-panic with let-else
- Use early-exit to flatten a method body
…iper

Add CStr::bytes iterator

See rust-lang/libs-team#135 for an ACP.

Since rust-lang/libs-team#134 was also accepted, this type is now `core::ffi::c_str::Bytes` instead of `core::ffi::CStrBytes`.
unix time module now return result

First try to fix rust-lang#108277 without break anything.

if anyone who read this know tips to be able to check compilation for different target I could use some help. So far I installed many target with rustup but `./x check --all-targets` doesn't seem to use them.

TODO:

- [x] better error
- [ ] test, how ?

`@rustbot` label -S-waiting-on-author +S-waiting-on-review
…-hof, r=GuillaumeGomez

rustdoc-search: search types by higher-order functions

This feature extends rustdoc with syntax and search index information for searching function pointers and closures (Higher-Order Functions, or HOF). Part of rust-lang#60485

This PR adds two syntaxes: a high-level one for finding any kind of HOF, and a direct implementation of the parenthesized path syntax that Rust itself uses.

## Preview pages

| Query | Results |
|-------|---------|
| [`option<T>, (fnonce (T) -> bool) -> option<T>`][optionfilter] | `Option::filter` |
| [`option<T>, (T -> bool) -> option<T>`][optionfilter2] | `Option::filter` |

Updated chapter of the book: https://notriddle.com/rustdoc-html-demo-9/search-hof/rustdoc/read-documentation/search.html

[optionfilter]: https://notriddle.com/rustdoc-html-demo-9/search-hof/std/vec/struct.Vec.html?search=option<T>%2C+(fnonce+(T)+->+bool)+->+option<T>&filter-crate=std
[optionfilter2]: https://notriddle.com/rustdoc-html-demo-9/search-hof/std/vec/struct.Vec.html?search=option<T>%2C+(T+->+bool)+->+option<T>&filter-crate=std

## Motivation

When type-based search was first landed, it was directly [described as incomplete][a comment].

[a comment]: rust-lang#23289 (comment)

Filling out the missing functionality is going to mean adding support for more of Rust's [type expression] syntax, such as references, raw pointers, function pointers, and closures. This PR adds function pointers and closures.

[type expression]: https://doc.rust-lang.org/reference/types.html#type-expressions

There's been demand for something "like Hoogle, but for Rust" expressed a few times [1](https://www.reddit.com/r/rust/comments/y8sbid/is_there_a_website_like_haskells_hoogle_for_rust/) [2](https://users.rust-lang.org/t/rust-equivalent-of-haskells-hoogle/102280) [3](https://internals.rust-lang.org/t/std-library-inclusion-policy/6852/2) [4](https://discord.com/channels/442252698964721669/448238009733742612/1109502307495858216). Some of them just don't realize what functionality already exists ([`Duration -> u64`](https://doc.rust-lang.org/nightly/std/?search=duration%20-%3E%20u64) already works), but a lot of them specifically want to search for higher-order functions like option combinators.

## Guide-level explanation (from the Rustdoc book)

To search for a function that accepts a function as a parameter, like `Iterator::all`, wrap the nested signature in parenthesis, as in [`Iterator<T>, (T -> bool) -> bool`][iterator-all]. You can also search for a specific closure trait, such as `Iterator<T>, (FnMut(T) -> bool) -> bool`, but you need to know which one you want.

[iterator-all]: https://notriddle.com/rustdoc-html-demo-9/search-hof/std/vec/struct.Vec.html?search=Iterator<T>%2C+(T+->+bool)+->+bool&filter-crate=std

## Reference-level description (also from the Rustdoc book)

### Primitives with Special Syntax

<table>
<thead>
  <tr>
    <th>Shorthand</th>
    <th>Explicit names</th>
  </tr>
</thead>
<tbody>
  <tr><td colspan="2">Before this PR</td></tr>
  <tr>
    <td><code>[]</code></td>
    <td><code>primitive:slice</code> and/or <code>primitive:array</code></td>
  </tr>
  <tr>
    <td><code>[T]</code></td>
    <td><code>primitive:slice&lt;T&gt;</code> and/or <code>primitive:array&lt;T&gt;</code></td>
  </tr>
  <tr>
    <td><code>!</code></td>
    <td><code>primitive:never</code></td>
  </tr>
  <tr>
    <td><code>()</code></td>
    <td><code>primitive:unit</code> and/or <code>primitive:tuple</code></td>
  </tr>
  <tr>
    <td><code>(T)</code></td>
    <td><code>T</code></td>
  </tr>
  <tr>
    <td><code>(T,)</code></td>
    <td><code>primitive:tuple&lt;T&gt;</code></td>
  </tr>
  <tr><td colspan="2">After this PR</td></tr>
  <tr>
    <td><code>(T, U -> V, W)</code></td>
    <td><code>fn(T, U) -> (V, W)</code>, Fn, FnMut, and FnOnce</td>
  </tr>
</tbody>
</table>

The `->` operator has lower precedence than comma. If it's not wrapped in brackets, it delimits the return value for the function being searched for. To search for functions that take functions as parameters, use parenthesis.

### Search query grammar

```ebnf
ident = *(ALPHA / DIGIT / "_")
path = ident *(DOUBLE-COLON ident) [BANG]
slice-like = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
tuple-like = OPEN-PAREN [ nonempty-arg-list ] CLOSE-PAREN
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like)
type-sep = COMMA/WS *(COMMA/WS)
nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep) [ return-args ]
generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
normal-generics = OPEN-ANGLE-BRACKET [ generic-arg-list ] *(type-sep)
            CLOSE-ANGLE-BRACKET
fn-like-generics = OPEN-PAREN [ nonempty-arg-list ] CLOSE-PAREN [ RETURN-ARROW arg ]
generics = normal-generics / fn-like-generics
return-args = RETURN-ARROW *(type-sep) nonempty-arg-list

exact-search = [type-filter *WS COLON] [ RETURN-ARROW ] *WS QUOTE ident QUOTE [ generics ]
type-search = [ nonempty-arg-list ]

query = *WS (exact-search / type-search) *WS

; unchanged parts of the grammar, like the full list of type filters, are omitted
```

## Future direction

### The remaining type expression grammar

As described in rust-lang#118194, this is another step in the type expression grammar: BareFunction, and the function-like mode of TypePath, are now supported.

* RawPointerType and ReferenceType actually are a priority.
* ImplTraitType and TraitObjectType (and ImplTraitTypeOneBound and TraitObjectTypeOneBound) aren't as much of a priority, since they desugar pretty easily.

### Search subtyping and traits

This is the other major factor that makes it less useful than it should be.

* `iterator<result<t>> -> result<t>` doesn't find `Result::from_iter`. You have to search [`intoiterator<result<t>> -> result<t>`](https://notriddle.com/rustdoc-html-demo-9/search-hof/std/vec/struct.Vec.html?search=intoiterator%3Cresult%3Ct%3E%3E%20-%3E%20result%3Ct%3E&filter-crate=std). Nobody's going to search for IntoIterator unless they basically already know about it and don't need the search engine anyway.

* Iterator combinators are usually structs that happen to implement Iterator, like `std::iter::Map`.

To solve these cases, it needs to look at trait implementations, knowing that Iterator is a "subtype of" IntoIterator, and Map is a "subtype of" Iterator, so `iterator -> result` is a subtype of `intoiterator -> result` and `iterator<t>, (t -> u) -> iterator<u>` is a subtype of [`iterator<t>, (t -> u) -> map<t -> u>`](https://notriddle.com/rustdoc-html-demo-9/search-hof/std/vec/struct.Vec.html?search=iterator%3Ct%3E%2C%20(t%20-%3E%20u)%20-%3E%20map%3Ct%20-%3E%20u%3E&filter-crate=std).
…OSTIC-calls, r=oli-obk

Document `TRACK_DIAGNOSTIC` calls.

r? ````@cjgillot````
…ywiser

Document how removing a type's field can be bad and what to do instead

Related to rust-lang#119645
…mease

Mention Register Size in `#[warn(asm_sub_register)]`

Fixes rust-lang#121593

Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…Jung

Various cleanups around the const eval query providers

r? ````@RalfJung````

after this, working on running validation before interning starts with swapping the order of two lines of code
Add methods to create StableMIR constant

I've been experimenting with transforming the StableMIR to instrument the code with potential UB checks.

The modified body will only be used by our analysis tool, however, constants in StableMIR must be backed by rustc constants. Thus, I'm adding a few functions to build constants, such as building string and other primitives.

One question I have is whether we should create a global allocation instead for strings.

r? ```@oli-obk```
Various style improvements to `rustc_lint::levels`

While reading this file, I noticed a few opportunities to make things a little nicer:

- Replace some nested if-let with let-chains
- Tweak a match pattern to allow shorthand struct syntax
- Fuse an `is_empty` check with getting the last element
- Merge some common code that emits `MalformedAttribute` and continues
- Format `"{tool}::{name}"` in a way that's consistent with other match arms
- Replace if-let-else-panic with let-else
- Use early-exit to flatten a method body

Some of these changes cause indentation churn, so ignoring whitespace is recommended.
const-eval: organize and extend tests for required-consts

This includes some tests that are known-broken and hence disabled (due to rust-lang#107503).

r? ```@oli-obk```
…, r=Amanieu

fix unsoundness in Step::forward_unchecked for signed integers

Fixes rust-lang#122420

```rust
pub fn foo(a: i8, b: u8) -> i8 {
    unsafe { a.checked_add_unsigned(b).unwrap_unchecked() }
}
```

still compiles down to a single arithmetic instruction ([godbolt](https://rust.godbolt.org/z/qsd3xYWfE)).

But we may be losing some loop optimizations if llvm can no longer easily derive that it's a finite counted loop from the no-wrapping flags.
@rustbot rustbot added O-unix Operating system: Unix-like 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 Mar 14, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Mar 14, 2024

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

Rollup of 11 pull requests

Successful merges:

 - rust-lang#104353 (Add CStr::bytes iterator)
 - rust-lang#114038 (unix time module now return result)
 - rust-lang#119676 (rustdoc-search: search types by higher-order functions)
 - rust-lang#120699 (Document `TRACK_DIAGNOSTIC` calls.)
 - rust-lang#121899 (Document how removing a type's field can be bad and what to do instead)
 - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`)
 - rust-lang#122397 (Various cleanups around the const eval query providers)
 - rust-lang#122405 (Add methods to create StableMIR constant)
 - rust-lang#122416 (Various style improvements to `rustc_lint::levels`)
 - rust-lang#122440 (const-eval: organize and extend tests for required-consts)
 - rust-lang#122461 (fix unsoundness in Step::forward_unchecked for signed integers)

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

bors commented Mar 14, 2024

⌛ Testing commit 787cb68 with merge 10a447d...

@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)

---- [ui] tests/ui/asm/aarch64/type-check-3.rs stdout ----
diff of stderr:

4 LL |         asm!("{}", in(reg) 0u8);
5    |               ^^           --- for this argument
6    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
9    = note: `#[warn(asm_sub_register)]` on by default
11 warning: formatting may not be suitable for sub-register argument


14 LL |         asm!("{}", in(reg) 0u16);
15    |               ^^           ---- for this argument
16    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
20 warning: formatting may not be suitable for sub-register argument
21   --> $DIR/type-check-3.rs:52:15


23 LL |         asm!("{}", in(reg) 0i32);
24    |               ^^           ---- for this argument
25    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
29 warning: formatting may not be suitable for sub-register argument
30   --> $DIR/type-check-3.rs:54:15


32 LL |         asm!("{}", in(reg) 0f32);
33    |               ^^           ---- for this argument
34    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
38 warning: formatting may not be suitable for sub-register argument
39   --> $DIR/type-check-3.rs:57:15


41 LL |         asm!("{}", in(vreg) 0i16);
42    |               ^^            ---- for this argument
43    |
-    = help: use `{0:h}` to have the register formatted as `h0`
-    = help: or use `{0:v}` to keep the default formatting of `v0`
+    = help: use `{0:h}` to have the register formatted as `h0` (for 16-bit values)
+    = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
47 warning: formatting may not be suitable for sub-register argument
48   --> $DIR/type-check-3.rs:59:15


50 LL |         asm!("{}", in(vreg) 0f32);
51    |               ^^            ---- for this argument
52    |
-    = help: use `{0:s}` to have the register formatted as `s0`
-    = help: or use `{0:v}` to keep the default formatting of `v0`
+    = help: use `{0:s}` to have the register formatted as `s0` (for 32-bit values)
+    = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
56 warning: formatting may not be suitable for sub-register argument
57   --> $DIR/type-check-3.rs:61:15


59 LL |         asm!("{}", in(vreg) 0f64);
60    |               ^^            ---- for this argument
61    |
-    = help: use `{0:d}` to have the register formatted as `d0`
-    = help: or use `{0:v}` to keep the default formatting of `v0`
+    = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
+    = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
65 warning: formatting may not be suitable for sub-register argument
66   --> $DIR/type-check-3.rs:63:15


68 LL |         asm!("{}", in(vreg_low16) 0f64);
69    |               ^^                  ---- for this argument
70    |
-    = help: use `{0:d}` to have the register formatted as `d0`
-    = help: or use `{0:v}` to keep the default formatting of `v0`
+    = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
+    = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
74 warning: formatting may not be suitable for sub-register argument
75   --> $DIR/type-check-3.rs:66:15


77 LL |         asm!("{0} {0}", in(reg) 0i16);
78    |               ^^^ ^^^           ---- for this argument
79    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
83 warning: formatting may not be suitable for sub-register argument
84   --> $DIR/type-check-3.rs:68:15


86 LL |         asm!("{0} {0:x}", in(reg) 0i16);
88    |
88    |
-    = help: use `{0:w}` to have the register formatted as `w0`
-    = help: or use `{0:x}` to keep the default formatting of `x0`
+    = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
+    = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
92 error: type `i128` cannot be used with this register class
93   --> $DIR/type-check-3.rs:73:28



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-check-3/type-check-3.stderr
To only update this specific test, also pass `--test-args asm/aarch64/type-check-3.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/aarch64/type-check-3.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/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-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/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-check-3" "-A" "unused" "-A" "internal_features" "-Crpath" "-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/type-check-3/auxiliary" "-C" "target-feature=+neon"
--- stderr -------------------------------
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:48:15
   |
   |
LL |         asm!("{}", in(reg) 0u8);
   |               ^^           --- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
   = note: `#[warn(asm_sub_register)]` on by default
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:50:15
   |
   |
LL |         asm!("{}", in(reg) 0u16);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:52:15
   |
   |
LL |         asm!("{}", in(reg) 0i32);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:54:15
   |
   |
LL |         asm!("{}", in(reg) 0f32);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:57:15
   |
   |
LL |         asm!("{}", in(vreg) 0i16);
   |               ^^            ---- for this argument
   |
   = help: use `{0:h}` to have the register formatted as `h0` (for 16-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:59:15
   |
   |
LL |         asm!("{}", in(vreg) 0f32);
   |               ^^            ---- for this argument
   |
   = help: use `{0:s}` to have the register formatted as `s0` (for 32-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:61:15
   |
   |
LL |         asm!("{}", in(vreg) 0f64);
   |               ^^            ---- for this argument
   |
   = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:63:15
   |
   |
LL |         asm!("{}", in(vreg_low16) 0f64);
   |               ^^                  ---- for this argument
   |
   = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:66:15
   |
   |
LL |         asm!("{0} {0}", in(reg) 0i16);
   |               ^^^ ^^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:68:15
   |
   |
LL |         asm!("{0} {0:x}", in(reg) 0i16);
   |
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
error: type `i128` cannot be used with this register class
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:73:28
   |
   |
LL |         asm!("{}", in(reg) 0i128);
   |
   |
   = note: register class `reg` supports these types: i8, i16, i32, i64, f32, f64

error: type `float64x2_t` cannot be used with this register class
   |
   |
LL |         asm!("{}", in(reg) f64x2);
   |
   |
   = note: register class `reg` supports these types: i8, i16, i32, i64, f32, f64
error: type `Simd256bit` cannot be used with this register class
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:77:29
   |
   |
LL |         asm!("{}", in(vreg) f64x4);
   |
   |
   = note: register class `vreg` supports these types: i8, i16, i32, i64, f32, f64, i8x8, i16x4, i32x2, i64x1, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2
error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:88:33
   |
   |
LL |         asm!("{:x}", inout(reg) 0u32 => val_f32);
   |                                 ^^^^    ^^^^^^^ type `f32`
   |                                 type `u32`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size


error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:90:33
   |
LL |         asm!("{:x}", inout(reg) 0u32 => val_ptr);
   |                                 ^^^^    ^^^^^^^ type `*mut u8`
   |                                 type `u32`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size


error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:92:33
   |
LL |         asm!("{:x}", inout(reg) main => val_u32);
   |                                 |
   |                                 type `fn()`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size

@bors
Copy link
Contributor

bors commented Mar 14, 2024

💔 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 Mar 14, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-hh9mjj4 branch March 16, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like 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. 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.