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
971 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
2013-10-23 08:49:18 +00:00
2015-01-28 13:34:18 +00:00
#[derive(Debug)]
enum Token {
2014-10-02 05:10:09 +00: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 22:33:10 +00:00
if actual != expected
{
println!("Found {}, but expected {}", actual, expected);
return false;
}
return true;
}
2013-03-27 16:58:28 +00:00
pub fn main()
{
let t = Token::Text("foo".to_string());
let u = Token::Section(vec!["alpha".to_string()],
2014-10-02 05:10:09 +00: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());
}