diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-09 23:40:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-09 23:40:03 +0200 |
| commit | 4e165c1c9923e19fa91ddcdb09fbc9d07f7c29da (patch) | |
| tree | 5d05d6b57e97f842e494f36c0e358ca677f7b45a /tests | |
| parent | 39bf7777aab9ac1f6b0802cd52cd91d6e021aa91 (diff) | |
| parent | b7a5f3a41c6613033f0e6be9307c40e3174a9381 (diff) | |
Rollup merge of #108843 - compiler-errors:non_lifetime_binders-method-probe, r=jackh726
Instantiate instead of erasing binder when probing param methods Fixes #108836 There is a really old comment saying that a `WhereClauseCandidate` probe candidate "should not contain any inference variables", but I'm not really confident that that comment applies anymore. In contrast, other candidates that we assemble during method probe contain inference variables in their substitutions (e.g. `InherentImplCandidate`)... Since this change is made only to support a nightly feature, I'm happy to gate the new behavior behind this feature flag or discuss it further. r? types
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/traits/non_lifetime_binders/method-probe.rs | 16 | ||||
| -rw-r--r-- | tests/ui/traits/non_lifetime_binders/method-probe.stderr | 11 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/traits/non_lifetime_binders/method-probe.rs b/tests/ui/traits/non_lifetime_binders/method-probe.rs new file mode 100644 index 00000000000..8df240c2082 --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/method-probe.rs @@ -0,0 +1,16 @@ +// check-pass + +#![feature(non_lifetime_binders)] +//~^ WARN the feature `non_lifetime_binders` is incomplete + +trait Foo: for<T> Bar<T> {} + +trait Bar<T> { + fn method() -> T; +} + +fn x<T: Foo>() { + let _: i32 = T::method(); +} + +fn main() {} diff --git a/tests/ui/traits/non_lifetime_binders/method-probe.stderr b/tests/ui/traits/non_lifetime_binders/method-probe.stderr new file mode 100644 index 00000000000..8f61792e6ce --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/method-probe.stderr @@ -0,0 +1,11 @@ +warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/method-probe.rs:3:12 + | +LL | #![feature(non_lifetime_binders)] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + |
