-
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
Enable type privacy lints in rustc #113284
Conversation
Some changes occurred in diagnostic error codes Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. |
This comment has been minimized.
This comment has been minimized.
@rustbot author |
Some changes occurred in src/tools/rust-analyzer cc @rust-lang/rust-analyzer |
unnameable_types
lint
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Blocked on #113637. |
This comment has been minimized.
This comment has been minimized.
@@ -1,5 +1,7 @@ | |||
//! Yet another index-based arena. | |||
|
|||
#![feature(type_privacy_lints)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust-analyzer must build on stable, so enabling feature gates is not an option.
From the examples in this PR it seems pretty clear to me that we should only report |
Also, #113637 has landed, so all |
Is |
@bjorn3
|
We cannot merge this until either #113702 is fixed, or |
@bjorn3 suggested using |
This comment has been minimized.
This comment has been minimized.
cc @davidtwco, @compiler-errors, @JohnTitor, @TaKO8Ki Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in need_type_info.rs cc @lcnr This PR changes Stable MIR Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
This comment has been minimized.
This comment has been minimized.
@@ -54,6 +54,8 @@ pub trait Value<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized { | |||
/// A thing that we can project into given *mutable* access to `ecx`, and that has a layout. | |||
/// This wouldn't have to depend on `Machine` but with the current type inference, | |||
/// that's just more convenient to work with (avoids repeating all the `Machine` bounds). | |||
#[allow(unnameable_types)] | |||
//~^ reachable at visibility `pub`, but can only be named at visibility `pub(interpret)` | |||
pub trait ValueMut<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an oversight, it should be reexported in interpret/mod.rs
like the Value
trait
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
@Bryanskiy FYI: when a PR is ready for review, send a message containing |
☔ The latest upstream changes (presumably #116196) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
privacy: Stabilize lint `unnameable_types` This is the last piece of ["RFC rust-lang#2145: Type privacy and private-in-public lints"](rust-lang#48054). Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (rust-lang#113284). The worst thing that may happen when a lint is removed are some `removed_lints` warnings, but I haven't heard anyone suggesting removing this specific lint. This lint is allow-by-default and is supposed to be enabled explicitly. Some false positives are expected, because sometimes unnameable types are a legitimate pattern. This lint also have some unnecessary false positives, that can be fixed - see rust-lang#120146 and rust-lang#120149. Closes rust-lang#48054.
Rollup merge of rust-lang#120144 - petrochenkov:unty, r=davidtwco privacy: Stabilize lint `unnameable_types` This is the last piece of ["RFC rust-lang#2145: Type privacy and private-in-public lints"](rust-lang#48054). Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (rust-lang#113284). The worst thing that may happen when a lint is removed are some `removed_lints` warnings, but I haven't heard anyone suggesting removing this specific lint. This lint is allow-by-default and is supposed to be enabled explicitly. Some false positives are expected, because sometimes unnameable types are a legitimate pattern. This lint also have some unnecessary false positives, that can be fixed - see rust-lang#120146 and rust-lang#120149. Closes rust-lang#48054.
Related to #113126 (comment).
r? @petrochenkov