Skip to content
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

Implement #[cfg] in where clauses #132388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frank-king
Copy link
Contributor

This PR implements #115590, which supports #[cfg] attributes in where clauses.

The biggest change is, that it adds AttrsVec and NodeId to the ast::WherePredicate and HirId to the hir::WherePredicate.

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2024

r? @cjgillot

rustbot has assigned @cjgillot.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 31, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2024

HIR ty lowering was modified

cc @fmease

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

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

Thanks @frank-king for the work. I haven't looked deeply into the parser code yet, I need to familiarize myself with it first.

compiler/rustc_ast/src/ast.rs Outdated Show resolved Hide resolved
compiler/rustc_ast/src/mut_visit.rs Outdated Show resolved Hide resolved
compiler/rustc_ast/src/mut_visit.rs Outdated Show resolved Hide resolved
compiler/rustc_ast/src/visit.rs Show resolved Hide resolved
compiler/rustc_ast_lowering/src/index.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/expand.rs Outdated Show resolved Hide resolved
compiler/rustc_hir/src/hir.rs Outdated Show resolved Hide resolved
compiler/rustc_hir/src/intravisit.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
compiler/rustc_expand/src/expand.rs Outdated Show resolved Hide resolved
@tgross35 tgross35 changed the title Implment #[cfg] in where clauses Implement #[cfg] in where clauses Oct 31, 2024
@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

I've opened #132894 for that refactoring.

Blocked on #132894.
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2024
@petrochenkov petrochenkov self-assigned this Nov 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 22, 2024
…=<try>

Refactor `where` predicates, and reserve for attributes support

Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates.

This is a part of rust-lang#115590 and is split from rust-lang#132388.

r? petrochenkov
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 26, 2024
…=cjgillot

Refactor `where` predicates, and reserve for attributes support

Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates.

This is a part of rust-lang#115590 and is split from rust-lang#132388.

r? petrochenkov
@rustbot
Copy link
Collaborator

rustbot commented Nov 26, 2024

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

@rust-log-analyzer

This comment has been minimized.

@frank-king
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Nov 26, 2024
tuple_struct_body = Some(body);
break;
let predicate =
self.collect_tokens(None, attrs, ForceCollect::Yes, |this, attrs| {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.collect_tokens(None, attrs, ForceCollect::Yes, |this, attrs| {
self.collect_tokens(None, attrs, ForceCollect::No, |this, attrs| {

@petrochenkov
Copy link
Contributor

(I didn't finish the full review yet.)

@cjgillot cjgillot removed their assignment Dec 2, 2024
@bors
Copy link
Contributor

bors commented Dec 10, 2024

☔ The latest upstream changes (presumably #129514) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants