Actually span makes more sense on whole function

This commit is contained in:
Richard Dodd 2018-08-21 13:12:25 +01:00
parent 5342a26fd0
commit 496d8cadd8

View File

@ -1114,7 +1114,7 @@ fn assert_last_param_is_slice(decl: &syn::FnDecl) -> Result<(), Diagnostic> {
slice, to hold the arguments of unknown length") slice, to hold the arguments of unknown length")
} }
let arg = decl.inputs.last().ok_or_else(|| not_slice_error(&decl.inputs))?; let arg = decl.inputs.last().ok_or_else(|| not_slice_error(&decl))?;
if let syn::FnArg::Captured(ref arg_cap) = arg.value() { if let syn::FnArg::Captured(ref arg_cap) = arg.value() {
if let syn::Type::Reference(ref ref_ty) = arg_cap.ty { if let syn::Type::Reference(ref ref_ty) = arg_cap.ty {
if let syn::Type::Slice(_) = *ref_ty.elem { if let syn::Type::Slice(_) = *ref_ty.elem {