]> git.lizzy.rs Git - rust.git/commit
Identify missing item category in `impl`s
authorEsteban Küber <esteban@kuber.com.ar>
Sat, 25 Mar 2017 06:00:21 +0000 (23:00 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Sat, 25 Mar 2017 06:06:00 +0000 (23:06 -0700)
commit57009caabd2a45a6efa4d36149feec39ab0a0658
treefbf7cad105ada8a7db30f266ce8b6313eeb62174
parentc62e532f3de4c0254b772c36fe629b2042efd107
Identify missing item category in `impl`s

```rust
struct S;
impl S {
    pub hello_method(&self) {
        println!("Hello");
    }
}
fn main() { S.hello_method(); }
```

```rust
error: can't qualify macro invocation with `pub`
 --> file.rs:3:4
  |
3 |     pub hello_method(&self) {
  |     ^^^-            - expected `!` here for a macro invocation
  |        |
  |        did you mean to write `fn` here for a method declaration?
  |
  = help: try adjusting the macro to put `pub` inside the invocation
```
src/libsyntax/parse/parser.rs
src/test/ui/did_you_mean/issue-40006.rs [new file with mode: 0644]
src/test/ui/did_you_mean/issue-40006.stderr [new file with mode: 0644]