diff options
| author | Wesley Wiser <wesleywiser@microsoft.com> | 2021-07-23 18:55:36 -0400 |
|---|---|---|
| committer | Wesley Wiser <wesleywiser@microsoft.com> | 2021-08-25 15:17:22 -0400 |
| commit | 0a42dfc2fa2b373aedf7a169da3f0ec0e996fc9f (patch) | |
| tree | b4676c6679915087e8824b3b439070dc907e3ac1 /src/test/ui/issues | |
| parent | a992a11913b39a258158646bb1e03528c5aa5060 (diff) | |
| download | rust-0a42dfc2fa2b373aedf7a169da3f0ec0e996fc9f.tar.gz rust-0a42dfc2fa2b373aedf7a169da3f0ec0e996fc9f.zip | |
Fix debugger stepping behavior around `match` expressions
Previously, we would set up the source lines for `match` expressions so
that the code generated to perform the test of the scrutinee was matched
to the line of the arm that required the test and then jump from the arm
block to the "next" block was matched to all of the lines in the `match`
expression.
While that makes sense, it has the side effect of causing strange
stepping behavior in debuggers.
I've changed the source information so that all of the generated tests
are sourced to `match {scrutinee}` and the jumps are sourced to the last
line of the block they are inside. This resolves the weird stepping
behavior in all debuggers and resolves some instances of "ambiguous
symbol" errors in WinDbg preventing the user from setting breakpoints at
`match` expressions.
Diffstat (limited to 'src/test/ui/issues')
| -rw-r--r-- | src/test/ui/issues/issue-17385.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-17385.stderr | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/test/ui/issues/issue-17385.rs b/src/test/ui/issues/issue-17385.rs index 93364d2f625..7400aadb059 100644 --- a/src/test/ui/issues/issue-17385.rs +++ b/src/test/ui/issues/issue-17385.rs @@ -15,8 +15,8 @@ impl Drop for Enum { fn main() { let foo = X(1); drop(foo); - match foo { - X(1) => (), //~ ERROR use of moved value + match foo { //~ ERROR use of moved value + X(1) => (), _ => unreachable!() } diff --git a/src/test/ui/issues/issue-17385.stderr b/src/test/ui/issues/issue-17385.stderr index 28c22260c38..77aa201b335 100644 --- a/src/test/ui/issues/issue-17385.stderr +++ b/src/test/ui/issues/issue-17385.stderr @@ -1,13 +1,12 @@ error[E0382]: use of moved value: `foo` - --> $DIR/issue-17385.rs:19:11 + --> $DIR/issue-17385.rs:18:5 | LL | let foo = X(1); | --- move occurs because `foo` has type `X`, which does not implement the `Copy` trait LL | drop(foo); | --- value moved here LL | match foo { -LL | X(1) => (), - | ^ value used here after move + | ^^^^^^^^^ value used here after move error[E0382]: use of moved value: `e` --> $DIR/issue-17385.rs:25:11 |
