Skip to content

Bounds on parameters of inherent GATs are not respected #106722

Closed
@fmease

Description

@fmease
Member

This code successfully compiles even though it should not (since String: !Copy).

#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

pub enum Ty {}

impl Ty {
    type Pr<T: Copy> = T;
}

const _: Ty::Pr<String> = String::new();

This strongly relates to #104251 which is only about the bounds on the Self type parameter (as I see it, others might disagree). #105961 does not address the issue around inherent GATs and I don't plan to change that (maybe). I consider this issue blocked on #105961 to avoid future merge conflicts.

@rustbot label T-compiler F-inherent_associated_types F-generic_associated_types requires-nightly S-blocked
@rustbot claim

Activity

added
requires-nightlyThis issue requires a nightly compiler in some way.
S-blockedStatus: Blocked on something else such as an RFC or other implementation work.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Jan 11, 2023
changed the title [-]Bounds on inherent (generic) associated types are not respected[/-] [+]Bounds on parameters of inherent GATs are not respected[/+] on Jan 29, 2023
fmease

fmease commented on Feb 20, 2023

@fmease
Author
removed
S-blockedStatus: Blocked on something else such as an RFC or other implementation work.
on Feb 20, 2023
added a commit that references this issue on May 8, 2023

Rollup merge of rust-lang#109410 - fmease:iat-alias-kind-inherent, r=…

29ac429
added a commit that references this issue on May 20, 2023

Rollup merge of rust-lang#109410 - fmease:iat-alias-kind-inherent, r=…

34655df
added
A-GATsArea: Generic associated types (GATs)
on Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-GATsArea: Generic associated types (GATs)C-bugCategory: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsF-inherent_associated_types`#![feature(inherent_associated_types)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @fmease@rustbot

    Issue actions

      Bounds on parameters of inherent GATs are not respected · Issue #106722 · rust-lang/rust