Skip to content

Autocomplete breaks down structs created with Default trait. #2135

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

Closed
seivan opened this issue Oct 30, 2019 · 2 comments
Closed

Autocomplete breaks down structs created with Default trait. #2135

seivan opened this issue Oct 30, 2019 · 2 comments

Comments

@seivan
Copy link
Contributor

seivan commented Oct 30, 2019

Might be related to #1427

@seivan seivan changed the title Autocomplete breaks down for Structs using Default trait. Autocomplete breaks down structs created with Default trait. Oct 30, 2019
@flodiebold
Copy link
Member

flodiebold commented Oct 30, 2019

It would be helpful to provide a code example to explain what you mean exactly here, otherwise we have to guess.

Assuming you mean cases like

let x = Vec::default();
x.

that's because we don't resolve trait methods called through the self type in this way yet. I'm working on it currently though 🙂

On the other hand, the following should work:

let x = <Vec<_> as Default>::default();

Of course, if the struct in question implements Default through a derive, that's another problem which is indeed related to #1427.

@seivan
Copy link
Contributor Author

seivan commented Oct 31, 2019

Sorry thought it wasn’t ambiguous. Yeah, this also explains why my highlighting broke for the default method. I’ll close this since it’s already a ticket on this. Thanks!

@seivan seivan closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants