os-rust/tests/ui/issues/issue-3556.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
972 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
2013-10-23 04:49:18 -04:00
2015-01-28 08:34:18 -05:00
#[derive(Debug)]
enum Token {
2014-10-02 08:10:09 +03:00
Text(String),
ETag(Vec<String>, String),
UTag(Vec<String>, String),
Section(Vec<String>, bool, Vec<Token>, String,
String, String, String, String),
IncompleteSection(Vec<String>, bool, String, bool),
Partial(String, String, String),
}
fn check_strs(actual: &str, expected: &str) -> bool
{
2014-02-05 16:33:10 -06:00
if actual != expected
{
println!("Found {}, but expected {}", actual, expected);
return false;
}
return true;
}
2013-03-27 09:58:28 -07:00
pub fn main()
{
let t = Token::Text("foo".to_string());
let u = Token::Section(vec!["alpha".to_string()],
2014-10-02 08:10:09 +03:00
true,
vec![t],
"foo".to_string(),
"foo".to_string(), "foo".to_string(), "foo".to_string(),
"foo".to_string());
let v = format!("{:?}", u); // this is the line that causes the seg fault
assert!(!v.is_empty());
}