more fixed issues

This commit is contained in:
b-naber 2021-11-26 23:37:24 +01:00
parent e0c98e2a33
commit a040b4189d
4 changed files with 41 additions and 0 deletions

View file

@ -1769,6 +1769,13 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
the type was too big.</p>"
);
}
Err(LayoutError::NormalizationFailure(_, _)) => {
writeln!(
w,
"<p><strong>Note:</strong> Encountered an error during type layout; \
the type was not normalizable.</p>"
)
}
}
writeln!(w, "</div>");

View file

@ -0,0 +1,9 @@
#![feature(rustc_attrs)]
use std::borrow::Cow;
#[rustc_layout(debug)]
type Edges<'a, E> = Cow<'a, [E]>;
//~^ ERROR layout error: NormalizationFailure
fn main() {}

View file

@ -0,0 +1,8 @@
error: layout error: NormalizationFailure(<[E] as std::borrow::ToOwned>::Owned, Type(<[E] as std::borrow::ToOwned>::Owned))
--> $DIR/issue-85103.rs:6:1
|
LL | type Edges<'a, E> = Cow<'a, [E]>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -0,0 +1,17 @@
// check-pass
#![feature(extern_types)]
#![allow(dead_code)]
extern {
type Extern;
}
trait Trait {
type Type;
}
#[inline]
fn f<'a>(_: <&'a Extern as Trait>::Type) where &'a Extern: Trait {}
fn main() {}