Skip to content

Make new type param suggestion more targetted - #73320

Merged
bors merged 3 commits into
rust-lang:masterfrom
estebank:type-param-sugg-more
Jun 19, 2020
Merged

Make new type param suggestion more targetted#73320
bors merged 3 commits into
rust-lang:masterfrom
estebank:type-param-sugg-more

Conversation

@estebank

Copy link
Copy Markdown
Contributor

Do not suggest new type param when encountering a missing type in an ADT
field with generic parameters.

Fix#72640.

Do not suggest new type param when encountering a missing type in an ADT
field with generic parameters.
Fixrust-lang#72640.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 13, 2020
@estebank

Copy link
Copy Markdown
ContributorAuthor

r? @Mark-Simulacrum

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Opened #73321 for handling this more gracefully.

@estebank
estebankforce-pushed the type-param-sugg-more branch from 8bdca7a to f48e5bdCompareJune 17, 2020 00:34
Suggest new type parameter on single char uppercase ident even if it
doesn't appear in a field's type parameter.
Address comment in rust-lang#72641.
@estebank
estebankforce-pushed the type-param-sugg-more branch from f48e5bd to af45d8aCompareJune 17, 2020 00:37
@estebank

Copy link
Copy Markdown
ContributorAuthor

r? @davidtwco

@davidtwcodavidtwco left a comment

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.

LGTM, one nit, r=me when you're happy.

Comment threadsrc/librustc_resolve/lib.rs Outdated
id: Option<NodeId>,
/// Signals whether this `PathSegment` has generic arguments. Used to avoid providing
/// nonsensical suggestions.
has_args: bool,

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.

Suggested change
has_args:bool,
has_generic_args:bool,

Might make this a little bit more clear.

@estebank

Copy link
Copy Markdown
ContributorAuthor

@bors r=davidtwco

@bors

bors commented Jun 18, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 8d1a380 has been approved by davidtwco

@borsbors 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 Jun 18, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 18, 2020
…vidtwco
Make new type param suggestion more targetted
Do not suggest new type param when encountering a missing type in an ADT
field with generic parameters.
Fixrust-lang#72640.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2020
…arth
Rollup of 17 pull requests
Successful merges:
- rust-lang#70551 (Make all uses of ty::Error delay a span bug)
- rust-lang#71338 (Expand "recursive opaque type" diagnostic)
- rust-lang#71976 (Improve diagnostics for `let x += 1`)
- rust-lang#72279 (add raw_ref macros)
- rust-lang#72628 (Add tests for 'impl Default for [T; N]')
- rust-lang#72804 (Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position)
- rust-lang#72814 (remove visit_terminator_kind from MIR visitor)
- rust-lang#72836 (Complete the std::time documentation to warn about the inconsistencies between OS)
- rust-lang#72968 (Only highlight doc search results via mouseover if mouse has moved)
- rust-lang#73034 (Export `#[inline]` fns with extern indicators)
- rust-lang#73315 (Clean up some weird command strings)
- rust-lang#73320 (Make new type param suggestion more targetted)
- rust-lang#73361 (Tweak "non-primitive cast" error)
- rust-lang#73425 (Mention functions pointers in the documentation)
- rust-lang#73428 (Fix typo in librustc_ast docs)
- rust-lang#73447 (Improve document for `Result::as_deref(_mut)` methods)
- rust-lang#73476 (Added tooltip for should_panic code examples)
Failed merges:
r? @ghost
@bors
bors merged commit f4b5f58 into rust-lang:masterJun 19, 2020
@cuvipercuviper added this to the 1.46 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

Do not suggest type parameter when followed by <

7 participants

@estebank@rust-highfive@bors@davidtwco@cuviper@eddyb@Mark-Simulacrum