-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
name struct in "field
...
is private" error
- Loading branch information
Showing
10 changed files
with
135 additions
and
38 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
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. | ||
|
||
#![feature(struct_variant)] | ||
|
||
pub enum Foo { | ||
Bar { | ||
baz: int | ||
} | ||
} |
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,48 @@ | ||
// 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. | ||
|
||
// aux-build:privacy-struct-variant.rs | ||
|
||
#![feature(struct_variant)] | ||
|
||
extern crate other = "privacy-struct-variant"; | ||
|
||
mod a { | ||
pub enum Foo { | ||
Bar { | ||
baz: int | ||
} | ||
} | ||
|
||
fn test() { | ||
let foo = Bar { baz: 42 }; | ||
|
||
let Bar { baz: _ } = foo; | ||
match foo { Bar { baz: _ } => {} } | ||
} | ||
} | ||
|
||
fn main() { | ||
let foo = a::Bar { baz: 42 }; | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `a::Foo` is private | ||
|
||
let a::Bar { baz: _ } = foo; | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `a::Foo` is private | ||
match foo { a::Bar { baz: _ } => {} } | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `a::Foo` is private | ||
// | ||
let foo = other::Bar { baz: 42 }; | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `privacy-struct-variant::Foo` is private | ||
|
||
let other::Bar { baz: _ } = foo; | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `privacy-struct-variant::Foo` is private | ||
match foo { other::Bar { baz: _ } => {} } | ||
//~^ ERROR: field `baz` of variant `Bar` of enum `privacy-struct-variant::Foo` is private | ||
} |
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
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
d4b73a7
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 ben0x539@d4b73a7
d4b73a7
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 ben0x539/rust/priv-field-in = d4b73a7 into auto
d4b73a7
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.
ben0x539/rust/priv-field-in = d4b73a7 merged ok, testing candidate = 31e8f24
d4b73a7
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/5096
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5096
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4188
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4202
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5196
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4283
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4291
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5198
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/4283
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4288
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/4354
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2083
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5195
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4292
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4303
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/4959
d4b73a7
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 = 31e8f24