Skip to content
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

Tracking Issue for const Weak::new #95091

Closed
1 of 3 tasks
CAD97 opened this issue Mar 18, 2022 · 0 comments · Fixed by #95965
Closed
1 of 3 tasks

Tracking Issue for const Weak::new #95091

CAD97 opened this issue Mar 18, 2022 · 0 comments · Fixed by #95965
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@CAD97
Copy link
Contributor

CAD97 commented Mar 18, 2022

Feature gate: #![feature(const_weak_new)]

This is a tracking issue for constification for creation of dangling weak reference counted pointers.

Public API

// alloc::rc
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}

// alloc::sync
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}

Steps / History

Unresolved Questions

  • None yet.
@CAD97 CAD97 added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 18, 2022
@CAD97 CAD97 changed the title Tracking Issue for const_weak_new Tracking Issue for const Weak::new Mar 18, 2022
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jul 31, 2023
Stabilize const-weak-new

This is a fairly uncontroversial library stabilization, so I'm going ahead and proposing it to ride the trains to stable.

This stabilizes the following APIs, which are defined to be non-allocating constructors.

```rust
// alloc::rc
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}

// alloc::sync
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}
```

Closes rust-lang#95091

`@rustbot` modify labels: +needs-fcp
@bors bors closed this as completed in e5a6e5c Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant