Skip to content

Commit 35f1570

Browse files
instantiate -> construct
1 parent 7eb2d4e commit 35f1570

File tree

10 files changed

+16
-18
lines changed

10 files changed

+16
-18
lines changed

compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
102102

103103
let msg = match def_id_or_name {
104104
DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) {
105-
DefKind::Ctor(CtorOf::Struct, _) => "instantiate this tuple struct".to_string(),
106-
DefKind::Ctor(CtorOf::Variant, _) => {
107-
"instantiate this tuple variant".to_string()
108-
}
105+
DefKind::Ctor(CtorOf::Struct, _) => "construct this tuple struct".to_string(),
106+
DefKind::Ctor(CtorOf::Variant, _) => "construct this tuple variant".to_string(),
109107
kind => format!("call this {}", kind.descr(def_id)),
110108
},
111109
DefIdOrName::Name(name) => format!("call this {name}"),

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -923,10 +923,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
923923
let msg = match def_id_or_name {
924924
DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) {
925925
DefKind::Ctor(CtorOf::Struct, _) => {
926-
"use parentheses to instantiate this tuple struct".to_string()
926+
"use parentheses to construct this tuple struct".to_string()
927927
}
928928
DefKind::Ctor(CtorOf::Variant, _) => {
929-
"use parentheses to instantiate this tuple variant".to_string()
929+
"use parentheses to construct this tuple variant".to_string()
930930
}
931931
kind => format!("use parentheses to call this {}", kind.descr(def_id)),
932932
},

src/test/ui/issues/issue-35241.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | fn test() -> Foo { Foo }
1111
|
1212
= note: expected struct `Foo`
1313
found fn item `fn(u32) -> Foo {Foo}`
14-
help: use parentheses to instantiate this tuple struct
14+
help: use parentheses to construct this tuple struct
1515
|
1616
LL | fn test() -> Foo { Foo(/* u32 */) }
1717
| +++++++++++

src/test/ui/resolve/privacy-enum-ctor.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ LL | let _: Z = Z::Fn;
327327
|
328328
= note: expected enum `Z`
329329
found fn item `fn(u8) -> Z {Z::Fn}`
330-
help: use parentheses to instantiate this tuple variant
330+
help: use parentheses to construct this tuple variant
331331
|
332332
LL | let _: Z = Z::Fn(/* u8 */);
333333
| ++++++++++
@@ -362,7 +362,7 @@ LL | let _: E = m::E::Fn;
362362
|
363363
= note: expected enum `E`
364364
found fn item `fn(u8) -> E {E::Fn}`
365-
help: use parentheses to instantiate this tuple variant
365+
help: use parentheses to construct this tuple variant
366366
|
367367
LL | let _: E = m::E::Fn(/* u8 */);
368368
| ++++++++++
@@ -397,7 +397,7 @@ LL | let _: E = E::Fn;
397397
|
398398
= note: expected enum `E`
399399
found fn item `fn(u8) -> E {E::Fn}`
400-
help: use parentheses to instantiate this tuple variant
400+
help: use parentheses to construct this tuple variant
401401
|
402402
LL | let _: E = E::Fn(/* u8 */);
403403
| ++++++++++

src/test/ui/suggestions/call-on-unimplemented-ctor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
insert_resource(Marker);
33
insert_resource(Time);
44
//~^ ERROR the trait bound `fn(u32) -> Time {Time}: Resource` is not satisfied
5-
//~| HELP use parentheses to instantiate this tuple struct
5+
//~| HELP use parentheses to construct this tuple struct
66
}
77

88
trait Resource {}

src/test/ui/suggestions/call-on-unimplemented-ctor.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `insert_resource`
1111
|
1212
LL | fn insert_resource<R: Resource>(resource: R) {}
1313
| ^^^^^^^^ required by this bound in `insert_resource`
14-
help: use parentheses to instantiate this tuple struct
14+
help: use parentheses to construct this tuple struct
1515
|
1616
LL | insert_resource(Time(/* u32 */));
1717
| +++++++++++

src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ LL | let _: S = S;
4949
|
5050
= note: expected struct `S`
5151
found fn item `fn(usize, usize) -> S {S}`
52-
help: use parentheses to instantiate this tuple struct
52+
help: use parentheses to construct this tuple struct
5353
|
5454
LL | let _: S = S(/* usize */, /* usize */);
5555
| ++++++++++++++++++++++++++
@@ -85,7 +85,7 @@ LL | let _: V = V;
8585
|
8686
= note: expected struct `V`
8787
found fn item `fn() -> V {V}`
88-
help: use parentheses to instantiate this tuple struct
88+
help: use parentheses to construct this tuple struct
8989
|
9090
LL | let _: V = V();
9191
| ++
@@ -139,7 +139,7 @@ LL | let _: E = E::A;
139139
|
140140
= note: expected enum `E`
141141
found fn item `fn(usize) -> E {E::A}`
142-
help: use parentheses to instantiate this tuple variant
142+
help: use parentheses to construct this tuple variant
143143
|
144144
LL | let _: E = E::A(/* usize */);
145145
| +++++++++++++

src/test/ui/typeck/issue-87181/empty-tuple-method.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo}` in the
44
LL | thing.bar.foo();
55
| ^^^ method not found in `fn() -> Foo {Foo}`
66
|
7-
help: use parentheses to instantiate this tuple struct
7+
help: use parentheses to construct this tuple struct
88
|
99
LL | (thing.bar)().foo();
1010
| + +++

src/test/ui/typeck/issue-87181/enum-variant.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo::Tup}` i
44
LL | thing.bar.foo();
55
| ^^^ method not found in `fn() -> Foo {Foo::Tup}`
66
|
7-
help: use parentheses to instantiate this tuple variant
7+
help: use parentheses to construct this tuple variant
88
|
99
LL | (thing.bar)().foo();
1010
| + +++

src/test/ui/typeck/issue-87181/tuple-field.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0609]: no field `0` on type `fn(char, u16) -> Foo {Foo}`
44
LL | thing.bar.0;
55
| ^
66
|
7-
help: use parentheses to instantiate this tuple struct
7+
help: use parentheses to construct this tuple struct
88
|
99
LL | (thing.bar)(/* char */, /* u16 */).0;
1010
| + ++++++++++++++++++++++++

0 commit comments

Comments
 (0)