2012-12-10 17:32:48 -08:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-04-14 21:00:31 +05:30
|
|
|
#![feature(managed_boxes)]
|
2013-12-11 23:17:54 -08:00
|
|
|
|
2011-09-20 10:28:16 -07:00
|
|
|
// Issue #945
|
|
|
|
// error-pattern:non-exhaustive match failure
|
|
|
|
fn test_box() {
|
|
|
|
@0;
|
|
|
|
}
|
|
|
|
fn test_str() {
|
2014-04-15 18:17:48 -07:00
|
|
|
let res = match false { true => { "happy".to_owned() },
|
2013-10-21 13:08:31 -07:00
|
|
|
_ => fail!("non-exhaustive match failure") };
|
2014-04-15 18:17:48 -07:00
|
|
|
assert_eq!(res, "happy".to_owned());
|
2011-09-20 10:28:16 -07:00
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
test_box();
|
|
|
|
test_str();
|
2013-01-31 17:51:01 -08:00
|
|
|
}
|