blob: 57ef5b83e2ccb5c84f08c1ad9f8a414102b09f37 [file] [edit]
//! Regression test for <https://github.com/rust-lang/rust/issues/3021>.
//! Ensure upvars from fn cannot be used in impl method block body.
fn siphash(k0 : u64) {
struct SipHash {
v0: u64,
}
impl SipHash {
pub fn reset(&mut self) {
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
}
}
}
fn main() {}