-
-
Save rrichardson/2220377 to your computer and use it in GitHub Desktop.
this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn readZip(fname: str) -> io::reader unsafe { | |
let mode= "r"; | |
let fptr = str::as_c_str(fname) {|f| str::as_c_str(mode) { |m| libc::popen(f, m) }; }; | |
io::FILE_reader(fptr, true); | |
} | |
fn main() { | |
let rd = readZip("unzip -p \*.zip"); | |
} | |
/////////// | |
import.rs:9:34: 9:87 error: in function anon, not all control paths return a value | |
import.rs:9 let fptr = str::as_c_str(fname) {|f| str::as_c_str(mode) { |m| libc::popen(f, m) }; }; | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
error: internal compiler error unexpected failure | |
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import.rs:7:37: 11:1 error: in function readZip, not all control paths return a value
import.rs:7 fn readZip(fname: str) -> io::reader unsafe {
import.rs:8 let mode= "r";
import.rs:9 let fptr = str::as_c_str(fname) {|f| str::as_c_str(mode) { |m| libc::popen(f, m) } };
import.rs:10 io::FILE_reader(fptr, true);
import.rs:11 }
import.rs:7:26: 7:36 error: see declared return type of 'io::reader'
import.rs:7 fn readZip(fname: str) -> io::reader unsafe {
^~~~~~~~~~