Skip to content

Commit 8a97b48

Browse files
committed
Auto merge of #106054 - matthiaskrgr:rollup-38epsfh, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #105567 (KCFI test: Also support LLVM 16 output) - #105847 (Ensure param-env is const before calling `eval_to_valtree`) - #105983 (Add a missing early return in drop tracking `handle_uninhabited_return`) - #106027 (rustdoc: simplify CSS and DOM for more-scraped-examples) - #106035 (Migrate search tab title color to CSS variable) - #106037 (Add regression test for #94293) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents cca80b9 + ee43f34 commit 8a97b48

File tree

15 files changed

+211
-39
lines changed

15 files changed

+211
-39
lines changed

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
577577
ty::ConstKind::Unevaluated(uv) => {
578578
let instance = self.resolve(uv.def, uv.substs)?;
579579
let cid = GlobalId { instance, promoted: None };
580-
self.ctfe_query(span, |tcx| tcx.eval_to_valtree(self.param_env.and(cid)))?
581-
.unwrap_or_else(|| bug!("unable to create ValTree for {uv:?}"))
580+
self.ctfe_query(span, |tcx| {
581+
tcx.eval_to_valtree(self.param_env.with_const().and(cid))
582+
})?
583+
.unwrap_or_else(|| bug!("unable to create ValTree for {uv:?}"))
582584
}
583585
ty::ConstKind::Bound(..) | ty::ConstKind::Infer(..) => {
584586
span_bug!(self.cur_span(), "unexpected ConstKind in ctfe: {val:?}")

compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ impl<'a, 'tcx> DropRangeVisitor<'a, 'tcx> {
233233
self.tcx()
234234
.sess
235235
.delay_span_bug(expr.span, format!("could not resolve infer vars in `{ty}`"));
236+
return;
236237
}
237238
let ty = self.tcx().erase_regions(ty);
238239
let m = self.tcx().parent_module(expr.hir_id).to_def_id();

src/librustdoc/html/render/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,8 +3005,7 @@ fn render_call_locations(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Ite
30053005
</summary>\
30063006
<div class=\"hide-more\">Hide additional examples</div>\
30073007
<div class=\"more-scraped-examples\">\
3008-
<div class=\"toggle-line\"><div class=\"toggle-line-inner\"></div></div>\
3009-
<div class=\"more-scraped-examples-inner\">"
3008+
<div class=\"toggle-line\"><div class=\"toggle-line-inner\"></div></div>"
30103009
);
30113010

30123011
// Only generate inline code for MAX_FULL_EXAMPLES number of examples. Otherwise we could
@@ -3030,7 +3029,7 @@ fn render_call_locations(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Ite
30303029
write!(w, "</ul></div>");
30313030
}
30323031

3033-
write!(w, "</div></div></details>");
3032+
write!(w, "</div></details>");
30343033
}
30353034

30363035
write!(w, "</div>");

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@ a.test-arrow:hover {
12811281
#titles > button > div.count {
12821282
display: inline-block;
12831283
font-size: 1rem;
1284+
color: var(--search-tab-title-count-color);
12841285
}
12851286

12861287
#src-sidebar-toggle {
@@ -1991,20 +1992,15 @@ in storage.js
19911992
}
19921993

19931994
.more-scraped-examples {
1994-
margin-left: 5px;
1995-
display: flex;
1996-
flex-direction: row;
1997-
}
1998-
1999-
.more-scraped-examples-inner {
2000-
/* 20px is width of toggle-line + toggle-line-inner */
2001-
width: calc(100% - 20px);
1995+
margin-left: 25px;
1996+
position: relative;
20021997
}
20031998

20041999
.toggle-line {
2005-
align-self: stretch;
2006-
margin-right: 10px;
2007-
margin-top: 5px;
2000+
position: absolute;
2001+
top: 5px;
2002+
bottom: 0;
2003+
right: calc(100% + 10px);
20082004
padding: 0 4px;
20092005
cursor: pointer;
20102006
}

src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
4545
--search-color: #fff;
4646
--search-results-alias-color: #c5c5c5;
4747
--search-results-grey-color: #999;
48+
--search-tab-title-count-color: #888;
4849
--stab-background-color: #314559;
4950
--stab-code-color: #e6e1cf;
5051
--code-highlight-kw-color: #ff7733;
@@ -175,10 +176,6 @@ pre, .rustdoc.source .example-wrap {
175176
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
176177
}
177178

178-
#titles > button > div.count {
179-
color: #888;
180-
}
181-
182179
/* rules that this theme does not need to set, here to satisfy the rule checker */
183180
/* note that a lot of these are partially set in some way (meaning they are set
184181
individually rather than as a group) */

src/librustdoc/html/static/css/themes/dark.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
--search-color: #111;
4141
--search-results-alias-color: #fff;
4242
--search-results-grey-color: #ccc;
43+
--search-tab-title-count-color: #888;
4344
--stab-background-color: #314559;
4445
--stab-code-color: #e6e1cf;
4546
--code-highlight-kw-color: #ab8ac1;
@@ -96,10 +97,6 @@
9697
background-color: #353535;
9798
}
9899

99-
#titles > button > div.count {
100-
color: #888;
101-
}
102-
103100
.scraped-example-list .scrape-help {
104101
border-color: #aaa;
105102
color: #eee;

src/librustdoc/html/static/css/themes/light.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
--search-color: #000;
4141
--search-results-alias-color: #000;
4242
--search-results-grey-color: #999;
43+
--search-tab-title-count-color: #888;
4344
--stab-background-color: #fff5d6;
4445
--stab-code-color: #000;
4546
--code-highlight-kw-color: #8959a8;
@@ -93,10 +94,6 @@
9394
border-top-color: #0089ff;
9495
}
9596

96-
#titles > button > div.count {
97-
color: #888;
98-
}
99-
10097
.scraped-example-list .scrape-help {
10198
border-color: #555;
10299
color: #333;

src/test/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,21 @@ impl Copy for i32 {}
2020

2121
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
2222
// CHECK-LABEL: define{{.*}}foo
23-
// FIXME(rcvalle): Change <unknown kind #36> to !kcfi_type when Rust is updated to LLVM 16
24-
// CHECK-SAME: {{.*}}!<unknown kind #36> ![[TYPE1:[0-9]+]]
23+
// CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE1:[0-9]+]]
2524
// CHECK: call i32 %f(i32 %arg){{.*}}[ "kcfi"(i32 -1666898348) ]
2625
f(arg)
2726
}
2827

2928
pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
3029
// CHECK-LABEL: define{{.*}}bar
31-
// FIXME(rcvalle): Change <unknown kind #36> to !kcfi_type when Rust is updated to LLVM 16
32-
// CHECK-SAME: {{.*}}!<unknown kind #36> ![[TYPE2:[0-9]+]]
30+
// CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE2:[0-9]+]]
3331
// CHECK: call i32 %f(i32 %arg1, i32 %arg2){{.*}}[ "kcfi"(i32 -1789026986) ]
3432
f(arg1, arg2)
3533
}
3634

3735
pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
3836
// CHECK-LABEL: define{{.*}}baz
39-
// FIXME(rcvalle): Change <unknown kind #36> to !kcfi_type when Rust is updated to LLVM 16
40-
// CHECK-SAME: {{.*}}!<unknown kind #36> ![[TYPE3:[0-9]+]]
37+
// CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE3:[0-9]+]]
4138
// CHECK: call i32 %f(i32 %arg1, i32 %arg2, i32 %arg3){{.*}}[ "kcfi"(i32 1248878270) ]
4239
f(arg1, arg2, arg3)
4340
}

src/test/rustdoc-gui/scrape-examples-layout.goml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ assert-property-false: (
1010
// Check that examples with very long lines have the same width as ones that don't.
1111
store-property: (
1212
clientWidth,
13-
".more-scraped-examples .scraped-example:nth-child(1) .code-wrapper .src-line-numbers",
13+
".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
1414
"clientWidth"
1515
)
1616

1717
assert-property: (
18-
".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
18+
".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers",
1919
{"clientWidth": |clientWidth|}
2020
)
2121

2222
assert-property: (
23-
".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers",
23+
".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers",
2424
{"clientWidth": |clientWidth|}
2525
)
2626

2727
assert-property: (
28-
".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers",
28+
".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers",
2929
{"clientWidth": |clientWidth|}
3030
)
3131

3232
assert-property: (
33-
".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers",
33+
".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
3434
{"clientWidth": |clientWidth|}
3535
)

src/test/rustdoc-gui/search-result-color.goml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ reload:
6666

6767
// Waiting for the search results to appear...
6868
wait-for: "#titles"
69+
assert-css: (
70+
"#titles > button > div.count",
71+
{"color": "rgb(136, 136, 136)"},
72+
ALL,
73+
)
6974
assert-css: (
7075
"//*[@class='desc'][text()='Just a normal struct.']",
7176
{"color": "rgb(197, 197, 197)"},
@@ -178,6 +183,11 @@ reload:
178183

179184
// Waiting for the search results to appear...
180185
wait-for: "#titles"
186+
assert-css: (
187+
"#titles > button > div.count",
188+
{"color": "rgb(136, 136, 136)"},
189+
ALL,
190+
)
181191
assert-css: (
182192
"//*[@class='desc'][text()='Just a normal struct.']",
183193
{"color": "rgb(221, 221, 221)"},
@@ -275,6 +285,11 @@ reload:
275285

276286
// Waiting for the search results to appear...
277287
wait-for: "#titles"
288+
assert-css: (
289+
"#titles > button > div.count",
290+
{"color": "rgb(136, 136, 136)"},
291+
ALL,
292+
)
278293
assert-css: (
279294
"//*[@class='desc'][text()='Just a normal struct.']",
280295
{"color": "rgb(0, 0, 0)"},

0 commit comments

Comments
 (0)