Skip to content

Commit b9e161a

Browse files
author
rudyardrichter
committed
Fix dogfood test
1 parent 5c2fc4e commit b9e161a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clippy_lints/src/use_shared_from_slice.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ impl <'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
5050
if match_type(cx, expr_ty, &paths::RC);
5151
if match_type(cx, subst.type_at(1), &paths::VEC);
5252
then {
53+
cx.sess().note_without_error(&format!("{:?}", subst));
5354
span_lint_and_sugg(
5455
cx,
5556
USE_SHARED_FROM_SLICE,
5657
expr.span,
5758
"constructing reference-counted type from vec",
5859
"consider using `into()`",
59-
format!("TODO"),
60+
format!("{}", "TODO"),
6061
);
6162
}
6263
}

tests/ui/use_shared_from_slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::rc::Rc;
22

33
fn main() {
4-
let bad_ref: Rc<Vec<usize>> = Rc::new(vec!(1, 2, 3));
4+
let _bad_ref: Rc<Vec<usize>> = Rc::new(vec!(1, 2, 3));
55

6-
let good_ref: Rc<[usize]> = vec!(1, 2, 3).into();
6+
let _good_ref: Rc<[usize]> = vec!(1, 2, 3).into();
77
}

0 commit comments

Comments
 (0)