2019-06-09 05:58:40 -05:00
|
|
|
extern "C" {
|
|
|
|
fn ffi(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
type FnType = fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
pub fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
) {}
|
|
|
|
|
|
|
|
struct SelfStruct {}
|
|
|
|
impl SelfStruct {
|
|
|
|
fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
self,
|
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
) {}
|
2019-09-29 02:26:02 -05:00
|
|
|
|
|
|
|
fn issue_64682_associated_fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-09-29 02:26:02 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 02:26:02 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 02:26:02 -05:00
|
|
|
) {}
|
2019-06-09 05:58:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct RefStruct {}
|
|
|
|
impl RefStruct {
|
|
|
|
fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
&self,
|
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
) {}
|
|
|
|
}
|
|
|
|
trait RefTrait {
|
|
|
|
fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
&self,
|
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
) {}
|
2019-09-29 02:26:02 -05:00
|
|
|
|
|
|
|
fn issue_64682_associated_fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-09-29 02:26:02 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 02:26:02 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 02:26:02 -05:00
|
|
|
) {}
|
2019-06-09 05:58:40 -05:00
|
|
|
}
|
2019-09-29 02:26:02 -05:00
|
|
|
|
2019-06-09 05:58:40 -05:00
|
|
|
impl RefTrait for RefStruct {
|
|
|
|
fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
&self,
|
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = |
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 16:49:20 -06:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32
|
2022-06-03 17:04:19 -05:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 05:58:40 -05:00
|
|
|
| {};
|
|
|
|
}
|