-
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
(#102929) Implement String:leak
#102941
(#102929) Implement String:leak
#102941
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @m-ou-se (or someone else) soon. Please see the contribution instructions for more information. |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
library/alloc/src/string.rs
Outdated
#[cfg(not(no_global_oom_handling))] | ||
#[unstable(feature = "string_leak", issue = "102929")] | ||
#[inline] | ||
pub fn leak<'a>(self) -> &'a mut str { |
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.
Is there any reason to use a generic <'a>
instead of just 'static
here? I believe the only reason we use <'a>
for Vec<T>
is for situations where T: !'static
.
pub fn leak<'a>(self) -> &'a mut str { | |
pub fn leak(self) -> &'static mut str { |
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.
Good idea; as I understand it, variance will still allow the 'static
to be used for any 'a
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 comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy you can squash commits. |
7c31130
to
687dd3d
Compare
In an attempt to undo the merge commit, I messed up git beyond my ability to repair it, so this PR is superseded by #103280 |
The job Click to see the possible cause of the failure (guessed by this bot)
|
…htriplett (rust-lang#102929) Implement `String::leak` (attempt 2) Implementation of `String::leak` (rust-lang#102929) ACP: rust-lang/libs-team#109 Supersedes rust-lang#102941 (see previous reviews there) `@rustbot` label +T-libs-api -T-libs
…htriplett (rust-lang#102929) Implement `String::leak` (attempt 2) Implementation of `String::leak` (rust-lang#102929) ACP: rust-lang/libs-team#109 Supersedes rust-lang#102941 (see previous reviews there) ``@rustbot`` label +T-libs-api -T-libs
…htriplett (rust-lang#102929) Implement `String::leak` (attempt 2) Implementation of `String::leak` (rust-lang#102929) ACP: rust-lang/libs-team#109 Supersedes rust-lang#102941 (see previous reviews there) ```@rustbot``` label +T-libs-api -T-libs
Implementation of
String::leak
(#102929)ACP: rust-lang/libs-team#109
Superseded by: #103280