-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: unwrap on an Err PlaceBuilder
#87987
Comments
The code can be further simplified to: fn main() {
let props = Props {
field_1: 1,
field_2: 1,
};
let props_2 = props.clone();
let _ = |__yew_props: Props| {
let _: Props = props_2;
};
} The issue seems to be around using type annotation. If a type annotation is included, the right hand side of the let statement should always be read. fn main() {
let props = Props {
field_1: 1,
field_2: 1,
};
let props_2 = props.clone();
let _ = |__yew_props: Props| {
let _ = props_2; // No ICE when we remove the type annotation
};
} |
Because if that's the case then we need props_2 to be caputred. |
@rustbot claim |
@roxelo We found another instance of this #![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() {} Found trying to migrate Let me know if you need any more information. |
RFC2229 Only compute place if upvars can be resolved Closes rust-lang#87987 This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved. r? `@nikomatsakis`
Encountered an ICE when building
yew
0.18.0 on edition 2021. I have roughly narrowed it down to the following (can probably be reduced further). Seems to be an issue with closure captures.Code
Meta
rustc --version --verbose
:Error output
Backtrace
cc @rust-lang/wg-rfc-2229
The text was updated successfully, but these errors were encountered: