mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 14:07:04 +00:00
Use final path segment for diagnostic
This commit is contained in:
parent
07b5eeebc9
commit
181ef540cf
@ -1265,7 +1265,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
} else {
|
||||
CallableKind::Function
|
||||
};
|
||||
maybe_emit_help(def_id, path.segments[0].ident, args, callable_kind);
|
||||
maybe_emit_help(def_id, path.segments.last().unwrap().ident, args, callable_kind);
|
||||
}
|
||||
hir::ExprKind::MethodCall(method, _receiver, args, _span) => {
|
||||
let Some(def_id) =
|
||||
|
@ -20,7 +20,7 @@ help: the return type of this call is `{integer}` due to the type of the argumen
|
||||
LL | <F as FnOnce(&mut u8)>::call_once(f, 1)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^
|
||||
| |
|
||||
| this argument influences the return type of `FnOnce`
|
||||
| this argument influences the return type of `call_once`
|
||||
note: method defined here
|
||||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
||||
|
||||
|
@ -25,7 +25,7 @@ help: the return type of this call is `u32` due to the type of the argument pass
|
||||
LL | <i32 as Add<i32>>::add(1u32, 2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^----^^^^
|
||||
| |
|
||||
| this argument influences the return type of `Add`
|
||||
| this argument influences the return type of `add`
|
||||
note: method defined here
|
||||
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
help: change the type of the numeric literal from `u32` to `i32`
|
||||
@ -48,7 +48,7 @@ help: the return type of this call is `u32` due to the type of the argument pass
|
||||
LL | <i32 as Add<i32>>::add(1, 2u32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^----^
|
||||
| |
|
||||
| this argument influences the return type of `Add`
|
||||
| this argument influences the return type of `add`
|
||||
note: method defined here
|
||||
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
help: change the type of the numeric literal from `u32` to `i32`
|
||||
|
Loading…
Reference in New Issue
Block a user