diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-09-21 19:01:09 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-21 19:01:09 +0530 |
| commit | 39bb2a79884b9e4813e2875de0910790d968f6c1 (patch) | |
| tree | bda7c2ff1af6b590f642aebd3f162dc509ff7862 /src | |
| parent | 77d063b9544e9f438c56474efea4e07ab0d0e1e4 (diff) | |
| parent | 83e6128b577649384ef4bd137223bcffe5c8a5b0 (diff) | |
Rollup merge of #102059 - compiler-errors:issue-101984, r=jackh726
Use rebind instead of dummy binder in `SameTypeModuloInfer` relation Lazy binder usage (sorry, my fault) + assertion in `Binder::dummy` Fixes #101984
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/suggestions/issue-101984.rs | 27 | ||||
| -rw-r--r-- | src/test/ui/suggestions/issue-101984.stderr | 14 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-101984.rs b/src/test/ui/suggestions/issue-101984.rs new file mode 100644 index 00000000000..5f7ecb77e0e --- /dev/null +++ b/src/test/ui/suggestions/issue-101984.rs @@ -0,0 +1,27 @@ +use std::marker::PhantomData; + +type Component = fn(&()); + +struct Wrapper { + router: Router<(Component, Box<Self>)>, +} + +struct Match<C>(PhantomData<C>); + +struct Router<T>(PhantomData<T>); + +impl<T> Router<T> { + pub fn at(&self) -> Result<Match<&T>, ()> { + todo!() + } +} + +impl Wrapper { + fn at(&self, path: &str) -> Result<(Component, Box<Self>), ()> { + let (cmp, router) = self.router.at()?; + //~^ ERROR mismatched types + todo!() + } +} + +fn main() {} diff --git a/src/test/ui/suggestions/issue-101984.stderr b/src/test/ui/suggestions/issue-101984.stderr new file mode 100644 index 00000000000..c744c62d11f --- /dev/null +++ b/src/test/ui/suggestions/issue-101984.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-101984.rs:21:13 + | +LL | let (cmp, router) = self.router.at()?; + | ^^^^^^^^^^^^^ ----------------- this expression has type `Match<&(for<'r> fn(&'r ()), Box<Wrapper>)>` + | | + | expected struct `Match`, found tuple + | + = note: expected struct `Match<&(for<'r> fn(&'r ()), Box<Wrapper>)>` + found tuple `(_, _)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. |
