diff options
| author | Seiichi Uchida <seuchida@gmail.com> | 2018-01-30 13:12:37 +0900 |
|---|---|---|
| committer | flip1995 <uwdkn@student.kit.edu> | 2018-05-02 11:32:33 +0200 |
| commit | e27d20a7ba01a67d7b46ff0edef2fa53f5421035 (patch) | |
| tree | fdef741a16cfc9b38c54aaaeadcb5e733b764cf7 /src/test/compile-fail | |
| parent | c1168be5360f17516b233be85ebb193bb4e612bf (diff) | |
Add tests for a new feature 'tool_attributes'
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/feature-gate-tool_attributes.rs | 15 | ||||
| -rw-r--r-- | src/test/compile-fail/unknown-tool-name.rs | 16 | ||||
| -rw-r--r-- | src/test/compile-fail/unknown_tool_attributes-1.rs | 18 |
3 files changed, 49 insertions, 0 deletions
diff --git a/src/test/compile-fail/feature-gate-tool_attributes.rs b/src/test/compile-fail/feature-gate-tool_attributes.rs new file mode 100644 index 00000000000..5a7536ca330 --- /dev/null +++ b/src/test/compile-fail/feature-gate-tool_attributes.rs @@ -0,0 +1,15 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + #[rustfmt::skip] //~ ERROR scoped attribute `rustfmt::skip` is experimental + let x = + 3; +} diff --git a/src/test/compile-fail/unknown-tool-name.rs b/src/test/compile-fail/unknown-tool-name.rs new file mode 100644 index 00000000000..1ee837b05d8 --- /dev/null +++ b/src/test/compile-fail/unknown-tool-name.rs @@ -0,0 +1,16 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(tool_attributes)] + +#![foo::bar] //~ ERROR An unkown tool name found in scoped attributes: `foo::bar`. [E0693] + +#[foo::bar] //~ ERROR An unkown tool name found in scoped attributes: `foo::bar`. [E0693] +fn main() {} diff --git a/src/test/compile-fail/unknown_tool_attributes-1.rs b/src/test/compile-fail/unknown_tool_attributes-1.rs new file mode 100644 index 00000000000..08a7bfed278 --- /dev/null +++ b/src/test/compile-fail/unknown_tool_attributes-1.rs @@ -0,0 +1,18 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that 'custom_attributes' feature does not allow scoped attributes. + +#![feature(custom_attributes)] + +#[foo::bar] +//~^ ERROR scoped attribute `foo::bar` is experimental (see issue #44690) [E0658] +//~^^ ERROR An unkown tool name found in scoped attributes: `foo::bar`. [E0693] +fn main() {} |
