Skip to content

abby test DSL: AliasTyOutlivesViaEnv - #162290

Open
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:abby-test-dsl-aliases
Open

abby test DSL: AliasTyOutlivesViaEnv#162290
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:abby-test-dsl-aliases

Conversation

@khyperia

@khyperia khyperia commented Sep 4, 2026

Copy link
Copy Markdown
Member

fixes rust-lang/project-assumptions-on-binders#32

adds two new features to the testing DSL:

  • in test bodies, add where syntax. This is parsed as a standard where clause (reusing the parser's parse_where_clause) and goes through the full lowering machinery for various destructurings and whatnot, and goes through the register_obligation pipeline, rather than being directly inserted into constraint storage.
    • where syntax inside of or {} is not supported, nor is it supported inside of expect {}
  • in test bodies (including inside or {}) as well as inside expect {}, parse AliasTyOutlivesViaEnv constraints via the syntax for<> Some::Alias: 'a.

The second one is particularly boilerplate-y, due to needing to hook up a Binder, which needs a HirId and whatnot (this is TestBinderBoundTypeConstraint). Oh well.

r? @BoxyUwU

@rustbot

rustbot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 4, 2026
@rustbot

rustbot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

Comment thread compiler/rustc_ast/src/ast.rs Outdated
Comment thread compiler/rustc_hir/src/hir.rs Outdated
visitor: &mut V,
constraint: &'v TestBinderBoundTypeConstraint<'v>,
) -> V::Result {
let TestBinderBoundTypeConstraint { span: _, hir_id, params, lhs, rhs } = constraint;

@BoxyUwU BoxyUwU Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool that ur doing this destructuring :3

View changes since the review

Comment thread compiler/rustc_hir_analysis/src/check/wfcheck.rs Outdated
expected
&& let LeafRegionConstraint::AliasTyOutlivesViaEnv(actual, actual_span) = actual
{
let expected_anon = self.tcx().anonymize_bound_vars(expected);

@BoxyUwU BoxyUwU Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does make me wonder if actually construction of RegionConstraint should just anonymize bound vars 😅 though, worse for diagnostics :3

cc #t-types/trait-system-refactor > `hypospray-0.1.2` minimization @ 💬

I feel like we (people working on the type system) need to figure out how we can be erasing bound vars and getting alright diagnostics. cos not anonymizing bound vars everything is bad for perf and structural identity based things 🤔

Not something for this PR though, rust-lang/project-assumptions-on-binders#38

View changes since the review

Comment thread tests/ui/assumptions_on_binders/test-infra-works.rs Outdated
Comment thread compiler/rustc_ast/src/ast.rs Outdated
@khyperia
khyperia force-pushed the abby-test-dsl-aliases branch from 87b02ae to 3b87c57 Compare September 4, 2026 12:42
@BoxyUwU

BoxyUwU commented Sep 4, 2026

Copy link
Copy Markdown
Member

r=me when Ci is green

@BoxyUwU

BoxyUwU commented Sep 4, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3b87c57 has been approved by BoxyUwU

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 4, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…BoxyUwU

abby test DSL: AliasTyOutlivesViaEnv

fixes rust-lang/project-assumptions-on-binders#32

adds two new features to the testing DSL:

- in test bodies, add `where` syntax. This is parsed as a standard where clause (reusing the parser's `parse_where_clause`) and goes through the full lowering machinery for various destructurings and whatnot, and goes through the `register_obligation` pipeline, rather than being directly inserted into constraint storage.
  - `where` syntax inside of `or {}` is not supported, nor is it supported inside of `expect {}`
- in test bodies (including inside `or {}`) as well as inside `expect {}`, parse `AliasTyOutlivesViaEnv` constraints via the syntax `for<> Some::Alias: 'a`.

The second one is particularly boilerplate-y, due to needing to hook up a `Binder`, which needs a `HirId` and whatnot (this is `TestBinderBoundTypeConstraint`). Oh well.

r? @BoxyUwU
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…BoxyUwU

abby test DSL: AliasTyOutlivesViaEnv

fixes rust-lang/project-assumptions-on-binders#32

adds two new features to the testing DSL:

- in test bodies, add `where` syntax. This is parsed as a standard where clause (reusing the parser's `parse_where_clause`) and goes through the full lowering machinery for various destructurings and whatnot, and goes through the `register_obligation` pipeline, rather than being directly inserted into constraint storage.
  - `where` syntax inside of `or {}` is not supported, nor is it supported inside of `expect {}`
- in test bodies (including inside `or {}`) as well as inside `expect {}`, parse `AliasTyOutlivesViaEnv` constraints via the syntax `for<> Some::Alias: 'a`.

The second one is particularly boilerplate-y, due to needing to hook up a `Binder`, which needs a `HirId` and whatnot (this is `TestBinderBoundTypeConstraint`). Oh well.

r? @BoxyUwU
rust-bors Bot pushed a commit that referenced this pull request Sep 4, 2026
Rollup of 27 pull requests

Successful merges:

 - #159074 ([PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8))
 - #159792 (A more readable debug map for IndexMaps)
 - #160745 (make closures act like MaybeDangling)
 - #161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - #162030 (Prevent `--test` to be used in `rustdoc-html` testsuite)
 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162262 (Avoid manually instantiating some binders in error reporting with `-Znext-solver`)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162290 (abby test DSL: AliasTyOutlivesViaEnv)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 4, 2026
…BoxyUwU

abby test DSL: AliasTyOutlivesViaEnv

fixes rust-lang/project-assumptions-on-binders#32

adds two new features to the testing DSL:

- in test bodies, add `where` syntax. This is parsed as a standard where clause (reusing the parser's `parse_where_clause`) and goes through the full lowering machinery for various destructurings and whatnot, and goes through the `register_obligation` pipeline, rather than being directly inserted into constraint storage.
  - `where` syntax inside of `or {}` is not supported, nor is it supported inside of `expect {}`
- in test bodies (including inside `or {}`) as well as inside `expect {}`, parse `AliasTyOutlivesViaEnv` constraints via the syntax `for<> Some::Alias: 'a`.

The second one is particularly boilerplate-y, due to needing to hook up a `Binder`, which needs a `HirId` and whatnot (this is `TestBinderBoundTypeConstraint`). Oh well.

r? @BoxyUwU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support predicates as things to be proven in the testing DSL

3 participants