-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't ICE on bad extern paths #17991
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
Conversation
let file = match loc.filename_str() { | ||
Some(file) => file, | ||
None => { | ||
sess.err(format!("extern location is not a file: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be "location for crate {} is not a file: {}"
using self.crate_name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I formatted this error like the other ones in the closure. Should those be changed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Changing them to include the crate name would make them more informative.
069fa8f
to
84d1cbf
Compare
@huonw updated |
r=me with a test added |
@alexcrichton were you looking for something more than src/test/compile-fail/empty-extern-arg.rs? |
Wow, I should have just kept reading, sorry about that! |
… r=Veykril fix: Don't add reference when it isn't needed for the "Extract variable" assist I.e. don't generate `let var_name = &foo()`. Because it always irritates me when I need to fix that. Anything that creates a new value don't need a reference. That excludes mostly field accesses and indexing. I had a thought that we can also not generate a reference for fields and indexing as long as the type is `Copy`, but sometimes people impl `Copy` even when they don't want to copy the values (e.g. a large type), so I didn't do that.
Closes #17990