Auto merge of #42585 - GuillaumeGomez:E0609, r=Susurrus

Add E0609

Part of #42229.

cc @Susurrus
This commit is contained in:
bors 2017-06-11 23:51:04 +00:00
commit 29ef41215c
13 changed files with 154 additions and 32 deletions

View file

@ -0,0 +1,18 @@
// 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 {
x: u32,
}
fn main() {
let x = Foo { x: 0 };
let _ = x.foo; //~ ERROR E0609
}

View file

@ -0,0 +1,14 @@
// 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.
fn main() {
let x = 0;
let _ = x.foo; //~ ERROR E0610
}

View file

@ -11,6 +11,6 @@
// Check that bogus field access is non-fatal
fn main() {
let x = 0;
let _ = x.foo; //~ no field `foo` on type `{integer}`
let _ = x.bar; //~ no field `bar` on type `{integer}`
let _ = x.foo; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
let _ = x.bar; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
}

View file

@ -9,7 +9,7 @@
// except according to those terms.
fn main() {
1.create_a_type_error[ //~ no field `create_a_type_error` on type `{integer}`
1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields
()+() //~ ERROR binary operation `+` cannot be applied
// ^ ensure that we typeck the inner expression ^
];

View file

@ -17,5 +17,5 @@ fn main() {
let y = 42;
let x = y.; //~ ERROR unexpected token
let x = y.(); //~ ERROR unexpected token
let x = y.foo; //~ ERROR no field
let x = y.foo; //~ ERROR `{integer}` is a primitive type and therefore doesn't have fields [E061
}

View file

@ -1,4 +1,4 @@
error: no field `baz` on type `Foo`
error[E0609]: no field `baz` on type `Foo`
--> $DIR/issue-36798.rs:17:7
|
17 | f.baz;

View file

@ -1,4 +1,4 @@
error: no field `zz` on type `Foo`
error[E0609]: no field `zz` on type `Foo`
--> $DIR/issue-36798_unknown_field.rs:17:7
|
17 | f.zz;

View file

@ -7,7 +7,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
50 | fake_method_stmt!();
| -------------------- in this macro invocation
error: no field `fake` on type `{integer}`
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:21:13
|
21 | 1.fake
@ -34,7 +34,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
54 | let _ = fake_method_expr!();
| ------------------- in this macro invocation
error: no field `fake` on type `{integer}`
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:39:13
|
39 | 1.fake

View file

@ -14,7 +14,7 @@ error: casting `*const U` as `*const str` is invalid
|
= note: vtable kinds may not match
error: no field `f` on type `fn() {main}`
error[E0609]: no field `f` on type `fn() {main}`
--> $DIR/cast-rfc0401.rs:75:18
|
75 | let _ = main.f as *const u32;