You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unconstrained region variables when making str-ptr-ptr hash and eq #3283
I was fiddling around with regioned stack closures, trying to see if it'd ever mean something to return one, and ran into the same error for the first time:
fn foo(+blk: fn(+p: &a/fn() -> &a/fn())) {
let mut state = 0;
let statep = &mut state;
do blk {
|| { *statep = 1; }
}
}
fn main() {
do foo |p| { p()() }
}
frames.rs:1:0: 1:0 error: Unconstrained region variable #8
frames.rs:1 fn foo(+blk: fn(+p: &a/fn() -> &a/fn())) {
^
frames.rs:1:0: 1:0 error: Unconstrained region variable #10
frames.rs:1 fn foo(+blk: fn(+p: &a/fn() -> &a/fn())) {
^
@pcwalton 's example no longer works since the linear_map function being used is now trait-based, rather than taking functions explicitly. I get a different error with @bblum's example:
/Users/tchevalier/rust2/src/test/run-pass/issue-3283.rs:4:11: 6:5 error: mismatched types: expected `&fn()` but found `@fn()` (expected & closure, found @ closure)
/Users/tchevalier/rust2/src/test/run-pass/issue-3283.rs:4 do blk {
/Users/tchevalier/rust2/src/test/run-pass/issue-3283.rs:5 || { *statep = 1; }
/Users/tchevalier/rust2/src/test/run-pass/issue-3283.rs:6 }
bblum's example compiles now (if you add a & before the fn type of blk), and pcwalton's example won't compile now for other reasons. So I'm considering this done. Reopen if you have a repro case
bblum's example compiled and ran just fine on my Mac, but segfaulted on the Linux and Windows bots. I don't have time right now to figure out why, so I'm checking it in xfailed.
I think this system should not type check. This is probably a bug in how we are handling region closures (I know there is work to be done there, not sure what bug #, let me fish it up).
Activity
bblum commentedon Aug 26, 2012
I was fiddling around with regioned stack closures, trying to see if it'd ever mean something to return one, and ran into the same error for the first time:
catamorphism commentedon Dec 7, 2012
@pcwalton 's example no longer works since the
linear_mapfunction being used is now trait-based, rather than taking functions explicitly. I get a different error with @bblum's example:I don't know if that's right or not.
catamorphism commentedon Mar 20, 2013
bblum's example compiles now (if you add a & before the fn type of blk), and pcwalton's example won't compile now for other reasons. So I'm considering this done. Reopen if you have a repro case
catamorphism commentedon Mar 25, 2013
bblum's example compiled and ran just fine on my Mac, but segfaulted on the Linux and Windows bots. I don't have time right now to figure out why, so I'm checking it in xfailed.
nikomatsakis commentedon Mar 29, 2013
I think this system should not type check. This is probably a bug in how we are handling region closures (I know there is work to be done there, not sure what bug #, let me fish it up).
nikomatsakis commentedon Mar 29, 2013
Dup of issue #3696, I think.
Auto merge of rust-lang#3283 - devnexen:fbsd_affinity, r=oli-obk
Enable an `#[safety_constraint(...)]` attribute helper for the `Arbit…
Use WorkDoneProgress LSP API for initial load
Merge rust-lang#3587