about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-26 08:39:27 +0200
committerGitHub <noreply@github.com>2023-03-26 08:39:27 +0200
commit705435fe0115e6a56112cbf4cbe8cb51bf061a18 (patch)
tree17f77772aba579e32335109fcd4dc5eb75c4a3bd /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent236178698ab28fa9d9e9d979f42837ef468016e7 (diff)
parent3310f72db9205d23f7900d85055c5cd0eec17814 (diff)
downloadrust-705435fe0115e6a56112cbf4cbe8cb51bf061a18.tar.gz
rust-705435fe0115e6a56112cbf4cbe8cb51bf061a18.zip
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);
}
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions