Skip to content

Commit 2228c86

Browse files
authored
Rollup merge of rust-lang#107857 - GuillaumeGomez:ui-test-impl-projections, r=oli-obk
Add ui test for implementation on projection The error in full can be seen in rust-lang#107263 and is part of why the PR is blocked (it still requires the approval from the team for supporting it). r? ``@oli-obk``
2 parents 2745401 + a03da2b commit 2228c86

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This test ensures that if implementation on projections is supported,
2+
// it doesn't end in very weird cycle error.
3+
4+
#![crate_type = "lib"]
5+
6+
pub trait Identity {
7+
type Identity: ?Sized;
8+
}
9+
10+
impl<T: ?Sized> Identity for T {
11+
type Identity = Self;
12+
}
13+
14+
pub struct I8<const F: i8>;
15+
16+
impl <I8<{i8::MIN}> as Identity>::Identity {
17+
//~^ ERROR no nominal type found for inherent implementation
18+
pub fn foo(&self) {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0118]: no nominal type found for inherent implementation
2+
--> $DIR/wrong-normalization.rs:16:6
3+
|
4+
LL | impl <I8<{i8::MIN}> as Identity>::Identity {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
6+
|
7+
= note: either implement a trait on it or create a newtype to wrap it instead
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0118`.

0 commit comments

Comments
 (0)