Skip to content

§11.6: blanket impls (impl[T: Bound] Trait for T) satisfy trait bounds but fail method call resolution ('unknown method') #3048

Closed

Description

@ehartford

Found during the #2987 manual audit of docs/spec/011_traits.md (§11.6, lines 280–283).

Minimal reproduction

trait Printable:
    fn show_it(self: &Self)

impl[T: Display] Printable for T:
    fn show_it(self: &Self):
        print(self)

fn call_bounded[T: Printable](v: &T):
    v.show_it()

fn main:
    call_bounded(&7)
    7.show_it()

Actual

call_bounded(&7) satisfies the T: Printable bound (blanket_trait_syms), then both v.show_it() and 7.show_it() fail with:

error: unknown method 'show_it' for type '&isize'
error: unknown method 'show_it' for type 'isize'

Expected

Per §11.6 ("A blanket impl provides a trait implementation for all types satisfying a bound"), calling a method of Trait on a concrete or generic type whose bound satisfies impl[T: Bound] Trait for T resolves and monomorphizes the blanket impl's method body.

Activity

  1. added
    bug
    spec-gap
    on Nov 5, 2026
  2. added a commit that references this issue on Nov 6, 2026
  3. ehartford commented on Nov 6, 2026

    @ehartford
    ContributorAuthor

    Fixed in #3054 (merged as 12489f1).

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

    bugspec-gap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions