Skip to content

specialization: default items completely drop candidates instead of ambiguity #105782

Description

@lcnr

which is unsound during coherence, as coherence requires completeness

#![feature(specialization)]

trait Default {
   type Id;
}

impl<T> Default for T {
   default type Id = T;
}

trait Overlap {
   type Assoc;
}

impl Overlap for u32 {
   type Assoc = usize;
}

impl Overlap for <u32 as Default>::Id {
   type Assoc = Box<usize>;
}

let eligible = match &impl_source {

Activity

  1. added
    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
    C-bugCategory: This is a bug.
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    on Dec 16, 2022
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    on Apr 5, 2023
  3. added a commit that references this issue on Apr 27, 2023
  4. added
    S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
    on Apr 27, 2023
  5. added a commit that references this issue on Apr 27, 2023
  6. lcnr commented on Mar 5, 2024

    @lcnr
    ContributorAuthor

    when closing this issue, also add the test from #74299

  7. added
    fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.
    on Mar 5, 2024
  8. added a commit that references this issue on Apr 23, 2024
    62bea82
  9. added a commit that references this issue on May 2, 2024
    26ba153
  10. added 3 commits that reference this issue on Aug 15, 2024
    3f9e86e
    a2cff3b
    cf34612
  11. added a commit that references this issue on Sep 6, 2024
    17b322f
  12. added a commit that references this issue on Sep 21, 2024
    454f2fe
  13. added 3 commits that reference this issue on Oct 3, 2024
    d017df7
    86a8d60
    a0c2aba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coherenceArea: CoherenceA-specializationArea: Trait impl specializationA-trait-systemArea: Trait systemC-bugCategory: This is a bug.F-specialization`#![feature(specialization)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions