-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: missing_debug_implementations linting on private items when used as parameter in trait impl #111359
Comments
searched nightlies: from nightly-2023-05-05 to nightly-2023-05-07 bisected with cargo-bisect-rustc v0.6.6Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start 2023-05-05 --end 2023-05-07 -- check --no-default-features |
Regression comes from #110907 |
The issue is that |
This works around the `missing_debug_implementations` regression in rust-lang/rust#111359 . I don't know if that will be fixed soon; I spent some time investigating it and have an idea of what's going on but not enough to fix it (and don't want to spend more time on this right now). So for now, let's just listen to the lint and add these impls.
In theory #110907 wasn't supposed to change the algorithm, only to make the collected data more detailed. cc @Bryanskiy, we need to figure out why there's a difference. |
Type inference is sometimes smarter than you'd expect, see e.g. examples in #57344, so we may have to conservatively consider generic arguments of impls as reachable. |
In general, the reachable set is an upper limit rather than something that can be determined precisely, so we can overshoot slightly (or not so slightly in cases where macros 2.0 are in scope), so lints based on it should generally be ready to require doc comments / stability attributes / copy or debug imps on items where they are not strictly necessary. |
Yeah, that seems fair. Stepping back, perhaps the question becomes: should this lint be really dealing with reachability or actual "intentional" publicity? |
Reachable means "objects of this type may be accessible to other crates, even if the type itself cannot be named", so it's also public of sorts, and you may want to pass such objects to |
This works around the `missing_debug_implementations` regression in rust-lang/rust#111359 . I don't know if that will be fixed soon; I spent some time investigating it and have an idea of what's going on but not enough to fix it (and don't want to spend more time on this right now). So for now, let's just listen to the lint and add these impls.
Yes, I understand, this is why I am talking about "intentional" publicity. Such types may end up being passed to |
This should be fixed in #111425, by restricting the lint to nominally |
Thanks! |
I found this issue while reviewing newly-occurring-on-nightly lints in my code, and I observe that: The documentation of |
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items. I encountered rust-lang#111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition. I chose the words to also be similar to `missing_docs` which already had such a remark.
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items. I encountered rust-lang#111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition. I chose the words to also be similar to `missing_docs` which already had such a remark.
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items. I encountered rust-lang#111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition. I chose the words to also be similar to `missing_docs` which already had such a remark.
Populate effective visibilities in `rustc_privacy` (take 2) Same as rust-lang/rust#110907 + regressions fixes. Fixes rust-lang/rust#111359. r? `@petrochenkov`
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items. I encountered rust-lang#111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition. I chose the words to also be similar to `missing_docs` which already had such a remark.
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items. I encountered rust-lang#111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition. I chose the words to also be similar to `missing_docs` which already had such a remark.
Populate effective visibilities in `rustc_privacy` (take 2) Same as rust-lang/rust#110907 + regressions fixes. Fixes rust-lang/rust#111359. r? `@petrochenkov`
(As a lint regression it is not a true "breaking" regression, but it's still strange behavior, categorizing as a regression.)
Code
(Also reproducible with
cargo check --no-default-features
in https://github.com/unicode-org/icu4x/tree/3a00b1efc12d8fac2aa84b04f85508e3b75bca4c/provider/datagen)Version it worked on
It most recently worked on: nightly-2023-05-06
Version with regression
rustc --version
: nightly-2023-05-07The text was updated successfully, but these errors were encountered: