Skip to content

Kind checker doesn't check that struct fields are copyable #3481

Closed
@catamorphism

Description

@catamorphism
Contributor

kind::check_expr just doesn't have a case for structs, so you can write:

B { foo: x }

if x has type ~T and B is a struct with a ~T field foo.

This wasn't showing up before because last-use was enabled and most values involved in initializing a struct are going to be last uses.

I have a fix, testing it.

Activity

brson

brson commented on Sep 13, 2012

@brson
Contributor

Nice. I think I hit this today.

catamorphism

catamorphism commented on Sep 13, 2012

@catamorphism
ContributorAuthor

This was painful to track down. I think it's the root cause of everything breaking when I disabled last-use, but I'm still waiting for the build to finish.

nikomatsakis

nikomatsakis commented on Sep 13, 2012

@nikomatsakis
Contributor

Good catch.

added a commit that references this issue on Oct 13, 2012
c4155f5
removed their assignment
on Jun 16, 2014
added a commit that references this issue on Apr 20, 2024

Auto merge of rust-lang#3481 - RalfJung:rustup, r=RalfJung

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brson@nikomatsakis@catamorphism

        Issue actions

          Kind checker doesn't check that struct fields are copyable · Issue #3481 · rust-lang/rust