Skip to content

feat: implement a simple hover auto traits in rpit - #23240

Open
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:hover-rpit-auto-traits
Open

feat: implement a simple hover auto traits in rpit#23240
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:hover-rpit-auto-traits

Conversation

@A4-Tacks

@A4-Tacks A4-Tacks commented Aug 26, 2026

Copy link
Copy Markdown
Member

Partial implement of #23237

Example

//- minicore: send, unpin
fn foo() -> $0impl Trait {
    &raw const ()
}

->

impl Trait + Unpin
impl Trait = *const ()

impl

keyword docs

Example
---
```rust
//- minicore: send, unpin
fn foo() -> $0impl Trait {
    &raw const ()
}
```

->

> ```rust
> impl Trait + Unpin
> impl Trait = *const ()
> ```
>
> ---
>
> ```rust
> impl
> ```
>
> ---
>
> keyword docs
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2026
if traits.is_empty() { None } else { Some(traits.into_iter().collect()) }
}

#[salsa::tracked(returns(as_deref))]

@ChayimFriedman2 ChayimFriedman2 Aug 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should IMO be the same query with crate_notable_traits(). Also both should check the presence of the unsafe feature like we do for crate_lang_items().

View changes since the review

Some(HoverResult { markup, actions })
}

pub(super) fn rpit(

@ChayimFriedman2 ChayimFriedman2 Aug 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO this is the wrong way to fix. We should instead do that in display infra, for every printed opaque.

Granted, it'll need more work because we don't currently carry the Option<GenericDefId> required for trait solving (to get trait_environment()) in display.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants