Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of struct variants in a couple of places
- Loading branch information
Jakub Wieczorek
committed
Oct 5, 2014
1 parent
c586490
commit b9896cb
Showing
7 changed files
with
86 additions
and
14 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
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,19 @@ | ||
// Copyright 2014 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. | ||
|
||
enum Foo { | ||
Bar(int) | ||
} | ||
|
||
fn main() { | ||
match Bar(1i) { | ||
Foo { i } => () //~ ERROR `Foo` does not name a variant | ||
} | ||
} |
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,17 @@ | ||
// Copyright 2014 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. | ||
|
||
enum SomeEnum { | ||
E | ||
} | ||
|
||
fn main() { | ||
E { name: "foobar" }; //~ ERROR `E` does not name a structure | ||
} |
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,21 @@ | ||
// Copyright 2014 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. | ||
|
||
enum MyOption<T> { | ||
MySome(T), | ||
MyNone, | ||
} | ||
|
||
fn main() { | ||
match MySome(42i) { | ||
MySome { x: 42i } => (), //~ ERROR `MySome` does not name a struct variant | ||
_ => (), | ||
} | ||
} |
b9896cb
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 https://github.com/jakub-/rust/commit/b9896cbf6efa6736730f4666957b94b7e29d7fdf
b9896cb
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 jakub-/rust/issue-17405 = b9896cb into auto
b9896cb
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.
jakub-/rust/issue-17405 = b9896cb merged ok, testing candidate = 26d9a6f4
b9896cb
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.
some tests failed:
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1675
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1669
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1675
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1672
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1671
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1671
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1669
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1668
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1671
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1328
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/1325
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/1329
exception: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/162
b9896cb
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 https://github.com/jakub-/rust/commit/b9896cbf6efa6736730f4666957b94b7e29d7fdf
b9896cb
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 jakub-/rust/issue-17405 = b9896cb into auto
b9896cb
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.
jakub-/rust/issue-17405 = b9896cb merged ok, testing candidate = f50b56c
b9896cb
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/1679
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1676
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1670
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1676
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1673
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1672
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1672
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1676
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1670
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1669
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1672
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1329
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/1326
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/1330
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/163
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/162
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-c/builds/161
b9896cb
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 = f50b56c