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

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

This comment has been minimized.

@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 :)

@yaahc yaahc force-pushed the transparent-modules branch 2 times, most recently from 08b1160 to b2651d1 Compare October 15, 2025 20:00
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the transparent-modules branch 2 times, most recently from 20236fb to 741a558 Compare October 15, 2025 20:22
@yaahc yaahc requested a review from jdonszelmann October 15, 2025 20:27
@yaahc yaahc force-pushed the transparent-modules branch from 741a558 to 74e1b33 Compare October 15, 2025 20:35
/// Allows for transmuting between arrays with sizes that contain generic consts.
(unstable, transmute_generic_consts, "1.70.0", Some(109929)),
/// Allows #[transparent] on modules to inherit lexical scopes.
(unstable, transparent_modules, "1.91.0", Some(79260)),
Copy link
Member Author

Choose a reason for hiding this comment

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

not a real tracking issue


gated!(
transparent, Normal,
template!(Word, "https://github.com/rust-lang/rust/issues/79260#issuecomment-731773625"),
Copy link
Member Author

@yaahc yaahc Oct 15, 2025

Choose a reason for hiding this comment

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

probably also want to update this to point to actual documentation (I don't intend to add that, if its a blocker then leave this open or close it until someone comes along who wants to push this over the finish line)

@yaahc yaahc force-pushed the transparent-modules branch from 74e1b33 to afaa6b5 Compare October 15, 2025 20:41
pub(crate) use s;
}

trait IWantAMethod {
Copy link
Contributor

Choose a reason for hiding this comment

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

you'll also want a test in which you use #[transparent] without the feature gate to make sure it's properly rejected without the feature

Copy link
Contributor

Choose a reason for hiding this comment

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

note: this does work correctly, I just tested it, but you still want to have a test for it

@jdonszelmann
Copy link
Contributor

@rustbot author

@rustbot rustbot 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 Oct 16, 2025
@yaahc yaahc added the A-resolve Area: Name/path resolution done by `rustc_resolve` specifically label Oct 16, 2025
@bors
Copy link
Collaborator

bors commented Nov 1, 2025

☔ The latest upstream changes (presumably #148356) 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

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-resolve Area: Name/path resolution done by `rustc_resolve` specifically 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.

6 participants