]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/deprecation-sanity.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / test / compile-fail / deprecation-sanity.rs
CommitLineData
9cc50fc6
SL
1// Copyright 2015 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.
10
11// Various checks that deprecation attributes are used correctly
12
9cc50fc6
SL
13mod bogus_attribute_types_1 {
14 #[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
15 fn f1() { }
16
17 #[deprecated(since = "a", note)] //~ ERROR incorrect meta item
18 fn f2() { }
19
20 #[deprecated(since, note = "a")] //~ ERROR incorrect meta item
21 fn f3() { }
22
23 #[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
24 fn f5() { }
25
26 #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
27 fn f6() { }
28}
29
30#[deprecated(since = "a", note = "b")]
31#[deprecated(since = "a", note = "b")]
32fn multiple1() { } //~ ERROR multiple deprecated attributes
33
34#[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items
35fn f1() { }
36
37fn main() { }