Rollup merge of #73485 - estebank:dedup-preds, r=nikomatsakis

Perform obligation deduplication to avoid buggy `ExistentialMismatch`

Address #59326.
This commit is contained in:
Manish Goregaokar 2020-06-26 13:57:29 -07:00 committed by GitHub
commit f13d09abe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 3 deletions

View file

@ -0,0 +1,26 @@
// check-pass
trait Service {
type S;
}
trait Framing {
type F;
}
impl Framing for () {
type F = ();
}
trait HttpService<F: Framing>: Service<S = F::F> {}
type BoxService = Box<dyn HttpService<(), S = ()>>;
fn build_server<F: FnOnce() -> BoxService>(_: F) {}
fn make_server<F: Framing>() -> Box<dyn HttpService<F, S = F::F>> {
unimplemented!()
}
fn main() {
build_server(|| make_server())
}