-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
DST: cannot provide inherent impl for traits #17750
Comments
cc @nick29581 |
Was this in an RFC? |
@bluss DST was pre-RFC (the design anyway), so no, it was not. |
It as a good question whether this is supposed to work or not. Since traits are types now, just unsized, I would say "yes". But since an impl for a trait is no different to just providing default methods, perhaps we want to avoid that overlap. Shouldn't be hard to fix if we all agree on "yes", but cc @nikomatsakis to check he agrees. |
@nick29581 As I understand it, an
I think the closer correspondence is to creating an extension trait with a blanket My guess is that this was an intended, but implicit part of the DST proposal, but @nikomatsakis can speak more directly to that. |
These subtle differences make me want it less. But the blanket impl-like use case seems legitimate. I agree with the intended but implicit assessment - I vaguely remember this coming up as a use case at some point |
I've always assumed this would work but I'm curious @aturon was there a specific point in the libraries that required it? |
@nikomatsakis IIRC this came out of playing around with the |
I started looking at this, but the hard bits seem to be some adjustment to method selection, so I'll wait on #18121 landing before doing this |
I think there is some serious utility in providing this, especially for things like Any. I will try to dig up some other use-cases. @aturon Note that since |
…irement-in-linked-projects, r=Veykril fix: remove AbsPath requirement from linkedProjects Should (fingers crossed!) fix rust-lang/rust-analyzer#17664. I opened the `rustc` workspace with the [suggested configuration](https://github.com/rust-lang/rust/blob/e552c168c72c95dc28950a9aae8ed7030199aa0d/src/etc/rust_analyzer_settings.json) and I was able to successfully open some rustc crates (`rustc_incremental`) and have IDE functionality. `@Veykril:` can you try these changes and let me know if it fixed rustc?
This code:
generates this error:
I couldn't find any existing issue on this, but this is expected to work, right?
The text was updated successfully, but these errors were encountered: