]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/unused-attr.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / test / compile-fail / unused-attr.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
85aaf69f 10
1a4d82fc 11#![deny(unused_attributes)]
3b2f2976 12#![allow(dead_code, unused_imports, unused_extern_crates)]
92a42be0 13#![feature(custom_attribute)]
1a4d82fc
JJ
14
15#![foo] //~ ERROR unused attribute
16
17#[foo] //~ ERROR unused attribute
18extern crate core;
19
20#[foo] //~ ERROR unused attribute
21use std::collections;
22
23#[foo] //~ ERROR unused attribute
24extern "C" {
25 #[foo] //~ ERROR unused attribute
26 fn foo();
27}
28
29#[foo] //~ ERROR unused attribute
30mod foo {
31 #[foo] //~ ERROR unused attribute
32 pub enum Foo {
33 #[foo] //~ ERROR unused attribute
34 Bar,
35 }
36}
37
38#[foo] //~ ERROR unused attribute
39fn bar(f: foo::Foo) {
40 match f {
41 #[foo] //~ ERROR unused attribute
42 foo::Foo::Bar => {}
43 }
44}
45
46#[foo] //~ ERROR unused attribute
47struct Foo {
48 #[foo] //~ ERROR unused attribute
49 a: isize
50}
51
52#[foo] //~ ERROR unused attribute
53trait Baz {
54 #[foo] //~ ERROR unused attribute
85aaf69f 55 fn blah(&self);
1a4d82fc 56 #[foo] //~ ERROR unused attribute
85aaf69f 57 fn blah2(&self) {}
1a4d82fc
JJ
58}
59
60fn main() {}