2019-06-09 10:58:40 +00:00
|
|
|
extern "C" {
|
|
|
|
fn ffi(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
type FnType = fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
pub fn foo(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00: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 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
) {}
|
2019-09-29 07:26:02 +00:00
|
|
|
|
|
|
|
fn issue_64682_associated_fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-09-29 07:26:02 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 07:26:02 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 07:26:02 +00:00
|
|
|
) {}
|
2019-06-09 10:58:40 +00: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 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00: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 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
) {}
|
2019-09-29 07:26:02 +00:00
|
|
|
|
|
|
|
fn issue_64682_associated_fn(
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: i32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-09-29 07:26:02 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 07:26:02 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-09-29 07:26:02 +00:00
|
|
|
) {}
|
2019-06-09 10:58:40 +00:00
|
|
|
}
|
2019-09-29 07:26:02 +00:00
|
|
|
|
2019-06-09 10:58:40 +00: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 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Qux
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32,
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = |
|
|
|
|
/// Foo
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[test] a: u32,
|
2020-11-18 22:49:20 +00:00
|
|
|
//~^ ERROR expected non-macro attribute, found attribute macro
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Bar
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[must_use]
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
/// Baz
|
|
|
|
//~^ ERROR documentation comments cannot be applied to function
|
|
|
|
#[no_mangle] b: i32
|
2022-06-03 22:04:19 +00:00
|
|
|
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
|
2019-06-09 10:58:40 +00:00
|
|
|
| {};
|
|
|
|
}
|