instantiate -> construct
This commit is contained in:
parent
7eb2d4e7d0
commit
35f1570732
@ -102,10 +102,8 @@ pub(crate) fn suggest_fn_call(
|
||||
|
||||
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}"),
|
||||
|
@ -923,10 +923,10 @@ fn suggest_fn_call(
|
||||
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)),
|
||||
},
|
||||
|
@ -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 */) }
|
||||
| +++++++++++
|
||||
|
@ -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 */);
|
||||
| ++++++++++
|
||||
|
@ -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 {}
|
||||
|
@ -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 */));
|
||||
| +++++++++++
|
||||
|
@ -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 */);
|
||||
| +++++++++++++
|
||||
|
@ -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();
|
||||
| + +++
|
||||
|
@ -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();
|
||||
| + +++
|
||||
|
@ -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;
|
||||
| + ++++++++++++++++++++++++
|
||||
|
Loading…
Reference in New Issue
Block a user