Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
ab6e2bc3d0dbe518fc647078b32f29b4151fda2c
rust/tests/codegen/to_vec.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
178 B
Rust
Raw Normal View History

Change slice::to_vec to not use extend_from_slice This also required adding a loop guard in case clone panics Add specialization for copy There is a better version for copy, so I've added specialization for that function and hopefully that should speed it up even more. Switch FromIter<slice::Iter> to use `to_vec` Test different unrolling version for to_vec Revert to impl From benchmarking, it appears this version is faster
2020-11-18 22:59:47 +00:00
// compile-flags: -O
#![crate_type = "lib"]
// CHECK-LABEL: @copy_to_vec
#[no_mangle]
fn copy_to_vec(s: &[u64]) -> Vec<u64> {
s.to_vec()
// CHECK: call void @llvm.memcpy
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 794ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API