Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnostic testing: need revison to overlapping_spans test that still surfaces under NLL #51194

Closed
pnkfelix opened this issue May 29, 2018 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@pnkfelix
Copy link
Member

pnkfelix commented May 29, 2018

The test overlapping_spans is deliberately trying to create a bug where two "distinct" spans that happen to overlap will be reported by the diagnostic tool, to test our ability to render them in different styles so that the end user can distinguish them.

Look, its easier if you just see the output from AST-borrowck:

LL | S {f:_s} => {} //~ ERROR cannot move out
| ^^^^^--^
| | |
| | hint: to prevent move, use `ref _s` or `ref mut _s`
| cannot move out of here

You can see on line 5 the interesting pair of spans combined by using different characters: ^^^^^--^

The problem is that NLL currently happens to not issue such a report with such overlapping spans.

The particular output from NLL right now is the following, but I do not want to categorize that choice of output as a bug in NLL at the moment.

error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
--> $DIR/overlapping_spans.rs:21:14
|
LL | S {f:_s} => {} //~ ERROR cannot move out
| ^^ cannot move out of here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0509`.

Thus it fails to exercise the behavior that we are interested in witnessing in this test.

Can someone come up with a test for such overlapping spans that does not rely on vagaries of the borrow checker?

@pnkfelix pnkfelix added the A-diagnostics Area: Messages for errors, warnings, and lints label May 29, 2018
@pnkfelix
Copy link
Member Author

(Coming up with an alternative test may not be an ultra high priority, since the NLL team probably should try to address #51189 )

@pnkfelix
Copy link
Member Author

pnkfelix commented Nov 5, 2018

I'm going to just delete this test as part of resolving #55533. See also #52663 (comment)

@pnkfelix pnkfelix closed this as completed Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant