]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-arg-doc-comment.rs
Auto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, r=aDotInTheVoid
[rust.git] / src / test / ui / parser / fn-arg-doc-comment.rs
1 pub fn f( //~ NOTE function defined here
2     /// Comment
3     //~^ ERROR documentation comments cannot be applied to function parameters
4     //~| NOTE doc comments are not allowed here
5     //~| NOTE
6     id: u8,
7     /// Other
8     //~^ ERROR documentation comments cannot be applied to function parameters
9     //~| NOTE doc comments are not allowed here
10     //~| NOTE
11     a: u8,
12 ) {}
13
14 fn bar(id: #[allow(dead_code)] i32) {}
15 //~^ ERROR attributes cannot be applied to a function parameter's type
16 //~| NOTE attributes are not allowed here
17 //~| NOTE function defined here
18 //~| NOTE
19
20 fn main() {
21     // verify that the parser recovered and properly typechecked the args
22     f("", "");
23     //~^ ERROR arguments to this function are incorrect
24     //~| NOTE expected `u8`, found `&str`
25     //~| NOTE expected `u8`, found `&str`
26     bar("");
27     //~^ ERROR mismatched types
28     //~| NOTE arguments to this function are incorrect
29     //~| NOTE expected `i32`, found `&str`
30 }