diff options
| author | bors <bors@rust-lang.org> | 2023-07-02 21:12:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-02 21:12:10 +0000 |
| commit | 4752466c8e8fb960b13fd2297e3a3cc5b13aa0c7 (patch) | |
| tree | 9bc8bd2b2a680933983991cb2ca2fbb053818d8d /library/std/src/sys/unix/stack_overflow.rs | |
| parent | ea4ca225fb3b22ea8c7dbc0cde87b29f003d85e6 (diff) | |
| parent | 555ceb83fefc937e03bade598b608b76700234cb (diff) | |
| download | rust-4752466c8e8fb960b13fd2297e3a3cc5b13aa0c7.tar.gz rust-4752466c8e8fb960b13fd2297e3a3cc5b13aa0c7.zip | |
Auto merge of #11069 - y21:issue11063, r=Alexendoo
[`missing_fields_in_debug`]: make sure self type is an adt Fixes #11063, another ICE that can only happen in core. This lint needs the `DefId` of the implementor to get its fields, but that ICEs if the implementor does not have a `DefId` (as is the case with primitive types, e.g. `impl Debug for bool`), which is where this ICE comes from. This PR changes the check I added in #10897 to be more... robust against `Debug` implementations we don't want to lint. Instead of just checking if the self type is a type parameter and "special casing" one specific case we don't want to lint, we should probably rather just check that the self type is either a struct, an enum or a union and only then continue. That prevents weird edge cases like this one that can only happen in core. Again, I don't know if it's even possible to add a test case for this since one cannot implement `Debug` for primitive types outside of the crate that defined `Debug` (core). I did make sure that this PR no longer ICEs on `impl<T> Debug for T` and `impl Debug for bool`. Maybe writing such a test is possible with `#![no_core]` and then re-defining the `Debug` trait or something like that...? changelog: [`missing_fields_in_debug`]: make sure self type is an adt (fixes an ICE in core) r? `@Alexendoo` (reviewed the last PRs for this lint)
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
