-
-
Notifications
You must be signed in to change notification settings - Fork 15k
rustdoc: Separate the caches for synthetic auto trait & blanket impls #157171
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // The presence of built-in or user-written trait impls disqualifies potential built-in auto trait | ||
| // impls for a type. Here we have a blanket impl of an auto trait which suppresses all hypothetical | ||
| // auto trait impls. | ||
| // | ||
| // Check that we don't claim that there's an auto trait impl & ensure that we show the blanket impl. | ||
| // Erroneously we once used to omit the blanket impl since auto trait impls & blanket impls used to | ||
| // share the same cache and auto trait impls get generated first. Now, they have separate caches. | ||
| // | ||
| // issue: <https://github.com/rust-lang/rust/issues/148980> | ||
|
|
||
| #![feature(auto_traits)] | ||
| #![crate_name = "it"] | ||
|
|
||
| pub auto trait Marker {} | ||
|
|
||
| //@ has 'it/struct.Subject.html' | ||
| #[derive(Clone, Copy)] | ||
| pub struct Subject; | ||
|
|
||
| // NOTE: `#synthetic-implementations-list` contains auto trait impls only despite its name. | ||
| //@ !has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' \ | ||
| // 'Marker for Subject' | ||
|
|
||
| //@ has - '//*[@id="blanket-implementations-list"]//*[@class="impl"]' \ | ||
| // 'Marker for Twhere T: Copy' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, it has to be Twhere for now, T where would fail the htmldocck check. It seems htmldocck incorrectly strips HTML tags. For reference, the HTML looks like IIRC I stumble upon this quite often (unsurprisingly) but I usually split the test expectation into two lines, something like |
||
| impl<T: Copy> Marker for T {} | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the time or leisure to investigate and implement this now. However, this issue does occupy my mind and I'll tackle it soon(tm).
Tagging the corresp. GH issue: #97129.
View changes since the review