diff options
| author | oddg <odegevigney@gmail.com> | 2020-05-14 19:58:43 -0700 |
|---|---|---|
| committer | oddg <odegevigney@gmail.com> | 2020-06-13 17:35:31 -0700 |
| commit | d5ea0e9f8def9a3ec0eb2dd88f0465d4d1a81c21 (patch) | |
| tree | 5a45f946c1a71c435de04f6a7dcc0119271cc46b /src/librustc_session | |
| parent | 1fb612bd15bb3ef098fd24c20d0727de573b4410 (diff) | |
Report error when casting an C-like enum implementing Drop
Diffstat (limited to 'src/librustc_session')
| -rw-r--r-- | src/librustc_session/lint/builtin.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs index 58388bafbed..5a8f5c1b9fb 100644 --- a/src/librustc_session/lint/builtin.rs +++ b/src/librustc_session/lint/builtin.rs @@ -534,6 +534,16 @@ declare_lint! { @feature_gate = sym::unsafe_block_in_unsafe_fn; } +declare_lint! { + pub CENUM_IMPL_DROP_CAST, + Warn, + "a C-like enum implementing Drop is cast", + @future_incompatible = FutureIncompatibleInfo { + reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>", + edition: None, + }; +} + declare_lint_pass! { /// Does nothing as a lint pass, but registers some `Lint`s /// that are used by other parts of the compiler. @@ -607,6 +617,7 @@ declare_lint_pass! { ASM_SUB_REGISTER, UNSAFE_OP_IN_UNSAFE_FN, INCOMPLETE_INCLUDE, + CENUM_IMPL_DROP_CAST, ] } |
