Suggest macro call when not sure that it is fn definition
This commit is contained in:
parent
c82e9e8e1e
commit
df357b20be
20 changed files with 33 additions and 37 deletions
|
|
@ -16,5 +16,5 @@ struct X {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let y = X {a = 1};
|
||||
let y = X {a: 1};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ struct X {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let y = X {a = 1};
|
||||
let y = X {a: 1};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ struct X {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let y = X {a = 1};
|
||||
let y = X {a: 1};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ fn main() {
|
|||
println!("Y {}",x);
|
||||
return x;
|
||||
};
|
||||
//~^ ERROR expected item, found `;`
|
||||
|
||||
caller(bar_handler);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ struct Foo<B> {
|
|||
|
||||
fn bar() {
|
||||
let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
fn main() {
|
||||
let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@
|
|||
pub fn main() {
|
||||
struct Foo { x: isize }
|
||||
let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{`
|
||||
//~^ ERROR expected item, found `=`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let v[0] = v[1]; //~ error: expected one of `:`, `;`, `=`, or `@`, found `[`
|
||||
}
|
||||
let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
fn main() {
|
||||
let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
fn main() {
|
||||
let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
fn main() {
|
||||
let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@
|
|||
fn main() {
|
||||
let 10 - 3 ..= 10 = 8;
|
||||
//~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -15,4 +15,4 @@
|
|||
pub fn main() {
|
||||
let r = 1..2..3;
|
||||
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -15,4 +15,4 @@
|
|||
pub fn main() {
|
||||
let r = ..1..2;
|
||||
//~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
|
||||
}
|
||||
} //~ ERROR expected item, found `}`
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ error: missing `fn` for method definition
|
|||
|
|
||||
11 | pub foo(s: usize) { bar() }
|
||||
| ^
|
||||
|
|
||||
help: add `fn` here to parse `foo` as a public method
|
||||
|
|
||||
11 | pub fn foo(s: usize) { bar() }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: missing `fn` or `struct` for method or struct definition
|
|||
--> $DIR/pub-ident-fn-or-struct-2.rs:11:4
|
||||
|
|
||||
11 | pub S();
|
||||
| ^
|
||||
| ---^- help: if you meant to call a macro, write instead: `S!`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: missing `fn` or `struct` for method or struct definition
|
|||
--> $DIR/pub-ident-fn-or-struct.rs:11:4
|
||||
|
|
||||
11 | pub S (foo) bar
|
||||
| ^
|
||||
| ---^- help: if you meant to call a macro, write instead: `S!`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ error: missing `fn` for method definition
|
|||
|
|
||||
11 | pub foo(s: usize) -> bool { true }
|
||||
| ^^^
|
||||
|
|
||||
help: add `fn` here to parse `foo` as a public method
|
||||
|
|
||||
11 | pub fn foo(s: usize) -> bool { true }
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ error: missing `struct` for struct definition
|
|||
|
|
||||
11 | pub S {
|
||||
| ^
|
||||
|
|
||||
help: add `struct` here to parse `S` as a public struct
|
||||
|
|
||||
11 | pub struct S {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue