<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/lint/dead-code, branch lcnr/rustc-dev-guide</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=lcnr/rustc-dev-guide</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=lcnr/rustc-dev-guide'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-10T13:50:14+00:00</updated>
<entry>
<title>fix: re-enable self-assignment</title>
<updated>2025-08-10T13:50:14+00:00</updated>
<author>
<name>Lee ByeongJun</name>
<email>lbj199874@gmail.com</email>
</author>
<published>2025-08-10T13:50:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ba350ff9110de2c75dab1e9530b63898bdc10154'/>
<id>urn:sha1:ba350ff9110de2c75dab1e9530b63898bdc10154</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #143519 - mu001999-contrib:dead-code/impl-items, r=petrochenkov</title>
<updated>2025-07-13T13:15:57+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-07-13T13:15:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7e0721b79881fc9bddb713f7237e7dae132e9f79'/>
<id>urn:sha1:7e0721b79881fc9bddb713f7237e7dae132e9f79</id>
<content type='text'>
Check assoc consts and tys later like assoc fns

This PR
1. checks assoc consts and tys later like assoc fns
2. marks assoc consts appear in poly-trait-ref live

For assoc consts, considering
```rust
#![deny(dead_code)]

trait Tr { // ERROR trait `Tr` is never used
    const I: Self;
}

struct Foo; //~ ERROR struct `Foo` is never constructed

impl Tr for Foo {
    const I: Self = Foo;
}

fn main() {}
```

Current this will produce unused `I` instead of unused `Tr` and `Foo` ([play](https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2024&amp;gist=e0490d4a2d522cb70437b26e514a3d9c)), because `const I: Self = Foo;` will be added into the worklist at first:
```
error: associated constant `I` is never used
 --&gt; src/main.rs:4:11
  |
3 | trait Tr { // ERROR trait `Tr` is never used
  |       -- associated constant in this trait
4 |     const I: Self;
  |           ^
  |
note: the lint level is defined here
 --&gt; src/main.rs:1:9
  |
1 | #![deny(dead_code)]
  |         ^^^^^^^^^

error: could not compile `playground` (bin "playground") due to 1 previous error
```

This also happens to assoc tys, see the [new test](https://github.com/rust-lang/rust/compare/master...mu001999-contrib:rust:dead-code/impl-items?expand=1#diff-bf45fa403934a31c9d610a073ed2603d885e7e81572e8edf38b7f4e08a1f3531)

Fixes rust-lang/rust#126729

r? `````@petrochenkov`````
</content>
</entry>
<entry>
<title>Check assoc consts and tys later like assoc fns</title>
<updated>2025-07-10T15:39:54+00:00</updated>
<author>
<name>Mu001999</name>
<email>mu001999@outlook.com</email>
</author>
<published>2025-07-06T06:07:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=889582e704e516ab22a685711ef593a98fd9021a'/>
<id>urn:sha1:889582e704e516ab22a685711ef593a98fd9021a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make `Default` const and add some `const Default` impls</title>
<updated>2025-07-07T22:09:37+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-12-21T20:25:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c3301503b97cd6b768a944661b81a92994e9db00'/>
<id>urn:sha1:c3301503b97cd6b768a944661b81a92994e9db00</id>
<content type='text'>
Full list of `impl const Default` types:

- ()
- bool
- char
- Cell
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData&lt;T&gt;
- Option&lt;T&gt;
- std::iter::Empty&lt;T&gt;
- std::ptr::Alignment
- &amp;[T]
- &amp;mut [T]
- &amp;str
- &amp;mut str
- String
- Vec&lt;T&gt;
</content>
</entry>
<entry>
<title>Marks ADT live if it appears in pattern</title>
<updated>2025-06-14T05:44:43+00:00</updated>
<author>
<name>Mu001999</name>
<email>mu001999@outlook.com</email>
</author>
<published>2025-06-14T04:05:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=52167e04e62a84fe5073c4074733c72f96961ace'/>
<id>urn:sha1:52167e04e62a84fe5073c4074733c72f96961ace</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Always consider `const _` items as live for dead code analysis</title>
<updated>2025-06-09T13:48:06+00:00</updated>
<author>
<name>Urgau</name>
<email>urgau@numericable.fr</email>
</author>
<published>2025-06-08T18:36:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=33beaba7c8b78e9d4908e98dd1d6b4e15c6ba6f8'/>
<id>urn:sha1:33beaba7c8b78e9d4908e98dd1d6b4e15c6ba6f8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add test for issue 127911 and 128839</title>
<updated>2025-05-29T12:51:51+00:00</updated>
<author>
<name>Mu001999</name>
<email>mu001999@outlook.com</email>
</author>
<published>2025-05-29T12:51:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6eb601036859970c93c30781f6dfd1061a0c6737'/>
<id>urn:sha1:6eb601036859970c93c30781f6dfd1061a0c6737</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refactor the two-phase check for impls and impl items</title>
<updated>2025-05-27T14:03:21+00:00</updated>
<author>
<name>Mu001999</name>
<email>mu001999@outlook.com</email>
</author>
<published>2025-05-22T19:51:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f83ecd82701923c38f847d290a4e0859d8cf0126'/>
<id>urn:sha1:f83ecd82701923c38f847d290a4e0859d8cf0126</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Cleaned up 4 tests in `tests/ui/issues`</title>
<updated>2025-04-19T07:10:26+00:00</updated>
<author>
<name>Spencer</name>
<email>spencer3035@gmail.com</email>
</author>
<published>2025-04-16T03:06:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3eaa4b93684f10765ce9b8004fac461008ae678a'/>
<id>urn:sha1:3eaa4b93684f10765ce9b8004fac461008ae678a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: convert `tests/ui/lint/dead-code/self-assign.rs` to known-bug</title>
<updated>2025-04-13T09:33:55+00:00</updated>
<author>
<name>Jieyou Xu</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2025-04-13T09:33:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=16334cdfd4640dbae4c3f5699d4f81ae358c715f'/>
<id>urn:sha1:16334cdfd4640dbae4c3f5699d4f81ae358c715f</id>
<content type='text'>
</content>
</entry>
</feed>
