diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-03-28 15:14:35 +0100 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2025-03-28 18:15:23 +0100 |
| commit | 7a295d1be07d191527dfcdf4613ced7ab6fa9676 (patch) | |
| tree | a2dbb2fd926ea79c23c43a9ce4954b18da6d73c4 /tests/ui/impl-trait/inside-item-nested-in-anon-const.rs | |
| parent | 90f5eab952728ac6edcf529a171f7de5c25e5d49 (diff) | |
| download | rust-7a295d1be07d191527dfcdf4613ced7ab6fa9676.tar.gz rust-7a295d1be07d191527dfcdf4613ced7ab6fa9676.zip | |
Fix TAIT & ATPIT feature gating in the presence of anon consts
Diffstat (limited to 'tests/ui/impl-trait/inside-item-nested-in-anon-const.rs')
| -rw-r--r-- | tests/ui/impl-trait/inside-item-nested-in-anon-const.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/inside-item-nested-in-anon-const.rs b/tests/ui/impl-trait/inside-item-nested-in-anon-const.rs new file mode 100644 index 00000000000..ab54d5f87ba --- /dev/null +++ b/tests/ui/impl-trait/inside-item-nested-in-anon-const.rs @@ -0,0 +1,25 @@ +// Ensure we don't misclassify `impl Trait` as TAIT/ATPIT if located inside an anon const in a +// type alias/assoc type. +// issue: <https://github.com/rust-lang/rust/issues/139055> +//@ check-pass +#![forbid(unstable_features)] + +struct Girder<const N: usize>; + +type Alias = Girder<{ + fn pass(input: impl Sized) -> impl Sized { input } + 0 +}>; + +trait Trait { + type Assoc; +} + +impl Trait for () { + type Assoc = [(); { + fn pass(input: impl Sized) -> impl Sized { input } + 0 + }]; +} + +fn main() {} |
