fix(macros): forbid casts to `_` in bind parameters
@@ -35,8 +35,14 @@ pub fn quote_args<DB: DatabaseExt>(
let param_ty = param_ty.as_ref().unwrap();
let param_ty = match get_type_override(expr) {
- // don't emit typechecking code for this binding
- Some(Type::Infer(_)) => return Ok(quote!()),
+ // TODO: enable this in 1.45 when we can strip `as _`
+ // without stripping these we get some pretty nasty type errors
+ Some(Type::Infer(_)) => return Err(
+ syn::Error::new_spanned(
+ expr,
+ "casts to `_` are not allowed in bind parameters yet"
+ ).into()
+ ),
Some(ty) => ty.to_token_stream(),
None => {
DB::param_type_for_id(&param_ty)
