diff options
| author | Michael Goulet <michael@errs.io> | 2022-09-20 16:39:39 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-09-20 16:39:39 +0000 |
| commit | 83e6128b577649384ef4bd137223bcffe5c8a5b0 (patch) | |
| tree | 026681193f99aef7ae81a7dd4e73c86a01322207 /src | |
| parent | 4136b59b7da8866762761ed29405a5c5f58a5e3d (diff) | |
| download | rust-83e6128b577649384ef4bd137223bcffe5c8a5b0.tar.gz rust-83e6128b577649384ef4bd137223bcffe5c8a5b0.zip | |
Better binder treatment
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`. |
