Skip to content

Allow the unstable attribute on foreign type#158233

Open
kantnero wants to merge 3 commits into
rust-lang:mainfrom
kantnero:allow-unstable-attr-on-target
Open

Allow the unstable attribute on foreign type#158233
kantnero wants to merge 3 commits into
rust-lang:mainfrom
kantnero:allow-unstable-attr-on-target

Conversation

@kantnero

@kantnero kantnero commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

While working the FnPtr trait in #156176 @carbotaniuman was trying to implement Code as an extern type but got an error as the current stability infrastructure does not allow unstable attribute on foreign type. #158200

This PR fixes that by allowing the unstable attribute on ForeignTy and adds test to verify.

@rustbot r? @JonathanBrouwer

@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@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 Jun 22, 2026
@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @JonathanBrouwer (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rust-log-analyzer

This comment has been minimized.

Comment thread tests/ui/stability-attribute/foreign-type-stability.rs Outdated
@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 Jun 22, 2026
@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@kantnero kantnero force-pushed the allow-unstable-attr-on-target branch from b915a1c to 4b98d4c Compare June 22, 2026 17:25
@kantnero kantnero requested a review from JonathanBrouwer June 22, 2026 17:44
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 22, 2026
@kantnero kantnero marked this pull request as draft June 22, 2026 17:46
@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 Jun 22, 2026
@kantnero kantnero force-pushed the allow-unstable-attr-on-target branch from 8fd861c to b973eb9 Compare June 22, 2026 18:03
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
@kantnero kantnero marked this pull request as ready for review June 26, 2026 21:36
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 26, 2026
@kantnero

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like the uitests need to be blessed, looks good to me after that, thanks <3

View changes since this review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 27, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 27, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors r+ rollup
Thanks a lot!

@rust-bors

rust-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 94888f0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 27, 2026
…rget, r=JonathanBrouwer

Allow the unstable attribute on foreign type

While working the `FnPtr` trait in rust-lang#156176 @carbotaniuman was trying to implement `Code` as an extern type but got an error as the current stability infrastructure does not allow `unstable` attribute on foreign type.  rust-lang#158200

This PR fixes that by allowing the `unstable` attribute on ForeignTy  and adds test to verify.

@rustbot r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests



Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 4 pull requests



Successful merges:

 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 27, 2026
…rget, r=JonathanBrouwer

Allow the unstable attribute on foreign type

While working the `FnPtr` trait in rust-lang#156176 @carbotaniuman was trying to implement `Code` as an extern type but got an error as the current stability infrastructure does not allow `unstable` attribute on foreign type.  rust-lang#158200

This PR fixes that by allowing the `unstable` attribute on ForeignTy  and adds test to verify.

@rustbot r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors try jobs=x86_64-gnu-llvm-22-3

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
Allow the unstable attribute on foreign type


try-job: x86_64-gnu-llvm-22-3
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #137858 (Add new `unused_footnote_definition` rustdoc lint)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 27, 2026
…rget, r=JonathanBrouwer

Allow the unstable attribute on foreign type

While working the `FnPtr` trait in rust-lang#156176 @carbotaniuman was trying to implement `Code` as an extern type but got an error as the current stability infrastructure does not allow `unstable` attribute on foreign type.  rust-lang#158200

This PR fixes that by allowing the `unstable` attribute on ForeignTy  and adds test to verify.

@rustbot r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
@rust-bors

rust-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a211074 (a211074522f1363fba8b3ebad1611cfe1c84757c)
Base parent: 13f1859 (13f1859f2faf97a15664e655624baa7417fdc100)

rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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