Const parameters can not be inferred with _
Small improvement. Thanks varkor Co-authored-by: varkor <github@varkor.com> Bless
This commit is contained in:
parent
e6225434ff
commit
6845e22bba
4 changed files with 28 additions and 0 deletions
|
@ -44,6 +44,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
// the match is non-exhaustive.
|
||||
_ => bug!("invalid generic parameter kind {}", kind),
|
||||
};
|
||||
|
||||
if let ParamKindOrd::Const { .. } = kind_ord {
|
||||
if let GenericArg::Type(hir::Ty { kind: hir::TyKind::Infer, .. }) = arg {
|
||||
err.help("const arguments cannot yet be inferred with `_`");
|
||||
}
|
||||
}
|
||||
|
||||
let arg_ord = match arg {
|
||||
GenericArg::Lifetime(_) => ParamKindOrd::Lifetime,
|
||||
GenericArg::Type(_) => ParamKindOrd::Type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue