From 8ef81388e2def7b12d3b527705bf32402c8d7c8a Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 30 Dec 2020 15:34:53 +0000 Subject: [PATCH] Some refactoring --- compiler/rustc_ast/src/mut_visit.rs | 2 +- .../rustc_ast_passes/src/ast_validation.rs | 2 +- compiler/rustc_ast_pretty/src/pprust/state.rs | 1 + .../src/infer/error_reporting/mod.rs | 5 ++-- compiler/rustc_metadata/src/rmeta/encoder.rs | 7 +++-- compiler/rustc_passes/src/stability.rs | 7 ++--- compiler/rustc_privacy/src/lib.rs | 1 + compiler/rustc_resolve/src/diagnostics.rs | 4 +-- compiler/rustc_resolve/src/late.rs | 28 +++++++++---------- compiler/rustc_resolve/src/lib.rs | 14 ++++++---- compiler/rustc_typeck/src/astconv/mod.rs | 3 +- .../rustc_typeck/src/check/fn_ctxt/_impl.rs | 2 +- compiler/rustc_typeck/src/check/wfcheck.rs | 7 +++-- compiler/rustc_typeck/src/collect.rs | 6 +++- compiler/rustc_typeck/src/collect/type_of.rs | 3 +- .../const-generics/defaults/const-default.rs | 5 +--- .../default_function_param.rs | 9 +++--- .../default_function_param.stderr | 11 +++----- .../min_const_generics/default_trait_param.rs | 2 ++ src/test/ui/error-codes/E0128.stderr | 4 +-- .../feature-gate-const_generic_defaults.rs | 5 ---- ...feature-gate-const_generic_defaults.stderr | 10 ------- .../generic-non-trailing-defaults.stderr | 9 +----- ...generic-type-params-forward-mention.stderr | 4 +-- src/test/ui/issues/issue-18183.stderr | 4 +-- src/test/ui/issues/issue-26812.stderr | 4 +-- .../ui/panic-handler/weak-lang-item.stderr | 4 +-- 27 files changed, 74 insertions(+), 89 deletions(-) delete mode 100644 src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs delete mode 100644 src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index c5378fb47bc2a..f426f2c7fece5 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -785,8 +785,8 @@ pub fn noop_flat_map_generic_param( visit_opt(default, |default| vis.visit_ty(default)); } GenericParamKind::Const { ty, kw_span: _, default } => { - visit_opt(default, |default| vis.visit_anon_const(default)); vis.visit_ty(ty); + visit_opt(default, |default| vis.visit_anon_const(default)); } } smallvec![param] diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 235528d6b02bf..d4d7713f70565 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -1180,7 +1180,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { default.value.span, "default values for const generic parameters are unstable", ); - err.note("to enable them use #![feature(const_generic_defaults)]"); + err.help("add `#![feature(const_generic_defaults)]` to the crate attributes to enable"); err.emit(); break; } diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 3a7ec3a8df1dd..d6f2773cc47ce 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -2659,6 +2659,7 @@ impl<'a> State<'a> { s.word_space(":"); s.print_type(ty); s.print_type_bounds(":", ¶m.bounds); + // FIXME(const_generic_defaults) if let Some(ref _default) = default { // FIXME(const_generics_defaults): print the `default` value here s.s.space(); diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index d614f18610683..7df80b2b5b9a4 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -963,9 +963,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { .rev() .filter_map(|param| match param.kind { ty::GenericParamDefKind::Lifetime => None, - - ty::GenericParamDefKind::Type { has_default, .. } - | ty::GenericParamDefKind::Const { has_default } => { + ty::GenericParamDefKind::Const { has_default } + | ty::GenericParamDefKind::Type { has_default, .. } => { Some((param.def_id, has_default)) } }) diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index ff8ec1d551323..3237857452736 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -1876,13 +1876,16 @@ impl EncodeContext<'a, 'tcx> { default.is_some(), ); } - GenericParamKind::Const { .. } => { + GenericParamKind::Const { ref default, .. } => { self.encode_info_for_generic_param( def_id.to_def_id(), EntryKind::ConstParam, true, ); - // FIXME(const_generics_defaults) + if default.is_some() { + self.encode_stability(def_id.to_def_id()); + } + // FIXME(const_generic_defaults) } } } diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index dd9cb51c858b4..8a6ac843534c6 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -507,10 +507,9 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> { fn visit_generic_param(&mut self, p: &'tcx hir::GenericParam<'tcx>) { let kind = match &p.kind { - // FIXME(const_generics_defaults) - hir::GenericParamKind::Type { default, .. } if default.is_some() => { - AnnotationKind::Container - } + // Allow stability attributes on default generic arguments. + hir::GenericParamKind::Type { default: Some(_), .. } + | hir::GenericParamKind::Const { default: Some(_), .. } => AnnotationKind::Container, _ => AnnotationKind::Prohibited, }; diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 9ba9524ee1a08..d9789dda2ea9e 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -931,6 +931,7 @@ impl ReachEverythingInTheInterfaceVisitor<'_, 'tcx> { GenericParamDefKind::Const { has_default, .. } => { self.visit(self.ev.tcx.type_of(param.def_id)); if has_default { + // FIXME(const_generic_defaults) // how should the error case be handled here? // let default_const = self.ev.tcx.const_eval_poly(param.def_id).unwrap(); // self.visit(default_const); diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 7493fd68505fe..d402fa4f8494f 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -450,12 +450,12 @@ impl<'a> Resolver<'a> { self.session, span, E0128, - "type parameters with a default cannot use \ + "generic parameters with a default cannot use \ forward declared identifiers" ); err.span_label( span, - "defaulted type parameters cannot be forward declared".to_string(), + "defaulted generic parameters cannot be forward declared".to_string(), ); err } diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 85faa961b1492..f9f33492a1ec3 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -132,10 +132,10 @@ crate enum RibKind<'a> { /// We passed through a `macro_rules!` statement MacroDefinition(DefId), - /// All bindings in this rib are type parameters that can't be used - /// from the default of a type parameter because they're not declared - /// before said type parameter. Also see the `visit_generics` override. - ForwardTyParamBanRibKind, + /// All bindings in this rib are generic parameters that can't be used + /// from the default of a generic parameter because they're not declared + /// before said generic parameter. Also see the `visit_generics` override. + ForwardGenericParamBanRibKind, /// We are inside of the type of a const parameter. Can't refer to any /// parameters. @@ -154,7 +154,7 @@ impl RibKind<'_> { | ModuleRibKind(_) | MacroDefinition(_) | ConstParamTyRibKind => false, - AssocItemRibKind | ItemRibKind(_) | ForwardTyParamBanRibKind => true, + AssocItemRibKind | ItemRibKind(_) | ForwardGenericParamBanRibKind => true, } } } @@ -555,15 +555,16 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { // provide previous type parameters as they're built. We // put all the parameters on the ban list and then remove // them one by one as they are processed and become available. - let mut default_ban_rib = Rib::new(ForwardTyParamBanRibKind); + let mut default_ban_rib = Rib::new(ForwardGenericParamBanRibKind); let mut found_default = false; default_ban_rib.bindings.extend(generics.params.iter().filter_map( |param| match param.kind { - GenericParamKind::Const { .. } | GenericParamKind::Lifetime { .. } => None, - GenericParamKind::Type { ref default, .. } => { - found_default |= default.is_some(); - found_default.then_some((Ident::with_dummy_span(param.ident.name), Res::Err)) + GenericParamKind::Type { default: Some(_), .. } + | GenericParamKind::Const { default: Some(_), .. } => { + found_default = true; + Some((Ident::with_dummy_span(param.ident.name), Res::Err)) } + _ => None, }, )); @@ -591,8 +592,8 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { if let Some(ref ty) = default { self.ribs[TypeNS].push(default_ban_rib); - self.with_rib(ValueNS, ForwardTyParamBanRibKind, |this| { - // HACK: We use an empty `ForwardTyParamBanRibKind` here which + self.with_rib(ValueNS, ForwardGenericParamBanRibKind, |this| { + // HACK: We use an empty `ForwardGenericParamBanRibKind` here which // is only used to forbid the use of const parameters inside of // type defaults. // @@ -616,7 +617,6 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { self.visit_ty(ty); self.ribs[TypeNS].pop().unwrap(); self.ribs[ValueNS].pop().unwrap(); - // FIXME(const_generics:default) do something with default here? } } } @@ -866,7 +866,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { | ItemRibKind(..) | ConstantItemRibKind(..) | ModuleRibKind(..) - | ForwardTyParamBanRibKind + | ForwardGenericParamBanRibKind | ConstParamTyRibKind => { return false; } diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index d8f201fd0d8fa..4eda1220599c7 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -2592,8 +2592,8 @@ impl<'a> Resolver<'a> { debug!("validate_res_from_ribs({:?})", res); let ribs = &all_ribs[rib_index + 1..]; - // An invalid forward use of a type parameter from a previous default. - if let ForwardTyParamBanRibKind = all_ribs[rib_index].kind { + // An invalid forward use of a generic parameter from a previous default. + if let ForwardGenericParamBanRibKind = all_ribs[rib_index].kind { if record_used { let res_error = if rib_ident.name == kw::SelfUpper { ResolutionError::SelfInTyParamDefault @@ -2617,7 +2617,7 @@ impl<'a> Resolver<'a> { | ClosureOrAsyncRibKind | ModuleRibKind(..) | MacroDefinition(..) - | ForwardTyParamBanRibKind => { + | ForwardGenericParamBanRibKind => { // Nothing to do. Continue. } ItemRibKind(_) | FnItemRibKind | AssocItemRibKind => { @@ -2689,7 +2689,9 @@ impl<'a> Resolver<'a> { // We only forbid constant items if we are inside of type defaults, // for example `struct Foo()]>` - ForwardTyParamBanRibKind => { + ForwardGenericParamBanRibKind => { + // FIXME(const_generic_defaults): we may need to distinguish between + // being in type parameter defaults and const parameter defaults in_ty_param_default = true; continue; } @@ -2782,7 +2784,9 @@ impl<'a> Resolver<'a> { // We only forbid constant items if we are inside of type defaults, // for example `struct Foo()]>` - ForwardTyParamBanRibKind => { + ForwardGenericParamBanRibKind => { + // FIXME(const_generic_defaults): we may need to distinguish between + // being in type parameter defaults and const parameter defaults in_ty_param_default = true; continue; } diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index 34e5ab9073371..4328d0acb0a2a 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -507,7 +507,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { GenericParamDefKind::Const { has_default } => { let ty = tcx.at(self.span).type_of(param.def_id); if !infer_args && has_default { - let c = ty::Const::from_anon_const(tcx, param.def_id.expect_local()); + let c = substs.unwrap()[param.index as usize].expect_const(); ty::subst::GenericArg::from(c) } else if infer_args { self.astconv.ct_infer(ty, Some(param), self.span).into() @@ -515,6 +515,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { // We've already errored above about the mismatch. tcx.const_error(ty).into() } + // FIXME(const_generic_defaults) /* if !infer_args && has_default { /* diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs index a5733c9637d4f..2c13405b72c99 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs @@ -1447,7 +1447,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if infer_args || !has_default { return self.fcx.var_for_def(self.span, param); } - // FIXME(const_generics:defaults) + // FIXME(const_generic_defaults) // No const parameters were provided, we have to infer them. todo!() } diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index d257ea22dc1c9..5e61a168270f5 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -713,10 +713,11 @@ fn check_where_clauses<'tcx, 'fcx>( let generics = tcx.generics_of(def_id); let is_our_default = |def: &ty::GenericParamDef| match def.kind { - GenericParamDefKind::Type { has_default, .. } => { + GenericParamDefKind::Type { has_default, .. } + | GenericParamDefKind::Const { has_default } => { has_default && def.index >= generics.parent_count as u32 } - _ => unreachable!(), + GenericParamDefKind::Lifetime => unreachable!(), }; // Check that concrete defaults are well-formed. See test `type-check-defaults.rs`. @@ -758,7 +759,7 @@ fn check_where_clauses<'tcx, 'fcx>( fcx.tcx.mk_param_from_def(param) } - GenericParamDefKind::Const { .. } | GenericParamDefKind::Type { .. } => { + GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => { // If the param has a default, ... if is_our_default(param) { let default_ty = fcx.tcx.type_of(param.def_id); diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index 424e5ab900dbc..44e905c0b0a26 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -254,10 +254,14 @@ impl Visitor<'tcx> for CollectItemTypesVisitor<'tcx> { self.tcx.ensure().type_of(def_id); } hir::GenericParamKind::Type { .. } => {} - hir::GenericParamKind::Const { .. } => { + hir::GenericParamKind::Const { default, .. } => { let def_id = self.tcx.hir().local_def_id(param.hir_id); self.tcx.ensure().type_of(def_id); // FIXME(const_generics_defaults) + if let Some(default) = default { + let def_id = self.tcx.hir().local_def_id(default.hir_id); + self.tcx.ensure().type_of(def_id); + } } } } diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index b7f7b8355ff2b..95905b53585a9 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -83,8 +83,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option< return generics .params .iter() - .filter(|param| matches!(param.kind, ty::GenericParamDefKind::Const { .. - })) + .filter(|param| matches!(param.kind, ty::GenericParamDefKind::Const { .. })) .nth(arg_index) .map(|param| param.def_id); } diff --git a/src/test/ui/const-generics/defaults/const-default.rs b/src/test/ui/const-generics/defaults/const-default.rs index b2286e7d5bd98..00410224de5bb 100644 --- a/src/test/ui/const-generics/defaults/const-default.rs +++ b/src/test/ui/const-generics/defaults/const-default.rs @@ -5,10 +5,7 @@ #![allow(incomplete_features)] -#[derive(Default)] -pub struct ConstDefault { - items: [u32; N] -} +pub struct ConstDefault {} pub fn main() { let s = ConstDefault::default(); diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.rs b/src/test/ui/const-generics/min_const_generics/default_function_param.rs index e4044eaaa7cf3..52803c5b7266a 100644 --- a/src/test/ui/const-generics/min_const_generics/default_function_param.rs +++ b/src/test/ui/const-generics/min_const_generics/default_function_param.rs @@ -1,7 +1,6 @@ -#![feature(const_generic_defaults)] +#![crate_type = "lib"] +#![feature(const_generics_defaults)] #![feature(min_const_generics)] +#![allow(incomplete_features)] -fn foo() {} -//~^ ERROR default values for const generic parameters are experimental - -fn main() {} +fn foo() {} diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr b/src/test/ui/const-generics/min_const_generics/default_function_param.stderr index 31b5ad5123ed2..c7148e8ec071a 100644 --- a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr +++ b/src/test/ui/const-generics/min_const_generics/default_function_param.stderr @@ -1,12 +1,9 @@ -error[E0658]: default values for const generic parameters are experimental - --> $DIR/default_function_param.rs:1:26 +error[E0282]: type annotations needed + --> $DIR/default_function_param.rs:6:28 | LL | fn foo() {} - | ^^^ - | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable + | ^ cannot infer type for type `{integer}` error: aborting due to previous error -For more information about this error, try `rustc --explain E0658`. +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs b/src/test/ui/const-generics/min_const_generics/default_trait_param.rs index c3581aca1cf42..14bac473ed9a0 100644 --- a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs +++ b/src/test/ui/const-generics/min_const_generics/default_trait_param.rs @@ -1,2 +1,4 @@ trait Foo {} //~^ ERROR default values for const generic parameters are experimental + +fn main() {} diff --git a/src/test/ui/error-codes/E0128.stderr b/src/test/ui/error-codes/E0128.stderr index 253aa166bd371..eb66d46936a85 100644 --- a/src/test/ui/error-codes/E0128.stderr +++ b/src/test/ui/error-codes/E0128.stderr @@ -1,8 +1,8 @@ -error[E0128]: type parameters with a default cannot use forward declared identifiers +error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/E0128.rs:1:14 | LL | struct Foo { - | ^ defaulted type parameters cannot be forward declared + | ^ defaulted generic parameters cannot be forward declared error: aborting due to previous error diff --git a/src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs b/src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs deleted file mode 100644 index 6ba314666e2e5..0000000000000 --- a/src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(min_const_generics)] -#![crate_type="lib"] - -struct A; -//~^ ERROR default values for diff --git a/src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr b/src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr deleted file mode 100644 index 0b7140c0c0f80..0000000000000 --- a/src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: default values for const generic parameters are unstable - --> $DIR/feature-gate-const_generic_defaults.rs:4:27 - | -LL | struct A; - | ^ - | - = note: to enable them use #![feature(const_generic_defaults)] - -error: aborting due to previous error - diff --git a/src/test/ui/generics/generic-non-trailing-defaults.stderr b/src/test/ui/generics/generic-non-trailing-defaults.stderr index fb359f673a95e..33dd442972208 100644 --- a/src/test/ui/generics/generic-non-trailing-defaults.stderr +++ b/src/test/ui/generics/generic-non-trailing-defaults.stderr @@ -10,12 +10,5 @@ error: type parameters with a default must be trailing LL | struct Foo, C>(A, B, C); | ^ -error[E0128]: type parameters with a default cannot use forward declared identifiers - --> $DIR/generic-non-trailing-defaults.rs:6:23 - | -LL | struct Foo, C>(A, B, C); - | ^ defaulted type parameters cannot be forward declared - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0128`. diff --git a/src/test/ui/generics/generic-type-params-forward-mention.stderr b/src/test/ui/generics/generic-type-params-forward-mention.stderr index 97389c337fcbe..fa661c274ebca 100644 --- a/src/test/ui/generics/generic-type-params-forward-mention.stderr +++ b/src/test/ui/generics/generic-type-params-forward-mention.stderr @@ -1,8 +1,8 @@ -error[E0128]: type parameters with a default cannot use forward declared identifiers +error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/generic-type-params-forward-mention.rs:2:23 | LL | struct Foo, U = bool>(T, U); - | ^ defaulted type parameters cannot be forward declared + | ^ defaulted generic parameters cannot be forward declared error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18183.stderr b/src/test/ui/issues/issue-18183.stderr index c8f8ac9296dc0..a7dc64708d856 100644 --- a/src/test/ui/issues/issue-18183.stderr +++ b/src/test/ui/issues/issue-18183.stderr @@ -1,8 +1,8 @@ -error[E0128]: type parameters with a default cannot use forward declared identifiers +error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/issue-18183.rs:1:20 | LL | pub struct Foo(Bar); - | ^^^ defaulted type parameters cannot be forward declared + | ^^^ defaulted generic parameters cannot be forward declared error: aborting due to previous error diff --git a/src/test/ui/issues/issue-26812.stderr b/src/test/ui/issues/issue-26812.stderr index 8d507a7ea0144..fd1bbb9c5673d 100644 --- a/src/test/ui/issues/issue-26812.stderr +++ b/src/test/ui/issues/issue-26812.stderr @@ -1,8 +1,8 @@ -error[E0128]: type parameters with a default cannot use forward declared identifiers +error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/issue-26812.rs:3:10 | LL | fn avg(_: T) {} - | ^^^^^^^ defaulted type parameters cannot be forward declared + | ^^^^^^^ defaulted generic parameters cannot be forward declared error: aborting due to previous error diff --git a/src/test/ui/panic-handler/weak-lang-item.stderr b/src/test/ui/panic-handler/weak-lang-item.stderr index 68e3e21df3e08..b7c040c7a850b 100644 --- a/src/test/ui/panic-handler/weak-lang-item.stderr +++ b/src/test/ui/panic-handler/weak-lang-item.stderr @@ -10,10 +10,10 @@ help: you can use `as` to change the binding name of the import LL | extern crate core as other_core; | -error: language item required, but not found: `eh_personality` - error: `#[panic_handler]` function required, but not found +error: language item required, but not found: `eh_personality` + error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0259`.