summary refs log tree commit diff
path: root/src/test/ui/codemap_tests
diff options
context:
space:
mode:
authorJonathan Turner <jturner@mozilla.com>2016-08-17 07:20:04 -0700
committerJonathan Turner <jturner@mozilla.com>2016-08-17 14:26:14 -0700
commit61865384b8fa6d79d2b36cbd7c899eaf15f4aeea (patch)
tree136502c033d49ba3e6e28f9460129586a381e92a /src/test/ui/codemap_tests
parentd0a272b797fd538c4b4230bdefea534af8c1ffde (diff)
downloadrust-61865384b8fa6d79d2b36cbd7c899eaf15f4aeea.tar.gz
rust-61865384b8fa6d79d2b36cbd7c899eaf15f4aeea.zip
Replace local backtrace with def-use, repair std macro spans
Diffstat (limited to 'src/test/ui/codemap_tests')
-rw-r--r--src/test/ui/codemap_tests/bad-format-args.rs15
-rw-r--r--src/test/ui/codemap_tests/bad-format-args.stderr26
-rw-r--r--src/test/ui/codemap_tests/issue-28308.rs13
-rw-r--r--src/test/ui/codemap_tests/issue-28308.stderr10
-rw-r--r--src/test/ui/codemap_tests/repair_span_std_macros.rs13
-rw-r--r--src/test/ui/codemap_tests/repair_span_std_macros.stderr11
6 files changed, 88 insertions, 0 deletions
diff --git a/src/test/ui/codemap_tests/bad-format-args.rs b/src/test/ui/codemap_tests/bad-format-args.rs
new file mode 100644
index 00000000000..de7bc88f9ba
--- /dev/null
+++ b/src/test/ui/codemap_tests/bad-format-args.rs
@@ -0,0 +1,15 @@
+// Copyright 2016 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.
+
+fn main() {
+    format!();
+    format!("" 1);
+    format!("", 1 1);
+}
diff --git a/src/test/ui/codemap_tests/bad-format-args.stderr b/src/test/ui/codemap_tests/bad-format-args.stderr
new file mode 100644
index 00000000000..fab8e2c8ce1
--- /dev/null
+++ b/src/test/ui/codemap_tests/bad-format-args.stderr
@@ -0,0 +1,26 @@
+error: requires at least a format string argument
+  --> $DIR/bad-format-args.rs:12:5
+   |
+12 |     format!();
+   |     ^^^^^^^^^^
+   |
+   = note: this error originates in a macro from the standard library
+
+error: expected token: `,`
+  --> $DIR/bad-format-args.rs:13:5
+   |
+13 |     format!("" 1);
+   |     ^^^^^^^^^^^^^^
+   |
+   = note: this error originates in a macro from the standard library
+
+error: expected token: `,`
+  --> $DIR/bad-format-args.rs:14:5
+   |
+14 |     format!("", 1 1);
+   |     ^^^^^^^^^^^^^^^^^
+   |
+   = note: this error originates in a macro from the standard library
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/codemap_tests/issue-28308.rs b/src/test/ui/codemap_tests/issue-28308.rs
new file mode 100644
index 00000000000..e3a4920d951
--- /dev/null
+++ b/src/test/ui/codemap_tests/issue-28308.rs
@@ -0,0 +1,13 @@
+// Copyright 2016 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.
+
+fn main() {
+    assert!("foo");
+}
diff --git a/src/test/ui/codemap_tests/issue-28308.stderr b/src/test/ui/codemap_tests/issue-28308.stderr
new file mode 100644
index 00000000000..0d51a3f36e9
--- /dev/null
+++ b/src/test/ui/codemap_tests/issue-28308.stderr
@@ -0,0 +1,10 @@
+error: cannot apply unary operator `!` to type `&'static str`
+  --> $DIR/issue-28308.rs:12:5
+   |
+12 |     assert!("foo");
+   |     ^^^^^^^^^^^^^^^
+   |
+   = note: this error originates in a macro from the standard library
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/codemap_tests/repair_span_std_macros.rs b/src/test/ui/codemap_tests/repair_span_std_macros.rs
new file mode 100644
index 00000000000..3abc91d4f5f
--- /dev/null
+++ b/src/test/ui/codemap_tests/repair_span_std_macros.rs
@@ -0,0 +1,13 @@
+// Copyright 2016 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.
+
+fn main() {
+    let x = vec![];
+}
diff --git a/src/test/ui/codemap_tests/repair_span_std_macros.stderr b/src/test/ui/codemap_tests/repair_span_std_macros.stderr
new file mode 100644
index 00000000000..1c9cbd63c33
--- /dev/null
+++ b/src/test/ui/codemap_tests/repair_span_std_macros.stderr
@@ -0,0 +1,11 @@
+error[E0282]: unable to infer enough type information about `_`
+  --> $DIR/repair_span_std_macros.rs:12:13
+   |
+12 |     let x = vec![];
+   |             ^^^^^^ cannot infer type for `_`
+   |
+   = note: type annotations or generic parameter binding required
+   = note: this error originates in a macro from the standard library
+
+error: aborting due to previous error
+