Skip to content

Commit 126561c

Browse files
committed
Auto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - #85271 (Fix indentation in move keyword documentation) - #85551 (Fix search results display) - #85621 (Restore sans-serif font for module items.) - #85628 (Replace more "NULL" with "null") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ef0ec30 + 16fe40d commit 126561c

12 files changed

+57
-17
lines changed

compiler/rustc_mir_build/src/check_unsafety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl UnsafeOpKind {
296296
),
297297
DerefOfRawPointer => (
298298
"dereference of raw pointer",
299-
"raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules \
299+
"raw pointers may be null, dangling or unaligned; they can violate aliasing rules \
300300
and cause data races: all of these are undefined behavior",
301301
),
302302
AssignToDroppingUnionField => (

library/std/src/keyword_docs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1008,9 +1008,9 @@ mod mod_keyword {}
10081008
/// move || println!("This is a: {}", text)
10091009
/// }
10101010
///
1011-
/// let fn_plain = create_fn();
1011+
/// let fn_plain = create_fn();
10121012
///
1013-
/// fn_plain();
1013+
/// fn_plain();
10141014
/// ```
10151015
///
10161016
/// `move` is often used when [threads] are involved.

src/librustdoc/html/static/rustdoc.css

+33-5
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ h4.type.trait-impl, h4.associatedconstant.trait-impl, h4.associatedtype.trait-im
145145

146146
h1, h2, h3, h4,
147147
.sidebar, a.source, .search-input, .search-results .result-name,
148+
.content table td:first-child > a,
148149
div.item-list .out-of-band,
149150
#source-sidebar, #sidebar-toggle,
150151
details.rustdoc-toggle > summary::before,
@@ -759,25 +760,40 @@ a {
759760

760761
.search-results.active {
761762
display: block;
763+
/* prevent overhanging tabs from moving the first result */
764+
clear: both;
762765
}
763766

764-
.search-results .desc {
767+
.search-results .desc > span {
765768
white-space: nowrap;
766769
text-overflow: ellipsis;
767770
overflow: hidden;
768771
display: block;
769772
}
770773

771-
.search-results a {
774+
.search-results > a {
775+
display: block;
776+
width: 100%;
772777
/* A little margin ensures the browser's outlining of focused links has room to display. */
773778
margin-left: 2px;
774779
margin-right: 2px;
775-
display: block;
780+
border-bottom: 1px solid #aaa3;
781+
}
782+
783+
.search-results > a > div {
784+
display: flex;
785+
flex-flow: row wrap;
776786
}
777787

778-
.result-name {
788+
.search-results .result-name, .search-results div.desc, .search-results .result-description {
779789
width: 50%;
780-
float: left;
790+
}
791+
.search-results .result-name {
792+
padding-right: 1em;
793+
}
794+
795+
.search-results .result-name > span {
796+
display: inline-block;
781797
}
782798

783799
.result-name span.primitive::after {
@@ -1733,6 +1749,18 @@ details.undocumented[open] > summary::before {
17331749
.search-container > div {
17341750
width: calc(100% - 32px);
17351751
}
1752+
1753+
/* Display an alternating layout on tablets and phones */
1754+
.search-results > a {
1755+
border-bottom: 1px solid #aaa9;
1756+
padding: 5px 0px;
1757+
}
1758+
.search-results .result-name, .search-results div.desc, .search-results .result-description {
1759+
width: 100%;
1760+
}
1761+
.search-results div.desc, .search-results .result-description {
1762+
padding-left: 2em;
1763+
}
17361764
}
17371765

17381766
@media print {

src/librustdoc/html/static/search.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,8 @@ window.initSearch = function(rawSearchIndex) {
994994
("<span class=\"alias\"><b>" + item.alias + " </b></span><span " +
995995
"class=\"grey\"><i>&nbsp;- see&nbsp;</i></span>") : "") +
996996
item.displayPath + "<span class=\"" + type + "\">" +
997-
name + "</span></div><div>" +
998-
"<span class=\"desc\">" + item.desc +
997+
name + "</span></div><div class=\"desc\">" +
998+
"<span>" + item.desc +
999999
"&nbsp;</span></div></div></a>";
10001000
});
10011001
output += "</div>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
goto: file://|DOC_PATH|/test_docs/index.html
2+
size: (900, 1000)
3+
write: (".search-input", "test")
4+
// Waiting for the search results to appear...
5+
wait-for: "#titles"
6+
// The width is returned by "getComputedStyle" which returns the exact number instead of the
7+
// CSS rule which is "50%"...
8+
assert: (".search-results div.desc", {"width": "320px"})
9+
size: (600, 100)
10+
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
11+
// when computed it's larger.
12+
assert: (".search-results div.desc", {"width": "570px"})

src/test/ui/generator/issue-45729-unsafe-in-generator.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | *(1 as *mut u32) = 42;
55
| ^^^^^^^^^^^^^^^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/issues/issue-47412.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | match *ptr {}
55
| ^^^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/traits/safety-fn-body.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | *self += 1;
55
| ^^^^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/unsafe/issue-45087-unreachable-unsafe.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | *(1 as *mut u32) = 42;
55
| ^^^^^^^^^^^^^^^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/unsafe/unsafe-fn-assign-deref-ptr.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | *p = 0;
55
| ^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | return *p;
55
| ^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

src/test/ui/unsafe/unsafe-unstable-const-fn.thir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function
44
LL | *a == b
55
| ^^ dereference of raw pointer
66
|
7-
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
7+
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)