forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#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 rust-lang#115403 fixes rust-lang#115410 This was accidentally regressed in rust-lang#114134, because it was accidentally stabilized in rust-lang#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.
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |