-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use impl_header_lifetime_elision in libcore #54687
Conversation
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -14,7 +14,7 @@ LL | impl Copy for &'static NotSync {} | |||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
| | |||
= note: conflicting implementation in crate `core`: | |||
- impl<'a, T> std::marker::Copy for &'a T | |||
- impl<'_, T> std::marker::Copy for &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.
This line is not valid syntax. I filed #54690 to follow up.
@bors r+ |
📌 Commit 8d6bee3 has been approved by |
This comment has been minimized.
This comment has been minimized.
@dtolnay I needed to add a commit to fix the libcore test build; please re-r+ |
Looks good! @bors r+ |
📌 Commit d4840da has been approved by |
⌛ Testing commit d4840da with merge 5ed5b3bcb5610cf0712466f4887142bb62c4ebbd... |
💔 Test failed - status-appveyor |
3hr timeout on appveyor: https://ci.appveyor.com/project/rust-lang/rust/build/1.0.9185 Can I get a retry, please? |
@bors retry |
Use impl_header_lifetime_elision in libcore The feature is approved for stabilization, so let's use it to remove about 300 `'a`s. Tracking issue for the feature: rust-lang#15872
Use impl_header_lifetime_elision in libcore The feature is approved for stabilization, so let's use it to remove about 300 `'a`s. Tracking issue for the feature: rust-lang#15872
Rollup of 10 pull requests Successful merges: - #54269 (#53840: Consolidate pattern check errors) - #54458 (Allow both explicit and elided lifetimes in the same impl header) - #54603 (Add `crate::` to trait suggestions in Rust 2018.) - #54648 (Update Cargo's submodule) - #54680 (make run-pass tests with empty main just compile-pass tests) - #54687 (Use impl_header_lifetime_elision in libcore) - #54699 (Re-export `getopts` so custom drivers can reference it.) - #54702 (do not promote comparing function pointers) - #54728 (Renumber `proc_macro` tracking issues) - #54745 (make `CStr::from_bytes_with_nul_unchecked()` a const fn) Failed merges: r? @ghost
Stabilize impl_header_lifetime_elision in 2015 ~~This is currently blocked on #54902; it should be good after that~~ It's already stable in 2018; this finishes the stabilization. FCP completed (#15872 (comment)), proposal (#15872 (comment)). Tracking issue: #15872 Usage examples (from libcore): #54687
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to rust-lang#54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see rust-lang#41960 (comment)
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to rust-lang/rust#54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see rust-lang/rust#41960 (comment)
The feature is approved for stabilization, so let's use it to remove about 300
'a
s.Tracking issue for the feature: #15872