diff options
| author | bors <bors@rust-lang.org> | 2023-09-07 19:10:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-07 19:10:07 +0000 |
| commit | 1e746d7741d44551e9378daf13b8797322aa0b74 (patch) | |
| tree | 147bdfd98e0e16f4e0481ee570503a2e3261e63f /tests/ui/consts | |
| parent | 70c7e4d21c7249af4222a10d09dc03286aa1e787 (diff) | |
| parent | 320bb8116f136f4748787cf92178da9e7e5b2d91 (diff) | |
| download | rust-1e746d7741d44551e9378daf13b8797322aa0b74.tar.gz rust-1e746d7741d44551e9378daf13b8797322aa0b74.zip | |
Auto merge of #115527 - oli-obk:drop_maybe_uninit_in_const, r=lcnr
Don't require `Drop` for `[PhantomData<T>; N]` where `N` and `T` are generic, if `T` requires `Drop` fixes https://github.com/rust-lang/rust/issues/115403 fixes https://github.com/rust-lang/rust/issues/115410 This was accidentally regressed in https://github.com/rust-lang/rust/pull/114134, because it was accidentally stabilized in #102204 (cc `@rust-lang/lang,` seems like an innocent stabilization, considering this PR is more of a bugfix than a feature). While we have a whole month to beta backport this change before the regression hits stable, I'd still prefer not to go through an FCP on this PR (which fixes a regression), if T-lang wants an FCP, I can can open an issue about the change itself.
Diffstat (limited to 'tests/ui/consts')
| -rw-r--r-- | tests/ui/consts/drop-maybe_uninit.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/consts/drop-maybe_uninit.rs b/tests/ui/consts/drop-maybe_uninit.rs new file mode 100644 index 00000000000..2fdeae5f185 --- /dev/null +++ b/tests/ui/consts/drop-maybe_uninit.rs @@ -0,0 +1,17 @@ +// build-pass + +pub const fn f<T, const N: usize>(_: [std::mem::MaybeUninit<T>; N]) {} + +pub struct Blubb<T>(*const T); + +pub const fn g<T, const N: usize>(_: [Blubb<T>; N]) {} + +pub struct Blorb<const N: usize>([String; N]); + +pub const fn h(_: Blorb<0>) {} + +pub struct Wrap(Blorb<0>); + +pub const fn i(_: Wrap) {} + +fn main() {} |
