-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Dedup bounds with parent impl block #105392
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
Open
GuillaumeGomez
wants to merge
2
commits into
rust-lang:master
Choose a base branch
from
GuillaumeGomez:rustdoc-dedup-bounds
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+173
−24
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// This test ensures that if a child item's bounds are duplicated with the parent, they are not | ||
// generated in the documentation. | ||
|
||
#![crate_name = "foo"] | ||
|
||
pub trait Bar {} | ||
pub trait Bar2 {} | ||
pub trait Bar3 {} | ||
pub trait Bar4 {} | ||
|
||
// @has 'foo/trait.Foo.html' | ||
pub trait Foo<'a, T: Bar + 'a> where T: Bar2 { | ||
// @has - '//*[@id="method.foo"]/h4' 'fn foo()' | ||
// `Bar` shouldn't appear in the bounds. | ||
// @!has - '//*[@id="method.foo"]/h4' 'Bar' | ||
fn foo() where T: Bar {} | ||
// @has - '//*[@id="method.foo2"]/h4' 'fn foo2()' | ||
// `Bar2` shouldn't appear in the bounds. | ||
// @!has - '//*[@id="method.foo2"]/h4' 'Bar2' | ||
fn foo2() where T: Bar2 {} | ||
// @has - '//*[@id="method.foo3"]/h4' "fn foo3<'b>()where T: Bar3, 'a: 'b," | ||
fn foo3<'b>() where T: Bar3, 'a: 'b {} | ||
// @has - '//*[@id="method.foo4"]/h4' "fn foo4()where T: Bar3," | ||
fn foo4() where T: Bar2 + Bar3 {} | ||
} | ||
|
||
pub struct X; | ||
|
||
// @has 'foo/struct.X.html' | ||
impl<'a, T: Bar> X where T: Bar2 { | ||
// @has - '//*[@id="method.foo"]/h4' 'fn foo()' | ||
// @!has - '//*[@id="method.foo"]/h4' 'Bar' | ||
// `Bar` shouldn't appear in the bounds. | ||
pub fn foo() where T: Bar {} | ||
// @has - '//*[@id="method.foo2"]/h4' 'fn foo2()' | ||
// `Bar2` shouldn't appear in the bounds. | ||
// @!has - '//*[@id="method.foo2"]/h4' 'Bar2' | ||
pub fn foo2() where T: Bar2 {} | ||
// @has - '//*[@id="method.foo3"]/h4' "fn foo3<'b>()where T: Bar3, 'a: 'b," | ||
pub fn foo3<'b>() where 'a: 'b, T: Bar3 {} | ||
// @has - '//*[@id="method.foo4"]/h4' "fn foo4()where T: Bar3," | ||
pub fn foo4() where T: Bar2 + Bar3 {} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.