]> git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/auxiliary/private-inferred-type.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / test / compile-fail / auxiliary / private-inferred-type.rs
1 // Copyright 2017 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 #![feature(decl_macro)]
12
13 fn priv_fn() {}
14 static PRIV_STATIC: u8 = 0;
15 enum PrivEnum { Variant }
16 pub enum PubEnum { Variant }
17 trait PrivTrait { fn method() {} }
18 impl PrivTrait for u8 {}
19 pub trait PubTrait { fn method() {} }
20 impl PubTrait for u8 {}
21 struct PrivTupleStruct(u8);
22 pub struct PubTupleStruct(u8);
23 impl PubTupleStruct { fn method() {} }
24
25 struct Priv;
26 pub type Alias = Priv;
27 pub struct Pub<T = Alias>(pub T);
28
29 impl Pub<Priv> {
30 pub fn static_method() {}
31 }
32 impl Pub<u8> {
33 fn priv_method(&self) {}
34 }
35
36 pub macro m() {
37 priv_fn;
38 PRIV_STATIC;
39 PrivEnum::Variant;
40 PubEnum::Variant;
41 <u8 as PrivTrait>::method;
42 <u8 as PubTrait>::method;
43 PrivTupleStruct;
44 PubTupleStruct;
45 Pub(0u8).priv_method();
46 }