Skip to content

Rollup of 8 pull requests #108919

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

Merged
merged 19 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
40185db
Delete old re-exports from rustc_smir
celinval Mar 4, 2023
af664be
rustdoc: include link on all.html location header
notriddle Mar 3, 2023
b66db7e
Create new rustc_smir struct to map future crates
celinval Mar 4, 2023
775bacd
Simplify `sort_by` calls
WaffleLapkin Mar 7, 2023
5eaeb71
Change item collection to be on demand
celinval Mar 7, 2023
a439c02
may not => cannot
compiler-errors Mar 7, 2023
0f4255e
Dedup copy field errors for identical types
compiler-errors Mar 8, 2023
8a99ffc
Suppress copy impl error when post-normalized type references errors
compiler-errors Mar 7, 2023
be60bcb
Rename `MapInPlace` as `FlatMapInPlace`.
nnethercote Mar 8, 2023
204ba32
fix: evaluate with wrong obligation stack
LYF1999 Mar 8, 2023
1d442af
move clippy tests back to their intended directory
pietroalbini Mar 8, 2023
6c91ce2
Rollup merge of #108686 - notriddle:notriddle/jank-all, r=jsha
matthiaskrgr Mar 8, 2023
9b6b7a3
Rollup merge of #108846 - celinval:smir-poc, r=oli-obk
matthiaskrgr Mar 8, 2023
1a9376d
Rollup merge of #108873 - WaffleLapkin:cmp, r=cjgillot
matthiaskrgr Mar 8, 2023
f6b8a9f
Rollup merge of #108883 - compiler-errors:post-norm-copy-err, r=BoxyUwU
matthiaskrgr Mar 8, 2023
031b528
Rollup merge of #108884 - compiler-errors:tweak-illegal-copy-impl-mes…
matthiaskrgr Mar 8, 2023
a95943b
Rollup merge of #108887 - nnethercote:rename-MapInPlace, r=lqd
matthiaskrgr Mar 8, 2023
33c3036
Rollup merge of #108901 - LYF1999:yf/108897, r=lcnr
matthiaskrgr Mar 8, 2023
7732ccc
Rollup merge of #108903 - rust-lang:pa-fix-clippy-tests, r=flip1995
matthiaskrgr Mar 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc: include link on all.html location header
This avoids a subtle layout shift when switching from the crate page
to all items.
  • Loading branch information
notriddle committed Mar 4, 2023
commit af664be4230d4052df32e7821a4a85ae9d13a474
4 changes: 1 addition & 3 deletions src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
};
let all = shared.all.replace(AllTypes::new());
let mut sidebar = Buffer::html();
if shared.cache.crate_version.is_some() {
write!(sidebar, "<h2 class=\"location\">Crate {}</h2>", crate_name)
};
write!(sidebar, "<h2 class=\"location\"><a href=\"#\">Crate {}</a></h2>", crate_name);

let mut items = Buffer::html();
sidebar_module_like(&mut items, all.item_sections());
Expand Down
14 changes: 14 additions & 0 deletions tests/rustdoc-gui/sidebar.goml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,17 @@ assert-property: (".sidebar", {"clientWidth": "200"})
click: "#toggle-all-docs"
assert-text: ("#toggle-all-docs", "[−]")
assert-property: (".sidebar", {"clientWidth": "200"})

// Checks that all.html and index.html have their sidebar link in the same place.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
store-property: (index_sidebar_width, ".sidebar .location a", "clientWidth")
store-property: (index_sidebar_height, ".sidebar .location a", "clientHeight")
store-property: (index_sidebar_x, ".sidebar .location a", "offsetTop")
store-property: (index_sidebar_y, ".sidebar .location a", "offsetLeft")
goto: "file://" + |DOC_PATH| + "/test_docs/all.html"
assert-property: (".sidebar .location a", {
"clientWidth": |index_sidebar_width|,
"clientHeight": |index_sidebar_height|,
"offsetTop": |index_sidebar_x|,
"offsetLeft": |index_sidebar_y|,
})