]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-arg-doc-comment.rs
Rollup merge of #92024 - pcwalton:per-codegen-unit-names, r=davidtwco
[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 `&str`
21     //~| ERROR mismatched types
22     //~| NOTE expected `u8`, found `&str`
23     bar("");
24     //~^ ERROR mismatched types
25     //~| NOTE expected `i32`, found `&str`
26 }