diff options
| author | The 8472 <git@infinite-source.de> | 2024-08-13 23:54:54 +0200 |
|---|---|---|
| committer | The 8472 <git@infinite-source.de> | 2024-08-14 20:50:04 +0200 |
| commit | 6d8f0bd930dc0ab9c72fc89583e74500a665e2ba (patch) | |
| tree | 662ba025725a0ef377a7e22388fb8527f2311e03 /library/alloc/src/vec | |
| parent | 80eb5a8e910e5185d47cdefe3732d839c78a5e7e (diff) | |
| download | rust-6d8f0bd930dc0ab9c72fc89583e74500a665e2ba.tar.gz rust-6d8f0bd930dc0ab9c72fc89583e74500a665e2ba.zip | |
apply #[optimize(size)] to #[cold] ones and part of the panick machinery
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index b4e0bc5fcbe..bafd5579644 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1520,6 +1520,7 @@ impl<T, A: Allocator> Vec<T, A> { #[cold] #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] #[track_caller] + #[optimize(size)] fn assert_failed(index: usize, len: usize) -> ! { panic!("swap_remove index (is {index}) should be < len (is {len})"); } @@ -1568,6 +1569,7 @@ impl<T, A: Allocator> Vec<T, A> { #[cold] #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] #[track_caller] + #[optimize(size)] fn assert_failed(index: usize, len: usize) -> ! { panic!("insertion index (is {index}) should be <= len (is {len})"); } @@ -1630,6 +1632,7 @@ impl<T, A: Allocator> Vec<T, A> { #[cold] #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] #[track_caller] + #[optimize(size)] fn assert_failed(index: usize, len: usize) -> ! { panic!("removal index (is {index}) should be < len (is {len})"); } @@ -2318,6 +2321,7 @@ impl<T, A: Allocator> Vec<T, A> { #[cold] #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] #[track_caller] + #[optimize(size)] fn assert_failed(at: usize, len: usize) -> ! { panic!("`at` split index (is {at}) should be <= len (is {len})"); } |
