Skip to content

Instantly share code, notes, and snippets.

@tobz
Created December 12, 2015 23:04
Show Gist options
  • Save tobz/43048ceb9560c50a310a to your computer and use it in GitHub Desktop.
Save tobz/43048ceb9560c50a310a to your computer and use it in GitHub Desktop.
extern crate openssl;
use openssl::ssl::{SslContext, SslMethod};
fn main() {
let ssl_context = try!(SslContext::new(SslMethod::Sslv23));
}
Compiling weird_try_behaviour v0.1.0 (file:///Users/tlawrence/src/weird_try_behaviour)
<std macros>:5:8: 6:42 error: mismatched types:
expected `()`,
found `core::result::Result<_, _>`
(expected (),
found enum `core::result::Result`) [E0308]
<std macros>:5 return $ crate:: result:: Result:: Err (
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
src/main.rs:6:23: 6:63 note: in this expansion of try! (defined in <std macros>)
<std macros>:5:8: 6:42 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `weird_try_behaviour`.
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment