• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // run-pass
2 
3 // Tests for if as expressions returning boxed types
test_box()4 fn test_box() {
5     let rs: Box<_> = if true { Box::new(100) } else { Box::new(101) };
6     assert_eq!(*rs, 100);
7 }
8 
main()9 pub fn main() { test_box(); }
10