@@ -5,9 +5,8 @@ use crate::utils::usage::{is_unused, mutated_variables};
5
5
use crate :: utils:: {
6
6
get_enclosing_block, get_parent_expr, get_trait_def_id, has_iter_method, higher, implements_trait,
7
7
is_integer_const, is_no_std_crate, is_refutable, is_type_diagnostic_item, last_path_segment, match_trait_method,
8
- match_type, match_var, multispan_sugg, qpath_res, snippet, snippet_opt, snippet_with_applicability,
9
- snippet_with_macro_callsite, span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then, sugg,
10
- SpanlessEq ,
8
+ match_type, match_var, multispan_sugg, qpath_res, snippet, snippet_with_applicability, snippet_with_macro_callsite,
9
+ span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then, sugg, SpanlessEq ,
11
10
} ;
12
11
use if_chain:: if_chain;
13
12
use rustc_ast:: ast;
@@ -1121,8 +1120,8 @@ fn build_manual_memcpy_suggestion<'tcx>(
1121
1120
let ( dst_offset, dst_limit) = print_offset_and_limit ( & dst) ;
1122
1121
let ( src_offset, src_limit) = print_offset_and_limit ( & src) ;
1123
1122
1124
- let dst_base_str = snippet_opt ( cx, dst. base . span ) . unwrap_or_else ( || "???" . into ( ) ) ;
1125
- let src_base_str = snippet_opt ( cx, src. base . span ) . unwrap_or_else ( || "???" . into ( ) ) ;
1123
+ let dst_base_str = snippet ( cx, dst. base . span , "???" ) ;
1124
+ let src_base_str = snippet ( cx, src. base . span , "???" ) ;
1126
1125
1127
1126
let dst = if dst_offset. as_str ( ) == "" && dst_limit. as_str ( ) == "" {
1128
1127
dst_base_str
@@ -1133,6 +1132,7 @@ fn build_manual_memcpy_suggestion<'tcx>(
1133
1132
dst_offset. maybe_par( ) ,
1134
1133
dst_limit. maybe_par( )
1135
1134
)
1135
+ . into ( )
1136
1136
} ;
1137
1137
1138
1138
format ! (
0 commit comments