forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#127975 - GuillaumeGomez:fix-trait-bounds-display, r=notriddle Fix trait bounds display Fixes rust-lang#127398. I took a simple rule: if there are more than two bounds, we display them like rustfmt. Before this PR: ![Screenshot from 2024-07-19 17-38-59](https://github.com/user-attachments/assets/4162b57e-7ebb-48f9-a3a1-25e443c140cb) After this PR: ![Screenshot from 2024-07-19 17-39-09](https://github.com/user-attachments/assets/a3ba22dd-5f34-45d0-ad9d-0cdf89dc509c) r? `@notriddle`
- Loading branch information
Showing
4 changed files
with
68 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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 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,35 @@ | ||
// Check that if a trait has more than 2 bounds, they are displayed on different lines. | ||
|
||
// It tries to load a JS for each trait but there are none since they're not implemented. | ||
fail-on-request-error: false | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/trait_bounds/trait.OneBound.html" | ||
// They should have the same Y position. | ||
compare-elements-position: ( | ||
".item-decl code", | ||
".item-decl a.trait[title='trait core::marker::Sized']", | ||
["y"], | ||
) | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/trait_bounds/trait.TwoBounds.html" | ||
// They should have the same Y position. | ||
compare-elements-position: ( | ||
".item-decl code", | ||
".item-decl a.trait[title='trait core::marker::Copy']", | ||
["y"], | ||
) | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/trait_bounds/trait.ThreeBounds.html" | ||
// All on their own line. | ||
compare-elements-position-false: ( | ||
".item-decl code", | ||
".item-decl a.trait[title='trait core::marker::Sized']", | ||
["y"], | ||
) | ||
compare-elements-position-false: ( | ||
".item-decl a.trait[title='trait core::marker::Sized']", | ||
".item-decl a.trait[title='trait core::marker::Copy']", | ||
["y"], | ||
) | ||
compare-elements-position-false: ( | ||
".item-decl a.trait[title='trait core::marker::Copy']", | ||
".item-decl a.trait[title='trait core::cmp::Eq']", | ||
["y"], | ||
) |
This file contains 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