Skip to content

Conversation

yaahc
Copy link
Member

@yaahc yaahc commented Oct 15, 2025

Addresses #79260

r? @petrochenkov

@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

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

cc @jdonszelmann

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 15, 2025
/// * A trait or an enum (it implicitly contains associated types, methods and variant
/// constructors).
Def(DefKind, DefId, Option<Symbol>),
Def(DefKind, DefId, Option<(Symbol, bool)>),
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the most obvious place to put this but it doesn't feel great, don't love all the places where I changed shit to name_and_transparent, open to suggestions for how to better thread this information through

Comment on lines +257 to +262
// Inner module is inside the macro
&& module.expansion != parent.expansion
// Parent module is outside of the macro
&& module.expansion.is_descendant_of(parent.expansion)
// The macro is a proc macro derive
&& let Some(def_id) = module.expansion.expn_data().macro_def_id
Copy link
Member Author

Choose a reason for hiding this comment

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

ill clean this up in the next pass, formatting got fked up in a few places >:[

orig_ident.span,
"ambiguous scoped macro resolutions with path-based \
scope resolution as first candidate"
scope resolution as first candidate"
Copy link
Member Author

Choose a reason for hiding this comment

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

todo: cleanup formatting

transmute_opts,
transmute_trait,
transmute_unchecked,
transparent,
Copy link
Member Author

Choose a reason for hiding this comment

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

I feel like I'm probably doing this part subtly wrong.

The transparent symbol already exists and I'm using it, I tried seeing if I could stay away from it and find a way to have all the compiler internal stuff talk about it with a unique symbol (transparent_modules) but have the actual ident of the attribute be transparent but it seemed like this was controlling that. If I got that wrong lmk.

@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)
fmt: checked 6479 files
tidy check
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
tidy [features]: /checkout/compiler/rustc_feature/src/unstable.rs:664: feature transparent_modules is not sorted by feature name (should be between transmute_generic_consts and transparent_unions)
tidy [features]: /checkout/compiler/rustc_feature/src/unstable.rs:664: no tracking issue for feature transparent_modules
Expected a gate test for the feature 'transparent_modules'.
Hint: create a failing test file named 'tests/ui/feature-gates/feature-gate-transparent-modules.rs',
      with its failures due to missing usage of `#![feature(transparent_modules)]`.
Hint: If you already have such a test and don't want to rename it,
      you can also add a // gate-test-transparent_modules line to the test file.
tidy [features]: Found 1 features without a gate test.
tidy [features]: /checkout/compiler/rustc_feature/src/unstable.rs:664: The stabilization version 1.92.0 of lang feature `transparent_modules` is written out but should be CURRENT_RUSTC_VERSION
tidy [features]: FAIL
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'venv'
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'virtualenv'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (25.2)
linting python files
---
info: ES-Check: there were no ES version matching errors!  🎉
typechecking javascript files
tidy: The following check failed: features
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy /checkout /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo /checkout/obj/build 4 /node/bin/npm --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1549:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1280:29

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:03:20
  local time: Wed Oct 15 00:53:20 UTC 2025
  network time: Wed, 15 Oct 2025 00:53:20 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

const PATH: &[Symbol] = &[sym::transparent];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Mod)]);
const CREATE: fn(Span) -> AttributeKind = |span| AttributeKind::Transparent(span);
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for a closure here

@jdonszelmann jdonszelmann self-assigned this Oct 15, 2025
@jdonszelmann
Copy link
Contributor

With that nit, r=me for just the attributes stuff. I don't know as much about the name resolution part to sign off on that but thats for petrochenkov :)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

5 participants