Skip to content

Commit

Permalink
Auto merge of #120660 - matthiaskrgr:rollup-zuqljul, r=matthiaskrgr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Feb 5, 2024
2 parents f9304df + 1dc19d8 commit f4ae05b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/pass/issues/issue-miri-3282-struct-tail-normalize.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// regression test for an ICE: https://github.com/rust-lang/miri/issues/3282

trait Id {
type Assoc: ?Sized;
}

impl<T: ?Sized> Id for T {
type Assoc = T;
}

#[repr(transparent)]
struct Foo<T: ?Sized> {
field: <T as Id>::Assoc,
}

fn main() {
let x = unsafe { std::mem::transmute::<fn(&str), fn(&Foo<str>)>(|_| ()) };
let foo: &Foo<str> = unsafe { &*("uwu" as *const str as *const Foo<str>) };
x(foo);
}

0 comments on commit f4ae05b

Please sign in to comment.