Better binder treatment
This commit is contained in:
parent
4136b59b7d
commit
83e6128b57
@ -2765,7 +2765,7 @@ fn binders<T>(
|
||||
where
|
||||
T: relate::Relate<'tcx>,
|
||||
{
|
||||
Ok(ty::Binder::dummy(self.relate(a.skip_binder(), b.skip_binder())?))
|
||||
Ok(a.rebind(self.relate(a.skip_binder(), b.skip_binder())?))
|
||||
}
|
||||
|
||||
fn consts(
|
||||
|
27
src/test/ui/suggestions/issue-101984.rs
Normal file
27
src/test/ui/suggestions/issue-101984.rs
Normal file
@ -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() {}
|
14
src/test/ui/suggestions/issue-101984.stderr
Normal file
14
src/test/ui/suggestions/issue-101984.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user