Skip to content

guide-pointers: minor nits #14247

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

Merged
merged 1 commit into from
May 17, 2014
Merged

guide-pointers: minor nits #14247

merged 1 commit into from
May 17, 2014

Conversation

Ryman
Copy link
Contributor

@Ryman Ryman commented May 16, 2014

Not too hot on the second change, welcome a better suggestion/wording.

@@ -73,7 +73,7 @@ However.
Here are the use-cases for pointers. I've prefixed them with the name of the
pointer that satisfies that use-case:

1. Owned: ~Trait must be a pointer, because you don't know the size of the
1. Owned: Box<Trait> must be a pointer, because you don't know the size of the
Copy link
Member

Choose a reason for hiding this comment

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

This should have back-ticks around it because it's code. (It's possibly actually necessarily in this instance, or else the <Trait> will get picked up by the markdown parser as HTML and then just swallowed.)

@Ryman
Copy link
Contributor Author

Ryman commented May 16, 2014

@huonw updated

@steveklabnik
Copy link
Member

Nice, thanks.

bors added a commit that referenced this pull request May 17, 2014
Not too hot on the second change, welcome a better suggestion/wording.
@bors bors closed this May 17, 2014
@bors bors merged commit 6bfe361 into rust-lang:master May 17, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Mar 13, 2023
generate correct completion edits for missing macro arguments

Fixes rust-lang#14246

rust-analyzer used the token at the cursor after macro expansion to decide whether to replace the token at the cursor before macro expansion. In most cases these two are the same but in some cases these can mismatch which can lead to incorrect replacements.

For example if an ident/expr macro argument is missing rust-analyzer generates a "missing" identifier as a placeholder, there is only a brace at the cursor. Therefore, rust-analyzer will incorrectly replace the macro brace with the completion in that case leading to rust-lang#14246.

Using the expanded token type was intentional. However, this doesn't seem to ever be desirable (this is supported by the fact that there were no tests that relied on this behavior) since the type of edit to perform should always be determined by the token it's actually applied to. Therefore this PR simply switches the relevant match to use the unexpanded token instead
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 3, 2025
Dereferencing string literals in suggestions is redundant.

changelog: [`cmp_owned`]: more natural suggestions are provided for
string literals now

fixes rust-lang#8103
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

Successfully merging this pull request may close these issues.

5 participants