add tests and comment
This commit is contained in:
parent
4a0473c0f5
commit
8716eae3b1
4 changed files with 19 additions and 0 deletions
|
@ -16,6 +16,8 @@ fn evaluate_obligation<'tcx>(
|
||||||
canonical_goal: CanonicalPredicateGoal<'tcx>,
|
canonical_goal: CanonicalPredicateGoal<'tcx>,
|
||||||
) -> Result<EvaluationResult, OverflowError> {
|
) -> Result<EvaluationResult, OverflowError> {
|
||||||
debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal);
|
debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal);
|
||||||
|
// HACK This bubble is required for this tests to pass:
|
||||||
|
// impl-trait/issue99642.rs
|
||||||
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_with_canonical(
|
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_with_canonical(
|
||||||
DUMMY_SP,
|
DUMMY_SP,
|
||||||
&canonical_goal,
|
&canonical_goal,
|
||||||
|
|
|
@ -258,6 +258,8 @@ fn type_op_prove_predicate<'tcx>(
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
|
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
|
||||||
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
||||||
|
// HACK This bubble is required for this test to pass:
|
||||||
|
// impl-trait/issue-99642.rs
|
||||||
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query(
|
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query(
|
||||||
&canonicalized,
|
&canonicalized,
|
||||||
|infcx, fulfill_cx, key| {
|
|infcx, fulfill_cx, key| {
|
||||||
|
|
8
src/test/ui/impl-trait/issue-99642-2.rs
Normal file
8
src/test/ui/impl-trait/issue-99642-2.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
#![feature(type_alias_impl_trait)]
|
||||||
|
type Opq = impl Sized;
|
||||||
|
fn test() -> impl Iterator<Item = Opq> {
|
||||||
|
Box::new(0..) as Box<dyn Iterator<Item = _>>
|
||||||
|
}
|
||||||
|
fn main(){}
|
7
src/test/ui/impl-trait/issue-99642.rs
Normal file
7
src/test/ui/impl-trait/issue-99642.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
fn test() -> impl Iterator<Item = impl Sized> {
|
||||||
|
Box::new(0..) as Box<dyn Iterator<Item = _>>
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue