",
);
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",
- "
",
+ "
",
);
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",
- "
",
+ "
",
);
}
}
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 28e968c9ff5f9..e29abbec69c2d 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 bb978dc0f3ec8..9e74ede8ff7b3 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
{ 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"
impl Foo for Bar {}
-// @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"
impl Foo for Bar {}
-// @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"
impl<'a> Foo for &'a Bar {}
@@ -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 0a8c2c8d2a9e6..7b931727e446d 100644
--- a/src/test/rustdoc/impl-parts.rs
+++ b/src/test/rustdoc/impl-parts.rs
@@ -7,6 +7,6 @@ pub struct Foo { field: T }
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !AnAutoTrait for Foowhere 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 !AnAutoTrait for Foowhere T: Sync,"
impl !AnAutoTrait for Foo 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 e8e2a48983c89..8155fcb56b697 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 b6e73f889adab..a931c89f47e72 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 cf84a99e53fa1..95604758a6b3e 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 821635d3768f3..317faf7c619f6 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 1f292229fd6cd..59c465b9e1492 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 bc638ddf55be0..612fe77642ce5 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 1f3b73f96d8b9..dd0efa972ba3e 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 6e92be87a02e9..57b0882b636e3 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 b5bd91ceb9e75..58d2c09776f98 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::() }; //~ ERROR does not diverge
+}
+
+enum Uninhabited {}
+
+fn foo() -> 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 c999a54952560..78551fcc434a8 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::() };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ 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`.