about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorSeiichi Uchida <seuchida@gmail.com>2018-01-12 11:41:33 +0900
committerSeiichi Uchida <seuchida@gmail.com>2018-01-12 21:48:17 +0900
commitd088b25d7e3a317e98b59d49c262a314fb2bbd26 (patch)
tree8d19712de5eed5908e94436d1233b3223fa08c6c /src/test/compile-fail
parent73ac5d6a80f26c692f1e084b72d69637d7de2c8c (diff)
Avoid panicking when invalid argument is passed to cfg(..)
Closes #43925.
Closes #43926.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/issue-43925.rs16
-rw-r--r--src/test/compile-fail/issue-43926.rs14
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-43925.rs b/src/test/compile-fail/issue-43925.rs
new file mode 100644
index 00000000000..8ad57647290
--- /dev/null
+++ b/src/test/compile-fail/issue-43925.rs
@@ -0,0 +1,16 @@
+// Copyright 2018 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.
+
+#![feature(attr_literals)]
+
+#[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)`
+extern {}
+
+fn main() {}
diff --git a/src/test/compile-fail/issue-43926.rs b/src/test/compile-fail/issue-43926.rs
new file mode 100644
index 00000000000..5d510b643a3
--- /dev/null
+++ b/src/test/compile-fail/issue-43926.rs
@@ -0,0 +1,14 @@
+// Copyright 2018 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.
+
+#[link(name="foo", cfg())] //~ ERROR `cfg()` must have an argument
+extern {}
+
+fn main() {}