]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/astconv/generics.rs
Rustdoc render public underscore_imports as Re-exports
[rust.git] / compiler / rustc_typeck / src / astconv / generics.rs
index 0db5fda272a262db2436215889e865b64d4c2232..b7e77f389f8575c9500156ed57eebeef00e5b64c 100644 (file)
@@ -44,6 +44,13 @@ fn generic_arg_mismatch_err(
             // 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,