-
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
"cannot relate bound region" in a concrete lifetime vs for<'a> mismatch. #30906
Labels
A-closures
Area: Closures (`|…| { … }`)
A-diagnostics
Area: Messages for errors, warnings, and lints
F-unboxed_closures
`#![feature(unboxed_closures)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
eddyb
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Jan 14, 2016
Must be caused by the built-in implementation of fn test<F: for<'x> Lambda<&'x str>>(_: F) {}
trait Lambda<T> {
type Output;
}
impl<T, U> Lambda<T> for fn(T) -> U {
type Output = U;
}
struct Compose<F,G>(F,G);
impl<T,F,G> Lambda<T> for Compose<F,G>
where F: Lambda<T>, G: Lambda<F::Output> {
type Output = G::Output;
}
fn bad<T>(f: fn(&'static str) -> T) {
test(Compose(f, std::mem::drop as fn(T)));
} |
@eddyb does this look the same or should I open a new issue: trait SomeTrait {}
fn foo<P, Q, F>(func: F)
where
for<'a> F: Fake<'a, P, Q>,
// just for an impl
P: Default,
Q: std::fmt::Debug,
{
let p = P::default();
let q = func(&p);
println!("{:?}", q);
}
trait Fake<'a, P: 'a, Q>: Fn(&'a P) -> Q
where
Self::Output: SomeTrait + 'a,
{
}
impl<'a, P: 'a, Q, F> Fake<'a, P, Q> for F
where
F: Fn(&'a P) -> Q,
F::Output: SomeTrait + 'a,
{
}
#[derive(Debug)]
struct Wrapper<'a>(&'a u8);
impl<'a> SomeTrait for Wrapper<'a> {}
fn main() {
foo(Wrapper);
}
|
No longer ICEs:
|
estebank
added
A-diagnostics
Area: Messages for errors, warnings, and lints
A-closures
Area: Closures (`|…| { … }`)
and removed
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
C-bug
Category: This is a bug.
labels
Jan 30, 2019
Current output:
|
JohnTitor
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Oct 1, 2019
Centril
added
F-unboxed_closures
`#![feature(unboxed_closures)]`
requires-nightly
This issue requires a nightly compiler in some way.
labels
Nov 5, 2019
#30904 (comment) should've been posted here - this is what's been fixed, not #30904. |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this issue
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this issue
Nov 15, 2019
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-closures
Area: Closures (`|…| { … }`)
A-diagnostics
Area: Messages for errors, warnings, and lints
F-unboxed_closures
`#![feature(unboxed_closures)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Usage of
FnOnce<(T,)>
is to avoid proving an explicit type parameter for theOutput
associated type, as an workaround for #30867.Originally submitted as part of #30904.
The text was updated successfully, but these errors were encountered: