diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-06-16 07:24:39 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-16 07:24:39 +0900 |
| commit | 52afa3a70c2f5fad0c61f06497b13b66490b97a8 (patch) | |
| tree | 8e4eb1be9b679a408a41704e115d9c40919345be /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | b37e4e043eaeb74a8cf284bd7fddcce7d370552d (diff) | |
| parent | 33ccd76562fe549e147bfccd0f5666505401ae0d (diff) | |
| download | rust-52afa3a70c2f5fad0c61f06497b13b66490b97a8.tar.gz rust-52afa3a70c2f5fad0c61f06497b13b66490b97a8.zip | |
Rollup merge of #97964 - WaffleLapkin:fix_borrow_par_suggestions, r=compiler-errors
Fix suggestions for `&a: T` parameters
I've accidentally discovered that we have broken suggestions for `&a: T` parameters:
```rust
fn f(&mut bar: u32) {}
fn main() {
let _ = |&mut a| ();
}
```
```text
error[E0308]: mismatched types
--> ./t.rs:1:6
|
1 | fn f(&mut bar: u32) {}
| ^^^^^^^^-----
| | |
| | expected due to this
| expected `u32`, found `&mut _`
| help: did you mean `bar`: `&u32`
|
= note: expected type `u32`
found mutable reference `&mut _`
error[E0308]: mismatched types
--> ./t.rs:4:23
|
4 | let _: fn(u32) = |&mut a| ();
| ^^^^^--
| | |
| | expected due to this
| expected `u32`, found `&mut _`
| help: did you mean `a`: `&u32`
|
= note: expected type `u32`
found mutable reference `&mut _`
```
It's hard to see, but
1. The help span is overlapping with "expected" spans
2. It suggests `fn f( &u32) {}` (no `mut` and lost parameter name) and `|&u32 ()` (no closing `|` and lost parameter name)
I've tried to fix this.
r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
0 files changed, 0 insertions, 0 deletions
