Skip to content

parse const trait Trait #143879

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

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

Conversation

fee1-dead
Copy link
Member

r? oli-obk or anyone from project-const-traits

cc @rust-lang/project-const-traits

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustc-dev-guide Area: rustc-dev-guide 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 13, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

HIR ty lowering was modified

cc @fmease

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

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

cc @rust-lang/rust-analyzer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@fee1-dead fee1-dead added the F-const_trait_impl `#![feature(const_trait_impl)]` label Jul 13, 2025
@rust-log-analyzer

This comment has been minimized.

@fee1-dead fee1-dead force-pushed the push-lrlpoouyqqry branch from fbc7508 to 49ab742 Compare July 13, 2025 12:08
@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Jul 13, 2025
@rust-log-analyzer

This comment has been minimized.

@fee1-dead fee1-dead force-pushed the push-lrlpoouyqqry branch from 49ab742 to 4e9b986 Compare July 13, 2025 14:24
@rust-log-analyzer

This comment has been minimized.

@fee1-dead fee1-dead force-pushed the push-lrlpoouyqqry branch from 4e9b986 to b782ee2 Compare July 13, 2025 15:54
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jul 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 13, 2025

This PR modifies run-make tests.

cc @jieyouxu

@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING] core::build_steps::tool::ToolBuild { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 9.470
[TIMING] core::build_steps::tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/tests/run-make/const-trait-stable-toolchain/rmake.rs:11:
         .env("RUSTC_BOOTSTRAP", "-1")
         .cfg("feature_enabled")
         .run_fail()
-        .assert_stderr_not_contains(
-            "as `const` to allow it to have `const` implementations",
-        )
+        .assert_stderr_not_contains("as `const` to allow it to have `const` implementations")
         .stderr_utf8();
     diff()
         .expected_file("const-super-trait-stable-enabled.stderr")
Diff in /checkout/tests/run-make/const-trait-stable-toolchain/rmake.rs:40:
         .env("RUSTC_BOOTSTRAP", "-1")
         .run_fail()
         .assert_stderr_not_contains("enable `#![feature(const_trait_impl)]` in your crate and mark")
-        .assert_stderr_not_contains(
-            "as `const` to allow it to have `const` implementations",
-        )
+        .assert_stderr_not_contains("as `const` to allow it to have `const` implementations")
         .stderr_utf8();
     diff()
         .expected_file("const-super-trait-stable-disabled.stderr")
fmt: checked 6159 files
Build completed unsuccessfully in 0:00:44
  local time: Sun Jul 13 15:59:29 UTC 2025
  network time: Sun, 13 Jul 2025 15:59:29 GMT
##[error]Process completed with exit code 1.

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

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

Comment on lines +881 to +882
|| self.check_keyword(exp!(Const)) && (self.is_keyword_ahead(1, &[kw::Trait])
|| self.is_keyword_ahead(1, &[kw::Unsafe]) && self.is_keyword_ahead(2, &[kw::Trait, kw::Auto]))
Copy link
Member

@fmease fmease Jul 13, 2025

Choose a reason for hiding this comment

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

This doesn't admit const auto trait Trait {}, it should tho (it already allows const unsafe auto trait Trait {}). Ofc for that const auto needs to be followed by trait so we don't regress const auto: () = ();.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! r=me after rebase, fmt fix and with nits addressed.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this file should be modified? This will just fail in r-a's repo after the sync bc r-a doesn't impl the new syntax (we currently don't run r-a's tests in r-l/r's CI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide F-const_trait_impl `#![feature(const_trait_impl)]` 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants