Additionally gate negative bounds behind new -Zinternal-testing-features#156212
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| track_diagnostics: bool = (false, parse_bool, [UNTRACKED], | ||
| "tracks where in rustc a diagnostic was emitted"), | ||
| trait_solver_testing_features: bool = (false, parse_bool, [TRACKED], | ||
| "allow certain internal language features to be enabled that help exercise & test the trait solver"), |
There was a problem hiding this comment.
it's "allow […] to be enabled" not "allow" since it doesn't automatically allow negative bounds as they're still gated behind internal feature negative_bounds; it merely allows you to allow negative_bounds.
| track_diagnostics: bool = (false, parse_bool, [UNTRACKED], | ||
| "tracks where in rustc a diagnostic was emitted"), | ||
| trait_solver_testing_features: bool = (false, parse_bool, [TRACKED], | ||
| "allow certain internal language features to be enabled that help exercise & test the trait solver"), |
There was a problem hiding this comment.
I'm not saying "trait solvers", plural, so this description doesn't need to be updated when the next solver supersedes the old one.
There was a problem hiding this comment.
If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked.
This seems fine to me: simple and reasonable. But I'm not an expert on features (stable and unstable). Do you want to wait for (or request) feedback from additional people?
|
I like using the playground to experiment with all the crazy internal stuff. Will that no longer be possible with this? At least you can pass arguments on rust.godbolt.org, but stilll... Can we instead rename the feature gate to something like |
|
Interesting point which I do understand but on the other hand it would sadden me if playground limitations actively dictated how we design our internals. I also use the playground for experimenting with wacky features and for finding bugs from time to time (and it's easier to use on the phone compared to Godbolt last time I checked). In recent years however I almost always use my local machine for speed, access to IR-dumping I need to think on that. |
0f6b69b to
5105d28
Compare
cc @lcnr for visibility |
|
we could generalize this just to generally in favor, yeah |
|
r=me in its current form. I don't have strong opinions about the flag or feature name. Reusing the existing |
|
|
idk, going through my notifs this seems a bit ambiguously stuck. So I'd just go with "r=lcnr,nnethercote" no matter what name you choose |
5105d28 to
fcbfc8f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
-Ztrait-solver-testing-features-Zinternal-testing-features
|
Renamed to @bors r=lcnr,nnethercote rollup |
…, r=lcnr,nnethercote Additionally gate negative bounds behind new `-Zinternal-testing-features` Support for negative bounds (not to be confused with negative impls) was added in PR RUST-110791 (2023) for internal testing purposes only. In PR RUST-119354 (2023) I marked it internal. Moreover, we intentionally never advertise this feature and we declare it as *an internal-only feature for testing the trait solver* in the Unstable Book ([via](https://doc.rust-lang.org/unstable-book/language-features/negative-bounds.html#negative_bounds)). However, these measures didn't prevent someone from trying to use them in the public API of the stdlib[^1]! I can't blame them in the slightest: The stdlib uses unstable and internal features left and right, even in stable APIs. What's more, there's the sibling feature *negative impls* that obviously bears a similar name, is not internal and is used in stable APIs. I can see that it's easy to miss that their status differs so drastically. Well, I have to admit, it's unlikely that such a PR would ever pass review. However, there's a chance it might, I don't know. Last time it was me who caught it. I argue that "better docs" just wouldn't really help, a tidy rule would be too much effort & be too fragile and triagebot mentions would be the wrong tool for the job ([see also](rust-lang/triagebot#2182 (comment))) even if their functionality got extended. Therefore I've decided to additionally gate negative bounds behind a new `-Zinternal-testing-features` flag. This should be deterrent enough since surely nobody would modify the build flags for the stdlib I'm thinking and the name should scream "I'm unfit for general use". If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked. [^1]: This should go without saying but don't put any blame on individuals! Context: rust-lang#146668 (comment).
…, r=lcnr,nnethercote Additionally gate negative bounds behind new `-Zinternal-testing-features` Support for negative bounds (not to be confused with negative impls) was added in PR RUST-110791 (2023) for internal testing purposes only. In PR RUST-119354 (2023) I marked it internal. Moreover, we intentionally never advertise this feature and we declare it as *an internal-only feature for testing the trait solver* in the Unstable Book ([via](https://doc.rust-lang.org/unstable-book/language-features/negative-bounds.html#negative_bounds)). However, these measures didn't prevent someone from trying to use them in the public API of the stdlib[^1]! I can't blame them in the slightest: The stdlib uses unstable and internal features left and right, even in stable APIs. What's more, there's the sibling feature *negative impls* that obviously bears a similar name, is not internal and is used in stable APIs. I can see that it's easy to miss that their status differs so drastically. Well, I have to admit, it's unlikely that such a PR would ever pass review. However, there's a chance it might, I don't know. Last time it was me who caught it. I argue that "better docs" just wouldn't really help, a tidy rule would be too much effort & be too fragile and triagebot mentions would be the wrong tool for the job ([see also](rust-lang/triagebot#2182 (comment))) even if their functionality got extended. Therefore I've decided to additionally gate negative bounds behind a new `-Zinternal-testing-features` flag. This should be deterrent enough since surely nobody would modify the build flags for the stdlib I'm thinking and the name should scream "I'm unfit for general use". If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked. [^1]: This should go without saying but don't put any blame on individuals! Context: rust-lang#146668 (comment).
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #152852 (Remove driver_lint_caps) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #152852 (Remove driver_lint_caps) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
…, r=lcnr,nnethercote Additionally gate negative bounds behind new `-Zinternal-testing-features` Support for negative bounds (not to be confused with negative impls) was added in PR RUST-110791 (2023) for internal testing purposes only. In PR RUST-119354 (2023) I marked it internal. Moreover, we intentionally never advertise this feature and we declare it as *an internal-only feature for testing the trait solver* in the Unstable Book ([via](https://doc.rust-lang.org/unstable-book/language-features/negative-bounds.html#negative_bounds)). However, these measures didn't prevent someone from trying to use them in the public API of the stdlib[^1]! I can't blame them in the slightest: The stdlib uses unstable and internal features left and right, even in stable APIs. What's more, there's the sibling feature *negative impls* that obviously bears a similar name, is not internal and is used in stable APIs. I can see that it's easy to miss that their status differs so drastically. Well, I have to admit, it's unlikely that such a PR would ever pass review. However, there's a chance it might, I don't know. Last time it was me who caught it. I argue that "better docs" just wouldn't really help, a tidy rule would be too much effort & be too fragile and triagebot mentions would be the wrong tool for the job ([see also](rust-lang/triagebot#2182 (comment))) even if their functionality got extended. Therefore I've decided to additionally gate negative bounds behind a new `-Zinternal-testing-features` flag. This should be deterrent enough since surely nobody would modify the build flags for the stdlib I'm thinking and the name should scream "I'm unfit for general use". If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked. [^1]: This should go without saying but don't put any blame on individuals! Context: rust-lang#146668 (comment).
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
Rollup of 24 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #155299 (make repr_transparent_non_zst_fields a hard error) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - #155113 (Ensure Send/Sync impl for std::process::CommandArgs) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157723 (Move uninhabited unreachable code lint to rustc_mir_transform) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
Rollup merge of #156212 - fmease:double-gate-negative-bounds, r=lcnr,nnethercote Additionally gate negative bounds behind new `-Zinternal-testing-features` Support for negative bounds (not to be confused with negative impls) was added in PR RUST-110791 (2023) for internal testing purposes only. In PR RUST-119354 (2023) I marked it internal. Moreover, we intentionally never advertise this feature and we declare it as *an internal-only feature for testing the trait solver* in the Unstable Book ([via](https://doc.rust-lang.org/unstable-book/language-features/negative-bounds.html#negative_bounds)). However, these measures didn't prevent someone from trying to use them in the public API of the stdlib[^1]! I can't blame them in the slightest: The stdlib uses unstable and internal features left and right, even in stable APIs. What's more, there's the sibling feature *negative impls* that obviously bears a similar name, is not internal and is used in stable APIs. I can see that it's easy to miss that their status differs so drastically. Well, I have to admit, it's unlikely that such a PR would ever pass review. However, there's a chance it might, I don't know. Last time it was me who caught it. I argue that "better docs" just wouldn't really help, a tidy rule would be too much effort & be too fragile and triagebot mentions would be the wrong tool for the job ([see also](rust-lang/triagebot#2182 (comment))) even if their functionality got extended. Therefore I've decided to additionally gate negative bounds behind a new `-Zinternal-testing-features` flag. This should be deterrent enough since surely nobody would modify the build flags for the stdlib I'm thinking and the name should scream "I'm unfit for general use". If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked. [^1]: This should go without saying but don't put any blame on individuals! Context: #146668 (comment).
Rollup of 24 pull requests Successful merges: - rust-lang/rust#157716 (update Enzyme, June'26) - rust-lang/rust#149793 (Add inline asm support for amdgpu) - rust-lang/rust#155299 (make repr_transparent_non_zst_fields a hard error) - rust-lang/rust#157612 (Add a test where subtyping inhibits coercion.) - rust-lang/rust#157626 (Autogenerate unstable compiler flag stubs for unstable-book) - rust-lang/rust#157667 (Rename typing modes to better describe real usage) - rust-lang/rust#149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - rust-lang/rust#155113 (Ensure Send/Sync impl for std::process::CommandArgs) - rust-lang/rust#156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - rust-lang/rust#157342 (Reduce verbosity of cycle errors when possible) - rust-lang/rust#157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - rust-lang/rust#157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - rust-lang/rust#157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - rust-lang/rust#157698 (Remove an unnecessary cloning) - rust-lang/rust#157699 (Arg splat experiment - hir FnDecl impl) - rust-lang/rust#157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - rust-lang/rust#157722 (Move create_scope_map to rustc_codegen_ssa.) - rust-lang/rust#157723 (Move uninhabited unreachable code lint to rustc_mir_transform) - rust-lang/rust#157725 (Keep generic suggestion for macro-expanded missing-type items) - rust-lang/rust#157733 (Remove old FIXMEs about nocapture attribute) - rust-lang/rust#157737 (Reorganize `tests/ui/issues` [7/N]) - rust-lang/rust#157746 (supports_c_variadic_definitions: extend checklist for new targets) - rust-lang/rust#157763 (Move unused target expression error to appropriate place and rename it) - rust-lang/rust#157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
Support for negative bounds (not to be confused with negative impls) was added in PR RUST-110791 (2023) for internal testing purposes only.
In PR RUST-119354 (2023) I marked it internal. Moreover, we intentionally never advertise this feature and we declare it as an internal-only feature for testing the trait solver in the Unstable Book (via).
However, these measures didn't prevent someone from trying to use them in the public API of the stdlib1! I can't blame them in the slightest: The stdlib uses unstable and internal features left and right, even in stable APIs. What's more, there's the sibling feature negative impls that obviously bears a similar name, is not internal and is used in stable APIs. I can see that it's easy to miss that their status differs so drastically.
Well, I have to admit, it's unlikely that such a PR would ever pass review. However, there's a chance it might, I don't know. Last time it was me who caught it.
I argue that "better docs" just wouldn't really help, a tidy rule would be too much effort & be too fragile and triagebot mentions would be the wrong tool for the job (see also) even if their functionality got extended.
Therefore I've decided to additionally gate negative bounds behind a new
-Zinternal-testing-featuresflag. This should be deterrent enough since surely nobody would modify the build flags for the stdlib I'm thinking and the name should scream "I'm unfit for general use".If y'all disagree with the hypothesis and the solution, please voice your concern! I'm fine with retracting this PR if it's not liked.
Footnotes
This should go without saying but don't put any blame on individuals! Context: https://github.com/rust-lang/rust/pull/146668#issuecomment-3303881805. ↩