@@ -130,7 +130,7 @@ fn replace_arith(acc: &mut Assists, ctx: &AssistContext<'_, '_>, kind: ArithKind
130130
131131fn is_primitive_int ( ctx : & AssistContext < ' _ , ' _ > , expr : & ast:: Expr ) -> bool {
132132 match ctx. sema . type_of_expr ( expr) {
133- Some ( ty) => ty. adjusted ( ) . is_int_or_uint ( ) ,
133+ Some ( ty) => ty. original . strip_reference ( ) . is_int_or_uint ( ) ,
134134 _ => false ,
135135 }
136136}
@@ -221,6 +221,7 @@ mod tests {
221221 check_assist (
222222 replace_arith_with_checked,
223223 r#"
224+ //- minicore: add, builtin_impls
224225fn main() {
225226 let x = 1 $0+ 2;
226227}
@@ -238,6 +239,7 @@ fn main() {
238239 check_assist (
239240 replace_arith_with_saturating,
240241 r#"
242+ //- minicore: add, builtin_impls
241243fn main() {
242244 let x = 1 $0+ 2;
243245}
@@ -272,6 +274,7 @@ fn main() {
272274 check_assist (
273275 replace_arith_with_wrapping,
274276 r#"
277+ //- minicore: add, builtin_impls
275278fn main() {
276279 let x = 1 $0+ 2;
277280}
@@ -289,6 +292,7 @@ fn main() {
289292 check_assist (
290293 replace_arith_with_wrapping,
291294 r#"
295+ //- minicore: add, builtin_impls
292296fn main() {
293297 let x = 1*3 $0+ 2;
294298}
@@ -306,6 +310,7 @@ fn main() {
306310 check_assist (
307311 replace_arith_with_wrapping,
308312 r#"
313+ //- minicore: add, builtin_impls
309314fn main() {
310315 let mut x = 1;
311316 x $0+= 2;
@@ -325,6 +330,7 @@ fn main() {
325330 check_assist_not_applicable (
326331 replace_arith_with_checked,
327332 r#"
333+ //- minicore: add, builtin_impls
328334fn main() {
329335 let x = 1 $0+$0 2;
330336}
0 commit comments