about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-11 15:08:41 +0000
committerbors <bors@rust-lang.org>2022-06-11 15:08:41 +0000
commit85a26a9a96d3d0b1846cee97abbe6714dcbc6483 (patch)
treeaeaae2a25c2e278eaa5177e0486ac4d37aa86891 /src
parentfa68e73e9947be8ffc5b3b46d899e4953a44e7e9 (diff)
parentb3c9a2fde4a28bfdced15a1cc8583b155d1d281a (diff)
downloadrust-85a26a9a96d3d0b1846cee97abbe6714dcbc6483.tar.gz
rust-85a26a9a96d3d0b1846cee97abbe6714dcbc6483.zip
Auto merge of #97989 - Dylan-DPC:rollup-wol1a1y, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #97761 (validating the vtable can lead to Stacked Borrows errors)
 - #97789 (Fix #71363's test by adding `-Z translate-remapped-path-to-local-path=no`)
 - #97913 (Wrap `HirId`s of locals into `LocalVarId`s for THIR nodes)
 - #97979 (Fix typos in Provider API docs)
 - #97987 (remove an unnecessary `String`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/span/issue-71363.rs15
-rw-r--r--src/test/ui/span/issue-71363.stderr10
2 files changed, 17 insertions, 8 deletions
diff --git a/src/test/ui/span/issue-71363.rs b/src/test/ui/span/issue-71363.rs
index 3e85559caf9..bbb4a93623b 100644
--- a/src/test/ui/span/issue-71363.rs
+++ b/src/test/ui/span/issue-71363.rs
@@ -1,6 +1,4 @@
-// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z ui-testing=no
-// only-x86_64-unknown-linux-gnu
-//---^ Limiting target as the above unstable flags don't play well on some environment.
+// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
 
 struct MyError;
 impl std::error::Error for MyError {}
@@ -8,3 +6,14 @@ impl std::error::Error for MyError {}
 //~| ERROR: `MyError` doesn't implement `Debug`
 
 fn main() {}
+
+// This test relies on library/std/src/error.rs *not* being included in the error message, so that
+// we can test whether a file not included in the error message affects it (more specifically
+// whether the line number of the excluded file affects the indentation of the other line numbers).
+//
+// To test this we're simulating a remap of the rust src base (so that library/std/src/error.rs
+// does not point to a local file) *and* we're disabling the code to try mapping a remapped path to
+// a local file (which would defeat the purpose of the former flag).
+//
+// Note that this comment is at the bottom of the file intentionally, as we need the line number of
+// the impl to be lower than 10.
diff --git a/src/test/ui/span/issue-71363.stderr b/src/test/ui/span/issue-71363.stderr
index d54f21752b8..04e2b46c317 100644
--- a/src/test/ui/span/issue-71363.stderr
+++ b/src/test/ui/span/issue-71363.stderr
@@ -1,7 +1,7 @@
 error[E0277]: `MyError` doesn't implement `std::fmt::Display`
- --> $DIR/issue-71363.rs:6:6
+ --> $DIR/issue-71363.rs:4:6
   |
-6 | impl std::error::Error for MyError {}
+4 | impl std::error::Error for MyError {}
   |      ^^^^^^^^^^^^^^^^^ `MyError` cannot be formatted with the default formatter
   |
   = help: the trait `std::fmt::Display` is not implemented for `MyError`
@@ -9,9 +9,9 @@ error[E0277]: `MyError` doesn't implement `std::fmt::Display`
 note: required by a bound in `std::error::Error`
 
 error[E0277]: `MyError` doesn't implement `Debug`
- --> $DIR/issue-71363.rs:6:6
+ --> $DIR/issue-71363.rs:4:6
   |
-6 | impl std::error::Error for MyError {}
+4 | impl std::error::Error for MyError {}
   |      ^^^^^^^^^^^^^^^^^ `MyError` cannot be formatted using `{:?}`
   |
   = help: the trait `Debug` is not implemented for `MyError`
@@ -19,7 +19,7 @@ error[E0277]: `MyError` doesn't implement `Debug`
 note: required by a bound in `std::error::Error`
 help: consider annotating `MyError` with `#[derive(Debug)]`
   |
-5 | #[derive(Debug)]
+3 | #[derive(Debug)]
   |
 
 error: aborting due to 2 previous errors