-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Implement alloc::sync::UniqueArc
#133572
Implement alloc::sync::UniqueArc
#133572
Conversation
fec20b5
to
39aed9b
Compare
This comment has been minimized.
This comment has been minimized.
39aed9b
to
5142171
Compare
Hah! I’m just noticing that this, as well as Otherwise, you can fn extend_lifetime<'a, 'b>(x: &'a str) -> &'b str {
let r = UniqueRc::new(""); // UniqueRc<&'static str>
let w = UniqueRc::downgrade(&r); // Weak<&'static str>
let mut r = r; // COVARIANT: ==>> UniqueRc<&'a str>
*r = x; // assign the &'a str
let _r = UniqueRc::into_rc(r); // Rc<&'a str>, but we only care to activate the weak
let r = w.upgrade().unwrap(); // upgrade succeeds: Rc<&'static str>
*r // &'static str, coerces to &'b str
} |
☔ The latest upstream changes (presumably #135357) made this pull request unmergeable. Please resolve the merge conflicts. |
…k-Simulacrum Make (unstable API) `UniqueRc` invariant for soundness Add test case from rust-lang#133572 (comment) (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
…k-Simulacrum Make (unstable API) `UniqueRc` invariant for soundness Add test case from rust-lang#133572 (comment) (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
Rollup merge of rust-lang#135379 - steffahn:uniquerc-invariant, r=Mark-Simulacrum Make (unstable API) `UniqueRc` invariant for soundness Add test case from rust-lang#133572 (comment) (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
5142171
to
9310c96
Compare
This comment has been minimized.
This comment has been minimized.
951fa08
to
0b2c03e
Compare
ff35547
to
d4783e3
Compare
☔ The latest upstream changes (presumably #138208) made this pull request unmergeable. Please resolve the merge conflicts. |
…k-Simulacrum Make (unstable API) `UniqueRc` invariant for soundness Add test case from rust-lang#133572 (comment) (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
d4783e3
to
eb094ed
Compare
Could you add a test that checks the behavior of weak pointers created from |
@bors r+ |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing d4812c8 (parent) -> 1799887 (this PR) Test differencesShow 20 test diffsStage 0
Stage 1
Stage 2
Additionally, 16 doctest diffs were found. These are ignored, as they are noisy. Job group index
Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (1799887): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 2.5%, secondary 2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 777.207s -> 777.64s (0.06%) |
This implements the
alloc::sync::UniqueArc
part of #112566.