-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Warning added when dependency crate has async drop types, and the feature is disabled #141253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Warning added when dependency crate has async drop types, and the feature is disabled #141253
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
r? oli-obk |
f2b3e74
to
6105928
Compare
oh nice, that's even more precise than just a feature gate check, as you are specifically inspecting the async drop impls in crate metadata @bors r+ rollup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple typos of the word "dependency".
compiler/rustc_metadata/messages.ftl
Outdated
@@ -1,6 +1,10 @@ | |||
metadata_as_needed_compatibility = | |||
linking modifier `as-needed` is only compatible with `dylib` and `framework` linking kinds | |||
|
|||
metadata_async_drop_types_in_dependency = | |||
found async drop types in dependecy `{$extern_crate}`, but async_drop feature is disabled for `{$local_crate}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found async drop types in dependecy `{$extern_crate}`, but async_drop feature is disabled for `{$local_crate}` | |
found async drop types in dependency `{$extern_crate}`, but async_drop feature is disabled for `{$local_crate}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
//@ aux-build:async-drop-dep.rs | ||
//@ edition:2021 | ||
|
||
#![feature(async_drop)] | ||
#![cfg_attr(with_feature, feature(async_drop))] | ||
//[without_feature]~^ WARN found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//[without_feature]~^ WARN found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` | |
//[without_feature]~^ WARN found async drop types in dependency `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` |
@@ -0,0 +1,10 @@ | |||
warning: found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` | |
warning: found async drop types in dependency `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` |
…-inconsistency-warning, r=oli-obk Warning added when dependency crate has async drop types, and the feature is disabled In continue of rust-lang#141031. When dependency crate has non-empty `adt_async_destructor` table in metadata, and `async_drop` feature is disabled for local crate, warning will be emitted. Test `dependency-dropped` has two revisions - with and without feature enabled. With feature enabled, async drop for dropee is executed ("Async drop" printed). Without the feature enabled, sync drop is executed ("Sync drop" printed) and warning is emitted. Warning example: ``` warning: found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` --> $DIR/dependency-dropped.rs:7:1 | LL | #![cfg_attr(with_feature, feature(async_drop))] | ^ | = help: if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used ```
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#131200 (Handle `rustc_query_system` cases of `rustc::potential_query_instability` lint) - rust-lang#141244 (windows: document that we rely on an undocumented property of GetUserProfileDirectoryW) - rust-lang#141247 (skip compiler tools sanity checks on certain commands) - rust-lang#141248 (fix data race in ReentrantLock fallback for targets without 64bit atomics) - rust-lang#141249 (introduce common macro for `MutVisitor` and `Visitor` to dedup code) - rust-lang#141253 (Warning added when dependency crate has async drop types, and the feature is disabled) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
6105928
to
e192953
Compare
@bors r+ In case the rollup succeeds, there will be conflicts and you'll have to rebase. At that point this PR will only contain the typo fix |
Rollup merge of rust-lang#141253 - azhogin:azhogin/async-drop-feature-inconsistency-warning, r=oli-obk Warning added when dependency crate has async drop types, and the feature is disabled In continue of rust-lang#141031. When dependency crate has non-empty `adt_async_destructor` table in metadata, and `async_drop` feature is disabled for local crate, warning will be emitted. Test `dependency-dropped` has two revisions - with and without feature enabled. With feature enabled, async drop for dropee is executed ("Async drop" printed). Without the feature enabled, sync drop is executed ("Sync drop" printed) and warning is emitted. Warning example: ``` warning: found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` --> $DIR/dependency-dropped.rs:7:1 | LL | #![cfg_attr(with_feature, feature(async_drop))] | ^ | = help: if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used ```
☔ The latest upstream changes (presumably #141255) made this pull request unmergeable. Please resolve the merge conflicts. |
…s disabled - typo fixed
e192953
to
4a99cbb
Compare
@bors r+ rollup |
Bors didn't go crazy if it merges the same pr second time? |
Bors merges commits 😅 github automatically closes PRs whose commits are in the branch they target. So I think everything just works out |
…-inconsistency-warning, r=oli-obk Warning added when dependency crate has async drop types, and the feature is disabled In continue of rust-lang#141031. When dependency crate has non-empty `adt_async_destructor` table in metadata, and `async_drop` feature is disabled for local crate, warning will be emitted. Test `dependency-dropped` has two revisions - with and without feature enabled. With feature enabled, async drop for dropee is executed ("Async drop" printed). Without the feature enabled, sync drop is executed ("Sync drop" printed) and warning is emitted. Warning example: ``` warning: found async drop types in dependecy `async_drop_dep`, but async_drop feature is disabled for `dependency_dropped` --> $DIR/dependency-dropped.rs:7:1 | LL | #![cfg_attr(with_feature, feature(async_drop))] | ^ | = help: if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used ```
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#139419 (Error on recursive opaque ty in HIR typeck) - rust-lang#141236 (Resolved issue with mismatched types triggering ICE in certain scenarios) - rust-lang#141253 (Warning added when dependency crate has async drop types, and the feature is disabled) - rust-lang#141269 (rustc-dev-guide subtree update) - rust-lang#141275 (`gather_locals`: only visit guard pattern guards when checking the guard) - rust-lang#141279 (`lower_to_hir` cleanups) - rust-lang#141285 (Add tick to `RePlaceholder` debug output) r? `@ghost` `@rustbot` modify labels: rollup
In continue of #141031.
When dependency crate has non-empty
adt_async_destructor
table in metadata, andasync_drop
feature is disabled for local crate, warning will be emitted.Test
dependency-dropped
has two revisions - with and without feature enabled. With feature enabled, async drop for dropee is executed ("Async drop" printed). Without the feature enabled, sync drop is executed ("Sync drop" printed) and warning is emitted.Warning example: