]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/private-variant-and-crate-reexport.rs
New upstream version 1.18.0+dfsg1
[rustc.git] / src / test / compile-fail / private-variant-and-crate-reexport.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
5bcae85e 11#![deny(private_in_public)]
9cc50fc6
SL
12#![allow(dead_code)]
13
7453a54e 14extern crate core;
5bcae85e 15pub use core as reexported_core; //~ ERROR extern crate `core` is private, and cannot be reexported
7453a54e
SL
16//~^ WARNING hard error
17
9cc50fc6 18mod m1 {
5bcae85e 19 pub use ::E::V; //~ ERROR variant `V` is private, and cannot be reexported
9cc50fc6
SL
20 //~^ WARNING hard error
21}
22
23mod m2 {
5bcae85e 24 pub use ::E::{V}; //~ ERROR variant `V` is private, and cannot be reexported
9cc50fc6
SL
25 //~^ WARNING hard error
26}
27
28mod m3 {
5bcae85e 29 pub use ::E::V::{self}; //~ ERROR variant `V` is private, and cannot be reexported
9cc50fc6
SL
30 //~^ WARNING hard error
31}
32
33mod m4 {
5bcae85e 34 pub use ::E::*; //~ ERROR variant `V` is private, and cannot be reexported
9cc50fc6
SL
35 //~^ WARNING hard error
36}
37
38enum E { V }
39
5bcae85e 40fn main() {}