-
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
Deprecate intrinsics::drop_in_place
and collections::Bound
, which accidentally weren't deprecated
#82122
Conversation
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
Note that this might not necessarily "fix" #82080 if you happen to think that rustc_deprecated should "just work" on re-exports, but this is a far more expedient fix to the current problem. |
This comment has been minimized.
This comment has been minimized.
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!
@bors r+ |
📌 Commit dfae9f0077de752ec9c00f6625c65cab202366b3 has been approved by |
It looks like 2021-02-14T23:40:28.5030915Z tidy check
2021-02-14T23:40:28.8226072Z * 624 error codes
2021-02-14T23:40:28.8227914Z * highest error code: E0781
2021-02-14T23:40:28.8228436Z Checking which error codes lack tests...
2021-02-14T23:40:29.0131586Z Found 436 error codes
2021-02-14T23:40:29.0132273Z Found 0 error codes with no tests
2021-02-14T23:40:29.0132741Z Done!
2021-02-14T23:40:30.1846989Z tidy error: /checkout/library/core/src/intrinsics.rs:72: undocumented unsafe
2021-02-14T23:40:32.0135064Z some tidy checks failed @bors r- |
Could you open a separate issue for making |
@bors r+ |
📌 Commit c813b38ec04eae0108cfb14312be8e4348dc0d27 has been approved by |
I've opened #82123 to track fixing the behavior of |
This comment has been minimized.
This comment has been minimized.
Oof, I'll take a look at that. |
@bors r- |
Ok, when I first saw that this patch was changing the output of some UI tests I was concerned that codegen was secretly referring to |
That sounds right, yeah, I think that's what was implemented in #73996. |
This comment has been minimized.
This comment has been minimized.
Ok, so I assume that the mir output being diffed here is only for human consumption, and that the new fully-qualified path being shown for But fascinatingly, one of the failing MIR tests does contain an explicit reference to While we're at it, I'm just grepping for |
@jyn514 this was in the error as well:
|
I've updated Clippy; ready for re-approval. |
@bors r=dtolnay |
📌 Commit 49aa79e has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@36f1f04. Direct link to PR: <rust-lang/rust#82122> 💔 miri on windows: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung). 💔 miri on linux: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung).
Replace deprecated `collections::Bound` with `ops::Bound` Fixes rust-lang/rust#83242 , which resulted from rust-lang/rust#82122 .
Replace deprecated `collections::Bound` with `ops::Bound` Cc rust-lang/rust#83242 , which resulted from rust-lang/rust#82122 .
#[doc(hidden)] | ||
pub use crate::ops::Bound; | ||
pub type Bound<T> = crate::ops::Bound<T>; |
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.
FWIW, this is technically a breaking change if someone did use std::collections::Bound::*;
(like Miri did)
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.
Oh, I assumed miri had broken due to denying deprecation warnings. I wasn't aware that type aliases to enums couldn't glob-import; it looks like even concrete importing like use collections::Bound::Unbounded
isn't supported. :\ This is a distressing limitation of type alises that I wasn't aware of; I trusted that the limitations laid out in the reference were exhaustive. I'm not sure what to do about this. At the very least I'll file an issue about supporting this, since it really does seem like a bug in type aliases.
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.
I've filed #83248 to track importing variants through type aliases. I'll also ping the libs team on Zulip to see what they think should be done.
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.
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.
I trusted that the limitations laid out in the reference were exhaustive.
Which part of the reference is that? Might be worth reporting a bug (or submitting a PR).
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.
This page of the reference: https://doc.rust-lang.org/reference/items/type-aliases.html , at the bottom where it talks about where type aliases cannot be used. I'll submit a PR.
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.
Reference PR at rust-lang/reference#984
Revert the second deprecation of collections::Bound Per the review at rust-lang#82122 (comment) and the decision at https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/unavoidable.20breakage.20when.20deprecating.20an.20enum.3F , revert this small portion of rust-lang#82122 for the time being. This doesn't affect the other components of that patch, i.e. `intrinsics::drop_in_place` is still deprecated-for-real, and uses of `collections::Bound` remain removed from the repo.
Revert the second deprecation of collections::Bound Per the review at rust-lang#82122 (comment) and the decision at https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/unavoidable.20breakage.20when.20deprecating.20an.20enum.3F , revert this small portion of rust-lang#82122 for the time being. This doesn't affect the other components of that patch, i.e. `intrinsics::drop_in_place` is still deprecated-for-real, and uses of `collections::Bound` remain removed from the repo.
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.
Fixes #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 that type aliases only observably differ from types when used on unit structs or tuple structs, whereasBound
is an enum.