Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
..base
on static struct initializers.
- Loading branch information
1 parent
4cc3bbb
commit 1493141
Showing
5 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
struct Foo { a: int, b: int } | ||
struct Bar { x: int } | ||
|
||
static bar: Bar = Bar { x: 5 }; | ||
static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types: expected `Foo` but found `Bar` | ||
static foo_i: Foo = Foo { a: 2, ..4 }; //~ ERROR mismatched types: expected `Foo` | ||
|
||
fn main() { | ||
let b = Bar { x: 5 }; | ||
let f = Foo { a: 2, ..b }; //~ ERROR mismatched types: expected `Foo` but found `Bar` | ||
let f_i = Foo { a: 2, ..4 }; //~ ERROR mismatched types: expected `Foo` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1493141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at kevinmehall@1493141
1493141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging kevinmehall/rust/const-struct-base = 1493141 into auto
1493141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kevinmehall/rust/const-struct-base = 1493141 merged ok, testing candidate = 27812ea
1493141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/613
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/616
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt/builds/618
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt-vg/builds/611
success: http://buildbot.rust-lang.org/builders/auto-mac-all-opt/builds/614
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/632
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt/builds/635
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/632
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt/builds/636
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt-vg/builds/641
success: http://buildbot.rust-lang.org/builders/auto-linux-all-opt/builds/634
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/616
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt/builds/631
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/405
1493141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 27812ea