about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-07 07:31:53 +0000
committerbors <bors@rust-lang.org>2022-10-07 07:31:53 +0000
commit58546803885164d488185fb9cb9fb04fcbe64e30 (patch)
tree37e199929bff5c5e717e197a5dfe34e16dba6fb7
parentcf0fa76f2711a26ff114f005af886479867724f7 (diff)
parenta09e2f6753078f3ab40b02e8c184d9b2fe07f342 (diff)
downloadrust-58546803885164d488185fb9cb9fb04fcbe64e30.tar.gz
rust-58546803885164d488185fb9cb9fb04fcbe64e30.zip
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
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs5
-rw-r--r--compiler/rustc_hir_analysis/src/check/_match.rs2
-rw-r--r--src/ci/docker/README.md4
-rw-r--r--src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config2
-rw-r--r--src/librustdoc/html/render/print_item.rs8
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css10
-rw-r--r--src/test/rustdoc/impl-disambiguation.rs10
-rw-r--r--src/test/rustdoc/impl-parts.rs2
-rw-r--r--src/test/ui/async-await/issue-66387-if-without-else.stderr2
-rw-r--r--src/test/ui/consts/control-flow/issue-50577.stderr2
-rw-r--r--src/test/ui/expr/if/if-without-else-result.rs2
-rw-r--r--src/test/ui/expr/if/if-without-else-result.stderr2
-rw-r--r--src/test/ui/expr/if/issue-4201.rs2
-rw-r--r--src/test/ui/expr/if/issue-4201.stderr2
-rw-r--r--src/test/ui/issues/issue-19991.rs2
-rw-r--r--src/test/ui/issues/issue-19991.stderr2
-rw-r--r--src/test/ui/let-else/let-else-non-diverging.rs11
-rw-r--r--src/test/ui/let-else/let-else-non-diverging.stderr13
18 files changed, 53 insertions, 30 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 6131bb4baf5..9a0c379b4e4 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -977,9 +977,10 @@ fn link_natively<'a>(
                      but `link.exe` was not found",
                 );
                 sess.note_without_error(
-                    "please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 \
-                     was installed with the Visual C++ option",
+                    "please ensure that Visual Studio 2017 or later, or Build Tools \
+                     for Visual Studio were installed with the Visual C++ option.",
                 );
+                sess.note_without_error("VS Code is a different product, and is not sufficient.");
             }
             sess.abort_if_errors();
         }
diff --git a/compiler/rustc_hir_analysis/src/check/_match.rs b/compiler/rustc_hir_analysis/src/check/_match.rs
index 201927091a6..143508b785f 100644
--- a/compiler/rustc_hir_analysis/src/check/_match.rs
+++ b/compiler/rustc_hir_analysis/src/check/_match.rs
@@ -259,7 +259,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 err.help("consider adding an `else` block that evaluates to the expected type");
                 error = true;
             },
-            ret_reason.is_none(),
+            false,
         );
         error
     }
diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md
index 64faaf4f19b..38629c4fae7 100644
--- a/src/ci/docker/README.md
+++ b/src/ci/docker/README.md
@@ -242,10 +242,14 @@ For targets: `i586-unknown-linux-gnu`
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 3.2.101
 - Binary utilities > Version of binutils = 2.32
+- Binary utilities > binutils extra config = --enable-compressed-debug-sections=none -- (\*)
 - C-library > glibc version = 2.17.0
 - C compiler > gcc version = 8.3.0
 - C compiler > C++ = ENABLE
 
+(\*) Compressed debug is enabled by default for gas (assembly) on Linux/x86 targets,
+     but that makes our `compiler_builtins` incompatible with binutils < 2.32.
+
 ### `powerpc-linux-gnu.config`
 
 For targets: `powerpc-unknown-linux-gnu`
diff --git a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config
index ef2e9467f4a..cdbd52d23bc 100644
--- a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config
+++ b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config
@@ -336,7 +336,7 @@ CT_BINUTILS_LINKERS_LIST="ld"
 CT_BINUTILS_LINKER_DEFAULT="bfd"
 # CT_BINUTILS_PLUGINS is not set
 CT_BINUTILS_RELRO=m
-CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
+CT_BINUTILS_EXTRA_CONFIG_ARRAY="--enable-compressed-debug-sections=none"
 # CT_BINUTILS_FOR_TARGET is not set
 CT_ALL_BINUTILS_CHOICES="BINUTILS"
 
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 7bd0dbf9325..7999373511b 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -890,7 +890,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
             w,
             "implementors",
             "Implementors",
-            "<div class=\"item-list\" id=\"implementors-list\">",
+            "<div id=\"implementors-list\">",
         );
         for implementor in concrete {
             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:
                 w,
                 "synthetic-implementors",
                 "Auto implementors",
-                "<div class=\"item-list\" id=\"synthetic-implementors-list\">",
+                "<div id=\"synthetic-implementors-list\">",
             );
             for implementor in synthetic {
                 render_implementor(
@@ -923,7 +923,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
             w,
             "implementors",
             "Implementors",
-            "<div class=\"item-list\" id=\"implementors-list\"></div>",
+            "<div id=\"implementors-list\"></div>",
         );
 
         if t.is_auto(cx.tcx()) {
@@ -931,7 +931,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
                 w,
                 "synthetic-implementors",
                 "Auto implementors",
-                "<div class=\"item-list\" id=\"synthetic-implementors-list\"></div>",
+                "<div id=\"synthetic-implementors-list\"></div>",
             );
         }
     }
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 28e968c9ff5..e29abbec69c 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -690,11 +690,6 @@ pre, .rustdoc.source .example-wrap {
 	border: 1px solid var(--border-color);
 }
 
-.content .item-list {
-	list-style-type: none;
-	padding: 0;
-}
-
 /* Shift "where ..." part of method or fn definition down a line */
 .content .method .where,
 .content .fn .where,
@@ -773,8 +768,9 @@ h2.small-section-header > .anchor {
 }
 
 .all-items a:hover,
-.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
-.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
+.docblock a:not(.test-arrow):not(.scrape-help):hover,
+.docblock-short a:not(.test-arrow):not(.scrape-help):hover,
+.item-info a {
 	text-decoration: underline;
 }
 
diff --git a/src/test/rustdoc/impl-disambiguation.rs b/src/test/rustdoc/impl-disambiguation.rs
index bb978dc0f3e..9e74ede8ff7 100644
--- a/src/test/rustdoc/impl-disambiguation.rs
+++ b/src/test/rustdoc/impl-disambiguation.rs
@@ -4,13 +4,13 @@ pub trait Foo {}
 
 pub struct Bar<T> { field: T }
 
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl Foo for Bar<u8>"
 impl Foo for Bar<u8> {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl Foo for Bar<u16>"
 impl Foo for Bar<u16> {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl<'a> Foo for &'a Bar<u8>"
 impl<'a> Foo for &'a Bar<u8> {}
 
@@ -22,9 +22,9 @@ pub mod mod2 {
     pub enum Baz {}
 }
 
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl Foo for foo::mod1::Baz"
 impl Foo for mod1::Baz {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl<'a> Foo for &'a foo::mod2::Baz"
 impl<'a> Foo for &'a mod2::Baz {}
diff --git a/src/test/rustdoc/impl-parts.rs b/src/test/rustdoc/impl-parts.rs
index 0a8c2c8d2a9..7b931727e44 100644
--- a/src/test/rustdoc/impl-parts.rs
+++ b/src/test/rustdoc/impl-parts.rs
@@ -7,6 +7,6 @@ pub struct Foo<T> { field: T }
 
 // @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
 //     "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
-// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header"]' \
+// @has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
 //     "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
 impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}
diff --git a/src/test/ui/async-await/issue-66387-if-without-else.stderr b/src/test/ui/async-await/issue-66387-if-without-else.stderr
index e8e2a48983c..8155fcb56b6 100644
--- a/src/test/ui/async-await/issue-66387-if-without-else.stderr
+++ b/src/test/ui/async-await/issue-66387-if-without-else.stderr
@@ -4,7 +4,7 @@ error[E0317]: `if` may be missing an `else` clause
 LL | /     if true {
 LL | |         return 0;
 LL | |     }
-   | |_____^ expected `()`, found `i32`
+   | |_____^ expected `i32`, found `()`
    |
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/consts/control-flow/issue-50577.stderr b/src/test/ui/consts/control-flow/issue-50577.stderr
index b6e73f889ad..a931c89f47e 100644
--- a/src/test/ui/consts/control-flow/issue-50577.stderr
+++ b/src/test/ui/consts/control-flow/issue-50577.stderr
@@ -2,7 +2,7 @@ error[E0317]: `if` may be missing an `else` clause
   --> $DIR/issue-50577.rs:3:16
    |
 LL |         Drop = assert_eq!(1, 1),
-   |                ^^^^^^^^^^^^^^^^ expected `()`, found `isize`
+   |                ^^^^^^^^^^^^^^^^ expected `isize`, found `()`
    |
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/expr/if/if-without-else-result.rs b/src/test/ui/expr/if/if-without-else-result.rs
index cf84a99e53f..95604758a6b 100644
--- a/src/test/ui/expr/if/if-without-else-result.rs
+++ b/src/test/ui/expr/if/if-without-else-result.rs
@@ -1,6 +1,6 @@
 fn main() {
     let a = if true { true };
     //~^ ERROR `if` may be missing an `else` clause [E0317]
-    //~| expected `()`, found `bool`
+    //~| expected `bool`, found `()`
     println!("{}", a);
 }
diff --git a/src/test/ui/expr/if/if-without-else-result.stderr b/src/test/ui/expr/if/if-without-else-result.stderr
index 821635d3768..317faf7c619 100644
--- a/src/test/ui/expr/if/if-without-else-result.stderr
+++ b/src/test/ui/expr/if/if-without-else-result.stderr
@@ -5,7 +5,7 @@ LL |     let a = if true { true };
    |             ^^^^^^^^^^----^^
    |             |         |
    |             |         found here
-   |             expected `()`, found `bool`
+   |             expected `bool`, found `()`
    |
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/expr/if/issue-4201.rs b/src/test/ui/expr/if/issue-4201.rs
index 1f292229fd6..59c465b9e14 100644
--- a/src/test/ui/expr/if/issue-4201.rs
+++ b/src/test/ui/expr/if/issue-4201.rs
@@ -3,7 +3,7 @@ fn main() {
         0
     } else if false {
 //~^ ERROR `if` may be missing an `else` clause
-//~| expected `()`, found integer
+//~| expected integer, found `()`
         1
     };
 }
diff --git a/src/test/ui/expr/if/issue-4201.stderr b/src/test/ui/expr/if/issue-4201.stderr
index bc638ddf55b..612fe77642c 100644
--- a/src/test/ui/expr/if/issue-4201.stderr
+++ b/src/test/ui/expr/if/issue-4201.stderr
@@ -8,7 +8,7 @@ LL | |
 LL | |         1
    | |         - found here
 LL | |     };
-   | |_____^ expected `()`, found integer
+   | |_____^ expected integer, found `()`
    |
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs
index 1f3b73f96d8..dd0efa972ba 100644
--- a/src/test/ui/issues/issue-19991.rs
+++ b/src/test/ui/issues/issue-19991.rs
@@ -3,7 +3,7 @@
 
 fn main() {
     if let Some(homura) = Some("madoka") { //~  ERROR missing an `else` clause
-                                           //~| expected `()`, found integer
+                                           //~| expected integer, found `()`
         765
     };
 }
diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr
index 6e92be87a02..57b0882b636 100644
--- a/src/test/ui/issues/issue-19991.stderr
+++ b/src/test/ui/issues/issue-19991.stderr
@@ -6,7 +6,7 @@ LL | |
 LL | |         765
    | |         --- found here
 LL | |     };
-   | |_____^ expected `()`, found integer
+   | |_____^ expected integer, found `()`
    |
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/let-else/let-else-non-diverging.rs b/src/test/ui/let-else/let-else-non-diverging.rs
index b5bd91ceb9e..58d2c09776f 100644
--- a/src/test/ui/let-else/let-else-non-diverging.rs
+++ b/src/test/ui/let-else/let-else-non-diverging.rs
@@ -8,4 +8,15 @@ fn main() {
         }
     };
     let Some(x) = Some(1) else { Some(2) }; //~ ERROR does not diverge
+
+    // Ensure that uninhabited types do not "diverge".
+    // This might be relaxed in the future, but when it is,
+    // it should be an explicitly wanted descision.
+    let Some(x) = Some(1) else { foo::<Uninhabited>() }; //~ ERROR does not diverge
+}
+
+enum Uninhabited {}
+
+fn foo<T>() -> T {
+    panic!()
 }
diff --git a/src/test/ui/let-else/let-else-non-diverging.stderr b/src/test/ui/let-else/let-else-non-diverging.stderr
index c999a549525..78551fcc434 100644
--- a/src/test/ui/let-else/let-else-non-diverging.stderr
+++ b/src/test/ui/let-else/let-else-non-diverging.stderr
@@ -39,6 +39,17 @@ LL |     let Some(x) = Some(1) else { Some(2) };
    = help: try adding a diverging expression, such as `return` or `panic!(..)`
    = help: ...or use `match` instead of `let...else`
 
-error: aborting due to 3 previous errors
+error[E0308]: `else` clause of `let...else` does not diverge
+  --> $DIR/let-else-non-diverging.rs:15:32
+   |
+LL |     let Some(x) = Some(1) else { foo::<Uninhabited>() };
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited`
+   |
+   = note: expected type `!`
+              found enum `Uninhabited`
+   = help: try adding a diverging expression, such as `return` or `panic!(..)`
+   = help: ...or use `match` instead of `let...else`
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0308`.