-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Actually deprecate collections::Bound
#82080
Comments
intrinsics::drop_in_place
intrinsics::drop_in_place
and collections::Bound
, and possibly fix #[rustc_deprecated]
not properly applying to re-exports
intrinsics::drop_in_place
and collections::Bound
, and possibly fix #[rustc_deprecated]
not properly applying to re-exportsintrinsics::drop_in_place
and collections::Bound
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
7702: Remove use of deprecated `std::collections::Bound` r=Veykril a=bstrie `std::collections::Bound` has been deprecated since Rust 1.26, but due to a bug (rust-lang/rust#82080) it never triggered a visible deprecation warning. Fixing this is being done in rust-lang/rust#82122 , but landing that requires rustc-analyzer to build without triggering any deprecation warnings (https://github.com/rust-lang-ci/rust/runs/1911884006#step:24:19361). Co-authored-by: bstrie <865233+bstrie@users.noreply.github.com>
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
Reopening because the new deprecation of |
intrinsics::drop_in_place
and collections::Bound
intrinsics::drop_in_place
and~~ collections::Bound
intrinsics::drop_in_place
and~~ collections::Bound
collections::Bound
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
Whoops, commit b62694b got synced back and forth for some reason. |
Oh I think I see what happened... the original commit did a lot of things, among them fixing clippy. The commit description contained "Fixes #82080". Each commit that affects clippy is synced to clippy (creating a new commit ID since all the non-clippy changes are removed from it), and then that is synced back (with the same commit ID as what it got in clippy). So now we got a fresh commit that still has "Fixes #82080" in its description. This sounds like a general problem with the subtree approach... |
In f2c7917 ,
intrinsics::drop_in_place
was supposedly deprecated in favor ofptr::drop_in_place
:However, this function does not show up as deprecated in the library docs (https://doc.rust-lang.org/nightly/std/intrinsics/fn.drop_in_place.html), nor does it trigger the deprecation warning in the following program:
Presumably this is an unforeseen inability of
#[rustc_deprecated]
to operate on re-exports. Regardless it means that this function was never actually deprecated in practice, and it will need be deprecated for real with an updatedsince
value.This can be resolved by simply making
intrinsics::drop_in_place
into an actual function that merely wraps and callsptr::drop_in_place
, then and then applying#[rustc_deprecated]
to it. Alternatively one could fix#[rustc_deprecated]
to work when applied to re-exports, but that seems far more involved.Edit: I've also discovered another example of this, which is
collections::Bound
:The problem in this case is a bit more difficult than with
drop_in_place
and requires a bit more care. To wit, function items aren't nominal types, so redefiningintrinsics::drop_in_place
as a wrapper overptr::drop_in_place
isn't a breaking change. However, redefiningcollections::Bound
as a newtype overops::Bound
would create a new nominal type, and would be a breaking change. Furthermore, type aliases viatype
aren't fully at parity with "real" types, so there might be potential for breakage if one were to simply dopub type Bound = ops::Bound;
(I can confirm that the#[deprecated]
attribute does work on type aliases). However, I think in practice it should(?) be alright to use a type alias here (the only disparity I can think of with type aliases is that they can't be used as constructors for unit structs, but I'd like second opinions).The text was updated successfully, but these errors were encountered: