]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-3556.rs
Auto merge of #94799 - lcnr:list-ty-perf, r=petrochenkov
[rust.git] / src / test / ui / issues / issue-3556.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 #[derive(Debug)]
5 enum Token {
6     Text(String),
7     ETag(Vec<String>, String),
8     UTag(Vec<String>, String),
9     Section(Vec<String>, bool, Vec<Token>, String,
10             String, String, String, String),
11     IncompleteSection(Vec<String>, bool, String, bool),
12     Partial(String, String, String),
13 }
14
15 fn check_strs(actual: &str, expected: &str) -> bool
16 {
17     if actual != expected
18     {
19         println!("Found {}, but expected {}", actual, expected);
20         return false;
21     }
22     return true;
23 }
24
25 pub fn main()
26 {
27     let t = Token::Text("foo".to_string());
28     let u = Token::Section(vec!["alpha".to_string()],
29                     true,
30                     vec![t],
31                     "foo".to_string(),
32                     "foo".to_string(), "foo".to_string(), "foo".to_string(),
33                     "foo".to_string());
34     let v = format!("{:?}", u);    // this is the line that causes the seg fault
35     assert!(!v.is_empty());
36 }