Skip to content
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

Make drop-glue/destructor hover tooltip more compact and distinguishable #19410

Open
Zalathar opened this issue Mar 21, 2025 · 2 comments · May be fixed by #19425
Open

Make drop-glue/destructor hover tooltip more compact and distinguishable #19410

Zalathar opened this issue Mar 21, 2025 · 2 comments · May be fixed by #19425
Labels
C-feature Category: feature request

Comments

@Zalathar
Copy link
Contributor

#18987 added a feature to show information about a type's drop glue and destructor in the hover tooltip.

This information is useful enough that I don't want to turn the feature off, but in practice I find that it:

  • is easily confused for the type's documentation,
  • reduces the amount of real documentation that can be seen (sometimes hiding it altogether), and
  • is rather verbose in general.

image

It might be preferable to do some or all of these, by default or as an option:

  • Change the wording to be less verbose (e.g. no drop glue, no destructor).
  • Display this information alongside the size/alignment information, if possible.
  • Style it in some way that makes it more distinct from documentation.
@Zalathar Zalathar added the C-feature Category: feature request label Mar 21, 2025
@ChayimFriedman2
Copy link
Contributor

Change the wording to be less verbose (e.g. no drop glue, no destructor).

We deliberately choose "does not contain types with destructors" because some people may not know what drop glue means, Although I'm not a fan of the wording, I couldn't find anything better.

@ConradIrwin
Copy link

At least among the rust codebases and programmers I've interacted with "Drop" is the word used (not destructor, though that is how the feature is documented: https://doc.rust-lang.org/reference/destructors.html, and may be more familiar to users of languages other than rust).

I strongly agree with trying to put this in the meta-data line instead of blending with the documentation.

How about size = 12 (0xC), align = 0x4, no Drop, size = 12 (0xC), align = 0x4, has Drop, size = 12 (0xC), align = 0x4, Drop depends on type

ConradIrwin added a commit to ConradIrwin/rust-analyzer that referenced this issue Mar 23, 2025
This reduces the amount of information shown (a direct `Drop` impl is
rendered the same way as the drop glue that calls `Drop` impls
transitively), but I don't know of a scenario where the difference is
meaningful.

Closes rust-lang#19410
@ConradIrwin ConradIrwin linked a pull request Mar 23, 2025 that will close this issue
ConradIrwin added a commit to ConradIrwin/rust-analyzer that referenced this issue Mar 23, 2025
This reduces the amount of information shown (a direct `Drop` impl is
rendered the same way as the drop glue that calls `Drop` impls
transitively), but I don't know of a scenario where the difference is
meaningful.

Closes rust-lang#19410
ConradIrwin added a commit to ConradIrwin/rust-analyzer that referenced this issue Mar 23, 2025
This reduces the amount of information shown (a direct `Drop` impl is
rendered the same way as the drop glue that calls `Drop` impls
transitively), but I don't know of a scenario where the difference is
meaningful.

Closes rust-lang#19410
ConradIrwin added a commit to ConradIrwin/rust-analyzer that referenced this issue Mar 26, 2025
This combines the memory layout and drop information on one line,
and makes the wording more succinct.

Closes rust-lang#19410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants