Skip to content

Disallow ambiguous attributes on expressions (take 2) - #160235

Open
petrochenkov wants to merge 1 commit into
rust-lang:mainfrom
petrochenkov:ambattr2
Open

Disallow ambiguous attributes on expressions (take 2)#160235
petrochenkov wants to merge 1 commit into
rust-lang:mainfrom
petrochenkov:ambattr2

Conversation

@petrochenkov

Copy link
Copy Markdown
Contributor

Previous reverted attempt - #124099.
cc #159581

TODO:

@rustbot

rustbot commented Jul 30, 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 Jul 30, 2026
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 16 candidates

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [codegen] tests/codegen-llvm/loop-attrs/unroll-loop-metadata.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: suspicious attribute: parse_expr_assoc_rest_with rhs
##[error]  --> /checkout/tests/codegen-llvm/loop-attrs/unroll-loop-metadata.rs:53:24
   |
53 |     let _return = (1 + #[unroll(never)]
   |                        ^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/codegen-llvm/loop-attrs/unroll-loop-metadata.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=wasm32-wasip1" "--check-cfg" "cfg(test,FALSE)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "--emit" "llvm-ir" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/loop-attrs/unroll-loop-metadata/unroll-loop-metadata.ll" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-O" "-Cno-prepopulate-passes"
stdout: none
--- stderr -------------------------------
error: suspicious attribute: parse_expr_assoc_rest_with rhs
##[error]  --> /checkout/tests/codegen-llvm/loop-attrs/unroll-loop-metadata.rs:53:24
   |
53 |     let _return = (1 + #[unroll(never)]
   |                        ^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error
------------------------------------------

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants