about summary refs log tree commit diff
path: root/tests/ui/async-await/recursive-async-auto-trait-overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-10 23:47:25 +0000
committerbors <bors@rust-lang.org>2025-08-10 23:47:25 +0000
commit21a19c297d4f5a03501d92ca251bd7a17073c08a (patch)
tree93ca4123ac144c6d8d5fc796bfa2251ffb95db27 /tests/ui/async-await/recursive-async-auto-trait-overflow.rs
parentc8ca44c98eade864824a3c0a15fbdc1edb7f9dd4 (diff)
parent29d26f27a6d6c466ed143bdfa128f76a19226743 (diff)
downloadrust-21a19c297d4f5a03501d92ca251bd7a17073c08a.tar.gz
rust-21a19c297d4f5a03501d92ca251bd7a17073c08a.zip
Auto merge of #135846 - estebank:non-exhaustive-dfv-ctor-2, r=BoxyUwU
Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
Diffstat (limited to 'tests/ui/async-await/recursive-async-auto-trait-overflow.rs')
0 files changed, 0 insertions, 0 deletions