Account for bad placeholder types in where clauses

This commit is contained in:
Esteban Küber 2020-03-22 18:50:30 -07:00
parent 5ae85f43f4
commit e75158d486
7 changed files with 192 additions and 86 deletions

View File

@ -20,7 +20,7 @@ use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticId};
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::{CtorOf, DefKind, Namespace, Res}; use rustc_hir::def::{CtorOf, DefKind, Namespace, Res};
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor; use rustc_hir::intravisit::{walk_generics, Visitor};
use rustc_hir::print; use rustc_hir::print;
use rustc_hir::{Constness, ExprKind, GenericArg, GenericArgs}; use rustc_hir::{Constness, ExprKind, GenericArg, GenericArgs};
use rustc_session::lint::builtin::{AMBIGUOUS_ASSOCIATED_ITEMS, LATE_BOUND_LIFETIME_ARGUMENTS}; use rustc_session::lint::builtin::{AMBIGUOUS_ASSOCIATED_ITEMS, LATE_BOUND_LIFETIME_ARGUMENTS};
@ -838,18 +838,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
} }
}, },
); );
if !inferred_params.is_empty() {
// We always collect the spans for placeholder types when evaluating `fn`s, but we
// only want to emit an error complaining about them if infer types (`_`) are not
// allowed. `allow_ty_infer` gates this behavior.
crate::collect::placeholder_type_error(
tcx,
inferred_params[0],
&[],
inferred_params,
false,
);
}
self.complain_about_missing_type_params( self.complain_about_missing_type_params(
missing_type_params, missing_type_params,
@ -2739,7 +2727,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
} }
hir::TyKind::BareFn(ref bf) => { hir::TyKind::BareFn(ref bf) => {
require_c_abi_if_c_variadic(tcx, &bf.decl, bf.abi, ast_ty.span); require_c_abi_if_c_variadic(tcx, &bf.decl, bf.abi, ast_ty.span);
tcx.mk_fn_ptr(self.ty_of_fn(bf.unsafety, bf.abi, &bf.decl, &[], None)) tcx.mk_fn_ptr(self.ty_of_fn(
bf.unsafety,
bf.abi,
&bf.decl,
&hir::Generics::empty(),
None,
))
} }
hir::TyKind::TraitObject(ref bounds, ref lifetime) => { hir::TyKind::TraitObject(ref bounds, ref lifetime) => {
self.conv_object_ty_poly_trait_ref(ast_ty.span, bounds, lifetime) self.conv_object_ty_poly_trait_ref(ast_ty.span, bounds, lifetime)
@ -2922,7 +2916,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
unsafety: hir::Unsafety, unsafety: hir::Unsafety,
abi: abi::Abi, abi: abi::Abi,
decl: &hir::FnDecl<'_>, decl: &hir::FnDecl<'_>,
generic_params: &[hir::GenericParam<'_>], generics: &hir::Generics<'_>,
ident_span: Option<Span>, ident_span: Option<Span>,
) -> ty::PolyFnSig<'tcx> { ) -> ty::PolyFnSig<'tcx> {
debug!("ty_of_fn"); debug!("ty_of_fn");
@ -2934,6 +2928,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
for ty in decl.inputs { for ty in decl.inputs {
visitor.visit_ty(ty); visitor.visit_ty(ty);
} }
walk_generics(&mut visitor, generics);
let input_tys = decl.inputs.iter().map(|a| self.ty_of_arg(a, None)); let input_tys = decl.inputs.iter().map(|a| self.ty_of_arg(a, None));
let output_ty = match decl.output { let output_ty = match decl.output {
hir::FnRetTy::Return(ref output) => { hir::FnRetTy::Return(ref output) => {
@ -2955,7 +2951,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
crate::collect::placeholder_type_error( crate::collect::placeholder_type_error(
tcx, tcx,
ident_span.map(|sp| sp.shrink_to_hi()).unwrap_or(DUMMY_SP), ident_span.map(|sp| sp.shrink_to_hi()).unwrap_or(DUMMY_SP),
generic_params, &generics.params[..],
visitor.0, visitor.0,
ident_span.is_some(), ident_span.is_some(),
); );
@ -2981,8 +2977,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
tcx.sess, tcx.sess,
decl.output.span(), decl.output.span(),
E0581, E0581,
"return type references {} \ "return type references {} which is not constrained by the fn input types",
which is not constrained by the fn input types",
lifetime_name lifetime_name
); );
if let ty::BrAnon(_) = *br { if let ty::BrAnon(_) = *br {
@ -2993,8 +2988,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// though we can easily give a hint that ought to be // though we can easily give a hint that ought to be
// relevant. // relevant.
err.note( err.note(
"lifetimes appearing in an associated type \ "lifetimes appearing in an associated type are not considered constrained",
are not considered constrained",
); );
} }
err.emit(); err.emit();

View File

@ -1003,7 +1003,14 @@ fn typeck_tables_of_with_fallback<'tcx>(
let fcx = if let (Some(header), Some(decl)) = (fn_header, fn_decl) { let fcx = if let (Some(header), Some(decl)) = (fn_header, fn_decl) {
let fn_sig = if crate::collect::get_infer_ret_ty(&decl.output).is_some() { let fn_sig = if crate::collect::get_infer_ret_ty(&decl.output).is_some() {
let fcx = FnCtxt::new(&inh, param_env, body.value.hir_id); let fcx = FnCtxt::new(&inh, param_env, body.value.hir_id);
AstConv::ty_of_fn(&fcx, header.unsafety, header.abi, decl, &[], None) AstConv::ty_of_fn(
&fcx,
header.unsafety,
header.abi,
decl,
&hir::Generics::empty(),
None,
)
} else { } else {
tcx.fn_sig(def_id) tcx.fn_sig(def_id)
}; };

View File

@ -1502,7 +1502,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
sig.header.unsafety, sig.header.unsafety,
sig.header.abi, sig.header.abi,
&sig.decl, &sig.decl,
&generics.params[..], &generics,
Some(ident.span), Some(ident.span),
), ),
} }
@ -1513,14 +1513,9 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
ident, ident,
generics, generics,
.. ..
}) => AstConv::ty_of_fn( }) => {
&icx, AstConv::ty_of_fn(&icx, header.unsafety, header.abi, decl, &generics, Some(ident.span))
header.unsafety, }
header.abi,
decl,
&generics.params[..],
Some(ident.span),
),
ForeignItem(&hir::ForeignItem { kind: ForeignItemKind::Fn(ref fn_decl, _, _), .. }) => { ForeignItem(&hir::ForeignItem { kind: ForeignItemKind::Fn(ref fn_decl, _, _), .. }) => {
let abi = tcx.hir().get_foreign_abi(hir_id); let abi = tcx.hir().get_foreign_abi(hir_id);
@ -2142,7 +2137,14 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
} else { } else {
hir::Unsafety::Unsafe hir::Unsafety::Unsafe
}; };
let fty = AstConv::ty_of_fn(&ItemCtxt::new(tcx, def_id), unsafety, abi, decl, &[], None); let fty = AstConv::ty_of_fn(
&ItemCtxt::new(tcx, def_id),
unsafety,
abi,
decl,
&hir::Generics::empty(),
None,
);
// Feature gate SIMD types in FFI, since I am not sure that the // Feature gate SIMD types in FFI, since I am not sure that the
// ABIs are handled at all correctly. -huonw // ABIs are handled at all correctly. -huonw

View File

@ -49,4 +49,36 @@ trait K<A, B> {}
fn foo<X: K<_, _>>(x: X) {} fn foo<X: K<_, _>>(x: X) {}
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
fn bar<F>(_: F) where F: Fn() -> _ {}
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
fn baz<F: Fn() -> _>(_: F) {}
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
struct L<F>(F) where F: Fn() -> _;
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
struct M<F> where F: Fn() -> _ {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
a: F,
}
enum N<F> where F: Fn() -> _ {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
Foo(F),
}
union O<F> where F: Fn() -> _ {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR unions with non-`Copy` fields are unstable
foo: F,
}
trait P<F> where F: Fn() -> _ {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}
trait Q {
fn foo<F>(_: F) where F: Fn() -> _ {}
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}
fn main() {} fn main() {}

View File

@ -57,6 +57,19 @@ LL | type J = ty!(u8);
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: unions with non-`Copy` fields are unstable
--> $DIR/bad-assoc-ty.rs:69:1
|
LL | / union O<F> where F: Fn() -> _ {
LL | |
LL | |
LL | | foo: F,
LL | | }
| |_^
|
= note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
= help: add `#![feature(untagged_unions)]` to the crate attributes to enable
error[E0223]: ambiguous associated type error[E0223]: ambiguous associated type
--> $DIR/bad-assoc-ty.rs:1:10 --> $DIR/bad-assoc-ty.rs:1:10
| |
@ -129,8 +142,101 @@ LL | fn foo<X: K<_, _>>(x: X) {}
| ^ ^ not allowed in type signatures | ^ ^ not allowed in type signatures
| | | |
| not allowed in type signatures | not allowed in type signatures
|
help: use type parameters instead
|
LL | fn foo<X, T: K<T, T>>(x: X) {}
| ^^^ ^ ^
error: aborting due to 20 previous errors error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:52:34
|
LL | fn bar<F>(_: F) where F: Fn() -> _ {}
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
| ^^^ ^
Some errors have detailed explanations: E0121, E0223. error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:55:19
|
LL | fn baz<F: Fn() -> _>(_: F) {}
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | fn baz<F, T: Fn() -> T>(_: F) {}
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:58:33
|
LL | struct L<F>(F) where F: Fn() -> _;
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | struct L<F, T>(F) where F: Fn() -> T;
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:60:30
|
LL | struct M<F> where F: Fn() -> _ {
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | struct M<F, T> where F: Fn() -> T {
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:64:28
|
LL | enum N<F> where F: Fn() -> _ {
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | enum N<F, T> where F: Fn() -> T {
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:69:29
|
LL | union O<F> where F: Fn() -> _ {
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | union O<F, T> where F: Fn() -> T {
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:75:29
|
LL | trait P<F> where F: Fn() -> _ {
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | trait P<F, T> where F: Fn() -> T {
| ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:80:38
|
LL | fn foo<F>(_: F) where F: Fn() -> _ {}
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | fn foo<F, T>(_: F) where F: Fn() -> T {}
| ^^^ ^
error: aborting due to 29 previous errors
Some errors have detailed explanations: E0121, E0223, E0658.
For more information about an error, try `rustc --explain E0121`. For more information about an error, try `rustc --explain E0121`.

View File

@ -158,12 +158,9 @@ trait BadTrait<_> {}
//~^ ERROR expected identifier, found reserved identifier `_` //~^ ERROR expected identifier, found reserved identifier `_`
impl BadTrait<_> for BadStruct<_> {} impl BadTrait<_> for BadStruct<_> {}
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR the type placeholder `_` is not allowed within types on item signatures
fn impl_trait() -> impl BadTrait<_> { fn impl_trait() -> impl BadTrait<_> {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR the type placeholder `_` is not allowed within types on item signatures
unimplemented!() unimplemented!()
} }
@ -178,14 +175,12 @@ struct BadStruct2<_, T>(_, T);
type X = Box<_>; type X = Box<_>;
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR the type placeholder `_` is not allowed within types on item signatures
struct Struct; struct Struct;
trait Trait<T> {} trait Trait<T> {}
impl Trait<usize> for Struct {} impl Trait<usize> for Struct {}
type Y = impl Trait<_>; type Y = impl Trait<_>;
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR the type placeholder `_` is not allowed within types on item signatures
fn foo() -> Y { fn foo() -> Y {
Struct Struct
} }

View File

@ -11,25 +11,25 @@ LL | trait BadTrait<_> {}
| ^ expected identifier, found reserved identifier | ^ expected identifier, found reserved identifier
error: expected identifier, found reserved identifier `_` error: expected identifier, found reserved identifier `_`
--> $DIR/typeck_type_placeholder_item.rs:170:19 --> $DIR/typeck_type_placeholder_item.rs:167:19
| |
LL | struct BadStruct1<_, _>(_); LL | struct BadStruct1<_, _>(_);
| ^ expected identifier, found reserved identifier | ^ expected identifier, found reserved identifier
error: expected identifier, found reserved identifier `_` error: expected identifier, found reserved identifier `_`
--> $DIR/typeck_type_placeholder_item.rs:170:22 --> $DIR/typeck_type_placeholder_item.rs:167:22
| |
LL | struct BadStruct1<_, _>(_); LL | struct BadStruct1<_, _>(_);
| ^ expected identifier, found reserved identifier | ^ expected identifier, found reserved identifier
error: expected identifier, found reserved identifier `_` error: expected identifier, found reserved identifier `_`
--> $DIR/typeck_type_placeholder_item.rs:175:19 --> $DIR/typeck_type_placeholder_item.rs:172:19
| |
LL | struct BadStruct2<_, T>(_, T); LL | struct BadStruct2<_, T>(_, T);
| ^ expected identifier, found reserved identifier | ^ expected identifier, found reserved identifier
error: associated constant in `impl` without body error: associated constant in `impl` without body
--> $DIR/typeck_type_placeholder_item.rs:208:5 --> $DIR/typeck_type_placeholder_item.rs:203:5
| |
LL | const C: _; LL | const C: _;
| ^^^^^^^^^^- | ^^^^^^^^^^-
@ -37,7 +37,7 @@ LL | const C: _;
| help: provide a definition for the constant: `= <expr>;` | help: provide a definition for the constant: `= <expr>;`
error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
--> $DIR/typeck_type_placeholder_item.rs:170:22 --> $DIR/typeck_type_placeholder_item.rs:167:22
| |
LL | struct BadStruct1<_, _>(_); LL | struct BadStruct1<_, _>(_);
| - ^ already used | - ^ already used
@ -351,18 +351,6 @@ help: use type parameters instead
LL | struct BadStruct<T>(T); LL | struct BadStruct<T>(T);
| ^ ^ | ^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:159:32
|
LL | impl BadTrait<_> for BadStruct<_> {}
| ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:159:15
|
LL | impl BadTrait<_> for BadStruct<_> {}
| ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:159:15 --> $DIR/typeck_type_placeholder_item.rs:159:15
| |
@ -377,13 +365,13 @@ LL | impl<T> BadTrait<T> for BadStruct<T> {}
| ^^^ ^ ^ | ^^^ ^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:164:34 --> $DIR/typeck_type_placeholder_item.rs:162:34
| |
LL | fn impl_trait() -> impl BadTrait<_> { LL | fn impl_trait() -> impl BadTrait<_> {
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:170:25 --> $DIR/typeck_type_placeholder_item.rs:167:25
| |
LL | struct BadStruct1<_, _>(_); LL | struct BadStruct1<_, _>(_);
| ^ not allowed in type signatures | ^ not allowed in type signatures
@ -394,7 +382,7 @@ LL | struct BadStruct1<T, _>(T);
| ^ ^ | ^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:175:25 --> $DIR/typeck_type_placeholder_item.rs:172:25
| |
LL | struct BadStruct2<_, T>(_, T); LL | struct BadStruct2<_, T>(_, T);
| ^ not allowed in type signatures | ^ not allowed in type signatures
@ -405,13 +393,7 @@ LL | struct BadStruct2<K, T>(K, T);
| ^ ^ | ^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:179:14 --> $DIR/typeck_type_placeholder_item.rs:176:14
|
LL | type X = Box<_>;
| ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:179:14
| |
LL | type X = Box<_>; LL | type X = Box<_>;
| ^ not allowed in type signatures | ^ not allowed in type signatures
@ -531,37 +513,25 @@ LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
| ^^^ ^ | ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:164:34 --> $DIR/typeck_type_placeholder_item.rs:182:21
|
LL | fn impl_trait() -> impl BadTrait<_> {
| ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:186:21
| |
LL | type Y = impl Trait<_>; LL | type Y = impl Trait<_>;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:186:21 --> $DIR/typeck_type_placeholder_item.rs:190:14
|
LL | type Y = impl Trait<_>;
| ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:195:14
| |
LL | type B = _; LL | type B = _;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:197:14 --> $DIR/typeck_type_placeholder_item.rs:192:14
| |
LL | const C: _; LL | const C: _;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:199:14 --> $DIR/typeck_type_placeholder_item.rs:194:14
| |
LL | const D: _ = 42; LL | const D: _ = 42;
| ^ | ^
@ -606,25 +576,25 @@ LL | fn clone(&self) -> _ { FnTest9 }
| help: replace with the correct return type: `main::FnTest9` | help: replace with the correct return type: `main::FnTest9`
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:204:14 --> $DIR/typeck_type_placeholder_item.rs:199:14
| |
LL | type A = _; LL | type A = _;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:206:14 --> $DIR/typeck_type_placeholder_item.rs:201:14
| |
LL | type B = _; LL | type B = _;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:208:14 --> $DIR/typeck_type_placeholder_item.rs:203:14
| |
LL | const C: _; LL | const C: _;
| ^ not allowed in type signatures | ^ not allowed in type signatures
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/typeck_type_placeholder_item.rs:211:14 --> $DIR/typeck_type_placeholder_item.rs:206:14
| |
LL | const D: _ = 42; LL | const D: _ = 42;
| ^ | ^
@ -632,7 +602,7 @@ LL | const D: _ = 42;
| not allowed in type signatures | not allowed in type signatures
| help: replace `_` with the correct type: `i32` | help: replace `_` with the correct type: `i32`
error: aborting due to 71 previous errors error: aborting due to 66 previous errors
Some errors have detailed explanations: E0121, E0282, E0403. Some errors have detailed explanations: E0121, E0282, E0403.
For more information about an error, try `rustc --explain E0121`. For more information about an error, try `rustc --explain E0121`.