about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-18 10:47:33 +0000
committerbors <bors@rust-lang.org>2023-11-18 10:47:33 +0000
commite1e60b6976ed51e9464d15a2888d90c577dda223 (patch)
tree412cc889ace22d41fd865dbd8f56b36a8c7eab37 /compiler/rustc_codegen_gcc
parent6416e2e675504abc924592452e5f6874fdddb0dd (diff)
parent7141399454e75622fcc7b034b7e045a1b31f22d0 (diff)
downloadrust-e1e60b6976ed51e9464d15a2888d90c577dda223.tar.gz
rust-e1e60b6976ed51e9464d15a2888d90c577dda223.zip
Auto merge of #117924 - estebank:issue-53841, r=petrochenkov
When a local binding shadows a fn, point at fn def in call failure

When a local binding shadows a function that is then called, this local binding will cause an E0618 error. We now point not only at the binding definition, but also at the locally defined function of the same name.

```
error[E0618]: expected function, found `&str`
  --> $DIR/issue-22468.rs:3:13
   |
LL |     let foo = "bar";
   |         --- `foo` has type `&str`
LL |     let x = foo("baz");
   |             ^^^-------
   |             |
   |             call expression requires function
...
LL | fn foo(file: &str) -> bool {
   | -------------------------- this function of the same name is available here, but it shadowed by the local binding of the same name
```

Fix #53841
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions