Removed test for unhandled case in function_item_references lint
Removed test for the unhandled case of calls to `fn f<T>(x: &T)` where `x` is a function reference and is formatted as a pointer in `f`. This compiles since `&T` implements `Pointer`, but is unlikely to occur in practice. Also tweaked the lint's wording and modified tests accordingly.
This commit is contained in:
@@ -164,7 +164,7 @@ impl<'a, 'tcx> FunctionItemRefChecker<'a, 'tcx> {
|
||||
let ret = if fn_sig.output().skip_binder().is_unit() { "" } else { " -> _" };
|
||||
self.tcx.struct_span_lint_hir(FUNCTION_ITEM_REFERENCES, lint_root, span, |lint| {
|
||||
lint.build(&format!(
|
||||
"cast `{}` with `as {}{}fn({}{}){}` to use it as a pointer",
|
||||
"cast `{}` with `as {}{}fn({}{}){}` to obtain a function pointer",
|
||||
ident,
|
||||
unsafety,
|
||||
abi,
|
||||
|
||||
Reference in New Issue
Block a user