Skip to content

abby DSL: change where syntax to predicates - #163927

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:abby-dsl-predicates-syntax
Oct 7, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:abby-dsl-predicates-syntax

Conversation

@khyperia

@khyperia khyperia commented Oct 7, 2026

Copy link
Copy Markdown
Member

Fixes rust-lang/project-assumptions-on-binders#53

The where syntax was very confusing, and caused at least one instance of bringing folks up to speed on abby being made more difficult due to the bad syntax:

core::test_binder_constraints! {
    impl {
        forall<'a, 'b> where 'a: 'b {
            where 'a: 'b
        }
    }
}

The two where here mean VERY different things. This PR changes the second one to be predicates. The name sucks, but Boxy and I bikeshedded for ages and couldn't come up with anything better.

The only reason it was done this way was because the parser has self.eat_keyword(exp!(Where)) baked into parse_where_clause_common and it was vaguely annoying to refactor to reuse it with a different syntax. This PR does the vaguely annoying refactor.

r? @BoxyUwU

@rustbot

rustbot commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 7, 2026

// We are considering adding generics to the `where` keyword as an alternative higher-rank
// parameter syntax (as in `where<'a>` or `where<T>`. To avoid that being a breaking
// change we parse those generics now, but report an error.

@BoxyUwU BoxyUwU Oct 7, 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.

cc @fmease
random extra parsed syntax that seems unnecessary (I don't think we are planning to do this?)

View changes since the review

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.

Yeah, that's been reserved since 2016 (PR #38268). Would need a T-lang+T-types FCP to unreserve.

@BoxyUwU

BoxyUwU commented Oct 7, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

I generally dont want to complicate compiler parsing code just for abby's testing DSL but this seems like a nice cleanup anyway so :3

@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4d4ca08 has been tentatively approved by BoxyUwU

It will be put into the queue for this repository once PR CI succeeds.

@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 Oct 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 7, 2026
…x, r=BoxyUwU

abby DSL: change `where` syntax to `predicates`

Fixes rust-lang/project-assumptions-on-binders#53

The `where` syntax was very confusing, and caused at least one instance of bringing folks up to speed on abby being made more difficult due to the bad syntax:

```rust
core::test_binder_constraints! {
    impl {
        forall<'a, 'b> where 'a: 'b {
            where 'a: 'b
        }
    }
}
```

The two `where` here mean VERY different things. This PR changes the second one to be `predicates`. The name sucks, but Boxy and I bikeshedded for ages and couldn't come up with anything better.

The only reason it was done this way was because the parser has `self.eat_keyword(exp!(Where))` baked into `parse_where_clause_common` and it was vaguely annoying to refactor to reuse it with a different syntax. This PR does the vaguely annoying refactor.

r? @BoxyUwU
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #163887 (Remove `NonOwner` variant from `AstOwner`)
 - #163892 (add revisions for `pass -> [err|ICE]` ui tests `-Znext-solver` )
 - #162156 (add IBM f128 type)
 - #163925 (Submodule update of rustc-perf)
 - #163658 ([PAC] Stop hard coding key and discriminator, consult schema instead)
 - #163854 (Include offset in the alignment check when creating ConstValue::Indirect in GVN)
 - #163874 (explicitly check for fresh vars in canonicalize)
 - #163880 (Don't add pkgs.rustc to PATH in nix dev shell)
 - #163893 (Panic on `StableHash` of a `Path` with `GenericArgs`)
 - #163894 (revisions for TAIT in env bug)
 - #163902 (Clean up Reference annotations that drifted)
 - #163905 (Remove redundant closure in bootstrap)
 - #163921 (abby DSL: implement ambiguity)
 - #163927 (abby DSL: change `where` syntax to `predicates`)
 - #163933 (Add `synchronization` import lib to windows-gnullvm dist)
 - #163937 (Abby test DSL: dont ICE on foralls with unused bound vars)

> [!WARNING]
> This rollup conflicts with pending auto build #163934 and may need to be recreated if the pending build succeeds.
@rust-bors
rust-bors Bot merged commit 1d98298 into rust-lang:main Oct 7, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
Rollup merge of #163927 - khyperia:abby-dsl-predicates-syntax, r=BoxyUwU

abby DSL: change `where` syntax to `predicates`

Fixes rust-lang/project-assumptions-on-binders#53

The `where` syntax was very confusing, and caused at least one instance of bringing folks up to speed on abby being made more difficult due to the bad syntax:

```rust
core::test_binder_constraints! {
    impl {
        forall<'a, 'b> where 'a: 'b {
            where 'a: 'b
        }
    }
}
```

The two `where` here mean VERY different things. This PR changes the second one to be `predicates`. The name sucks, but Boxy and I bikeshedded for ages and couldn't come up with anything better.

The only reason it was done this way was because the parser has `self.eat_keyword(exp!(Where))` baked into `parse_where_clause_common` and it was vaguely annoying to refactor to reuse it with a different syntax. This PR does the vaguely annoying refactor.

r? @BoxyUwU
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Oct 8, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#163887 (Remove `NonOwner` variant from `AstOwner`)
 - rust-lang/rust#163892 (add revisions for `pass -> [err|ICE]` ui tests `-Znext-solver` )
 - rust-lang/rust#162156 (add IBM f128 type)
 - rust-lang/rust#163925 (Submodule update of rustc-perf)
 - rust-lang/rust#163658 ([PAC] Stop hard coding key and discriminator, consult schema instead)
 - rust-lang/rust#163854 (Include offset in the alignment check when creating ConstValue::Indirect in GVN)
 - rust-lang/rust#163874 (explicitly check for fresh vars in canonicalize)
 - rust-lang/rust#163880 (Don't add pkgs.rustc to PATH in nix dev shell)
 - rust-lang/rust#163893 (Panic on `StableHash` of a `Path` with `GenericArgs`)
 - rust-lang/rust#163894 (revisions for TAIT in env bug)
 - rust-lang/rust#163902 (Clean up Reference annotations that drifted)
 - rust-lang/rust#163905 (Remove redundant closure in bootstrap)
 - rust-lang/rust#163921 (abby DSL: implement ambiguity)
 - rust-lang/rust#163927 (abby DSL: change `where` syntax to `predicates`)
 - rust-lang/rust#163933 (Add `synchronization` import lib to windows-gnullvm dist)
 - rust-lang/rust#163937 (Abby test DSL: dont ICE on foralls with unused bound vars)

> [!WARNING]
> This rollup conflicts with pending auto build #163934 and may need to be recreated if the pending build succeeds.
@khyperia
khyperia deleted the abby-dsl-predicates-syntax branch October 8, 2026 05:07
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Oct 8, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#163887 (Remove `NonOwner` variant from `AstOwner`)
 - rust-lang/rust#163892 (add revisions for `pass -> [err|ICE]` ui tests `-Znext-solver` )
 - rust-lang/rust#162156 (add IBM f128 type)
 - rust-lang/rust#163925 (Submodule update of rustc-perf)
 - rust-lang/rust#163658 ([PAC] Stop hard coding key and discriminator, consult schema instead)
 - rust-lang/rust#163854 (Include offset in the alignment check when creating ConstValue::Indirect in GVN)
 - rust-lang/rust#163874 (explicitly check for fresh vars in canonicalize)
 - rust-lang/rust#163880 (Don't add pkgs.rustc to PATH in nix dev shell)
 - rust-lang/rust#163893 (Panic on `StableHash` of a `Path` with `GenericArgs`)
 - rust-lang/rust#163894 (revisions for TAIT in env bug)
 - rust-lang/rust#163902 (Clean up Reference annotations that drifted)
 - rust-lang/rust#163905 (Remove redundant closure in bootstrap)
 - rust-lang/rust#163921 (abby DSL: implement ambiguity)
 - rust-lang/rust#163927 (abby DSL: change `where` syntax to `predicates`)
 - rust-lang/rust#163933 (Add `synchronization` import lib to windows-gnullvm dist)
 - rust-lang/rust#163937 (Abby test DSL: dont ICE on foralls with unused bound vars)

> [!WARNING]
> This rollup conflicts with pending auto build #163934 and may need to be recreated if the pending build succeeds.
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Oct 9, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#163887 (Remove `NonOwner` variant from `AstOwner`)
 - rust-lang/rust#163892 (add revisions for `pass -> [err|ICE]` ui tests `-Znext-solver` )
 - rust-lang/rust#162156 (add IBM f128 type)
 - rust-lang/rust#163925 (Submodule update of rustc-perf)
 - rust-lang/rust#163658 ([PAC] Stop hard coding key and discriminator, consult schema instead)
 - rust-lang/rust#163854 (Include offset in the alignment check when creating ConstValue::Indirect in GVN)
 - rust-lang/rust#163874 (explicitly check for fresh vars in canonicalize)
 - rust-lang/rust#163880 (Don't add pkgs.rustc to PATH in nix dev shell)
 - rust-lang/rust#163893 (Panic on `StableHash` of a `Path` with `GenericArgs`)
 - rust-lang/rust#163894 (revisions for TAIT in env bug)
 - rust-lang/rust#163902 (Clean up Reference annotations that drifted)
 - rust-lang/rust#163905 (Remove redundant closure in bootstrap)
 - rust-lang/rust#163921 (abby DSL: implement ambiguity)
 - rust-lang/rust#163927 (abby DSL: change `where` syntax to `predicates`)
 - rust-lang/rust#163933 (Add `synchronization` import lib to windows-gnullvm dist)
 - rust-lang/rust#163937 (Abby test DSL: dont ICE on foralls with unused bound vars)

> [!WARNING]
> This rollup conflicts with pending auto build #163934 and may need to be recreated if the pending build succeeds.
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-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.

use a different syntax for predicates in testing DSL

4 participants