diff options
10 files changed, 16 insertions, 18 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs index 8c4fe75878f..08b21b82faf 100644 --- a/compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs @@ -102,10 +102,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let msg = match def_id_or_name { DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) { - DefKind::Ctor(CtorOf::Struct, _) => "instantiate this tuple struct".to_string(), - DefKind::Ctor(CtorOf::Variant, _) => { - "instantiate this tuple variant".to_string() - } + DefKind::Ctor(CtorOf::Struct, _) => "construct this tuple struct".to_string(), + DefKind::Ctor(CtorOf::Variant, _) => "construct this tuple variant".to_string(), kind => format!("call this {}", kind.descr(def_id)), }, DefIdOrName::Name(name) => format!("call this {name}"), diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 98e32e2ce85..8c41d9d240c 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -923,10 +923,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { let msg = match def_id_or_name { DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) { DefKind::Ctor(CtorOf::Struct, _) => { - "use parentheses to instantiate this tuple struct".to_string() + "use parentheses to construct this tuple struct".to_string() } DefKind::Ctor(CtorOf::Variant, _) => { - "use parentheses to instantiate this tuple variant".to_string() + "use parentheses to construct this tuple variant".to_string() } kind => format!("use parentheses to call this {}", kind.descr(def_id)), }, diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr index 9ee7654a088..42a78ed97e0 100644 --- a/src/test/ui/issues/issue-35241.stderr +++ b/src/test/ui/issues/issue-35241.stderr @@ -11,7 +11,7 @@ LL | fn test() -> Foo { Foo } | = note: expected struct `Foo` found fn item `fn(u32) -> Foo {Foo}` -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | fn test() -> Foo { Foo(/* u32 */) } | +++++++++++ diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr index a369dc6db52..82a4211f08a 100644 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ b/src/test/ui/resolve/privacy-enum-ctor.stderr @@ -327,7 +327,7 @@ LL | let _: Z = Z::Fn; | = note: expected enum `Z` found fn item `fn(u8) -> Z {Z::Fn}` -help: use parentheses to instantiate this tuple variant +help: use parentheses to construct this tuple variant | LL | let _: Z = Z::Fn(/* u8 */); | ++++++++++ @@ -362,7 +362,7 @@ LL | let _: E = m::E::Fn; | = note: expected enum `E` found fn item `fn(u8) -> E {E::Fn}` -help: use parentheses to instantiate this tuple variant +help: use parentheses to construct this tuple variant | LL | let _: E = m::E::Fn(/* u8 */); | ++++++++++ @@ -397,7 +397,7 @@ LL | let _: E = E::Fn; | = note: expected enum `E` found fn item `fn(u8) -> E {E::Fn}` -help: use parentheses to instantiate this tuple variant +help: use parentheses to construct this tuple variant | LL | let _: E = E::Fn(/* u8 */); | ++++++++++ diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.rs b/src/test/ui/suggestions/call-on-unimplemented-ctor.rs index 0e7412807b4..5f811044eb3 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-ctor.rs +++ b/src/test/ui/suggestions/call-on-unimplemented-ctor.rs @@ -2,7 +2,7 @@ fn main() { insert_resource(Marker); insert_resource(Time); //~^ ERROR the trait bound `fn(u32) -> Time {Time}: Resource` is not satisfied - //~| HELP use parentheses to instantiate this tuple struct + //~| HELP use parentheses to construct this tuple struct } trait Resource {} diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr b/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr index 48f3366596f..58612cbfb23 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr +++ b/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr @@ -11,7 +11,7 @@ note: required by a bound in `insert_resource` | LL | fn insert_resource<R: Resource>(resource: R) {} | ^^^^^^^^ required by this bound in `insert_resource` -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | insert_resource(Time(/* u32 */)); | +++++++++++ diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index f05dba1d4ca..597dc61c3f7 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -49,7 +49,7 @@ LL | let _: S = S; | = note: expected struct `S` found fn item `fn(usize, usize) -> S {S}` -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | let _: S = S(/* usize */, /* usize */); | ++++++++++++++++++++++++++ @@ -85,7 +85,7 @@ LL | let _: V = V; | = note: expected struct `V` found fn item `fn() -> V {V}` -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | let _: V = V(); | ++ @@ -139,7 +139,7 @@ LL | let _: E = E::A; | = note: expected enum `E` found fn item `fn(usize) -> E {E::A}` -help: use parentheses to instantiate this tuple variant +help: use parentheses to construct this tuple variant | LL | let _: E = E::A(/* usize */); | +++++++++++++ diff --git a/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr b/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr index a18c54a29b5..23e7b7cc363 100644 --- a/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr +++ b/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr @@ -4,7 +4,7 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo}` in the LL | thing.bar.foo(); | ^^^ method not found in `fn() -> Foo {Foo}` | -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | (thing.bar)().foo(); | + +++ diff --git a/src/test/ui/typeck/issue-87181/enum-variant.stderr b/src/test/ui/typeck/issue-87181/enum-variant.stderr index 90641410d8e..2247ea27021 100644 --- a/src/test/ui/typeck/issue-87181/enum-variant.stderr +++ b/src/test/ui/typeck/issue-87181/enum-variant.stderr @@ -4,7 +4,7 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo::Tup}` i LL | thing.bar.foo(); | ^^^ method not found in `fn() -> Foo {Foo::Tup}` | -help: use parentheses to instantiate this tuple variant +help: use parentheses to construct this tuple variant | LL | (thing.bar)().foo(); | + +++ diff --git a/src/test/ui/typeck/issue-87181/tuple-field.stderr b/src/test/ui/typeck/issue-87181/tuple-field.stderr index c1ca26ee9af..0a7d30b615a 100644 --- a/src/test/ui/typeck/issue-87181/tuple-field.stderr +++ b/src/test/ui/typeck/issue-87181/tuple-field.stderr @@ -4,7 +4,7 @@ error[E0609]: no field `0` on type `fn(char, u16) -> Foo {Foo}` LL | thing.bar.0; | ^ | -help: use parentheses to instantiate this tuple struct +help: use parentheses to construct this tuple struct | LL | (thing.bar)(/* char */, /* u16 */).0; | + ++++++++++++++++++++++++ |
