/src/test/run-pass/auxiliary/issue-14421.rs

https://gitlab.com/alx741/rust · Rust · 35 lines · 19 code · 7 blank · 9 comment · 0 complexity · 5fe361f18005870eade16e260d986b21 MD5 · raw file

  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.
  10. #![crate_type="lib"]
  11. #![deny(warnings)]
  12. #![allow(dead_code)]
  13. pub use src::aliases::B;
  14. pub use src::hidden_core::make;
  15. mod src {
  16. pub mod aliases {
  17. use super::hidden_core::A;
  18. pub type B = A<f32>;
  19. }
  20. pub mod hidden_core {
  21. use super::aliases::B;
  22. pub struct A<T> { t: T }
  23. pub fn make() -> B { A { t: 1.0 } }
  24. impl<T> A<T> {
  25. pub fn foo(&mut self) { println!("called foo"); }
  26. }
  27. }
  28. }