/src/test/compile-fail/auxiliary/static_priv_by_default.rs

https://gitlab.com/alx741/rust · Rust · 61 lines · 40 code · 11 blank · 10 comment · 0 complexity · 55db7e1be4f5a992bb0695425f0f1f56 MD5 · raw file

  1. // Copyright 2013 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. #![crate_type = "lib"]
  11. static private: isize = 0;
  12. pub static public: isize = 0;
  13. pub struct A(());
  14. impl A {
  15. fn foo() {}
  16. }
  17. mod foo {
  18. pub static a: isize = 0;
  19. pub fn b() {}
  20. pub struct c;
  21. pub enum d {}
  22. pub type e = isize;
  23. pub struct A(());
  24. impl A {
  25. fn foo() {}
  26. }
  27. // these are public so the parent can reexport them.
  28. pub static reexported_a: isize = 0;
  29. pub fn reexported_b() {}
  30. pub struct reexported_c;
  31. pub enum reexported_d {}
  32. pub type reexported_e = isize;
  33. }
  34. pub mod bar {
  35. pub use foo::reexported_a as e;
  36. pub use foo::reexported_b as f;
  37. pub use foo::reexported_c as g;
  38. pub use foo::reexported_d as h;
  39. pub use foo::reexported_e as i;
  40. }
  41. pub static a: isize = 0;
  42. pub fn b() {}
  43. pub struct c;
  44. pub enum d {}
  45. pub type e = isize;
  46. static j: isize = 0;
  47. fn k() {}
  48. struct l;
  49. enum m {}
  50. type n = isize;