about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/rustc-dev-remap.only-remap.stderr15
-rw-r--r--tests/ui-fulldeps/rustc-dev-remap.remap-unremap.stderr18
-rw-r--r--tests/ui-fulldeps/rustc-dev-remap.rs30
3 files changed, 63 insertions, 0 deletions
diff --git a/tests/ui-fulldeps/rustc-dev-remap.only-remap.stderr b/tests/ui-fulldeps/rustc-dev-remap.only-remap.stderr
new file mode 100644
index 00000000000..f54b6803b34
--- /dev/null
+++ b/tests/ui-fulldeps/rustc-dev-remap.only-remap.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `NotAValidResultType: VisitorResult` is not satisfied
+  --> $DIR/rustc-dev-remap.rs:LL:COL
+   |
+LL |     type Result = NotAValidResultType;
+   |                   ^^^^^^^^^^^^^^^^^^^ the trait `VisitorResult` is not implemented for `NotAValidResultType`
+   |
+   = help: the following other types implement trait `VisitorResult`:
+             ()
+             ControlFlow<T>
+note: required by a bound in `rustc_ast::visit::Visitor::Result`
+  --> /rustc-dev/xyz/compiler/rustc_ast/src/visit.rs:LL:COL
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/rustc-dev-remap.remap-unremap.stderr b/tests/ui-fulldeps/rustc-dev-remap.remap-unremap.stderr
new file mode 100644
index 00000000000..438c23458e2
--- /dev/null
+++ b/tests/ui-fulldeps/rustc-dev-remap.remap-unremap.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `NotAValidResultType: VisitorResult` is not satisfied
+  --> $DIR/rustc-dev-remap.rs:LL:COL
+   |
+LL |     type Result = NotAValidResultType;
+   |                   ^^^^^^^^^^^^^^^^^^^ the trait `VisitorResult` is not implemented for `NotAValidResultType`
+   |
+   = help: the following other types implement trait `VisitorResult`:
+             ()
+             ControlFlow<T>
+note: required by a bound in `rustc_ast::visit::Visitor::Result`
+  --> $COMPILER_DIR_REAL/rustc_ast/src/visit.rs:LL:COL
+   |
+LL |     type Result: VisitorResult = ();
+   |                  ^^^^^^^^^^^^^ required by this bound in `Visitor::Result`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/rustc-dev-remap.rs b/tests/ui-fulldeps/rustc-dev-remap.rs
new file mode 100644
index 00000000000..aae7d4c0c90
--- /dev/null
+++ b/tests/ui-fulldeps/rustc-dev-remap.rs
@@ -0,0 +1,30 @@
+//@ check-fail
+//
+//@ ignore-stage1
+//@ ignore-cross-compile
+//@ ignore-remote
+//
+//@ revisions: only-remap remap-unremap
+//@ compile-flags: -Z simulate-remapped-rust-src-base=/rustc-dev/xyz
+//@ [remap-unremap]compile-flags: -Ztranslate-remapped-path-to-local-path=yes
+
+// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically
+// as the remapped revision will begin with $COMPILER_DIR_REAL,
+// so we have to do it ourselves.
+//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:COL"
+
+#![feature(rustc_private)]
+
+extern crate rustc_ast;
+
+use rustc_ast::visit::Visitor;
+
+struct MyStruct;
+struct NotAValidResultType;
+
+impl Visitor<'_> for MyStruct {
+    type Result = NotAValidResultType;
+    //~^ ERROR the trait bound `NotAValidResultType: VisitorResult` is not satisfied
+}
+
+fn main() {}