Skip to content

Add support for ..base on static struct initializers.#8091

Merged
bors merged 1 commit intorust-lang:masterfrom
kevinmehall:const-struct-base
Jul 29, 2013
Merged

Add support for ..base on static struct initializers.#8091
bors merged 1 commit intorust-lang:masterfrom
kevinmehall:const-struct-base

Conversation

@kevinmehall
Copy link
Contributor

With an expression like

static w : foo = foo { a:5, ..x };

Rust currently gives the error "constant contains unimplemented expression type". This branch implements support for constant structs with ..base.

@alexcrichton
Copy link
Member

For completeness, could you add some negative tests as well to compile-fail? Something like expanding struct X into struct Y or an integer into struct X or something like that.

@kevinmehall
Copy link
Contributor Author

I rebased the commit to add compile-fail tests. There weren't similar tests for non-static struct expressions, so I also included those, though I think they might use the same code path.

bors added a commit that referenced this pull request Jul 29, 2013
With an expression like

    static w : foo = foo { a:5, ..x };

Rust currently gives the error "constant contains unimplemented expression type". This branch implements support for constant structs with `..base`.
@bors bors closed this Jul 29, 2013
@bors bors merged commit 1493141 into rust-lang:master Jul 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants