Skip to content

Rework raw ident suggestions - #66592

Merged
bors merged 2 commits into
rust-lang:masterfrom
estebank:raw-raw-ah-ah-ah
Nov 24, 2019
Merged

Rework raw ident suggestions#66592
bors merged 2 commits into
rust-lang:masterfrom
estebank:raw-raw-ah-ah-ah

Conversation

@estebank

Copy link
Copy Markdown
Contributor

Use heuristics to determine whethersuggesting raw identifiers is
appropriate.

Account for raw identifiers when printing a path in a use suggestion.

Fix #66126.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 20, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should also include Bracket-- e.g.:

macro_rules! async { () => {} }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(but it is a heuristic, and as such it may be better not to suggest changing async { ... })

@cramertj

Copy link
Copy Markdown
Member

r=me with travis fixed

@petrochenkov petrochenkov self-assigned this Nov 21, 2019
Comment thread src/libsyntax_pos/symbol.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code like this is pure technical debt, and my preferred solution would be to remove the diagnostic (#66126 (comment)), especially given that raw identifiers are a compatibility feature that should never be recommended in general.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that with this new restriction we'll only be presenting this suggestion in the very rare cases where the intent was there.

Comment thread src/librustc_resolve/lib.rs Outdated
@petrochenkov petrochenkov removed their assignment Nov 22, 2019
Use heuristics to determine whethersuggesting raw identifiers is
appropriate.

Account for raw identifiers when printing a path in a `use` suggestion.
@estebank

Copy link
Copy Markdown
Contributor Author

@bors r=cramertj as per #66592 (comment)

@bors

bors commented Nov 24, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 1803886 has been approved by cramertj

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2019
@bors

bors commented Nov 24, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1803886 with merge 5a1d028...

bors added a commit that referenced this pull request Nov 24, 2019
Rework raw ident suggestions

Use heuristics to determine whethersuggesting raw identifiers is
appropriate.

Account for raw identifiers when printing a path in a `use` suggestion.

Fix #66126.
@bors

bors commented Nov 24, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-azure
Approved by: cramertj
Pushing 5a1d028 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 24, 2019
@bors
bors merged commit 1803886 into rust-lang:master Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raw ident suggestion should only trigger if the code is otherwise well-formed

5 participants