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.
|
|
|
|
|
2011-09-20 10:28:16 -07:00
|
|
|
// Issue #945
|
|
|
|
// error-pattern:non-exhaustive match failure
|
|
|
|
fn test_box() {
|
|
|
|
@0;
|
|
|
|
}
|
|
|
|
fn test_str() {
|
2012-08-23 14:44:58 -07:00
|
|
|
let res = match false { true => { ~"happy" },
|
2013-05-06 00:18:51 +02:00
|
|
|
_ => fail!("non-exhaustive match failure") };
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(res, ~"happy");
|
2011-09-20 10:28:16 -07:00
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
test_box();
|
|
|
|
test_str();
|
2013-01-31 17:51:01 -08:00
|
|
|
}
|