diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-15 11:37:09 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-13 10:41:53 +0000 |
| commit | 9cf60ee9d33fadff387d83d09aef1ce43589e233 (patch) | |
| tree | 1b2769e5a57eaf2b7e1336b731d530569fabc8f3 /tests/ui/methods | |
| parent | c75f7283bf52c6e2ec6a178f2b7717a4daddacf4 (diff) | |
| download | rust-9cf60ee9d33fadff387d83d09aef1ce43589e233.tar.gz rust-9cf60ee9d33fadff387d83d09aef1ce43589e233.zip | |
Method resolution constrains hidden types instead of rejecting method candidates
Diffstat (limited to 'tests/ui/methods')
| -rw-r--r-- | tests/ui/methods/opaque_param_in_ufc.rs | 6 | ||||
| -rw-r--r-- | tests/ui/methods/opaque_param_in_ufc.stderr | 36 |
2 files changed, 3 insertions, 39 deletions
diff --git a/tests/ui/methods/opaque_param_in_ufc.rs b/tests/ui/methods/opaque_param_in_ufc.rs index a4b27a0131f..b170e6805f6 100644 --- a/tests/ui/methods/opaque_param_in_ufc.rs +++ b/tests/ui/methods/opaque_param_in_ufc.rs @@ -1,4 +1,7 @@ #![feature(type_alias_impl_trait)] + +//@ check-pass + struct Foo<T>(T); impl Foo<u32> { @@ -15,14 +18,11 @@ fn bar() -> Bar { impl Foo<Bar> { fn foo() -> Bar { Self::method(); - //~^ ERROR: no function or associated item named `method` found for struct `Foo<Bar>` Foo::<Bar>::method(); - //~^ ERROR: no function or associated item named `method` found for struct `Foo<Bar>` let x = Foo(bar()); Foo::method2(x); let x = Self(bar()); Self::method2(x); - //~^ ERROR: no function or associated item named `method2` found for struct `Foo<Bar>` todo!() } } diff --git a/tests/ui/methods/opaque_param_in_ufc.stderr b/tests/ui/methods/opaque_param_in_ufc.stderr deleted file mode 100644 index 7e5bbbac8a9..00000000000 --- a/tests/ui/methods/opaque_param_in_ufc.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0599]: no function or associated item named `method` found for struct `Foo<Bar>` in the current scope - --> $DIR/opaque_param_in_ufc.rs:17:15 - | -LL | struct Foo<T>(T); - | ------------- function or associated item `method` not found for this struct -... -LL | Self::method(); - | ^^^^^^ function or associated item not found in `Foo<Bar>` - | - = note: the function or associated item was found for - - `Foo<u32>` - -error[E0599]: no function or associated item named `method` found for struct `Foo<Bar>` in the current scope - --> $DIR/opaque_param_in_ufc.rs:19:21 - | -LL | struct Foo<T>(T); - | ------------- function or associated item `method` not found for this struct -... -LL | Foo::<Bar>::method(); - | ^^^^^^ function or associated item not found in `Foo<Bar>` - | - = note: the function or associated item was found for - - `Foo<u32>` - -error[E0599]: no function or associated item named `method2` found for struct `Foo<Bar>` in the current scope - --> $DIR/opaque_param_in_ufc.rs:24:15 - | -LL | struct Foo<T>(T); - | ------------- function or associated item `method2` not found for this struct -... -LL | Self::method2(x); - | ^^^^^^^ function or associated item not found in `Foo<Bar>` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0599`. |
