<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_builtin_macros/src/deriving/default.rs, branch try-perf</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try-perf</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try-perf'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-09T07:47:01+00:00</updated>
<entry>
<title>remove `P`</title>
<updated>2025-08-09T07:47:01+00:00</updated>
<author>
<name>Deadbeef</name>
<email>ent3rm4n@gmail.com</email>
</author>
<published>2025-08-09T05:24:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ad1113f87ef828b300ebb8fca397efd358580da3'/>
<id>urn:sha1:ad1113f87ef828b300ebb8fca397efd358580da3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make `derive_const` usable within libcore again</title>
<updated>2025-07-17T15:42:54+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-07-11T10:20:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=250648e871c1e685f09427bd31fd399090f15640'/>
<id>urn:sha1:250648e871c1e685f09427bd31fd399090f15640</id>
<content type='text'>
Also make it *only* usable on nightly
</content>
</entry>
<entry>
<title>Rustfmt</title>
<updated>2025-02-08T22:12:13+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-08T22:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fcae03369abb4c2cc180cd5a49e1f4440a81300'/>
<id>urn:sha1:1fcae03369abb4c2cc180cd5a49e1f4440a81300</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove Rustc{En,De}codable from library and compiler</title>
<updated>2025-01-14T15:16:38+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-01-07T17:28:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9ac62f972fd47705f9d229e854772194565071eb'/>
<id>urn:sha1:9ac62f972fd47705f9d229e854772194565071eb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use E0665 for missing `#[default]` error</title>
<updated>2024-12-21T19:14:58+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-12-21T02:43:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94812f1c8f455579a3a1c127c2bbac48fc7cecef'/>
<id>urn:sha1:94812f1c8f455579a3a1c127c2bbac48fc7cecef</id>
<content type='text'>
Use orphaned error code for the same error it belonged to before.

```
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
  --&gt; $DIR/macros-nonfatal-errors.rs:42:10
   |
LL |   #[derive(Default)]
   |            ^^^^^^^
LL | / enum NoDeclaredDefault {
LL | |     Foo,
LL | |     Bar,
LL | | }
   | |_- this enum needs a unit variant marked with `#[default]`
   |
   = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Foo,
   |     ~~~~~~~~~~~~~~
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Bar,
   |     ~~~~~~~~~~~~~~
```
</content>
</entry>
<entry>
<title>Re-export more `rustc_span::symbol` things from `rustc_span`.</title>
<updated>2024-12-18T02:38:53+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-12T23:29:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2620eb42d72d24baa1ca1056a769862b92c85f7f'/>
<id>urn:sha1:2620eb42d72d24baa1ca1056a769862b92c85f7f</id>
<content type='text'>
`rustc_span::symbol` defines some things that are re-exported from
`rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some
closely related things such as `Ident` and `kw`. So you can do `use
rustc_span::{Symbol, sym}` but you have to do `use
rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good
reason.

This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`,
and changes many `rustc_span::symbol::` qualifiers in `compiler/` to
`rustc_span::`. This is a 200+ net line of code reduction, mostly
because many files with two `use rustc_span` items can be reduced to
one.
</content>
</entry>
<entry>
<title>Disallow `#[default] Variant {}` regardless of feature flag</title>
<updated>2024-12-09T21:55:13+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-12-06T19:50:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2d6e763cc68b2433b9df33da2a80dc4cf4953079'/>
<id>urn:sha1:2d6e763cc68b2433b9df33da2a80dc4cf4953079</id>
<content type='text'>
</content>
</entry>
<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>Pass Ident by reference in ast Visitor</title>
<updated>2024-10-24T14:10:49+00:00</updated>
<author>
<name>maxcabrajac</name>
<email>max@cabrajac.com</email>
</author>
<published>2024-10-24T13:41:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=64a34518356426beb5ab8f89c2ef754f3ac03614'/>
<id>urn:sha1:64a34518356426beb5ab8f89c2ef754f3ac03614</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
</feed>
