Skip to content

iface types do not check that the instance is copyable #2222

Closed

Description

@nikomatsakis

This test passes:

iface foo {}

fn to_foo<F:foo>(f: F) -> foo {
    f as foo
}

fn main() {
}

but it seems to me it ought to fail, because f as foo copies f into a box, and we do not know that the type F is copyable.

Activity

  1. ghost assigned on Apr 16, 2012
  2. added a commit that references this issue on Sep 22, 2022
  3. added a commit that references this issue on Aug 21, 2026
  4. added a commit that references this issue on Sep 13, 2026
  5. added a commit that references this issue on Sep 23, 2026
  6. added a commit that references this issue on Oct 2, 2026
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-type-system

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions