These are chat archives for rust-lang/rust

27th
Jun 2017
stevensonmt
@stevensonmt
Jun 27 2017 14:25
fn main() {
  let x = foo();
  bar(x);
  baz(x);
}
I understand that calling bar(x) passes ownership of x which is why I'm getting a use of moved value error. I don't really know how to work around this, however. If I try bar(&x) and baz(&x) I get a mismatched type error. Suggestions?
Denis Lisov
@tanriol
Jun 27 2017 14:26
Change bar and baz to take references.
Maybe bar only if baz is the final operation on x.
stevensonmt
@stevensonmt
Jun 27 2017 14:33
duh, geez that's obvious. Thanks @tanriol.
Ashley Davis
@dualmoon
Jun 27 2017 17:59
hiya, i'm trying to get a simple program to build and having trouble. i have rust all set up and can compile basic stuff but this thing i'm building depends on openssl down the line. so i installed openssl and set environment variables to point to the right folders but it's still failing. is there another way to tell rust where to look for openssl? i'm on windows
i'm seeing src/openssl_shim.c(1): fatal error C1083: Cannot open include file: 'openssl/hmac.h': No such file or directory but i have OPENSSL_INCLUDE_DIR pointing to C:\OpenSSL-Win64\include which has an openssl folder containing hmac.h
Nikolay Denev
@ndenev
Jun 27 2017 19:07
@dualmoon have you tried doing cargo clean? I remember I had similar issues, when it failed initially, then I've added the OPENSSL_INCLUDE_DIR var, but I had to run cargo clean before it can build