Add E0612
This commit is contained in:
parent
302f99693f
commit
a42f8160ed
5 changed files with 68 additions and 24 deletions
16
src/test/compile-fail/E0612.rs
Normal file
16
src/test/compile-fail/E0612.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 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(u32);
|
||||
|
||||
fn main() {
|
||||
let y = Foo(0);
|
||||
y.1; //~ ERROR E0612
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ fn test(a: A, b: inner::A, c: inner::B, d: xc::A, e: xc::B, z: inner::Z) {
|
|||
e.b; //~ ERROR: field `b` of struct `xc::B` is private
|
||||
|
||||
z.0;
|
||||
z.1; //~ ERROR: field `1` of struct `inner::Z` is private
|
||||
z.1; //~ ERROR: field `1` of tuple-struct `inner::Z` is private
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
|
|||
51 | fake_field_stmt!();
|
||||
| ------------------- in this macro invocation
|
||||
|
||||
error: attempted tuple index `0` on type `{integer}`, but the type was not a tuple or tuple struct
|
||||
error[E0613]: attempted tuple index `0` on type `{integer}`, but the type was not a tuple or tuple struct
|
||||
--> $DIR/macro-backtrace-invalid-internals.rs:27:11
|
||||
|
|
||||
27 | (1).0
|
||||
|
|
@ -43,7 +43,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
|
|||
55 | let _ = fake_field_expr!();
|
||||
| ------------------ in this macro invocation
|
||||
|
||||
error: attempted tuple index `0` on type `{integer}`, but the type was not a tuple or tuple struct
|
||||
error[E0613]: attempted tuple index `0` on type `{integer}`, but the type was not a tuple or tuple struct
|
||||
--> $DIR/macro-backtrace-invalid-internals.rs:45:11
|
||||
|
|
||||
45 | (1).0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue