Skip to content

Commit f4ae05b

Browse files
committed
Auto merge of #120660 - matthiaskrgr:rollup-zuqljul, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #119481 (Clarify ambiguity in select_nth_unstable docs) - #119600 (Remove outdated references to librustc_middle) - #120458 (Document `&CStr` to `CString` conversion) - #120569 (coverage: Improve handling of function/closure spans) - #120572 (Update libc to 0.2.153) - #120587 (miri: normalize struct tail in ABI compat check) - #120607 (fix #120603 by adding a check in default_read_buf) - #120636 (Subtree update of `rust-analyzer`) - #120641 (rustdoc: trait.impl, type.impl: sort impls to make it not depend on serialization order) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f9304df + 1dc19d8 commit f4ae05b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// regression test for an ICE: https://github.com/rust-lang/miri/issues/3282
2+
3+
trait Id {
4+
type Assoc: ?Sized;
5+
}
6+
7+
impl<T: ?Sized> Id for T {
8+
type Assoc = T;
9+
}
10+
11+
#[repr(transparent)]
12+
struct Foo<T: ?Sized> {
13+
field: <T as Id>::Assoc,
14+
}
15+
16+
fn main() {
17+
let x = unsafe { std::mem::transmute::<fn(&str), fn(&Foo<str>)>(|_| ()) };
18+
let foo: &Foo<str> = unsafe { &*("uwu" as *const str as *const Foo<str>) };
19+
x(foo);
20+
}

0 commit comments

Comments
 (0)