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

Add Vec::leak #62196

Merged
merged 1 commit into from Jul 3, 2019

Conversation

Projects
None yet
8 participants
@cramertj
Copy link
Member

commented Jun 27, 2019

No description provided.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jun 27, 2019

r? @withoutboats

(rust_highfive has picked a reviewer for you, use r? to override)

Show resolved Hide resolved src/liballoc/vec.rs Outdated
@withoutboats

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2019

@bors r+

Seems reasonable at least on nightly, its annoying to write by hand.

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2019

📌 Commit 206a384 has been approved by withoutboats

@matklad

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

Am I missing something, or is this just Box::leak(vec.into_boxed_slice())?

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

@bors r-

This can be written without the unsafe as per @matklad's comment (even Box::leak(vec.into()) will suffice) and so we should do that in the implementation to reduce the overall trusted computing base.

@cramertj cramertj force-pushed the cramertj:vec-leak branch from 206a384 to 86d96e3 Jun 28, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented Jun 28, 2019

This can be written without the unsafe

Done, thanks for the suggestion.

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

Thanks!

@bors r=withoutboats,Centril rollup

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2019

📌 Commit 86d96e3 has been approved by withoutboats,Centril

@cramertj cramertj force-pushed the cramertj:vec-leak branch from 86d96e3 to bd10be5 Jun 28, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented Jun 28, 2019

@bors r=withoutboats,Centril rollup

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2019

📌 Commit bd10be5 has been approved by withoutboats,Centril

Centril added a commit to Centril/rust that referenced this pull request Jun 28, 2019

Centril added a commit to Centril/rust that referenced this pull request Jun 28, 2019

bors added a commit that referenced this pull request Jun 28, 2019

Auto merge of #62216 - Centril:rollup-i60jpn0, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #61199 (Revert "Set test flag when rustdoc is running with --test option" )
 - #61755 (Add `--pass $mode` to compiletest through `./x.py`)
 - #62023 (publish_toolstate: don't use 'new' from inside the loop)
 - #62104 (Inform the query system about properties of queries at compile time)
 - #62105 (Update miri)
 - #62150 (Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.)
 - #62163 (Avoid mem::uninitialized() in std::sys::unix)
 - #62196 (Add Vec::leak)
 - #62204 (doc(libcore) Fix CS)

Failed merges:

r? @ghost
@Centril

This comment was marked as resolved.

Copy link
Member

commented Jun 28, 2019

@bors r-

Failed in #62216.

@cramertj cramertj force-pushed the cramertj:vec-leak branch from bd10be5 to 9527565 Jun 28, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented Jul 1, 2019

@bors r=centril,withoutboats

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

📌 Commit 9527565 has been approved by cramertj

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #62247
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

📌 Commit 9527565 has been approved by centril,withoutboats

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 2, 2019

bors added a commit that referenced this pull request Jul 2, 2019

Auto merge of #62294 - Manishearth:rollup-y7ejw2l, r=Manishearth
Rollup of 16 pull requests

Successful merges:

 - #61871 (Don't use lift to detect local types)
 - #61883 (`non_ascii_idents` lint (part of RFC 2457))
 - #61922 (Don't store locals that have been moved from in generators)
 - #61995 (rustc: use a separate copy of P for HIR than for AST.)
 - #62026 (Final nail in `rand 0.4` coffin)
 - #62039 (Remove needless lifetimes (rustc))
 - #62099 (Remove io::Result from syntax::print)
 - #62103 (Add debug assertions to write_bytes and copy*)
 - #62133 (Feature gate `rustc` attributes harder)
 - #62161 (Add missing links for TryFrom docs)
 - #62177 (Move some tests in src/test/compile-fail -> src/test/ui)
 - #62183 (std: Move a process test out of libstd)
 - #62186 (Add missing type urls in Into trait)
 - #62196 (Add Vec::leak)
 - #62199 (import gdb for explicit access to gdb.current_objfile())
 - #62244 (Update rustfmt to 1.3.1)

Failed merges:

 - #62243 (Improve documentation for built-in macros)

r? @ghost

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 3, 2019

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 3, 2019

bors added a commit that referenced this pull request Jul 3, 2019

Auto merge of #62335 - Mark-Simulacrum:rollup-0pcaz5a, r=Mark-Simulacrum
Rollup of 15 pull requests

Successful merges:

 - #62021 (MSVC link output improve)
 - #62064 (nth_back for chunks_exact)
 - #62128 (Adjust warning of -C extra-filename with -o.)
 - #62161 (Add missing links for TryFrom docs)
 - #62183 (std: Move a process test out of libstd)
 - #62186 (Add missing type urls in Into trait)
 - #62196 (Add Vec::leak)
 - #62199 (import gdb for explicit access to gdb.current_objfile())
 - #62229 (Enable intptrcast for explicit casts)
 - #62250 (Improve box clone doctests to ensure the documentation is valid)
 - #62255 (Switch tracking issue for `#![feature(slice_patterns)]`)
 - #62285 (Fix michaelwoerister's mailmap)
 - #62304 (HashMap is UnwindSafe)
 - #62319 (Fix mismatching Kleene operators)
 - #62327 (Fixed document bug, those replaced each other)

Failed merges:

r? @ghost

@bors bors merged commit 9527565 into rust-lang:master Jul 3, 2019

1 check passed

pr Build #20190628.25 succeeded
Details

@cramertj cramertj deleted the cramertj:vec-leak branch Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.