]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-arg-doc-comment.rs
Stabilize `param_attrs` in Rust 1.39.0
[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     id: u8,
6     /// Other
7     //~^ ERROR documentation comments cannot be applied to function parameters
8     //~| NOTE doc comments are not allowed here
9     a: u8,
10 ) {}
11
12 fn bar(id: #[allow(dead_code)] i32) {}
13 //~^ ERROR attributes cannot be applied to a function parameter's type
14 //~| NOTE attributes are not allowed here
15
16 fn main() {
17     // verify that the parser recovered and properly typechecked the args
18     f("", "");
19     //~^ ERROR mismatched types
20     //~| NOTE expected u8, found reference
21     //~| NOTE expected
22     //~| ERROR mismatched types
23     //~| NOTE expected u8, found reference
24     //~| NOTE expected
25     bar("");
26     //~^ ERROR mismatched types
27     //~| NOTE expected i32, found reference
28     //~| NOTE expected
29 }