]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-arg-doc-comment.rs
Rollup merge of #61181 - GuillaumeGomez:fix-theme-checker, r=kinnison
[rust.git] / src / test / ui / parser / fn-arg-doc-comment.rs
1 pub fn f(
2     /// Comment
3     //~^ ERROR documentation comments cannot be applied to function parameters
4     //~| NOTE doc comments are not allowed here
5     //~| ERROR attributes on function parameters are unstable
6     //~| NOTE https://github.com/rust-lang/rust/issues/60406
7     id: u8,
8     /// Other
9     //~^ ERROR documentation comments cannot be applied to function parameters
10     //~| NOTE doc comments are not allowed here
11     //~| ERROR attributes on function parameters are unstable
12     //~| NOTE https://github.com/rust-lang/rust/issues/60406
13     a: u8,
14 ) {}
15
16 fn bar(id: #[allow(dead_code)] i32) {}
17 //~^ ERROR attributes cannot be applied to a function parameter's type
18 //~| NOTE attributes are not allowed here
19
20 fn main() {
21     // verify that the parser recovered and properly typechecked the args
22     f("", "");
23     //~^ ERROR mismatched types
24     //~| NOTE expected u8, found reference
25     //~| NOTE expected
26     //~| ERROR mismatched types
27     //~| NOTE expected u8, found reference
28     //~| NOTE expected
29     bar("");
30     //~^ ERROR mismatched types
31     //~| NOTE expected i32, found reference
32     //~| NOTE expected
33 }