about summary refs log tree commit diff
path: root/src/test/ui/issues
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-08 19:57:55 -0800
committerGitHub <noreply@github.com>2023-01-08 19:57:55 -0800
commit29420a8e7ab5d5aeeacdd8103eed7c8c19be7001 (patch)
tree576f5152401f8c1bce7563b8a1dd691664651cc1 /src/test/ui/issues
parent70f1566b2bbdf92dffb40fa122986a58b2c4ee86 (diff)
parent59aa421f3518b28bba5ebc883714638e65b0a3c5 (diff)
Rollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebank
Suppress type errors that come from private fields

Fixes #57320

There was some discussion here (https://github.com/rust-lang/rust/issues/57320#issuecomment-451308420), but I honestly think the second error is worth suppressing regardless.

I would be open to feedback though -- perhaps we can suppress the `.len()` suggestion if there's type error (since we have access to [`Expectation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/enum.Expectation.html), we can determine that).

r? ``@estebank``
Diffstat (limited to 'src/test/ui/issues')
-rw-r--r--src/test/ui/issues/issue-25386.rs1
-rw-r--r--src/test/ui/issues/issue-25386.stderr8
2 files changed, 1 insertions, 8 deletions
diff --git a/src/test/ui/issues/issue-25386.rs b/src/test/ui/issues/issue-25386.rs
index a76d8a615f6..b26cc77680d 100644
--- a/src/test/ui/issues/issue-25386.rs
+++ b/src/test/ui/issues/issue-25386.rs
@@ -24,5 +24,4 @@ macro_rules! check_ptr_exist {
 fn main() {
     let item = stuff::Item::new();
     println!("{}", check_ptr_exist!(item, name));
-    //~^ ERROR field `name` of struct `CObj` is private
 }
diff --git a/src/test/ui/issues/issue-25386.stderr b/src/test/ui/issues/issue-25386.stderr
index bce269393ee..727b9690829 100644
--- a/src/test/ui/issues/issue-25386.stderr
+++ b/src/test/ui/issues/issue-25386.stderr
@@ -9,12 +9,6 @@ LL |     println!("{}", check_ptr_exist!(item, name));
    |
    = note: this error originates in the macro `check_ptr_exist` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0616]: field `name` of struct `CObj` is private
-  --> $DIR/issue-25386.rs:26:43
-   |
-LL |     println!("{}", check_ptr_exist!(item, name));
-   |                                           ^^^^ private field
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0616`.