]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-5666.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-5666.rs
1 // run-pass
2 #![feature(box_syntax)]
3
4 struct Dog {
5     name : String
6 }
7
8 trait Barks {
9     fn bark(&self) -> String;
10 }
11
12 impl Barks for Dog {
13     fn bark(&self) -> String {
14         return format!("woof! (I'm {})", self.name);
15     }
16 }
17
18
19 pub fn main() {
20     let snoopy = box Dog{name: "snoopy".to_string()};
21     let bubbles = box Dog{name: "bubbles".to_string()};
22     let barker = [snoopy as Box<dyn Barks>, bubbles as Box<dyn Barks>];
23
24     for pup in &barker {
25         println!("{}", pup.bark());
26     }
27 }