rust/compiler
Matthias Krüger 705435fe01
Rollup merge of #109619 - compiler-errors:new-solver-still-further-specializable, r=BoxyUwU
Still-further-specializable projections are ambiguous in new solver

Fixes https://github.com/rust-lang/rust/pull/108896/files#r1148450781

r? ``@BoxyUwU`` (though feel free to re-roll)

---

This can be used to create an unsound transmute function with the new solver:

```rust
#![feature(specialization)]

trait Default {
   type Id;

   fn intu(&self) -> &Self::Id;
}

impl<T> Default for T {
   default type Id = T;

   fn intu(&self) -> &Self::Id {
        self
   }
}

fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
    *t.intu()
}

use std::num::NonZeroU8;
fn main() {
    let s = transmute::<u8, Option<NonZeroU8>>(0);
    assert_eq!(s, None);
}
```
2023-03-26 08:39:27 +02:00
..
2023-03-24 18:53:36 +00:00
2023-03-23 19:52:27 +00:00
2023-03-21 22:20:09 +01:00
2023-03-23 16:33:54 +08:00
2023-03-26 00:03:14 +00:00
2023-03-23 19:52:27 +00:00
2023-03-21 15:38:52 +00:00