diff options
| author | bors <bors@rust-lang.org> | 2022-06-16 23:50:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-16 23:50:20 +0000 |
| commit | 349bda2051e94b7aefb33d6541f48f561bf06dbc (patch) | |
| tree | 53b5320c033a44c0e0ed2f23b2ad5b194f083d2c /compiler/rustc_codegen_gcc | |
| parent | cacc75c82ebe15cf63d31034fcf7f1016cddf0e2 (diff) | |
| parent | 6ac93185f4daacacb537d5b61e900eb9d58edcd1 (diff) | |
| download | rust-349bda2051e94b7aefb33d6541f48f561bf06dbc.tar.gz rust-349bda2051e94b7aefb33d6541f48f561bf06dbc.zip | |
Auto merge of #98181 - JohnTitor:rollup-65ztwnz, r=JohnTitor
Rollup of 5 pull requests Successful merges: - #97377 (Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros) - #97675 (Make `std::mem::needs_drop` accept `?Sized`) - #98118 (Test NLL fix of bad lifetime inference for reference captured in closure.) - #98166 (Add rustdoc-json regression test for #98009) - #98169 (Keyword docs: Link to wikipedia article for dynamic dispatch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/example/mini_core.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_gcc/example/mini_core.rs b/compiler/rustc_codegen_gcc/example/mini_core.rs index a8435287d9f..ddcbb0d9fc7 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core.rs @@ -514,7 +514,7 @@ pub mod intrinsics { pub fn copy<T>(src: *const T, dst: *mut T, count: usize); pub fn transmute<T, U>(e: T) -> U; pub fn ctlz_nonzero<T>(x: T) -> T; - pub fn needs_drop<T>() -> bool; + pub fn needs_drop<T: ?::Sized>() -> bool; pub fn bitreverse<T>(x: T) -> T; pub fn bswap<T>(x: T) -> T; pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize); diff --git a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs index 69d591565ac..14fd9eeffa6 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs @@ -47,6 +47,11 @@ struct NoisyDrop { inner: NoisyDropInner, } +struct NoisyDropUnsized { + inner: NoisyDropInner, + text: str, +} + struct NoisyDropInner; impl Drop for NoisyDrop { @@ -184,7 +189,9 @@ fn main() { assert_eq!(intrinsics::min_align_of_val(&a) as u8, intrinsics::min_align_of::<&str>() as u8); assert!(!intrinsics::needs_drop::<u8>()); + assert!(!intrinsics::needs_drop::<[u8]>()); assert!(intrinsics::needs_drop::<NoisyDrop>()); + assert!(intrinsics::needs_drop::<NoisyDropUnsized>()); Unique { pointer: 0 as *const &str, |
