Skip to content
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

Rollup of 16 pull requests #94784

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6620244
Make some `Clone` impls `const`
lilasta Dec 11, 2021
9054fbb
mirror mention of intent of From
asquared31415 Jan 3, 2022
04b3162
Add collect_into
frengor Feb 20, 2022
5941fef
Constify slice indexing
fee1-dead Feb 22, 2022
4654a91
Constify slice index for strings
fee1-dead Mar 6, 2022
b328688
Statically compile libstdc++ everywhere if asked
Mar 8, 2022
0d92752
Suggest `if let`/`let_else` for refutable pat in `let`
estebank Mar 8, 2022
c3a998e
Do not suggest `let_else` if no bindings would be introduced
estebank Mar 8, 2022
a5216cf
Unify inherent impl blocks by wrapping them into a div
GuillaumeGomez Mar 8, 2022
fbd9c28
Update GUI tests for impl blocks path changes
GuillaumeGomez Mar 8, 2022
4e067e8
Improve rustdoc book
Urgau Mar 8, 2022
40e4bd2
treat all mir::Constant values as ConstantKind::Val
b-naber Feb 16, 2022
8a811a1
bless tests
b-naber Feb 16, 2022
26fe550
normalization change and rebase
b-naber Mar 8, 2022
5226395
Fix soundness issue in scoped threads.
m-ou-se Mar 5, 2022
7a481ff
Properly abort when thread result panics on drop.
m-ou-se Mar 5, 2022
1c06eb7
Remove outdated comment.
m-ou-se Mar 9, 2022
b97d875
Add soundness test for dropping scoped thread results before joining.
m-ou-se Mar 9, 2022
491350c
Ignore `close_read_wakes_up` test on SGX platform
raoulstrackx Mar 9, 2022
18bb2dd
manually bless 32-bit stderr
b-naber Mar 9, 2022
e346920
Also take in account mdbook redirect in linkchecker
Urgau Mar 9, 2022
021c3b0
keep ERROR in message
b-naber Mar 9, 2022
e54d4ab
Use MaybeUninit in VecDeque to remove the undefined behavior of slice
JmPotato Mar 1, 2022
4d56c15
Add documentation about lifetimes to thread::scope.
m-ou-se Mar 9, 2022
6781016
Add miri to the well known conditional compilation names and values
Urgau Mar 9, 2022
915f9a5
Warn users about || in let chain expressions
c410-f3r Mar 9, 2022
8073a88
Implement macro meta-variable expressions
c410-f3r Mar 9, 2022
63eddb3
Add tracking issue
frengor Mar 9, 2022
ed0ed70
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
Dylan-DPC Mar 9, 2022
0754c96
Rollup merge of #92541 - asquared31415:from-docs, r=m-ou-se
Dylan-DPC Mar 9, 2022
3f13f0b
Rollup merge of #93057 - frengor:iter_collect_into, r=m-ou-se
Dylan-DPC Mar 9, 2022
de7a97c
Rollup merge of #94059 - b-naber:constantkind-val-transformation, r=lcnr
Dylan-DPC Mar 9, 2022
753d931
Rollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=p…
Dylan-DPC Mar 9, 2022
3440019
Rollup merge of #94472 - JmPotato:use_maybeuninit_for_vecdeque, r=m-o…
Dylan-DPC Mar 9, 2022
e3c33bb
Rollup merge of #94644 - m-ou-se:scoped-threads-drop-soundness, r=jos…
Dylan-DPC Mar 9, 2022
30bb973
Rollup merge of #94657 - fee1-dead:const_slice_index, r=oli-obk
Dylan-DPC Mar 9, 2022
72d8cf1
Rollup merge of #94719 - jonhoo:enable-static-lld, r=Mark-Simulacrum
Dylan-DPC Mar 9, 2022
fca8dba
Rollup merge of #94739 - estebank:suggest-let-else, r=oli-obk
Dylan-DPC Mar 9, 2022
668c607
Rollup merge of #94740 - GuillaumeGomez:unify-impl-blocks, r=notriddle
Dylan-DPC Mar 9, 2022
f2baf2f
Rollup merge of #94753 - Urgau:rustdoc-book-improvements, r=Guillaume…
Dylan-DPC Mar 9, 2022
67fa033
Rollup merge of #94754 - c410-f3r:nice-error, r=lcnr
Dylan-DPC Mar 9, 2022
1ccd44f
Rollup merge of #94763 - m-ou-se:scoped-threads-lifetime-docs, r=Mark…
Dylan-DPC Mar 9, 2022
f7b1fcf
Rollup merge of #94768 - fortanix:raoul/fix_close_read_wakes_up_test_…
Dylan-DPC Mar 9, 2022
3257f81
Rollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkov
Dylan-DPC Mar 9, 2022
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
1 change: 1 addition & 0 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,7 @@ fn init_id_map() -> FxHashMap<String, usize> {
map.insert("provided-methods".to_owned(), 1);
map.insert("implementors".to_owned(), 1);
map.insert("synthetic-implementors".to_owned(), 1);
map.insert("implementations-list".to_owned(), 1);
map.insert("trait-implementations-list".to_owned(), 1);
map.insert("synthetic-implementations-list".to_owned(), 1);
map.insert("blanket-implementations-list".to_owned(), 1);
Expand Down
16 changes: 10 additions & 6 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,14 +1065,15 @@ fn render_assoc_items_inner(
let (non_trait, traits): (Vec<_>, _) = v.iter().partition(|i| i.inner_impl().trait_.is_none());
if !non_trait.is_empty() {
let mut tmp_buf = Buffer::empty_from(w);
let render_mode = match what {
let (render_mode, id) = match what {
AssocItemRender::All => {
tmp_buf.write_str(
"<h2 id=\"implementations\" class=\"small-section-header\">\
Implementations<a href=\"#implementations\" class=\"anchor\"></a>\
</h2>",
Implementations\
<a href=\"#implementations\" class=\"anchor\"></a>\
</h2>",
);
RenderMode::Normal
(RenderMode::Normal, "implementations-list".to_owned())
}
AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
let id =
Expand All @@ -1090,7 +1091,7 @@ fn render_assoc_items_inner(
trait_ = trait_.print(cx),
type_ = type_.print(cx),
);
RenderMode::ForDeref { mut_: deref_mut_ }
(RenderMode::ForDeref { mut_: deref_mut_ }, cx.derive_id(id))
}
};
let mut impls_buf = Buffer::empty_from(w);
Expand All @@ -1115,7 +1116,9 @@ fn render_assoc_items_inner(
}
if !impls_buf.is_empty() {
w.push_buffer(tmp_buf);
write!(w, "<div id=\"{}\">", id);
w.push_buffer(impls_buf);
w.write_str("</div>");
}
}

Expand Down Expand Up @@ -1146,7 +1149,8 @@ fn render_assoc_items_inner(
write!(
w,
"<h2 id=\"trait-implementations\" class=\"small-section-header\">\
Trait Implementations<a href=\"#trait-implementations\" class=\"anchor\"></a>\
Trait Implementations\
<a href=\"#trait-implementations\" class=\"anchor\"></a>\
</h2>\
<div id=\"trait-implementations-list\">{}</div>",
impls
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ function hideThemeButtonState() {
} else {
addClass(innerToggle, "will-expand");
onEachLazy(document.getElementsByClassName("rustdoc-toggle"), function(e) {
if (e.parentNode.id !== MAIN_ID ||
if (e.parentNode.id !== "implementations-list" ||
(!hasClass(e, "implementors-toggle") &&
!hasClass(e, "type-contents-toggle")))
{
Expand Down
8 changes: 4 additions & 4 deletions src/test/rustdoc-gui/docblock-table-overflow.goml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})

// Logically, the ".docblock" and the "<p>" should have the same scroll width.
compare-elements-property: (
"#implementations + details .docblock",
"#implementations + details .docblock > p",
"#implementations-list > details .docblock",
"#implementations-list > details .docblock > p",
["scrollWidth"],
)
assert-property: ("#implementations + details .docblock", {"scrollWidth": "801"})
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "801"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: ("#implementations + details .docblock table", {"scrollWidth": "1573"})
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1573"})
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/hash-item-expansion.goml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.borrow
// In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
assert-attribute: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""})
// We first check that the impl block is open by default.
assert-attribute: ("#implementations + details", {"open": ""})
assert-attribute: ("#implementations-list details", {"open": ""})
// To ensure that we will click on the currently hidden method.
assert-text: (".sidebar-elems section .block li > a", "must_use")
click: ".sidebar-elems section .block li > a"
// We check that the impl block was opened as expected so that we can see the method.
assert-attribute: ("#implementations + details", {"open": ""})
assert-attribute: ("#implementations-list > details", {"open": ""})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/impl-default-expansion.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This test ensures that the impl blocks are open by default.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
assert-attribute: ("#main-content > details.implementors-toggle", {"open": ""})
assert-attribute: ("#implementations-list details.implementors-toggle", {"open": ""})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/toggle-docs-mobile.goml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assert-attribute: (".top-doc", {"open": ""})
// Assert the position of the toggle on the top doc block.
assert-position: (".top-doc summary::before", {"x": 4})
// Assert the position of the toggle on the impl block.
assert-position: ("#implementations + details > summary::before", {"x": 4})
assert-position: ("#implementations-list > details > summary::before", {"x": 4})
// Assert the position of the toggle on a method.
assert-position: (
"#trait-implementations-list .impl-items .method-toggle > summary::before",
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/toggle-docs.goml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ wait-for: 50
assert-text: ("#toggle-all-docs", "[+]")
// We check that all <details> are collapsed (except for the impl block ones).
assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
assert-attribute: ("details.rustdoc-toggle.implementors-toggle", {"open": ""})
assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
// We now check that the other impl blocks are collapsed.
assert-attribute-false: (
"#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle",
Expand Down
4 changes: 3 additions & 1 deletion src/test/rustdoc/duplicate_impls/issue-33054.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// ignore-tidy-linelength

// @has issue_33054/impls/struct.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl Foo'
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
// @count - '//*[@id="main-content"]/details/summary/*[@class="impl has-srclink"]' 1
// @count - '//*[@id="main-content"]/div[@id="implementations-list"]/details/summary/*[@class="impl has-srclink"]' 1
// @has issue_33054/impls/bar/trait.Bar.html
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
// @count - '//*[@class="struct"]' 1
Expand Down