about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/repeat_vec_with_capacity_nostd.fixed
blob: dcff18723b6ce5908e90c4dc699e9657d43083cf (plain)
1
2
3
4
5
6
7
8
9
10
11
#![warn(clippy::repeat_vec_with_capacity)]
#![allow(clippy::manual_repeat_n)]
#![no_std]
use core::iter;
extern crate alloc;
use alloc::vec::Vec;

fn nostd() {
    let _: Vec<Vec<u8>> = core::iter::repeat_with(|| Vec::with_capacity(42)).take(123).collect();
    //~^ repeat_vec_with_capacity
}