<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/destructuring-assignment, branch 1.85.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-12-09T21:55:01+00:00</updated>
<entry>
<title>Introduce `default_field_values` feature</title>
<updated>2024-12-09T21:55:01+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-08-24T17:22:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9ac95c10c09faf50cc22eb97b6e1c59d64053c28'/>
<id>urn:sha1:9ac95c10c09faf50cc22eb97b6e1c59d64053c28</id>
<content type='text'>
Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681.

Support default fields in enum struct variant

Allow default values in an enum struct variant definition:

```rust
pub enum Bar {
    Foo {
        bar: S = S,
        baz: i32 = 42 + 3,
    }
}
```

Allow using `..` without a base on an enum struct variant

```rust
Bar::Foo { .. }
```

`#[derive(Default)]` doesn't account for these as it is still gating `#[default]` only being allowed on unit variants.

Support `#[derive(Default)]` on enum struct variants with all defaulted fields

```rust
pub enum Bar {
    #[default]
    Foo {
        bar: S = S,
        baz: i32 = 42 + 3,
    }
}
```

Check for missing fields in typeck instead of mir_build.

Expand test with `const` param case (needs `generic_const_exprs` enabled).

Properly instantiate MIR const

The following works:

```rust
struct S&lt;A&gt; {
    a: Vec&lt;A&gt; = Vec::new(),
}
S::&lt;i32&gt; { .. }
```

Add lint for default fields that will always fail const-eval

We *allow* this to happen for API writers that might want to rely on users'
getting a compile error when using the default field, different to the error
that they would get when the field isn't default. We could change this to
*always* error instead of being a lint, if we wanted.

This will *not* catch errors for partially evaluated consts, like when the
expression relies on a const parameter.

Suggestions when encountering `Foo { .. }` without `#[feature(default_field_values)]`:

 - Suggest adding a base expression if there are missing fields.
 - Suggest enabling the feature if all the missing fields have optional values.
 - Suggest removing `..` if there are no missing fields.
</content>
</entry>
<entry>
<title>Update tests for new TRPL chapter order</title>
<updated>2024-11-23T15:57:25+00:00</updated>
<author>
<name>Chris Krycho</name>
<email>hello@chriskrycho.com</email>
</author>
<published>2024-10-30T19:08:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d4275e08e7f73efabb2c41ceb27020c6f9005a68'/>
<id>urn:sha1:d4275e08e7f73efabb2c41ceb27020c6f9005a68</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add third help hint to diagnostic error E0027</title>
<updated>2024-10-24T07:17:28+00:00</updated>
<author>
<name>Duncan Proctor</name>
<email>duncpro@icloud.com</email>
</author>
<published>2024-10-22T05:51:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=10b60eba9bc55449721db912fe75bab11de43c4e'/>
<id>urn:sha1:10b60eba9bc55449721db912fe75bab11de43c4e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives</title>
<updated>2024-02-16T20:02:50+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-02-16T20:02:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ec2cc761bc7067712ecc7734502f703fe3b024c8'/>
<id>urn:sha1:ec2cc761bc7067712ecc7734502f703fe3b024c8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add error code for missing base expression in struct update syntax</title>
<updated>2024-01-09T19:25:54+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2023-05-26T13:49:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f1b8b7d7ae190a9cfc14a9c6ac5e4f78445ade46'/>
<id>urn:sha1:f1b8b7d7ae190a9cfc14a9c6ac5e4f78445ade46</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support bare unit structs in destructuring assignments</title>
<updated>2023-12-08T19:55:07+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-12-08T19:54:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d473bdfdc3a2c377afd873abd4ace4244af80766'/>
<id>urn:sha1:d473bdfdc3a2c377afd873abd4ace4244af80766</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Show number in error message even for one error</title>
<updated>2023-11-24T18:15:52+00:00</updated>
<author>
<name>Nilstrieb</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-11-21T15:44:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=41e8d152dc5abb5a706999ada8b059d3420af8f3'/>
<id>urn:sha1:41e8d152dc5abb5a706999ada8b059d3420af8f3</id>
<content type='text'>
Co-authored-by: Adrian &lt;adrian.iosdev@gmail.com&gt;
</content>
</entry>
<entry>
<title>add more tests</title>
<updated>2023-07-17T22:06:32+00:00</updated>
<author>
<name>b-naber</name>
<email>b_naber@gmx.de</email>
</author>
<published>2023-07-17T21:58:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e1e755311a6ae8a3d15dff80851d00a8b2881d82'/>
<id>urn:sha1:e1e755311a6ae8a3d15dff80851d00a8b2881d82</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add test, bless tests</title>
<updated>2023-07-17T22:00:43+00:00</updated>
<author>
<name>b-naber</name>
<email>b_naber@gmx.de</email>
</author>
<published>2023-06-21T18:01:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e18e3761ced3695e9d7a920b223a49767dd4f1f6'/>
<id>urn:sha1:e18e3761ced3695e9d7a920b223a49767dd4f1f6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Provide RHS type hint when reporting operator error</title>
<updated>2023-04-27T01:34:03+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-04-27T00:57:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=015acc261101aa7efcd3b72c31ff5f320dda65e3'/>
<id>urn:sha1:015acc261101aa7efcd3b72c31ff5f320dda65e3</id>
<content type='text'>
</content>
</entry>
</feed>
