@@ -16,8 +16,8 @@ use crate::utils::paths;
16
16
use crate :: utils:: {
17
17
clip, comparisons, differing_macro_contexts, higher, in_constant, in_macro, int_bits, last_path_segment,
18
18
match_def_path, match_path, multispan_sugg, opt_def_id, same_tys, sext, snippet, snippet_opt,
19
- snippet_with_applicability, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then,
20
- span_note_and_lint , unsext , AbsolutePathBuffer ,
19
+ snippet_with_applicability, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext ,
20
+ AbsolutePathBuffer ,
21
21
} ;
22
22
use if_chain:: if_chain;
23
23
use rustc:: hir;
@@ -2291,13 +2291,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RefToMut {
2291
2291
if let TyKind :: Ptr ( MutTy { mutbl: Mutability :: MutImmutable , .. } ) = t. node;
2292
2292
if let Ref ( ..) = cx. tables. node_id_to_type( e. hir_id) . sty;
2293
2293
then {
2294
- span_note_and_lint (
2294
+ span_lint (
2295
2295
cx,
2296
2296
CAST_REF_TO_MUT ,
2297
2297
expr. span,
2298
- "casting immutable reference to a mutable reference" ,
2299
- expr. span,
2300
- "consider implementing `UnsafeCell` instead" ,
2298
+ "casting &T to &mut T may cause undefined behaviour, consider instead using an UnsafeCell" ,
2301
2299
) ;
2302
2300
}
2303
2301
}
0 commit comments