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

Fix crash in use-self lint #4776

Merged
merged 4 commits into from Nov 8, 2019
Merged

Fix crash in use-self lint #4776

merged 4 commits into from Nov 8, 2019

Conversation

ghost
Copy link

@ghost ghost commented Nov 6, 2019

Fixes #4727

changelog: Fix crash in use-self lint

@ghost
Copy link
Author

ghost commented Nov 6, 2019

The compiler creates paths for the range syntax (..) during lowering. We shouldn't check these paths. The only way I could find to test for them was to check for dummy spans on the path segments.

I based the setup for the ice test on the "backtrace-debuginfo" ui test in the compiler. I don't like creating an ignored test for the submodule but I couldn't find a better way.

There is another problem in the code related to this issue around primitive types that don't have a def_id. I'll document it in another issue later.

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 6, 2019
@ghost
Copy link
Author

ghost commented Nov 6, 2019

Just noticed some problems with this PR. I'll update later...

@ghost ghost changed the title Fix crash in use-self lint WIP: Fix crash in use-self lint Nov 6, 2019
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Nov 6, 2019
@ghost ghost changed the title WIP: Fix crash in use-self lint Fix crash in use-self lint Nov 7, 2019
@ghost
Copy link
Author

ghost commented Nov 7, 2019

This should be good now. Just waiting on build fixes to be merged.

@@ -0,0 +1,13 @@
//ignore-test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move this file in the auxiliary dir, so you don't have to ignore it, like

macro_rules! use_self {

which is used in

#[path = "auxiliary/use_self_macro.rs"]
mod use_self_macro;

@flip1995
Copy link
Member

flip1995 commented Nov 8, 2019

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 8, 2019

📌 Commit cc6e27f has been approved by flip1995

bors added a commit that referenced this pull request Nov 8, 2019
Fix crash in `use-self` lint

Fixes #4727

changelog: Fix crash in `use-self` lint
@bors
Copy link
Contributor

bors commented Nov 8, 2019

⌛ Testing commit cc6e27f with merge 9c45480...

@flip1995
Copy link
Member

flip1995 commented Nov 8, 2019

@bors retry, to prioritize rustup

@flip1995
Copy link
Member

flip1995 commented Nov 8, 2019

@bors retry

@flip1995
Copy link
Member

flip1995 commented Nov 8, 2019

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Nov 8, 2019

⌛ Testing commit cc6e27f with merge b0b3dc6...

bors added a commit that referenced this pull request Nov 8, 2019
Fix crash in `use-self` lint

Fixes #4727

changelog: Fix crash in `use-self` lint
@bors
Copy link
Contributor

bors commented Nov 8, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing b0b3dc6 to master...

@bors bors merged commit cc6e27f into rust-lang:master Nov 8, 2019
@ghost ghost deleted the fix-4727 branch December 26, 2019 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE with use_self on trait implementation in seperate file
3 participants