summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs')
-rw-r--r--src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs
index 88ea39bf9..01cc433cb 100644
--- a/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs
+++ b/src/tools/clippy/tests/ui/rc_clone_in_vec_init/rc.rs
@@ -1,3 +1,4 @@
+//@no-rustfix: overlapping suggestions
#![warn(clippy::rc_clone_in_vec_init)]
#![allow(clippy::useless_vec)]
use std::rc::Rc;
@@ -7,6 +8,8 @@ fn main() {}
fn should_warn_simple_case() {
let v = vec![Rc::new("x".to_string()); 2];
+ //~^ ERROR: initializing a reference-counted pointer in `vec![elem; len]`
+ //~| NOTE: each element will point to the same `Rc` instance
}
fn should_warn_simple_case_with_big_indentation() {
@@ -15,12 +18,16 @@ fn should_warn_simple_case_with_big_indentation() {
dbg!(k);
if true {
let v = vec![Rc::new("x".to_string()); 2];
+ //~^ ERROR: initializing a reference-counted pointer in `vec![elem; len]`
+ //~| NOTE: each element will point to the same `Rc` instance
}
}
}
fn should_warn_complex_case() {
let v = vec![
+ //~^ ERROR: initializing a reference-counted pointer in `vec![elem; len]`
+ //~| NOTE: each element will point to the same `Rc` instance
std::rc::Rc::new(Mutex::new({
let x = 1;
dbg!(x);
@@ -30,6 +37,8 @@ fn should_warn_complex_case() {
];
let v1 = vec![
+ //~^ ERROR: initializing a reference-counted pointer in `vec![elem; len]`
+ //~| NOTE: each element will point to the same `Rc` instance
Rc::new(Mutex::new({
let x = 1;
dbg!(x);