Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 4 pull requests #106558

Merged
merged 8 commits into from
Jan 7, 2023
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0588.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct Aligned(i32);
struct Packed(Aligned);
```

Just like you cannot have both `align` and `packed` representation hints on a
Just like you cannot have both `align` and `packed` representation hints on the
same type, a `packed` type cannot contain another type with the `align`
representation hint. However, you can do the opposite:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,15 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
let span = self.path_segment.ident.span;

// insert a suggestion of the form "Y<'a, 'b>"
let ident = self.path_segment.ident.name.to_ident_string();
let sugg = format!("{}<{}>", ident, suggested_args);
let sugg = format!("<{}>", suggested_args);
debug!("sugg: {:?}", sugg);

err.span_suggestion_verbose(span, &msg, sugg, Applicability::HasPlaceholders);
err.span_suggestion_verbose(
span.shrink_to_hi(),
&msg,
sugg,
Applicability::HasPlaceholders,
);
}

AngleBrackets::Available => {
Expand Down Expand Up @@ -643,11 +647,15 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
let span = self.path_segment.ident.span;

// insert a suggestion of the form "Y<T, U>"
let ident = self.path_segment.ident.name.to_ident_string();
let sugg = format!("{}<{}>", ident, suggested_args);
let sugg = format!("<{}>", suggested_args);
debug!("sugg: {:?}", sugg);

err.span_suggestion_verbose(span, &msg, sugg, Applicability::HasPlaceholders);
err.span_suggestion_verbose(
span.shrink_to_hi(),
&msg,
sugg,
Applicability::HasPlaceholders,
);
}
AngleBrackets::Available => {
let gen_args_span = self.gen_args.span().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
}

ty::PredicateKind::WellFormed(ty) => {
if self.tcx.sess.opts.unstable_opts.trait_solver != TraitSolver::Chalk {
if self.tcx.sess.opts.unstable_opts.trait_solver == TraitSolver::Classic {
// WF predicates cannot themselves make
// errors. They can only block due to
// ambiguity; otherwise, they always
Expand All @@ -1180,7 +1180,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
// which bounds actually failed to hold.
self.tcx.sess.struct_span_err(
span,
&format!("the type `{}` is not well-formed (chalk)", ty),
&format!("the type `{}` is not well-formed", ty),
)
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1598,14 +1598,10 @@ in storage.js

.sidebar.shown,
.source-sidebar-expanded .source .sidebar,
.sidebar:focus-within {
.rustdoc:not(.source) .sidebar:focus-within {
left: 0;
}

.rustdoc.source > .sidebar {
width: 0;
}

.mobile-topbar h2 {
padding-bottom: 0;
margin: auto 0.5em auto auto;
Expand Down
6 changes: 3 additions & 3 deletions src/test/rustdoc-gui/sidebar-source-code-display.goml
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ assert-css: (

// We now check that the scroll position is kept when opening the sidebar.
click: "#src-sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
wait-for-css: (".sidebar", {"left": "-1000px"})
// We scroll to line 117 to change the scroll position.
scroll-to: '//*[@id="117"]'
assert-window-property: {"pageYOffset": "2542"}
// Expanding the sidebar...
click: "#src-sidebar-toggle"
wait-for-css: (".sidebar", {"width": "500px"})
wait-for-css: (".sidebar", {"left": "0px"})
click: "#src-sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
wait-for-css: (".sidebar", {"left": "-1000px"})
// The "scrollTop" property should be the same.
assert-window-property: {"pageYOffset": "2542"}

Expand Down
6 changes: 3 additions & 3 deletions src/test/rustdoc-gui/sidebar-source-code.goml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@op

// We now switch to mobile mode.
size: (600, 600)
wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})
wait-for-css: (".source-sidebar-expanded nav.sidebar", {"left": "0px"})
// We collapse the sidebar.
click: (10, 10)
// We check that the sidebar has the expected width (0).
assert-css: ("nav.sidebar", {"width": "0px"})
// We check that the sidebar has been moved off-screen.
assert-css: ("nav.sidebar", {"left": "-1000px"})
// We ensure that the class has been removed.
assert-false: ".source-sidebar-expanded"
assert: "nav.sidebar"
Expand Down
44 changes: 22 additions & 22 deletions src/test/rustdoc-ui/issue-105742.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | <Self as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:13:21
Expand All @@ -28,7 +28,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | <Self as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:18:37
Expand All @@ -44,7 +44,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Index<<Self as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:18:37
Expand All @@ -60,7 +60,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Index<<Self as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:30
Expand All @@ -76,7 +76,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:30
Expand All @@ -92,7 +92,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:46
Expand All @@ -108,7 +108,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:46
Expand All @@ -124,7 +124,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:5:40
Expand All @@ -140,7 +140,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<'_> = T, Output = T>) {
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:5:40
Expand All @@ -156,7 +156,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<T> = T, Output = T>) {
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:13:21
Expand All @@ -172,7 +172,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | <Self as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:13:21
Expand All @@ -188,7 +188,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | <Self as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:18:37
Expand All @@ -204,7 +204,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Index<<Self as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:18:37
Expand All @@ -220,7 +220,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Index<<Self as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:30
Expand All @@ -236,7 +236,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:30
Expand All @@ -252,7 +252,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:46
Expand All @@ -268,7 +268,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:23:46
Expand All @@ -284,7 +284,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
| ~~~~~~~
| +++

error[E0038]: the trait `SVec` cannot be made into an object
--> $DIR/issue-105742.rs:5:31
Expand Down Expand Up @@ -329,7 +329,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | fn len(&self) -> <Self as SVec>::Item<'_>;
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:35:38
Expand All @@ -345,7 +345,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | fn len(&self) -> <Self as SVec>::Item<T>;
| ~~~~~~~
| +++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:35:38
Expand All @@ -361,7 +361,7 @@ LL | type Item<'a, T>;
help: add missing lifetime argument
|
LL | fn len(&self) -> <Self as SVec>::Item<'_>;
| ~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `SVec::Item`
--> $DIR/issue-105742.rs:35:38
Expand All @@ -377,7 +377,7 @@ LL | type Item<'a, T>;
help: add missing generic argument
|
LL | fn len(&self) -> <Self as SVec>::Item<T>;
| ~~~~~~~
| +++

error: aborting due to 23 previous errors

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/chalkify/recursive_where_clause_on_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ fn foo<T: Foo>() {
fn main() {
// For some reason, the error is duplicated...

foo::<S>() //~ ERROR the type `S` is not well-formed (chalk)
//~^ ERROR the type `S` is not well-formed (chalk)
foo::<S>() //~ ERROR the type `S` is not well-formed
//~^ ERROR the type `S` is not well-formed
}
4 changes: 2 additions & 2 deletions src/test/ui/chalkify/recursive_where_clause_on_type.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: the type `S` is not well-formed (chalk)
error: the type `S` is not well-formed
--> $DIR/recursive_where_clause_on_type.rs:28:11
|
LL | foo::<S>()
| ^

error: the type `S` is not well-formed (chalk)
error: the type `S` is not well-formed
--> $DIR/recursive_where_clause_on_type.rs:28:5
|
LL | foo::<S>()
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-103790.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LL | struct S<const S: (), const S: S = { S }>;
help: add missing generic argument
|
LL | struct S<const S: (), const S: S<S> = { S }>;
| ~~~~
| +++

error[E0391]: cycle detected when computing type of `S::S`
--> $DIR/issue-103790.rs:4:32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | type Assoc<'a> where Self: 'a;
help: add missing lifetime argument
|
LL | fn g(&self) -> Self::Assoc<'_>;
| ~~~~~~~~~
| ++++

error[E0107]: missing generics for associated type `Trait::Assoc`
--> $DIR/elided-in-expr-position.rs:31:26
Expand All @@ -28,7 +28,7 @@ LL | type Assoc<'a> where Self: 'a;
help: add missing lifetime argument
|
LL | fn g(&self) -> Self::Assoc<'_> {
| ~~~~~~~~~
| ++++

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | type Y<'a>;
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
| ~~~~~
| ++++

error[E0107]: missing generics for associated type `X::Y`
--> $DIR/gat-trait-path-missing-lifetime.rs:8:20
Expand All @@ -28,7 +28,7 @@ LL | type Y<'a>;
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
| ~~~~~
| ++++

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/issue-71176.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | type A<'a>;
help: add missing lifetime argument
|
LL | inner: Box<dyn Provider<A<'a> = B>>,
| ~~~~~
| ++++

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | type SubType<'a>: SubTrait where Self: 'a;
help: add missing lifetime argument
|
LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0));
| ~~~~~~~~~~~
| ++++

error[E0038]: the trait `SuperTrait` cannot be made into an object
--> $DIR/issue-76535.rs:39:14
Expand Down
Loading