Skip to content

Commit 5854680

Browse files
committed
Auto merge of #102767 - matthiaskrgr:rollup-vcbt81v, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #102577 (Warn about Visual Studio Code branding confusion) - #102720 (do not reverse the expected type and found type for ObligationCauseCo…) - #102744 (rustdoc: remove unused CSS `.content .item-list`) - #102747 (rustdoc: remove unused CSS `.docblock a:not(.srclink)`) - #102748 (Disable compressed debug sections on i586-gnu) - #102761 (let-else: test else block with non-never uninhabited type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents cf0fa76 + a09e2f6 commit 5854680

File tree

18 files changed

+53
-30
lines changed

18 files changed

+53
-30
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,10 @@ fn link_natively<'a>(
977977
but `link.exe` was not found",
978978
);
979979
sess.note_without_error(
980-
"please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 \
981-
was installed with the Visual C++ option",
980+
"please ensure that Visual Studio 2017 or later, or Build Tools \
981+
for Visual Studio were installed with the Visual C++ option.",
982982
);
983+
sess.note_without_error("VS Code is a different product, and is not sufficient.");
983984
}
984985
sess.abort_if_errors();
985986
}

compiler/rustc_hir_analysis/src/check/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
259259
err.help("consider adding an `else` block that evaluates to the expected type");
260260
error = true;
261261
},
262-
ret_reason.is_none(),
262+
false,
263263
);
264264
error
265265
}

src/ci/docker/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,14 @@ For targets: `i586-unknown-linux-gnu`
242242
- Operating System > Target OS = linux
243243
- Operating System > Linux kernel version = 3.2.101
244244
- Binary utilities > Version of binutils = 2.32
245+
- Binary utilities > binutils extra config = --enable-compressed-debug-sections=none -- (\*)
245246
- C-library > glibc version = 2.17.0
246247
- C compiler > gcc version = 8.3.0
247248
- C compiler > C++ = ENABLE
248249
250+
(\*) Compressed debug is enabled by default for gas (assembly) on Linux/x86 targets,
251+
but that makes our `compiler_builtins` incompatible with binutils < 2.32.
252+
249253
### `powerpc-linux-gnu.config`
250254
251255
For targets: `powerpc-unknown-linux-gnu`

src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ CT_BINUTILS_LINKERS_LIST="ld"
336336
CT_BINUTILS_LINKER_DEFAULT="bfd"
337337
# CT_BINUTILS_PLUGINS is not set
338338
CT_BINUTILS_RELRO=m
339-
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
339+
CT_BINUTILS_EXTRA_CONFIG_ARRAY="--enable-compressed-debug-sections=none"
340340
# CT_BINUTILS_FOR_TARGET is not set
341341
CT_ALL_BINUTILS_CHOICES="BINUTILS"
342342

src/librustdoc/html/render/print_item.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
890890
w,
891891
"implementors",
892892
"Implementors",
893-
"<div class=\"item-list\" id=\"implementors-list\">",
893+
"<div id=\"implementors-list\">",
894894
);
895895
for implementor in concrete {
896896
render_implementor(cx, implementor, it, w, &implementor_dups, &[]);
@@ -902,7 +902,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
902902
w,
903903
"synthetic-implementors",
904904
"Auto implementors",
905-
"<div class=\"item-list\" id=\"synthetic-implementors-list\">",
905+
"<div id=\"synthetic-implementors-list\">",
906906
);
907907
for implementor in synthetic {
908908
render_implementor(
@@ -923,15 +923,15 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
923923
w,
924924
"implementors",
925925
"Implementors",
926-
"<div class=\"item-list\" id=\"implementors-list\"></div>",
926+
"<div id=\"implementors-list\"></div>",
927927
);
928928

929929
if t.is_auto(cx.tcx()) {
930930
write_small_section_header(
931931
w,
932932
"synthetic-implementors",
933933
"Auto implementors",
934-
"<div class=\"item-list\" id=\"synthetic-implementors-list\"></div>",
934+
"<div id=\"synthetic-implementors-list\"></div>",
935935
);
936936
}
937937
}

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

+3-7
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,6 @@ pre, .rustdoc.source .example-wrap {
690690
border: 1px solid var(--border-color);
691691
}
692692

693-
.content .item-list {
694-
list-style-type: none;
695-
padding: 0;
696-
}
697-
698693
/* Shift "where ..." part of method or fn definition down a line */
699694
.content .method .where,
700695
.content .fn .where,
@@ -773,8 +768,9 @@ h2.small-section-header > .anchor {
773768
}
774769

775770
.all-items a:hover,
776-
.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
777-
.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
771+
.docblock a:not(.test-arrow):not(.scrape-help):hover,
772+
.docblock-short a:not(.test-arrow):not(.scrape-help):hover,
773+
.item-info a {
778774
text-decoration: underline;
779775
}
780776

src/test/rustdoc/impl-disambiguation.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pub trait Foo {}
44

55
pub struct Bar<T> { field: T }
66

7-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
7+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
88
// "impl Foo for Bar<u8>"
99
impl Foo for Bar<u8> {}
10-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
10+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1111
// "impl Foo for Bar<u16>"
1212
impl Foo for Bar<u16> {}
13-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
13+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1414
// "impl<'a> Foo for &'a Bar<u8>"
1515
impl<'a> Foo for &'a Bar<u8> {}
1616

@@ -22,9 +22,9 @@ pub mod mod2 {
2222
pub enum Baz {}
2323
}
2424

25-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
25+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
2626
// "impl Foo for foo::mod1::Baz"
2727
impl Foo for mod1::Baz {}
28-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
28+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
2929
// "impl<'a> Foo for &'a foo::mod2::Baz"
3030
impl<'a> Foo for &'a mod2::Baz {}

src/test/rustdoc/impl-parts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ pub struct Foo<T> { field: T }
77

88
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
99
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
10-
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header"]' \
10+
// @has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1111
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
1212
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

src/test/ui/async-await/issue-66387-if-without-else.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0317]: `if` may be missing an `else` clause
44
LL | / if true {
55
LL | | return 0;
66
LL | | }
7-
| |_____^ expected `()`, found `i32`
7+
| |_____^ expected `i32`, found `()`
88
|
99
= note: `if` expressions without `else` evaluate to `()`
1010
= help: consider adding an `else` block that evaluates to the expected type

src/test/ui/consts/control-flow/issue-50577.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0317]: `if` may be missing an `else` clause
22
--> $DIR/issue-50577.rs:3:16
33
|
44
LL | Drop = assert_eq!(1, 1),
5-
| ^^^^^^^^^^^^^^^^ expected `()`, found `isize`
5+
| ^^^^^^^^^^^^^^^^ expected `isize`, found `()`
66
|
77
= note: `if` expressions without `else` evaluate to `()`
88
= help: consider adding an `else` block that evaluates to the expected type
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
let a = if true { true };
33
//~^ ERROR `if` may be missing an `else` clause [E0317]
4-
//~| expected `()`, found `bool`
4+
//~| expected `bool`, found `()`
55
println!("{}", a);
66
}

src/test/ui/expr/if/if-without-else-result.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let a = if true { true };
55
| ^^^^^^^^^^----^^
66
| | |
77
| | found here
8-
| expected `()`, found `bool`
8+
| expected `bool`, found `()`
99
|
1010
= note: `if` expressions without `else` evaluate to `()`
1111
= help: consider adding an `else` block that evaluates to the expected type

src/test/ui/expr/if/issue-4201.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fn main() {
33
0
44
} else if false {
55
//~^ ERROR `if` may be missing an `else` clause
6-
//~| expected `()`, found integer
6+
//~| expected integer, found `()`
77
1
88
};
99
}

src/test/ui/expr/if/issue-4201.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | |
88
LL | | 1
99
| | - found here
1010
LL | | };
11-
| |_____^ expected `()`, found integer
11+
| |_____^ expected integer, found `()`
1212
|
1313
= note: `if` expressions without `else` evaluate to `()`
1414
= help: consider adding an `else` block that evaluates to the expected type

src/test/ui/issues/issue-19991.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn main() {
55
if let Some(homura) = Some("madoka") { //~ ERROR missing an `else` clause
6-
//~| expected `()`, found integer
6+
//~| expected integer, found `()`
77
765
88
};
99
}

src/test/ui/issues/issue-19991.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | |
66
LL | | 765
77
| | --- found here
88
LL | | };
9-
| |_____^ expected `()`, found integer
9+
| |_____^ expected integer, found `()`
1010
|
1111
= note: `if` expressions without `else` evaluate to `()`
1212
= help: consider adding an `else` block that evaluates to the expected type

src/test/ui/let-else/let-else-non-diverging.rs

+11
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@ fn main() {
88
}
99
};
1010
let Some(x) = Some(1) else { Some(2) }; //~ ERROR does not diverge
11+
12+
// Ensure that uninhabited types do not "diverge".
13+
// This might be relaxed in the future, but when it is,
14+
// it should be an explicitly wanted descision.
15+
let Some(x) = Some(1) else { foo::<Uninhabited>() }; //~ ERROR does not diverge
16+
}
17+
18+
enum Uninhabited {}
19+
20+
fn foo<T>() -> T {
21+
panic!()
1122
}

src/test/ui/let-else/let-else-non-diverging.stderr

+12-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ LL | let Some(x) = Some(1) else { Some(2) };
3939
= help: try adding a diverging expression, such as `return` or `panic!(..)`
4040
= help: ...or use `match` instead of `let...else`
4141

42-
error: aborting due to 3 previous errors
42+
error[E0308]: `else` clause of `let...else` does not diverge
43+
--> $DIR/let-else-non-diverging.rs:15:32
44+
|
45+
LL | let Some(x) = Some(1) else { foo::<Uninhabited>() };
46+
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited`
47+
|
48+
= note: expected type `!`
49+
found enum `Uninhabited`
50+
= help: try adding a diverging expression, such as `return` or `panic!(..)`
51+
= help: ...or use `match` instead of `let...else`
52+
53+
error: aborting due to 4 previous errors
4354

4455
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)