]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/fn-arg-doc-comment.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / parser / fn-arg-doc-comment.rs
CommitLineData
a1dfa0c6
XL
1pub fn f(
2 /// Comment
dc9dc135 3 //~^ ERROR documentation comments cannot be applied to function parameters
a1dfa0c6
XL
4 //~| NOTE doc comments are not allowed here
5 id: u8,
6 /// Other
dc9dc135 7 //~^ ERROR documentation comments cannot be applied to function parameters
a1dfa0c6
XL
8 //~| NOTE doc comments are not allowed here
9 a: u8,
10) {}
11
a1dfa0c6 12fn bar(id: #[allow(dead_code)] i32) {}
dc9dc135 13//~^ ERROR attributes cannot be applied to a function parameter's type
a1dfa0c6
XL
14//~| NOTE attributes are not allowed here
15
16fn main() {
17 // verify that the parser recovered and properly typechecked the args
18 f("", "");
19 //~^ ERROR mismatched types
60c5eb7d 20 //~| NOTE expected `u8`, found `&str`
a1dfa0c6 21 //~| ERROR mismatched types
60c5eb7d 22 //~| NOTE expected `u8`, found `&str`
a1dfa0c6
XL
23 bar("");
24 //~^ ERROR mismatched types
60c5eb7d 25 //~| NOTE expected `i32`, found `&str`
a1dfa0c6 26}