Rollup of 6 pull requests#155297
Closed
JonathanBrouwer wants to merge 15 commits intorust-lang:mainfrom
Closed
Conversation
This especially means that for c: char, c.is_ascii() && c.is_whitespace() does **not** imply c.is_ascii_whitespace().
…min_adt_const_params`
* Fix ICE when Self is used in enum discriminant of a generic enum Move the validation into the existing `check_param_uses_if_mcg` machinery in HIR ty lowering instead of adding a new check in wfcheck. After the `AnonConstKind` refactoring, `ForbidMCGParamUsesFolder` was only gated on `AnonConstKind::MCG`, causing discriminant anon consts (`NonTypeSystem`) to bypass it entirely. Add `anon_const_forbids_generic_params()` which returns the appropriate `ForbidParamContext` for both MCG and enum discriminant contexts. Wire it into `check_param_uses_if_mcg` so that `Self` aliasing a generic type is caught before reaching `const_eval_poly`. Convert the `TooGeneric` span_bug into a proper diagnostic as a fallback for anything slipping through type-dependent path resolution. * Address review comments - Rename `ForbidMCGParamUsesFolder` to `ForbidParamUsesFolder` - Rename `MinConstGenerics` variant to `ConstArgument` with updated doc - Simplify doc comment on `anon_const_forbids_generic_params` - Make match on `AnonConstKind` exhaustive - Move `anon_const_def_id` inside the `if let` in `check_param_uses_if_mcg` - Remove now-unreachable `TooGeneric` span_err in wfcheck * Revert TooGeneric arm back to span_bug! as requested by reviewer * Use generics_of to determine if NonTypeSystem anon consts allow generic params * Also check InlineConst and Closure defs nested in enum discriminants * Simplify logic for determining anonymous constant parent in generic contexts * add test
…ate, r=BoxyUwU Add `const_param_ty_unchecked` gate Add `const_param_ty_unchecked` internal feature gate to skip `ConstParamTy_` trait enforcement on type. Provides an escape hatch for writing tests and examples that use const generics without needing to ensure all fields implement `ConstParamTy_`. r? BoxyUwU
…eric-self, r=BoxyUwU Fix ICE when Self is used in enum discriminant of a generic enum Fixes rust-lang#153756 Let discriminant AnonConst inherit parent generics via Node::Variant in generics_of, and emit a proper error instead of span_bug! for the TooGeneric case in wfcheck.
…=BoxyUwU Gate tuple const params behind `min_adt_const_params` feature r? BoxyUwU
…-Simulacrum,WaffleLapkin Clarify ascii whitespace exclusion of vertical tab in the doc This especially means that for `c: char`, `c.is_ascii() && c.is_whitespace()` does **not** imply `c.is_ascii_whitespace()`, which can cause bug and is highly counterintuitive.
…nup, r=lcnr Some small nits for supertrait_item_shadowing, and additional testing cc rust-lang#89151 r? types
…rn-white-space, r=jdonszelmann Test/lexer unicode pattern white space This PR adds a test for the Rust lexer to verify it correctly accepts vertical tab (`\x0B`) as valid whitespace between tokens. Vertical tab is part of Unicode Pattern_White_Space, which the Rust language specification uses to define whitespace. Related: Outreachy tracking [Pattern_White_Space](https://www.unicode.org/reports/tr31/#R3a)
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
const_param_ty_uncheckedgate #153536 (Addconst_param_ty_uncheckedgate)min_adt_const_paramsfeature #154882 (Gate tuple const params behindmin_adt_const_paramsfeature)r? @ghost
Create a similar rollup