Make Share::share final and improve docs#157655
Merged
Merged
Conversation
13 tasks
nikomatsakis
approved these changes
Jun 10, 2026
Contributor
|
bors delegate+ This looks good to me. I had one small suggestion. |
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
Contributor
Author
|
@bors r+ |
Contributor
|
@P8L1: 🔑 Insufficient privileges: not in review users |
Contributor
Author
|
@bors r=nikomatsakis |
Contributor
|
@P8L1: 🔑 Insufficient privileges: not in review users |
Contributor
Author
|
Lol I dont know what's going wrong here @bors r="nikomatsakis" |
Contributor
|
@P8L1: 🔑 Insufficient privileges: not in review users |
Contributor
|
@bors r+ delegate+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 12, 2026
…omatsakis Make Share::share final and improve docs Tracking issue: rust-lang#156756 This follows up on the initial unstable `Share` trait added in rust-lang#156828. The original API used an ordinary default method: ```rust fn share(&self) -> Self { Clone::clone(self) } ``` Niko pointed out that `share` should be final, since `Share` is meant to communicate the semantics of `Clone::clone` for clone-as-alias types, not provide a second independently-overridable operation. `Share` remains unstable under `#![feature(share_trait)]`. r? @nikomatsakis
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 12, 2026
…omatsakis Make Share::share final and improve docs Tracking issue: rust-lang#156756 This follows up on the initial unstable `Share` trait added in rust-lang#156828. The original API used an ordinary default method: ```rust fn share(&self) -> Self { Clone::clone(self) } ``` Niko pointed out that `share` should be final, since `Share` is meant to communicate the semantics of `Clone::clone` for clone-as-alias types, not provide a second independently-overridable operation. `Share` remains unstable under `#![feature(share_trait)]`. r? @nikomatsakis
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 12, 2026
…uwer Rollup of 17 pull requests Successful merges: - #156950 (Staticlib rename internal symbols) - #157322 (test pre-stabilization items on CI) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N)) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N))
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 12, 2026
…uwer Rollup of 17 pull requests Successful merges: - #156950 (Staticlib rename internal symbols) - #157322 (test pre-stabilization items on CI) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N)) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N))
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 12, 2026
…omatsakis Make Share::share final and improve docs Tracking issue: rust-lang#156756 This follows up on the initial unstable `Share` trait added in rust-lang#156828. The original API used an ordinary default method: ```rust fn share(&self) -> Self { Clone::clone(self) } ``` Niko pointed out that `share` should be final, since `Share` is meant to communicate the semantics of `Clone::clone` for clone-as-alias types, not provide a second independently-overridable operation. `Share` remains unstable under `#![feature(share_trait)]`. r? @nikomatsakis
This was referenced Jun 12, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 12, 2026
…uwer Rollup of 23 pull requests Successful merges: - #144220 (Add powerpc64-unknown-linux-gnuelfv2 target) - #153238 (debuginfo: slices are DW_TAG_array_type's) - #157112 (Update aarch64-unknown-freebsd target description) - #157322 (test pre-stabilization items on CI) - #157348 (Don't track cwd for `-Zremap-cwd-prefix` in incremental compilation) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157672 (Region inference: Simplify initialisation of region values) - #157680 (Require `#[pin_v2]` for explicit pin-projection patterns) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157818 (miri subtree update) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157079 (Don't recover `&raw EXPR` as a missing comma) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N)) Failed merges: - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N))
rust-timer
added a commit
that referenced
this pull request
Jun 13, 2026
Rollup merge of #157655 - P8L1:share-trait-final-docs, r=nikomatsakis Make Share::share final and improve docs Tracking issue: #156756 This follows up on the initial unstable `Share` trait added in #156828. The original API used an ordinary default method: ```rust fn share(&self) -> Self { Clone::clone(self) } ``` Niko pointed out that `share` should be final, since `Share` is meant to communicate the semantics of `Clone::clone` for clone-as-alias types, not provide a second independently-overridable operation. `Share` remains unstable under `#![feature(share_trait)]`. r? @nikomatsakis
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Jun 13, 2026
…uwer Rollup of 23 pull requests Successful merges: - rust-lang/rust#144220 (Add powerpc64-unknown-linux-gnuelfv2 target) - rust-lang/rust#153238 (debuginfo: slices are DW_TAG_array_type's) - rust-lang/rust#157112 (Update aarch64-unknown-freebsd target description) - rust-lang/rust#157322 (test pre-stabilization items on CI) - rust-lang/rust#157348 (Don't track cwd for `-Zremap-cwd-prefix` in incremental compilation) - rust-lang/rust#157490 (Add field-wise CoerceShared reborrow tests) - rust-lang/rust#157655 (Make Share::share final and improve docs) - rust-lang/rust#157672 (Region inference: Simplify initialisation of region values) - rust-lang/rust#157680 (Require `#[pin_v2]` for explicit pin-projection patterns) - rust-lang/rust#157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - rust-lang/rust#157796 (rustdoc: Some more lazy formatting) - rust-lang/rust#157818 (miri subtree update) - rust-lang/rust#157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - rust-lang/rust#157079 (Don't recover `&raw EXPR` as a missing comma) - rust-lang/rust#157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - rust-lang/rust#157622 (Disable retagging for variadic arguments in const-eval) - rust-lang/rust#157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - rust-lang/rust#157695 (Extend capabilities of `TypeFoldable_Generic`) - rust-lang/rust#157766 (interpret: avoid computing layout of sized raw pointee) - rust-lang/rust#157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - rust-lang/rust#157795 (revert 157013) - rust-lang/rust#157798 (Prevent approving PRs that wait for Crater or formal decisions) - rust-lang/rust#157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N)) Failed merges: - rust-lang/rust#157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue: #156756
This follows up on the initial unstable
Sharetrait added in #156828.The original API used an ordinary default method:
Niko pointed out that
shareshould be final, sinceShareis meant to communicate the semantics ofClone::clonefor clone-as-alias types, not provide a second independently-overridable operation.Shareremains unstable under#![feature(share_trait)].r? @nikomatsakis