Skip to content

Commit a040b41

Browse files
committed
more fixed issues
1 parent e0c98e2 commit a040b41

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,13 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
17691769
the type was too big.</p>"
17701770
);
17711771
}
1772+
Err(LayoutError::NormalizationFailure(_, _)) => {
1773+
writeln!(
1774+
w,
1775+
"<p><strong>Note:</strong> Encountered an error during type layout; \
1776+
the type was not normalizable.</p>"
1777+
)
1778+
}
17721779
}
17731780

17741781
writeln!(w, "</div>");
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(rustc_attrs)]
2+
3+
use std::borrow::Cow;
4+
5+
#[rustc_layout(debug)]
6+
type Edges<'a, E> = Cow<'a, [E]>;
7+
//~^ ERROR layout error: NormalizationFailure
8+
9+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: layout error: NormalizationFailure(<[E] as std::borrow::ToOwned>::Owned, Type(<[E] as std::borrow::ToOwned>::Owned))
2+
--> $DIR/issue-85103.rs:6:1
3+
|
4+
LL | type Edges<'a, E> = Cow<'a, [E]>;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// check-pass
2+
3+
#![feature(extern_types)]
4+
#![allow(dead_code)]
5+
6+
extern {
7+
type Extern;
8+
}
9+
10+
trait Trait {
11+
type Type;
12+
}
13+
14+
#[inline]
15+
fn f<'a>(_: <&'a Extern as Trait>::Type) where &'a Extern: Trait {}
16+
17+
fn main() {}

0 commit comments

Comments
 (0)