-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
more refined suggestions for functions that return a reference #17310
Labels
Comments
@rustbot claim |
@Veykril I'd like to take this as my first contribution to |
The relevant bits are here rust-analyzer/crates/ide-completion/src/render.rs Lines 616 to 637 in 25d9e05
|
Hey @Veykril , is this still up for grab? |
yes |
@rustbot claim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when typing
CustomByteSlice::
(see screenshot below), the first suggestion is to also borrow the result, this is fine normally, but in this casefrom_bytes
already returns a reference (note that the result is not wrong, but does raise a clippy warning)a special case for these unsized newtype wrappers is that they can't be constructed with
&StructName(something)
, so this suggestion (see screenshot below) should not be here (unless this will be supported by rust some time in the future, but then still it is not supported now so should not be suggested as it results in code that has compile errors)The text was updated successfully, but these errors were encountered: