diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-06-14 16:18:32 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2024-07-23 01:26:26 +0200 |
| commit | a8b3dfd25336dc12f17da23a0ed7004a4ebee234 (patch) | |
| tree | 4bd5f22a3820f0728c2861b6cb47a3d87c8215e6 /compiler/rustc_lint/src | |
| parent | 63a54d93be33bb1c0357c48532df778f6f2a416b (diff) | |
| download | rust-a8b3dfd25336dc12f17da23a0ed7004a4ebee234.tar.gz rust-a8b3dfd25336dc12f17da23a0ed7004a4ebee234.zip | |
Suppress lint type_alias_bounds for ty aliases containing const projections under GCE
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 40b336cd5ea..90555007607 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1437,6 +1437,16 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds { return; } + + // FIXME(generic_const_exprs): Revisit this before stabilization. + // See also `tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs`. + let ty = cx.tcx.type_of(item.owner_id).instantiate_identity(); + if ty.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) + && cx.tcx.features().generic_const_exprs + { + return; + } + // NOTE(inherent_associated_types): While we currently do take some bounds in type // aliases into consideration during IAT *selection*, we don't perform full use+def // site wfchecking for such type aliases. Therefore TAB should still trigger. |
