1
Fork 0
rust/library/alloc/src
Miguel Ojeda 83addf2540 alloc: fix no_global_oom_handling warnings
Rust 1.62.0 introduced a couple new `unused_imports` warnings
in `no_global_oom_handling` builds, making a total of 5 warnings:

```txt
warning: unused import: `Unsize`
 --> library/alloc/src/boxed/thin.rs:6:33
  |
6 | use core::marker::{PhantomData, Unsize};
  |                                 ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `from_fn`
  --> library/alloc/src/string.rs:51:18
   |
51 | use core::iter::{from_fn, FusedIterator};
   |                  ^^^^^^^

warning: unused import: `core::ops::Deref`
  --> library/alloc/src/vec/into_iter.rs:12:5
   |
12 | use core::ops::Deref;
   |     ^^^^^^^^^^^^^^^^

warning: associated function `shrink` is never used
   --> library/alloc/src/raw_vec.rs:424:8
    |
424 |     fn shrink(&mut self, cap: usize) -> Result<(), TryReserveError> {
    |        ^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: associated function `forget_remaining_elements` is never used
   --> library/alloc/src/vec/into_iter.rs:126:19
    |
126 |     pub(crate) fn forget_remaining_elements(&mut self) {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
```

This patch cleans them so that projects compiling `alloc` without
infallible allocations do not see the warnings. It also enables
the use of `-Dwarnings`.

The couple `dead_code` ones may be reverted when some fallible
allocation support starts using them.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-06-29 04:44:23 +02:00
..
alloc Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
boxed alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
collections Rollup merge of #98039 - tnballo:master, r=thomcc 2022-06-24 16:43:44 +09:00
ffi Finish bumping stage0 2022-05-27 07:36:17 -04:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
sync Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
vec alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
alloc.rs Auto merge of #97033 - nbdd0121:unwind3, r=Amanieu 2022-05-19 04:04:40 +00:00
borrow.rs Stabilize toowned_clone_into 2022-05-28 01:07:45 +09:00
boxed.rs Rollup merge of #97655 - steffahn:better-pin-box-construction-docs, r=thomcc 2022-06-02 23:39:07 +02:00
fmt.rs remove useless cold 2022-05-29 20:40:56 +01:00
lib.rs Expose iter::ByRefSized as unstable feature and use it 2022-06-18 00:03:54 +02:00
macros.rs Use #[rustc_box] in alloc instead of box syntax 2022-06-01 02:28:34 +02:00
raw_vec.rs alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
rc.rs Rollup merge of #96609 - ibraheemdev:arc-downcast-unchecked, r=m-ou-se 2022-06-20 14:56:35 +02:00
slice.rs Add reexport of slice::from{,_mut}_ptr_range to alloc & std 2022-05-30 15:44:56 +04:00
str.rs additional docs example for replace **all** of str 2022-06-10 00:28:46 +08:00
string.rs alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
sync.rs clarify Arc::clone overflow check comment 2022-06-21 21:14:03 -07:00
task.rs
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00