about summary refs log tree commit diff
path: root/tests/ui/modules
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-20 07:08:43 +0200
committerGitHub <noreply@github.com>2023-07-20 07:08:43 +0200
commit770c8d06672ea8d317df7bdf5ff5f8ce954ecbdd (patch)
tree718bce56573cbb50af071101db19daf13ce003a3 /tests/ui/modules
parent53580da72d55942374b9210ff20f1912260efa26 (diff)
parent20a3b9a2152ff705af029cbb359bc09a4b43a9c7 (diff)
downloadrust-770c8d06672ea8d317df7bdf5ff5f8ce954ecbdd.tar.gz
rust-770c8d06672ea8d317df7bdf5ff5f8ce954ecbdd.zip
Rollup merge of #113871 - clubby789:derive-sugg-span, r=compiler-errors
Use the correct span for displaying the line following a derive sugge…

`span` here is the main span of the diagnostic. In the linked issue's case, this belongs to `main.rs`. However, the line numbers (and line we are trying to display) are in `name.rs`, so using `span_to_lines` gives us the wrong `FileLines`.

Use `parts[0].span` (the span of the suggestion) here like the rest of the code does to get the right file.

Not sure if this needs a dedicated test because this fixes an existing error in the UI suite

Fixes #113844
Diffstat (limited to 'tests/ui/modules')
-rw-r--r--tests/ui/modules/issue-107649.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/modules/issue-107649.stderr b/tests/ui/modules/issue-107649.stderr
index 38a910b57b4..5705e84e0d9 100644
--- a/tests/ui/modules/issue-107649.stderr
+++ b/tests/ui/modules/issue-107649.stderr
@@ -11,7 +11,7 @@ help: consider annotating `Dummy` with `#[derive(Debug)]`
    --> $DIR/auxiliary/dummy_lib.rs:2:1
     |
 2   + #[derive(Debug)]
-3   | #[path = "auxiliary/dummy_lib.rs"]
+3   | pub struct Dummy;
     |
 
 error: aborting due to previous error