-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Compiler crash when dealing with Any and Ref #60622
Comments
Reduced: trait Any {}
trait AsAny {
fn as_any(self);
}
impl<T> AsAny for T where T: Any + AsAny {
fn as_any(self) {}
}
impl dyn AsAny {
fn borrow<'a>(&'a self) -> &'a dyn AsAny {
self
}
}
fn demo<'a>(cell: &'a (dyn AsAny + 'static)) {
cell.borrow::<'a, _>().as_any();
} |
Regression first occurred in 1.30 according to godbolt. |
One can leave out the Bug was introduced somewhere between 33b923f...63d6649 |
triage: P-high |
Smaller example from #60842: fn run_wild<T, DL: Borked<T>>(dl: &DL) {
dl.a::<'_, T>();
}
pub trait Borked<T> {
fn a(&self);
}
fn main() {} |
I was trying to remove as many type parameters as possible, and ended up with this: struct Borked {}
impl Borked {
fn a(&self) {}
}
fn run_wild<T>(b: &Borked) {
b.a::<'_, T>();
} Removing Not sure if it's any more or less helpful, but just putting this here. |
@rustbot claim Looks like that didn't work, either way, I'm taking a look into this issue. |
Error: The feature Please let |
1 similar comment
Error: The feature Please let |
Checking generic args after late bound region err. Fixes #60622. This PR fixes an ICE that occurs when a late bound region error is emitted and that resulted in the rest of the generic arguments of a function not being checked. For example, you could specify a generic type parameter `T` in a function call `foo<'_, T>()` to a function that doesn't have a generic type parameter. Since an error wasn't emitted from the function, compilation continued to parts of typeck that didn't expect a generic type argument in a call for a function that didn't have any generic type arguments.
…Mark-Simulacrum Allow claiming issues with triagebot Not sure if this was intentionally left out, but it can probably be enabled now that rust-lang/triagebot#3 is fixed (assuming that the deployed commit is recent enough). People have tried to use it already (rust-lang#60622 (comment)). r? @Mark-Simulacrum
Compiler crashes with
Also, I wonder what is the right way (or is there any way) to write a
demo
with expected behavior. Thanks.The text was updated successfully, but these errors were encountered: