Skip to content

Commit

Permalink
Update . -> :: tests for new diff suggestion format.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachs18 committed Feb 18, 2025
1 parent ae7b45a commit 2c37250
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ LL | let _ = Alias.new();
|
help: use the path separator to refer to an item
|
LL | let _ = Alias::new();
| ~~
LL - let _ = Alias.new();
LL + let _ = Alias::new();
|

error[E0423]: expected value, found type alias `Alias`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:26:13
Expand All @@ -53,8 +54,9 @@ LL | let _ = Alias.default;
|
help: use the path separator to refer to an item
|
LL | let _ = Alias::default;
| ~~
LL - let _ = Alias.default;
LL + let _ = Alias::default;
|

error[E0423]: expected value, found module `foo`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:30:13
Expand All @@ -64,8 +66,9 @@ LL | let _ = foo.bar;
|
help: use the path separator to refer to an item
|
LL | let _ = foo::bar;
| ~~
LL - let _ = foo.bar;
LL + let _ = foo::bar;
|

error[E0423]: expected value, found struct `std::cell::Cell`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:37:9
Expand Down Expand Up @@ -111,8 +114,9 @@ LL | Type!(alias).get();
= note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | <Type!(alias)>::get();
| ~~~~~~~~~~~~~~~~
LL - Type!(alias).get();
LL + <Type!(alias)>::get();
|

error[E0423]: expected value, found type alias `Alias`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:43:9
Expand All @@ -126,8 +130,9 @@ LL | Type! {alias}.get;
= note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | <Type! {alias}>::get;
| ~~~~~~~~~~~~~~~~~
LL - Type! {alias}.get;
LL + <Type! {alias}>::get;
|

error[E0423]: expected value, found struct `Vec`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:52:9
Expand Down Expand Up @@ -189,8 +194,9 @@ LL | let _ = create!(macro method alias);
= note: this error originates in the macro `Type` which comes from the expansion of the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | <Type!(alias)>::new(0)
| ~~~~~~~~~~~~~~~~
LL - Type!(alias).new(0)
LL + <Type!(alias)>::new(0)
|

error[E0423]: expected value, found type alias `Alias`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:73:9
Expand All @@ -204,8 +210,9 @@ LL | let _ = check_ty!(Alias);
= note: this error originates in the macro `check_ty` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | $Ty::foo
| ~~
LL - $Ty.foo
LL + $Ty::foo
|

error[E0423]: expected value, found type alias `Alias`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:80:9
Expand All @@ -219,8 +226,9 @@ LL | let _ = check_ident!(foo);
= note: this error originates in the macro `check_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | <Alias>::$Ident
| ~~~~~~~~~
LL - Alias.$Ident
LL + <Alias>::$Ident
|

error[E0423]: expected value, found type alias `Alias`
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:87:9
Expand All @@ -234,8 +242,9 @@ LL | let _ = check_ty_ident!(Alias, foo);
= note: this error originates in the macro `check_ty_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the path separator to refer to an item
|
LL | <$Ty>::$Ident
| ~~~~~~~
LL - $Ty.$Ident
LL + <$Ty>::$Ident
|

error: aborting due to 17 previous errors

Expand Down
65 changes: 37 additions & 28 deletions tests/ui/resolve/enum-expected-value-suggest-variants.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ LL | | }
| |_^
help: use the path separator to refer to a variant
|
LL | let _: Foo = Foo::A(0);
| ~~
LL - let _: Foo = Foo.A(0);
LL + let _: Foo = Foo::A(0);
|

error[E0423]: expected value, found enum `Foo`
--> $DIR/enum-expected-value-suggest-variants.rs:23:18
Expand All @@ -35,10 +36,12 @@ LL | | }
| |_^
help: the following enum variants are available
|
LL | let _: Foo = (Foo::A(/* fields */)).Bad(0);
| ~~~~~~~~~~~~~~~~~~~~~~
LL | let _: Foo = (Foo::B(/* fields */)).Bad(0);
| ~~~~~~~~~~~~~~~~~~~~~~
LL - let _: Foo = Foo.Bad(0);
LL + let _: Foo = (Foo::A(/* fields */)).Bad(0);
|
LL - let _: Foo = Foo.Bad(0);
LL + let _: Foo = (Foo::B(/* fields */)).Bad(0);
|

error[E0423]: expected value, found enum `Bar`
--> $DIR/enum-expected-value-suggest-variants.rs:32:18
Expand All @@ -58,8 +61,9 @@ LL | | }
| |_^
help: use the path separator to refer to a variant
|
LL | let _: Bar = Bar::C(0);
| ~~
LL - let _: Bar = Bar.C(0);
LL + let _: Bar = Bar::C(0);
|

error[E0423]: expected value, found enum `Bar`
--> $DIR/enum-expected-value-suggest-variants.rs:36:18
Expand All @@ -79,8 +83,9 @@ LL | | }
| |_^
help: use the path separator to refer to a variant
|
LL | let _: Bar = Bar::E;
| ~~
LL - let _: Bar = Bar.E;
LL + let _: Bar = Bar::E;
|

error[E0423]: expected value, found enum `Bar`
--> $DIR/enum-expected-value-suggest-variants.rs:40:18
Expand All @@ -101,15 +106,17 @@ LL | | }
help: you might have meant to use one of the following enum variants
|
LL | let _: Bar = Bar::E.Bad(0);
| ~~~~~~
| +++
LL | let _: Bar = Bar::F.Bad(0);
| ~~~~~~
| +++
help: alternatively, the following enum variants are also available
|
LL | let _: Bar = (Bar::C(/* fields */)).Bad(0);
| ~~~~~~~~~~~~~~~~~~~~~~
LL | let _: Bar = (Bar::D(/* fields */)).Bad(0);
| ~~~~~~~~~~~~~~~~~~~~~~
LL - let _: Bar = Bar.Bad(0);
LL + let _: Bar = (Bar::C(/* fields */)).Bad(0);
|
LL - let _: Bar = Bar.Bad(0);
LL + let _: Bar = (Bar::D(/* fields */)).Bad(0);
|

error[E0423]: expected value, found enum `Bar`
--> $DIR/enum-expected-value-suggest-variants.rs:45:18
Expand All @@ -130,15 +137,17 @@ LL | | }
help: you might have meant to use one of the following enum variants
|
LL | let _: Bar = Bar::E.Bad;
| ~~~~~~
| +++
LL | let _: Bar = Bar::F.Bad;
| ~~~~~~
| +++
help: alternatively, the following enum variants are also available
|
LL | let _: Bar = (Bar::C(/* fields */)).Bad;
| ~~~~~~~~~~~~~~~~~~~~~~
LL | let _: Bar = (Bar::D(/* fields */)).Bad;
| ~~~~~~~~~~~~~~~~~~~~~~
LL - let _: Bar = Bar.Bad;
LL + let _: Bar = (Bar::C(/* fields */)).Bad;
|
LL - let _: Bar = Bar.Bad;
LL + let _: Bar = (Bar::D(/* fields */)).Bad;
|

error[E0531]: cannot find tuple struct or tuple variant `A` in this scope
--> $DIR/enum-expected-value-suggest-variants.rs:51:9
Expand Down Expand Up @@ -169,9 +178,9 @@ LL | | }
help: try to match against one of the enum's variants
|
LL | Foo::A(..) => {}
| ~~~~~~
| +++
LL | Foo::B(..) => {}
| ~~~~~~
| +++

error[E0423]: expected function, tuple struct or tuple variant, found enum `Foo`
--> $DIR/enum-expected-value-suggest-variants.rs:15:18
Expand All @@ -191,9 +200,9 @@ LL | | }
help: try to construct one of the enum's variants
|
LL | let _: Foo = Foo::A(0);
| ~~~~~~
| +++
LL | let _: Foo = Foo::B(0);
| ~~~~~~
| +++

error[E0423]: expected function, tuple struct or tuple variant, found enum `Bar`
--> $DIR/enum-expected-value-suggest-variants.rs:27:18
Expand All @@ -215,9 +224,9 @@ LL | | }
help: try to construct one of the enum's variants
|
LL | let _: Bar = Bar::C(0);
| ~~~~~~
| +++
LL | let _: Bar = Bar::D(0);
| ~~~~~~
| +++

error: aborting due to 10 previous errors

Expand Down

0 comments on commit 2c37250

Please sign in to comment.