From 0530339dc34a68a5aa0c4038c661a82fd8d2a8e7 Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 16:09:21 -0400 Subject: [PATCH 1/6] regression test for #36379 --- src/test/compile-fail/issue-36379.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/compile-fail/issue-36379.rs diff --git a/src/test/compile-fail/issue-36379.rs b/src/test/compile-fail/issue-36379.rs new file mode 100644 index 0000000000000..2f513b034c36d --- /dev/null +++ b/src/test/compile-fail/issue-36379.rs @@ -0,0 +1,16 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(conservative_impl_trait, rustc_attrs)] + +fn _test() -> impl Default { } + +#[rustc_error] +fn main() { } //~ ERROR compilation successful From 6b151ef84169e34f0fd10bdd65eb192c32e7b432 Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 16:55:25 -0400 Subject: [PATCH 2/6] regression test for #38954 --- src/test/compile-fail/issue-38954.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/compile-fail/issue-38954.rs diff --git a/src/test/compile-fail/issue-38954.rs b/src/test/compile-fail/issue-38954.rs new file mode 100644 index 0000000000000..65b17a3db0b59 --- /dev/null +++ b/src/test/compile-fail/issue-38954.rs @@ -0,0 +1,16 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +fn _test(ref _p: str) {} + +#[rustc_error] +fn main() { } //~ ERROR compilation successful From 04ac7c33452bfb64c174577e24faefc63641f37d Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 17:36:59 -0400 Subject: [PATCH 3/6] regression test for #39362 --- src/test/compile-fail/issue-39362.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/compile-fail/issue-39362.rs diff --git a/src/test/compile-fail/issue-39362.rs b/src/test/compile-fail/issue-39362.rs new file mode 100644 index 0000000000000..9d8abbfc65d07 --- /dev/null +++ b/src/test/compile-fail/issue-39362.rs @@ -0,0 +1,28 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + Bar { bar: Bar, id: usize } +} + +enum Bar { + A, B, C, D, E, F +} + +fn test(f: Foo) { + match f { + //~^ ERROR non-exhaustive patterns + //~| patterns + Foo::Bar { bar: Bar::A, .. } => (), + Foo::Bar { bar: Bar::B, .. } => (), + } +} + +fn main() {} From 9ee9abcdbd94a54fe53f48065b1b05d96168665e Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 17:43:25 -0400 Subject: [PATCH 4/6] regression test for #38160 --- src/test/compile-fail/issue-38160.rs | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/compile-fail/issue-38160.rs diff --git a/src/test/compile-fail/issue-38160.rs b/src/test/compile-fail/issue-38160.rs new file mode 100644 index 0000000000000..311d0ceb4d37b --- /dev/null +++ b/src/test/compile-fail/issue-38160.rs @@ -0,0 +1,31 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_consts, rustc_attrs)] +#![allow(warnings)] + +trait MyTrait { + const MY_CONST: &'static str; +} + +macro_rules! my_macro { + () => { + struct MyStruct; + + impl MyTrait for MyStruct { + const MY_CONST: &'static str = stringify!(abc); + } + } +} + +my_macro!(); + +#[rustc_error] +fn main() {} //~ ERROR compilation successful From 95436c6d897881262a018dd48ed862eb63a20dc1 Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 17:57:16 -0400 Subject: [PATCH 5/6] regression test for #37665 regression test for #37550 --- src/test/compile-fail/issue-37665.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/compile-fail/issue-37665.rs diff --git a/src/test/compile-fail/issue-37665.rs b/src/test/compile-fail/issue-37665.rs new file mode 100644 index 0000000000000..f86f570d25dc6 --- /dev/null +++ b/src/test/compile-fail/issue-37665.rs @@ -0,0 +1,20 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z unstable-options --unpretty=mir + +use std::path::MAIN_SEPARATOR; + +fn main() { + let mut foo : String = "hello".to_string(); + foo.push(MAIN_SEPARATOR); + println!("{}", foo); + let x: () = 0; //~ ERROR: mismatched types +} From 2160b4ae589eeedbc8411f5bf2b02774194ce8e3 Mon Sep 17 00:00:00 2001 From: Venkata Giri Reddy Date: Thu, 25 May 2017 18:06:30 -0400 Subject: [PATCH 6/6] regression test for #37550 --- src/test/compile-fail/issue-37550.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/compile-fail/issue-37550.rs diff --git a/src/test/compile-fail/issue-37550.rs b/src/test/compile-fail/issue-37550.rs new file mode 100644 index 0000000000000..e1f7f64e01a66 --- /dev/null +++ b/src/test/compile-fail/issue-37550.rs @@ -0,0 +1,18 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(const_fn)] + +const fn x() { + let t = true; //~ ERROR blocks in constant functions are limited to items and tail expressions + let x = || t; //~ ERROR blocks in constant functions are limited to items and tail expressions +} + +fn main() {}