Repository navigation
Conversation
|
Some changes occurred in compiler/rustc_attr_parsing |
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This was previously cratered in #152856 (comment). That PR entirely removed |
|
Given that the crater run only found 6 crates that this broke, I also wouldn't be against entirely removing the attribute immediately. What we want to do here is a @rust-lang/lang decision though, so lets let them decide |
This comment has been minimized.
This comment has been minimized.
|
I think it is polite to keep it as future incompat warning for a couple of releases. |
|
Blessed the tests and added #164032 as tracking issue. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
❌ Commit 7433798 has been unapproved due to PR CI failure. Reapprove it with |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Diagnostic formatting changed decorations in a minor way. Blessed the respective test. @bors r=JonathanBrouwer Detailsdiff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
index c6c5735b9ec..ec0a8a9d1a4 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
@@ -119,7 +119,7 @@ error: the `no_link` attribute cannot be used on modules
|
LL | #[no_link]
| ^^^^^^^
-LL |
+...
LL | mod no_link {
|
= help: the `no_link` attribute can only be applied to extern crates
@@ -145,7 +145,7 @@ error: the `no_link` attribute cannot be used on structs
|
LL | #[no_link]
| ^^^^^^^
-LL |
+...
LL | struct S {
|
= help: the `no_link` attribute can only be applied to extern crates |
This comment has been minimized.
This comment has been minimized.
|
❌ Commit b0b50b0 has been unapproved due to PR CI failure. Reapprove it with |
This comment has been minimized.
This comment has been minimized.
|
lint-docs doesn't like |
|
What I've seen in the past to get around tidy is to also |
This is a pre-1.0 attribute that accidentally got stabilized. It was only meant for compiler plugins which we no longer support, not for regular crates. It is rather fragile and can easily lead to linker errors depending on where rustc decides to codegen functions and statics, which varies between rustc versions. It might also be unsound if a crate for example expects a global constructor it defined to run. Using it doesn't have an effect on the size of the produced binaries except when it defines a `#[used]` static given that we remove all unused functions and statics at link time already.
|
@bors r+ |
Add a future incompat warning for #[no_link] This is a pre-1.0 attribute that accidentally got stabilized. It was only meant for compiler plugins which we no longer support, not for regular crates. It is rather fragile and can easily lead to linker errors depending on where rustc decides to codegen functions and statics, which varies between rustc versions. It might also be unsound if a crate for example expects a global constructor it defined to run. Using it doesn't have an effect on the size of the produced binaries except when it defines a `#[used]` static given that we remove all unused functions and statics at link time already.
…uwer Rollup of 22 pull requests Successful merges: - #159580 (Reject cfg on expressions that cannot be safely removed) - #162597 (raise ambiguity error on attribute macro that could be tool attribute) - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs) - #163059 (Recover invalid return type until `{`, `}` or `;`) - #163672 (Use runCodeGen Abstraction for new LLVM) - #164028 (Add a future incompat warning for #[no_link]) - #164188 (Suggest adding lifetime for `dyn Trait` in return type) - #164345 (fix: handle `false` in root contexts) - #164494 (drop ands which are a superset of other ands) - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`) - #164785 (delegation: emit error when there is no field for `Self` mapping) - #164799 (Don't use `IntoIterator` in parallel API) - #164871 (Refactor call argument codegen) - #164648 (parse inline and rustc_force_inline with same parser) - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration) - #164900 (make tool_attrs method to retrieve tool attributes.) - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit) - #164996 (miri: add missing alignment check in write_bytes) - #165012 (Remove Span::eq_ctxt()) - #165013 ([tiny] Add missing backticks around lifetime name) - #165024 (rustdoc-search: rank re-export lower) - #165028 (Update enzyme to fix one bug related to higher-order derivatives) > [!WARNING] > This rollup conflicts with pending auto build #165042 and may need to be recreated if the pending build succeeds.
Add a future incompat warning for #[no_link] This is a pre-1.0 attribute that accidentally got stabilized. It was only meant for compiler plugins which we no longer support, not for regular crates. It is rather fragile and can easily lead to linker errors depending on where rustc decides to codegen functions and statics, which varies between rustc versions. It might also be unsound if a crate for example expects a global constructor it defined to run. Using it doesn't have an effect on the size of the produced binaries except when it defines a `#[used]` static given that we remove all unused functions and statics at link time already.
…uwer Rollup of 21 pull requests Successful merges: - #159580 (Reject cfg on expressions that cannot be safely removed) - #162597 (raise ambiguity error on attribute macro that could be tool attribute) - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs) - #163059 (Recover invalid return type until `{`, `}` or `;`) - #163672 (Use runCodeGen Abstraction for new LLVM) - #164028 (Add a future incompat warning for #[no_link]) - #164188 (Suggest adding lifetime for `dyn Trait` in return type) - #164345 (fix: handle `false` in root contexts) - #164494 (drop ands which are a superset of other ands) - #164785 (delegation: emit error when there is no field for `Self` mapping) - #164799 (Don't use `IntoIterator` in parallel API) - #164871 (Refactor call argument codegen) - #164648 (parse inline and rustc_force_inline with same parser) - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration) - #164900 (make tool_attrs method to retrieve tool attributes.) - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit) - #164996 (miri: add missing alignment check in write_bytes) - #165012 (Remove Span::eq_ctxt()) - #165013 ([tiny] Add missing backticks around lifetime name) - #165024 (rustdoc-search: rank re-export lower) - #165028 (Update enzyme to fix one bug related to higher-order derivatives)
…uwer Rollup of 21 pull requests Successful merges: - #159580 (Reject cfg on expressions that cannot be safely removed) - #162597 (raise ambiguity error on attribute macro that could be tool attribute) - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs) - #163059 (Recover invalid return type until `{`, `}` or `;`) - #163672 (Use runCodeGen Abstraction for new LLVM) - #164028 (Add a future incompat warning for #[no_link]) - #164188 (Suggest adding lifetime for `dyn Trait` in return type) - #164345 (fix: handle `false` in root contexts) - #164494 (drop ands which are a superset of other ands) - #164785 (delegation: emit error when there is no field for `Self` mapping) - #164799 (Don't use `IntoIterator` in parallel API) - #164871 (Refactor call argument codegen) - #164648 (parse inline and rustc_force_inline with same parser) - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration) - #164900 (make tool_attrs method to retrieve tool attributes.) - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit) - #164996 (miri: add missing alignment check in write_bytes) - #165012 (Remove Span::eq_ctxt()) - #165013 ([tiny] Add missing backticks around lifetime name) - #165024 (rustdoc-search: rank re-export lower) - #165028 (Update enzyme to fix one bug related to higher-order derivatives)
View all comments
This is a pre-1.0 attribute that accidentally got stabilized. It was only meant for compiler plugins which we no longer support, not for regular crates. It is rather fragile and can easily lead to linker errors depending on where rustc decides to codegen functions and statics, which varies between rustc versions. It might also be unsound if a crate for example expects a global constructor it defined to run. Using it doesn't have an effect on the size of the produced binaries except when it defines a
#[used]static given that we remove all unused functions and statics at link time already.