about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/proc-macro/break-token-spans.rs16
-rw-r--r--src/test/ui/proc-macro/break-token-spans.stderr21
-rw-r--r--src/test/ui/suggestions/issue-61963.rs1
-rw-r--r--src/test/ui/suggestions/issue-61963.stderr10
4 files changed, 46 insertions, 2 deletions
diff --git a/src/test/ui/proc-macro/break-token-spans.rs b/src/test/ui/proc-macro/break-token-spans.rs
new file mode 100644
index 00000000000..59dc3b5043c
--- /dev/null
+++ b/src/test/ui/proc-macro/break-token-spans.rs
@@ -0,0 +1,16 @@
+// aux-build:test-macros.rs
+// Regression test for issues #68489 and #70987
+// Tests that we properly break tokens in `probably_equal_for_proc_macro`
+// See #72306
+//
+// Note that the weird spacing in this example is critical
+// for testing the issue.
+
+extern crate test_macros;
+
+#[test_macros::recollect_attr]
+fn repro() {
+    f :: < Vec < _ > > ( ) ; //~ ERROR cannot find
+    let a: Option<Option<u8>>= true; //~ ERROR mismatched
+}
+fn main() {}
diff --git a/src/test/ui/proc-macro/break-token-spans.stderr b/src/test/ui/proc-macro/break-token-spans.stderr
new file mode 100644
index 00000000000..caca973f252
--- /dev/null
+++ b/src/test/ui/proc-macro/break-token-spans.stderr
@@ -0,0 +1,21 @@
+error[E0425]: cannot find function `f` in this scope
+  --> $DIR/break-token-spans.rs:13:5
+   |
+LL |     f :: < Vec < _ > > ( ) ;
+   |     ^ not found in this scope
+
+error[E0308]: mismatched types
+  --> $DIR/break-token-spans.rs:14:32
+   |
+LL |     let a: Option<Option<u8>>= true;
+   |            ------------------  ^^^^ expected enum `std::option::Option`, found `bool`
+   |            |
+   |            expected due to this
+   |
+   = note: expected enum `std::option::Option<std::option::Option<u8>>`
+              found type `bool`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0308, E0425.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/issue-61963.rs b/src/test/ui/suggestions/issue-61963.rs
index c9d738f5a28..666fc965f02 100644
--- a/src/test/ui/suggestions/issue-61963.rs
+++ b/src/test/ui/suggestions/issue-61963.rs
@@ -16,6 +16,7 @@ pub struct Qux<T>(T);
 
 #[dom_struct]
 pub struct Foo {
+    //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
     qux: Qux<Qux<Baz>>,
     bar: Box<Bar>,
     //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
diff --git a/src/test/ui/suggestions/issue-61963.stderr b/src/test/ui/suggestions/issue-61963.stderr
index 0e2eb7616cf..62ae5fa3fe5 100644
--- a/src/test/ui/suggestions/issue-61963.stderr
+++ b/src/test/ui/suggestions/issue-61963.stderr
@@ -1,5 +1,5 @@
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:20:14
+  --> $DIR/issue-61963.rs:21:14
    |
 LL |     bar: Box<Bar>,
    |              ^^^ help: use `dyn`: `dyn Bar`
@@ -10,5 +10,11 @@ note: the lint level is defined here
 LL | #![deny(bare_trait_objects)]
    |         ^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error
+error: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-61963.rs:18:1
+   |
+LL | pub struct Foo {
+   | ^^^ help: use `dyn`: `dyn pub`
+
+error: aborting due to 2 previous errors