select obligations after check_casts
Otherwise, we can get into a situation where you have a subtype obligation `#1 <: #2` pending, #1 is constrained by `check_casts`, but #2` is unaffected. Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
parent
b6e334d873
commit
e8910440a2
6 changed files with 48 additions and 4 deletions
14
src/test/ui/closures/2229_closure_analysis/issue_88118.rs
Normal file
14
src/test/ui/closures/2229_closure_analysis/issue_88118.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Regression test for #88118. Used to ICE.
|
||||
//
|
||||
// check-pass
|
||||
|
||||
#![feature(capture_disjoint_fields)]
|
||||
|
||||
fn foo<MsU>(handler: impl FnOnce() -> MsU + Clone + 'static) {
|
||||
Box::new(move |value| {
|
||||
(|_| handler.clone()())(value);
|
||||
None
|
||||
}) as Box<dyn Fn(i32) -> Option<i32>>;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
8
src/test/ui/closures/issue-87814-1.rs
Normal file
8
src/test/ui/closures/issue-87814-1.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// check-pass
|
||||
fn main() {
|
||||
let mut schema_all = vec![];
|
||||
(0..42).for_each(|_x| match Err(()) as Result<(), _> {
|
||||
Ok(()) => schema_all.push(()),
|
||||
Err(_) => (),
|
||||
});
|
||||
}
|
||||
11
src/test/ui/closures/issue-87814-2.rs
Normal file
11
src/test/ui/closures/issue-87814-2.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// check-pass
|
||||
#![feature(try_reserve)]
|
||||
|
||||
fn main() {
|
||||
let mut schema_all: (Vec<String>, Vec<String>) = (vec![], vec![]);
|
||||
|
||||
let _c = || match schema_all.0.try_reserve(1) as Result<(), _> {
|
||||
Ok(()) => (),
|
||||
Err(_) => (),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue