diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-11-09 06:01:10 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-11-16 17:00:23 +0000 |
| commit | 4f7dddd4a177c761f8576e6c1fedfd73db8bfe7d (patch) | |
| tree | c52a7af2bb1d05223a6debec8e90393ff5622436 | |
| parent | 8bd8f3b090507f87c6458ed507ee36ddd4a00767 (diff) | |
| download | rust-4f7dddd4a177c761f8576e6c1fedfd73db8bfe7d.tar.gz rust-4f7dddd4a177c761f8576e6c1fedfd73db8bfe7d.zip | |
recover primary span label
51 files changed, 131 insertions, 107 deletions
diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 264b96af6da..c5a312a6605 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -2418,9 +2418,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { field_ident: Ident, base: &'tcx hir::Expr<'tcx>, ty: Ty<'tcx>, - ) { + ) -> bool { let Some(output_ty) = self.get_impl_future_output_ty(ty) else { - return; + return false; }; let mut add_label = true; if let ty::Adt(def, _) = output_ty.kind() { @@ -2449,6 +2449,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if add_label { err.span_label(field_ident.span, format!("field not found in `{ty}`")); } + true } fn ban_nonexisting_field( @@ -2464,20 +2465,27 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ); let mut err = self.no_such_field_err(ident, base_ty, base.hir_id); - match *base_ty.peel_refs().kind() { + let has_label = match *base_ty.peel_refs().kind() { ty::Array(_, len) => { self.maybe_suggest_array_indexing(&mut err, expr, base, ident, len); + false } ty::RawPtr(..) => { self.suggest_first_deref_field(&mut err, expr, base, ident); + false } ty::Param(param_ty) => { self.point_at_param_definition(&mut err, param_ty); + false } ty::Alias(ty::Opaque, _) => { - self.suggest_await_on_field_access(&mut err, ident, base, base_ty.peel_refs()); + self.suggest_await_on_field_access(&mut err, ident, base, base_ty.peel_refs()) } - _ => {} + _ => false, + }; + + if !has_label { + err.span_label(ident.span, "unknown field"); } self.suggest_fn_call(&mut err, base, base_ty, |output_ty| { diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs index 051e6afd7a7..4a3195174df 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs +++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs @@ -10,6 +10,7 @@ fn await_on_struct_missing() { let x = S; x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP set `edition = "2021"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide @@ -22,6 +23,7 @@ fn await_on_struct_similar() { let x = S { awai: 42 }; x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| HELP a field with a similar name exists //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP set `edition = "2021"` in `Cargo.toml` @@ -31,6 +33,7 @@ fn await_on_struct_similar() { fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP set `edition = "2021"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide @@ -39,6 +42,7 @@ fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { fn await_on_apit(x: impl Future<Output = ()>) { x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP set `edition = "2021"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr index ebd117f506c..dd863ca541c 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr @@ -2,17 +2,17 @@ error[E0609]: no field `await` on type `await_on_struct_missing::S` --> $DIR/suggest-switching-edition-on-await-cargo.rs:11:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: set `edition = "2021"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `await_on_struct_similar::S` - --> $DIR/suggest-switching-edition-on-await-cargo.rs:23:7 + --> $DIR/suggest-switching-edition-on-await-cargo.rs:24:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: set `edition = "2021"` in `Cargo.toml` @@ -23,20 +23,20 @@ LL | x.awai; | ~~~~ error[E0609]: no field `await` on type `Pin<&mut dyn Future<Output = ()>>` - --> $DIR/suggest-switching-edition-on-await-cargo.rs:32:7 + --> $DIR/suggest-switching-edition-on-await-cargo.rs:34:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: set `edition = "2021"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `impl Future<Output = ()>` - --> $DIR/suggest-switching-edition-on-await-cargo.rs:40:7 + --> $DIR/suggest-switching-edition-on-await-cargo.rs:43:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: set `edition = "2021"` in `Cargo.toml` diff --git a/tests/ui/async-await/suggest-switching-edition-on-await.rs b/tests/ui/async-await/suggest-switching-edition-on-await.rs index 4b62713d1b2..10e245796ee 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await.rs +++ b/tests/ui/async-await/suggest-switching-edition-on-await.rs @@ -8,6 +8,7 @@ fn await_on_struct_missing() { let x = S; x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP pass `--edition 2021` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide @@ -20,6 +21,7 @@ fn await_on_struct_similar() { let x = S { awai: 42 }; x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| HELP a field with a similar name exists //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP pass `--edition 2021` to `rustc` @@ -29,6 +31,7 @@ fn await_on_struct_similar() { fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP pass `--edition 2021` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide @@ -37,6 +40,7 @@ fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { fn await_on_apit(x: impl Future<Output = ()>) { x.await; //~^ ERROR no field `await` on type + //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 //~| HELP pass `--edition 2021` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide diff --git a/tests/ui/async-await/suggest-switching-edition-on-await.stderr b/tests/ui/async-await/suggest-switching-edition-on-await.stderr index 82c5b107b05..0ed256b059f 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await.stderr @@ -2,17 +2,17 @@ error[E0609]: no field `await` on type `await_on_struct_missing::S` --> $DIR/suggest-switching-edition-on-await.rs:9:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `await_on_struct_similar::S` - --> $DIR/suggest-switching-edition-on-await.rs:21:7 + --> $DIR/suggest-switching-edition-on-await.rs:22:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: pass `--edition 2021` to `rustc` @@ -23,20 +23,20 @@ LL | x.awai; | ~~~~ error[E0609]: no field `await` on type `Pin<&mut dyn Future<Output = ()>>` - --> $DIR/suggest-switching-edition-on-await.rs:30:7 + --> $DIR/suggest-switching-edition-on-await.rs:32:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `impl Future<Output = ()>` - --> $DIR/suggest-switching-edition-on-await.rs:38:7 + --> $DIR/suggest-switching-edition-on-await.rs:41:7 | LL | x.await; - | ^^^^^ + | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later = help: pass `--edition 2021` to `rustc` diff --git a/tests/ui/derived-errors/issue-30580.stderr b/tests/ui/derived-errors/issue-30580.stderr index 146ffd7dd65..4e60368c387 100644 --- a/tests/ui/derived-errors/issue-30580.stderr +++ b/tests/ui/derived-errors/issue-30580.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `c` on type `&Foo` --> $DIR/issue-30580.rs:12:11 | LL | b.c; - | ^ + | ^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.rs b/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.rs index 36a7066e72e..ffc37b260a6 100644 --- a/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.rs +++ b/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.rs @@ -21,15 +21,18 @@ fn main() { // `doc(hidden)` because it's defined in this crate. A::default().hey; //~^ ERROR no field `hey` on type `A` + //~| NOTE unknown field //~| NOTE available fields are: `hello`, `bye` // Here we want to hide the field `hello` since it's marked // `doc(hidden)` and comes from an external crate. doc_hidden_fields::B::default().hey; //~^ ERROR no field `hey` on type `B` + //~| NOTE unknown field //~| NOTE available field is: `bye` C::default().hey; //~^ ERROR no field `hey` on type `C` + //~| NOTE unknown field //~| NOTE available fields are: `hello`, `bye` } diff --git a/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.stderr b/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.stderr index abded80066a..55f6d0fa323 100644 --- a/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.stderr +++ b/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.stderr @@ -2,23 +2,23 @@ error[E0609]: no field `hey` on type `A` --> $DIR/dont-suggest-doc-hidden-fields.rs:22:18 | LL | A::default().hey; - | ^^^ + | ^^^ unknown field | = note: available fields are: `hello`, `bye` error[E0609]: no field `hey` on type `B` - --> $DIR/dont-suggest-doc-hidden-fields.rs:28:37 + --> $DIR/dont-suggest-doc-hidden-fields.rs:29:37 | LL | doc_hidden_fields::B::default().hey; - | ^^^ + | ^^^ unknown field | = note: available field is: `bye` error[E0609]: no field `hey` on type `C` - --> $DIR/dont-suggest-doc-hidden-fields.rs:32:18 + --> $DIR/dont-suggest-doc-hidden-fields.rs:34:18 | LL | C::default().hey; - | ^^^ + | ^^^ unknown field | = note: available fields are: `hello`, `bye` diff --git a/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr b/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr index 414590873da..7066d29760e 100644 --- a/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr +++ b/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr @@ -13,13 +13,13 @@ error[E0609]: no field `field` on type `Compound` --> $DIR/dont-suggest-hygienic-fields.rs:24:16 | LL | let _ = ty.field; - | ^^^^^ + | ^^^^^ unknown field error[E0609]: no field `fieeld` on type `Compound` --> $DIR/dont-suggest-hygienic-fields.rs:25:16 | LL | let _ = ty.fieeld; - | ^^^^^^ + | ^^^^^^ unknown field error[E0026]: struct `Compound` does not have a field named `field` --> $DIR/dont-suggest-hygienic-fields.rs:27:20 @@ -42,7 +42,7 @@ error[E0609]: no field `0` on type `Component` --> $DIR/dont-suggest-hygienic-fields.rs:34:16 | LL | let _ = ty.0; - | ^ + | ^ unknown field error: aborting due to 6 previous errors diff --git a/tests/ui/did_you_mean/issue-36798.stderr b/tests/ui/did_you_mean/issue-36798.stderr index 354aef4047b..9f82d4c44cf 100644 --- a/tests/ui/did_you_mean/issue-36798.stderr +++ b/tests/ui/did_you_mean/issue-36798.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `baz` on type `Foo` --> $DIR/issue-36798.rs:7:7 | LL | f.baz; - | ^^^ + | ^^^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/did_you_mean/issue-36798_unknown_field.stderr b/tests/ui/did_you_mean/issue-36798_unknown_field.stderr index 4854a9bdeb8..4f216568979 100644 --- a/tests/ui/did_you_mean/issue-36798_unknown_field.stderr +++ b/tests/ui/did_you_mean/issue-36798_unknown_field.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `zz` on type `Foo` --> $DIR/issue-36798_unknown_field.rs:7:7 | LL | f.zz; - | ^^ + | ^^ unknown field | = note: available field is: `bar` diff --git a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr index d830564bc37..bcd1a00a4bb 100644 --- a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr +++ b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr @@ -16,7 +16,7 @@ error[E0609]: no field `inocently_mispellable` on type `Demo` --> $DIR/issue-42599_available_fields_note.rs:32:41 | LL | let innocent_field_misaccess = demo.inocently_mispellable; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ unknown field | help: a field with a similar name exists | @@ -27,7 +27,7 @@ error[E0609]: no field `egregiously_nonexistent_field` on type `Demo` --> $DIR/issue-42599_available_fields_note.rs:35:42 | LL | let egregious_field_misaccess = demo.egregiously_nonexistent_field; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown field | = note: available fields are: `favorite_integer`, `innocently_misspellable` diff --git a/tests/ui/error-codes/E0609-private-method.stderr b/tests/ui/error-codes/E0609-private-method.stderr index a2bfcca5e0b..d2a11e90627 100644 --- a/tests/ui/error-codes/E0609-private-method.stderr +++ b/tests/ui/error-codes/E0609-private-method.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `method` on type `Foo` --> $DIR/E0609-private-method.rs:15:7 | LL | f.method; - | ^^^^^^ + | ^^^^^^ unknown field error: aborting due to previous error diff --git a/tests/ui/error-codes/E0609.stderr b/tests/ui/error-codes/E0609.stderr index 78a61b92c5c..cad857553da 100644 --- a/tests/ui/error-codes/E0609.stderr +++ b/tests/ui/error-codes/E0609.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `foo` on type `Foo` --> $DIR/E0609.rs:8:15 | LL | let _ = x.foo; - | ^^^ + | ^^^ unknown field | = note: available field is: `x` @@ -10,7 +10,7 @@ error[E0609]: no field `1` on type `Bar` --> $DIR/E0609.rs:11:7 | LL | y.1; - | ^ + | ^ unknown field error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/ex-E0612.stderr b/tests/ui/error-codes/ex-E0612.stderr index ee15147ba3e..4dd9848cf07 100644 --- a/tests/ui/error-codes/ex-E0612.stderr +++ b/tests/ui/error-codes/ex-E0612.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `1` on type `Foo` --> $DIR/ex-E0612.rs:5:6 | LL | y.1; - | ^ + | ^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/infinite/infinite-autoderef.stderr b/tests/ui/infinite/infinite-autoderef.stderr index 1fa53beba68..51b61e3a66b 100644 --- a/tests/ui/infinite/infinite-autoderef.stderr +++ b/tests/ui/infinite/infinite-autoderef.stderr @@ -29,7 +29,7 @@ error[E0609]: no field `foo` on type `Foo` --> $DIR/infinite-autoderef.rs:24:9 | LL | Foo.foo; - | ^^^ + | ^^^ unknown field error[E0055]: reached the recursion limit while auto-dereferencing `Foo` --> $DIR/infinite-autoderef.rs:25:9 diff --git a/tests/ui/issues/issue-11004.stderr b/tests/ui/issues/issue-11004.stderr index b5831e42e39..ea141e61df8 100644 --- a/tests/ui/issues/issue-11004.stderr +++ b/tests/ui/issues/issue-11004.stderr @@ -3,7 +3,8 @@ error[E0609]: no field `x` on type `*mut A` | LL | let x : i32 = n.x; | --^ - | | + | | | + | | unknown field | help: `n` is a raw pointer; try dereferencing it: `(*n).x` error[E0609]: no field `y` on type `*mut A` @@ -11,7 +12,8 @@ error[E0609]: no field `y` on type `*mut A` | LL | let y : f64 = n.y; | --^ - | | + | | | + | | unknown field | help: `n` is a raw pointer; try dereferencing it: `(*n).y` error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-13847.stderr b/tests/ui/issues/issue-13847.stderr index 52b8dc04970..ded927693b2 100644 --- a/tests/ui/issues/issue-13847.stderr +++ b/tests/ui/issues/issue-13847.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `is_failure` on type `!` --> $DIR/issue-13847.rs:2:12 | LL | return.is_failure - | ^^^^^^^^^^ + | ^^^^^^^^^^ unknown field error: aborting due to previous error diff --git a/tests/ui/issues/issue-14721.stderr b/tests/ui/issues/issue-14721.stderr index 49ebb2976e8..f07bc7ad4f1 100644 --- a/tests/ui/issues/issue-14721.stderr +++ b/tests/ui/issues/issue-14721.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `desc` on type `&str` --> $DIR/issue-14721.rs:3:24 | LL | println!("{}", foo.desc); - | ^^^^ + | ^^^^ unknown field error: aborting due to previous error diff --git a/tests/ui/issues/issue-19244-1.stderr b/tests/ui/issues/issue-19244-1.stderr index 1eb530542c0..3358cac82e0 100644 --- a/tests/ui/issues/issue-19244-1.stderr +++ b/tests/ui/issues/issue-19244-1.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `1` on type `(usize,)` --> $DIR/issue-19244-1.rs:4:24 | LL | let a: [isize; TUP.1]; - | ^ + | ^ unknown field error: aborting due to previous error diff --git a/tests/ui/issues/issue-19244-2.stderr b/tests/ui/issues/issue-19244-2.stderr index 933371d1e89..71655457f90 100644 --- a/tests/ui/issues/issue-19244-2.stderr +++ b/tests/ui/issues/issue-19244-2.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `nonexistent_field` on type `MyStruct` --> $DIR/issue-19244-2.rs:5:27 | LL | let a: [isize; STRUCT.nonexistent_field]; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ unknown field | = note: available field is: `field` diff --git a/tests/ui/issues/issue-23253.stderr b/tests/ui/issues/issue-23253.stderr index be5714cd91a..44f01c1c167 100644 --- a/tests/ui/issues/issue-23253.stderr +++ b/tests/ui/issues/issue-23253.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `a` on type `Foo` --> $DIR/issue-23253.rs:4:14 | LL | Foo::Bar.a; - | ^ + | ^ unknown field error: aborting due to previous error diff --git a/tests/ui/issues/issue-24365.stderr b/tests/ui/issues/issue-24365.stderr index f9eead8a4f2..3f6ed0231d8 100644 --- a/tests/ui/issues/issue-24365.stderr +++ b/tests/ui/issues/issue-24365.stderr @@ -2,19 +2,19 @@ error[E0609]: no field `b` on type `Foo` --> $DIR/issue-24365.rs:10:22 | LL | println!("{}", a.b); - | ^ + | ^ unknown field error[E0609]: no field `attr_name_idx` on type `&Attribute` --> $DIR/issue-24365.rs:17:18 | LL | let z = (&x).attr_name_idx; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ unknown field error[E0609]: no field `attr_name_idx` on type `Attribute` --> $DIR/issue-24365.rs:18:15 | LL | let y = x.attr_name_idx; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ unknown field error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-31011.stderr b/tests/ui/issues/issue-31011.stderr index 58c170409fd..4971e3357b4 100644 --- a/tests/ui/issues/issue-31011.stderr +++ b/tests/ui/issues/issue-31011.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `trace` on type `&T` --> $DIR/issue-31011.rs:3:17 | LL | if $ctx.trace { - | ^^^^^ + | ^^^^^ unknown field ... LL | fn wrap<T>(context: &T) -> () | - type parameter 'T' declared here diff --git a/tests/ui/issues/issue-33525.stderr b/tests/ui/issues/issue-33525.stderr index f8d703dc3b1..ee9f4d4c301 100644 --- a/tests/ui/issues/issue-33525.stderr +++ b/tests/ui/issues/issue-33525.stderr @@ -8,13 +8,13 @@ error[E0609]: no field `lorem` on type `&'static str` --> $DIR/issue-33525.rs:3:8 | LL | "".lorem; - | ^^^^^ + | ^^^^^ unknown field error[E0609]: no field `ipsum` on type `&'static str` --> $DIR/issue-33525.rs:4:8 | LL | "".ipsum; - | ^^^^^ + | ^^^^^ unknown field error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr b/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr index 0edaeca8a88..0aa1ae7222f 100644 --- a/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr +++ b/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `00` on type `Verdict` --> $DIR/issue-47073-zero-padded-tuple-struct-indices.rs:8:30 | LL | let _condemned = justice.00; - | ^^ + | ^^ unknown field | help: a field with a similar name exists | @@ -13,7 +13,7 @@ error[E0609]: no field `001` on type `Verdict` --> $DIR/issue-47073-zero-padded-tuple-struct-indices.rs:10:31 | LL | let _punishment = justice.001; - | ^^^ + | ^^^ unknown field | = note: available fields are: `0`, `1` diff --git a/tests/ui/mismatched_types/cast-rfc0401.stderr b/tests/ui/mismatched_types/cast-rfc0401.stderr index d63cec48917..142a52aef13 100644 --- a/tests/ui/mismatched_types/cast-rfc0401.stderr +++ b/tests/ui/mismatched_types/cast-rfc0401.stderr @@ -18,7 +18,7 @@ error[E0609]: no field `f` on type `fn() {main}` --> $DIR/cast-rfc0401.rs:65:18 | LL | let _ = main.f as *const u32; - | ^ + | ^ unknown field error[E0605]: non-primitive cast: `*const u8` as `&u8` --> $DIR/cast-rfc0401.rs:29:13 diff --git a/tests/ui/parser/float-field.stderr b/tests/ui/parser/float-field.stderr index a81992c3380..d67d270ef7b 100644 --- a/tests/ui/parser/float-field.stderr +++ b/tests/ui/parser/float-field.stderr @@ -266,7 +266,7 @@ error[E0609]: no field `1e1` on type `S` --> $DIR/float-field.rs:6:7 | LL | s.1e1; - | ^^^ + | ^^^ unknown field | = note: available fields are: `0`, `1` @@ -274,13 +274,13 @@ error[E0609]: no field `1e1` on type `(u8, u8)` --> $DIR/float-field.rs:9:9 | LL | s.1.1e1; - | ^^^ + | ^^^ unknown field error[E0609]: no field `0x1e1` on type `S` --> $DIR/float-field.rs:24:7 | LL | s.0x1e1; - | ^^^^^ + | ^^^^^ unknown field | = note: available fields are: `0`, `1` @@ -288,7 +288,7 @@ error[E0609]: no field `0x1` on type `S` --> $DIR/float-field.rs:25:7 | LL | s.0x1.; - | ^^^ + | ^^^ unknown field | = note: available fields are: `0`, `1` @@ -296,7 +296,7 @@ error[E0609]: no field `0x1` on type `S` --> $DIR/float-field.rs:28:7 | LL | s.0x1.1; - | ^^^ + | ^^^ unknown field | = note: available fields are: `0`, `1` @@ -304,7 +304,7 @@ error[E0609]: no field `0x1` on type `S` --> $DIR/float-field.rs:30:7 | LL | s.0x1.1e1; - | ^^^ + | ^^^ unknown field | = note: available fields are: `0`, `1` @@ -312,7 +312,7 @@ error[E0609]: no field `0x1e` on type `S` --> $DIR/float-field.rs:34:7 | LL | s.0x1e+1; - | ^^^^ + | ^^^^ unknown field | = note: available fields are: `0`, `1` @@ -320,7 +320,7 @@ error[E0609]: no field `0x1e` on type `S` --> $DIR/float-field.rs:35:7 | LL | s.0x1e-1; - | ^^^^ + | ^^^^ unknown field | = note: available fields are: `0`, `1` @@ -328,7 +328,7 @@ error[E0609]: no field `1e1` on type `S` --> $DIR/float-field.rs:42:7 | LL | s.1e1f32; - | ^^^^^^ + | ^^^^^^ unknown field | = note: available fields are: `0`, `1` @@ -336,13 +336,13 @@ error[E0609]: no field `f32` on type `(u8, u8)` --> $DIR/float-field.rs:44:9 | LL | s.1.f32; - | ^^^ + | ^^^ unknown field error[E0609]: no field `1e1` on type `(u8, u8)` --> $DIR/float-field.rs:46:7 | LL | s.1.1e1f32; - | ^^^^^^^^ + | ^^^^^^^^ unknown field error: aborting due to 55 previous errors diff --git a/tests/ui/structs/struct-fields-typo.stderr b/tests/ui/structs/struct-fields-typo.stderr index 8423e7a97a0..aef0e0e8e5c 100644 --- a/tests/ui/structs/struct-fields-typo.stderr +++ b/tests/ui/structs/struct-fields-typo.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `baa` on type `BuildData` --> $DIR/struct-fields-typo.rs:11:17 | LL | let x = foo.baa; - | ^^^ + | ^^^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/structs/struct-pat-derived-error.stderr b/tests/ui/structs/struct-pat-derived-error.stderr index f80c2383ef8..78bb018cb4b 100644 --- a/tests/ui/structs/struct-pat-derived-error.stderr +++ b/tests/ui/structs/struct-pat-derived-error.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `d` on type `&A` --> $DIR/struct-pat-derived-error.rs:8:31 | LL | let A { x, y } = self.d; - | ^ + | ^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/suggestions/call-on-missing.stderr b/tests/ui/suggestions/call-on-missing.stderr index 2824343c913..1bab075dc9c 100644 --- a/tests/ui/suggestions/call-on-missing.stderr +++ b/tests/ui/suggestions/call-on-missing.stderr @@ -13,7 +13,7 @@ error[E0609]: no field `i` on type `fn() -> Foo {foo}` --> $DIR/call-on-missing.rs:16:9 | LL | foo.i; - | ^ + | ^ unknown field | help: use parentheses to call this function | @@ -35,7 +35,7 @@ error[E0609]: no field `i` on type `Box<dyn Fn() -> Foo>` --> $DIR/call-on-missing.rs:26:14 | LL | callable.i; - | ^ + | ^ unknown field | help: use parentheses to call this trait object | @@ -62,7 +62,7 @@ LL | fn type_param<T: Fn() -> Foo>(t: T) { | - type parameter 'T' declared here ... LL | t.i; - | ^ + | ^ unknown field | help: use parentheses to call this type parameter | diff --git a/tests/ui/suggestions/field-access-considering-privacy.stderr b/tests/ui/suggestions/field-access-considering-privacy.stderr index 5bbcfeea474..cbf6f3d1002 100644 --- a/tests/ui/suggestions/field-access-considering-privacy.stderr +++ b/tests/ui/suggestions/field-access-considering-privacy.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `opts` on type `TyCtxt<'tcx>` --> $DIR/field-access-considering-privacy.rs:29:13 | LL | tcx.opts; - | ^^^^ + | ^^^^ unknown field | help: one of the expressions' fields has a field of the same name | diff --git a/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr index f4010b39dc4..b294f4da7db 100644 --- a/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `f` on type `Foo` --> $DIR/non-existent-field-present-in-subfield-recursion-limit.rs:41:22 | LL | let test = fooer.f; - | ^ + | ^ unknown field | = note: available fields are: `first`, `second`, `third` diff --git a/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr b/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr index c3e40145038..65353ed923e 100644 --- a/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `c` on type `Foo` --> $DIR/non-existent-field-present-in-subfield.rs:37:24 | LL | let _test = &fooer.c; - | ^ + | ^ unknown field | help: one of the expressions' fields has a field of the same name | @@ -13,7 +13,7 @@ error[E0609]: no field `test` on type `Foo` --> $DIR/non-existent-field-present-in-subfield.rs:40:24 | LL | let _test2 = fooer.test; - | ^^^^ + | ^^^^ unknown field | help: one of the expressions' fields has a field of the same name | diff --git a/tests/ui/suggestions/parenthesized-deref-suggestion.stderr b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr index cafddbe2624..9f185f5dd52 100644 --- a/tests/ui/suggestions/parenthesized-deref-suggestion.stderr +++ b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `opts` on type `*const Session` --> $DIR/parenthesized-deref-suggestion.rs:7:30 | LL | (sess as *const Session).opts; - | ^^^^ + | ^^^^ unknown field | help: `(sess as *const Session)` is a raw pointer; try dereferencing it | @@ -14,7 +14,8 @@ error[E0609]: no field `0` on type `[u32; 1]` | LL | (x as [u32; 1]).0; | ----------------^ - | | + | | | + | | unknown field | help: instead of using tuple indexing, use array indexing: `(x as [u32; 1])[0]` error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/private-field.stderr b/tests/ui/suggestions/private-field.stderr index 6a735a163b8..0db426588bd 100644 --- a/tests/ui/suggestions/private-field.stderr +++ b/tests/ui/suggestions/private-field.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `cap` on type `S` --> $DIR/private-field.rs:7:12 | LL | dbg!(s.cap) - | ^^^ + | ^^^ unknown field | = note: available field is: `val` diff --git a/tests/ui/suggestions/suggest-field-through-deref.stderr b/tests/ui/suggestions/suggest-field-through-deref.stderr index f12d53448d3..cc9fe2044c9 100644 --- a/tests/ui/suggestions/suggest-field-through-deref.stderr +++ b/tests/ui/suggestions/suggest-field-through-deref.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `longname` on type `Arc<S>` --> $DIR/suggest-field-through-deref.rs:10:15 | LL | let _ = x.longname; - | ^^^^^^^^ + | ^^^^^^^^ unknown field | help: a field with a similar name exists | @@ -13,7 +13,7 @@ error[E0609]: no field `longname` on type `S` --> $DIR/suggest-field-through-deref.rs:12:15 | LL | let _ = y.longname; - | ^^^^^^^^ + | ^^^^^^^^ unknown field | help: a field with a similar name exists | @@ -24,7 +24,7 @@ error[E0609]: no field `longname` on type `Option<Arc<S>>` --> $DIR/suggest-field-through-deref.rs:14:15 | LL | let _ = a.longname; - | ^^^^^^^^ + | ^^^^^^^^ unknown field | help: a field with a similar name exists | @@ -35,7 +35,7 @@ error[E0609]: no field `long_name` on type `Option<S>` --> $DIR/suggest-field-through-deref.rs:16:15 | LL | let _ = b.long_name; - | ^^^^^^^^^ + | ^^^^^^^^^ unknown field | help: one of the expressions' fields has a field of the same name | @@ -46,7 +46,7 @@ error[E0609]: no field `longname` on type `Result<Arc<S>, ()>` --> $DIR/suggest-field-through-deref.rs:18:15 | LL | let _ = c.longname; - | ^^^^^^^^ + | ^^^^^^^^ unknown field | help: a field with a similar name exists | @@ -57,7 +57,7 @@ error[E0609]: no field `long_name` on type `Result<S, ()>` --> $DIR/suggest-field-through-deref.rs:20:15 | LL | let _ = d.long_name; - | ^^^^^^^^^ + | ^^^^^^^^^ unknown field | help: one of the expressions' fields has a field of the same name | diff --git a/tests/ui/suggestions/too-many-field-suggestions.stderr b/tests/ui/suggestions/too-many-field-suggestions.stderr index b556bdda3f6..ac5c8cb60cc 100644 --- a/tests/ui/suggestions/too-many-field-suggestions.stderr +++ b/tests/ui/suggestions/too-many-field-suggestions.stderr @@ -23,7 +23,7 @@ error[E0609]: no field `field` on type `Thing` --> $DIR/too-many-field-suggestions.rs:26:7 | LL | t.field; - | ^^^^^ + | ^^^^^ unknown field | help: some of the expressions' fields have a field of the same name | diff --git a/tests/ui/tuple/index-invalid.stderr b/tests/ui/tuple/index-invalid.stderr index 8d22f458a6c..ae2c275f52c 100644 --- a/tests/ui/tuple/index-invalid.stderr +++ b/tests/ui/tuple/index-invalid.stderr @@ -2,19 +2,19 @@ error[E0609]: no field `1` on type `(((),),)` --> $DIR/index-invalid.rs:2:22 | LL | let _ = (((),),).1.0; - | ^ + | ^ unknown field error[E0609]: no field `1` on type `((),)` --> $DIR/index-invalid.rs:4:24 | LL | let _ = (((),),).0.1; - | ^ + | ^ unknown field error[E0609]: no field `000` on type `(((),),)` --> $DIR/index-invalid.rs:6:22 | LL | let _ = (((),),).000.000; - | ^^^ + | ^^^ unknown field error: aborting due to 3 previous errors diff --git a/tests/ui/tuple/tuple-index-not-tuple.stderr b/tests/ui/tuple/tuple-index-not-tuple.stderr index 0f81f2a1bb8..a267e41b1bc 100644 --- a/tests/ui/tuple/tuple-index-not-tuple.stderr +++ b/tests/ui/tuple/tuple-index-not-tuple.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `0` on type `Point` --> $DIR/tuple-index-not-tuple.rs:6:12 | LL | origin.0; - | ^ + | ^ unknown field | help: a field with a similar name exists | @@ -13,7 +13,7 @@ error[E0609]: no field `0` on type `Empty` --> $DIR/tuple-index-not-tuple.rs:8:11 | LL | Empty.0; - | ^ + | ^ unknown field error: aborting due to 2 previous errors diff --git a/tests/ui/tuple/tuple-index-out-of-bounds.stderr b/tests/ui/tuple/tuple-index-out-of-bounds.stderr index 7fc8289aaa0..96090435d06 100644 --- a/tests/ui/tuple/tuple-index-out-of-bounds.stderr +++ b/tests/ui/tuple/tuple-index-out-of-bounds.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `2` on type `Point` --> $DIR/tuple-index-out-of-bounds.rs:7:12 | LL | origin.2; - | ^ + | ^ unknown field | help: a field with a similar name exists | @@ -13,7 +13,7 @@ error[E0609]: no field `2` on type `({integer}, {integer})` --> $DIR/tuple-index-out-of-bounds.rs:12:11 | LL | tuple.2; - | ^ + | ^ unknown field error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-52082-type-param-shadows-existing-type.stderr b/tests/ui/typeck/issue-52082-type-param-shadows-existing-type.stderr index 4be4c91dfc2..e1091c8f5ca 100644 --- a/tests/ui/typeck/issue-52082-type-param-shadows-existing-type.stderr +++ b/tests/ui/typeck/issue-52082-type-param-shadows-existing-type.stderr @@ -5,7 +5,7 @@ LL | fn equals_ref<Point>(a: &Point, b: &Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `x` on type `&Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:31:18 @@ -14,7 +14,7 @@ LL | fn equals_ref<Point>(a: &Point, b: &Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `y` on type `&Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:31:25 @@ -23,7 +23,7 @@ LL | fn equals_ref<Point>(a: &Point, b: &Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `y` on type `&Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:31:32 @@ -32,7 +32,7 @@ LL | fn equals_ref<Point>(a: &Point, b: &Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `x` on type `Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:39:11 @@ -41,7 +41,7 @@ LL | fn equals_val<Point>(a: Point, b: Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `x` on type `Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:39:18 @@ -50,7 +50,7 @@ LL | fn equals_val<Point>(a: Point, b: Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `y` on type `Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:39:25 @@ -59,7 +59,7 @@ LL | fn equals_val<Point>(a: Point, b: Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error[E0609]: no field `y` on type `Point` --> $DIR/issue-52082-type-param-shadows-existing-type.rs:39:32 @@ -68,7 +68,7 @@ LL | fn equals_val<Point>(a: Point, b: Point) -> bool | ----- type parameter 'Point' declared here LL | { LL | a.x == b.x && a.y == b.y - | ^ + | ^ unknown field error: aborting due to 8 previous errors diff --git a/tests/ui/typeck/issue-53712.stderr b/tests/ui/typeck/issue-53712.stderr index db85919afcb..7ed9cb10379 100644 --- a/tests/ui/typeck/issue-53712.stderr +++ b/tests/ui/typeck/issue-53712.stderr @@ -3,7 +3,8 @@ error[E0609]: no field `0` on type `[{integer}; 5]` | LL | arr.0; | ----^ - | | + | | | + | | unknown field | help: instead of using tuple indexing, use array indexing: `arr[0]` error: aborting due to previous error diff --git a/tests/ui/typeck/issue-65611.stderr b/tests/ui/typeck/issue-65611.stderr index 003c630790d..2278450a6d8 100644 --- a/tests/ui/typeck/issue-65611.stderr +++ b/tests/ui/typeck/issue-65611.stderr @@ -8,7 +8,7 @@ error[E0609]: no field `0` on type `&_` --> $DIR/issue-65611.rs:59:36 | LL | let x = buffer.last().unwrap().0.clone(); - | ^ + | ^ unknown field error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-67971.stderr b/tests/ui/typeck/issue-67971.stderr index 4ae0f5d1c5c..d50ed9cf13b 100644 --- a/tests/ui/typeck/issue-67971.stderr +++ b/tests/ui/typeck/issue-67971.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `sleep` on type `&mut S` --> $DIR/issue-67971.rs:5:9 | LL | ctx.sleep = 0; - | ^^^^^ + | ^^^^^ unknown field error[E0308]: mismatched types --> $DIR/issue-67971.rs:3:24 diff --git a/tests/ui/typeck/issue-87181/tuple-field.stderr b/tests/ui/typeck/issue-87181/tuple-field.stderr index 0a7d30b615a..16afac4bd6b 100644 --- a/tests/ui/typeck/issue-87181/tuple-field.stderr +++ b/tests/ui/typeck/issue-87181/tuple-field.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `0` on type `fn(char, u16) -> Foo {Foo}` --> $DIR/tuple-field.rs:12:15 | LL | thing.bar.0; - | ^ + | ^ unknown field | help: use parentheses to construct this tuple struct | diff --git a/tests/ui/typeck/issue-96738.stderr b/tests/ui/typeck/issue-96738.stderr index 547cffffa2e..2bc8453dda7 100644 --- a/tests/ui/typeck/issue-96738.stderr +++ b/tests/ui/typeck/issue-96738.stderr @@ -8,7 +8,7 @@ error[E0609]: no field `nonexistent_field` on type `fn(_) -> Option<_> {Option:: --> $DIR/issue-96738.rs:3:10 | LL | Some.nonexistent_field; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ unknown field error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/no-type-for-node-ice.stderr b/tests/ui/typeck/no-type-for-node-ice.stderr index b50241fb1a0..b990b5f951f 100644 --- a/tests/ui/typeck/no-type-for-node-ice.stderr +++ b/tests/ui/typeck/no-type-for-node-ice.stderr @@ -2,7 +2,7 @@ error[E0609]: no field `homura` on type `&'static str` --> $DIR/no-type-for-node-ice.rs:4:8 | LL | "".homura[""]; - | ^^^^^^ + | ^^^^^^ unknown field error: aborting due to previous error diff --git a/tests/ui/union/union-suggest-field.mirunsafeck.stderr b/tests/ui/union/union-suggest-field.mirunsafeck.stderr index 805f84da388..70921049399 100644 --- a/tests/ui/union/union-suggest-field.mirunsafeck.stderr +++ b/tests/ui/union/union-suggest-field.mirunsafeck.stderr @@ -8,7 +8,7 @@ error[E0609]: no field `principial` on type `U` --> $DIR/union-suggest-field.rs:17:15 | LL | let w = u.principial; - | ^^^^^^^^^^ + | ^^^^^^^^^^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/union/union-suggest-field.thirunsafeck.stderr b/tests/ui/union/union-suggest-field.thirunsafeck.stderr index 805f84da388..70921049399 100644 --- a/tests/ui/union/union-suggest-field.thirunsafeck.stderr +++ b/tests/ui/union/union-suggest-field.thirunsafeck.stderr @@ -8,7 +8,7 @@ error[E0609]: no field `principial` on type `U` --> $DIR/union-suggest-field.rs:17:15 | LL | let w = u.principial; - | ^^^^^^^^^^ + | ^^^^^^^^^^ unknown field | help: a field with a similar name exists | diff --git a/tests/ui/unsafe/unsafe-fn-autoderef.stderr b/tests/ui/unsafe/unsafe-fn-autoderef.stderr index 20a88c35610..f563118e8ac 100644 --- a/tests/ui/unsafe/unsafe-fn-autoderef.stderr +++ b/tests/ui/unsafe/unsafe-fn-autoderef.stderr @@ -3,7 +3,8 @@ error[E0609]: no field `f` on type `*const Rec` | LL | return p.f; | --^ - | | + | | | + | | unknown field | help: `p` is a raw pointer; try dereferencing it: `(*p).f` error: aborting due to previous error |
