Skip to content

Instantly share code, notes, and snippets.

View durka's full-sized avatar

Alex Burka durka

View GitHub Profile
@durka
durka / -
Created August 3, 2017 01:12
Alexs-MacBook-Air-3:nll alex$ cargo +nightly run ../test/*nll
Compiling lalrpop v0.13.1
error: failed to run custom build command for `lalrpop v0.13.1`
process didn't exit successfully: `/Users/alex/Programming/rust/nll/nll/target/debug/build/lalrpop-ae994b50db2e6ddc/build-script-build` (signal: 6, SIGABRT: process abort signal)
--- stdout
processing file `/Users/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/lalrpop-0.13.1/src/parser/lrgrammar.lalrpop`
--- stderr
thread 'main' has overflowed its stack
error: `matches` does not live long enough
--> src/bin/transfer.rs:89:16
|
89 | let dest = matches.value_of("DEST").unwrap();
| ^^^^^^^ does not live long enough
...
214 | }
| - borrowed value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
fn remote_df2(SshInfo { user, pass, host, dir }: SshInfo) -> Result<Bytes> {
let (tcp, sess) = ssh(user, pass, host)?;
let sftp = sess.sftp()?;
let file = sftp.open(Path::new(dir))?;
unsafe {
let mut handle = mem::transmute_copy::<ssh2::File, *mut LIBSSH2_SFTP_HANDLE>(&file);
let mut attrs: LIBSSH2_SFTP_STATVFS = mem::zeroed();
sftp.rc(libssh2_sftp_fstatvfs(handle, &mut attrs))?;
Ok(Bytes(attrs.f_bavail * attrs.f_bsize))
}
POST /webui/apps/sdcss application/x-www-form-urlencoded; charset=utf-8:
=> Error: No matching routes for POST /webui/apps/sdcss application/x-www-form-urlencoded; charset=utf-8.
=> Warning: Responding with 404 Not Found catcher.
=> Response succeeded.
GET /self_upgrade.html image/gif:
=> Error: No matching routes for GET /self_upgrade.html image/gif.
=> Warning: Responding with 404 Not Found catcher.
=> Response succeeded.
GET / image/gif:
=> Matched: GET /
warning: unreachable pattern
--> src/routes.rs:66:1
|
66 | / handle_login! {
67 | | #[get("/<date>/<flow>/<idx>")]
68 | | pub fn episode/episode_login(user: User, users: State<ActiveUsers>, date: Datestamp, flow: Option<FlowType>, idx: u32) -> Template {
69 | | let flow = flow.ok_or(ErrorKind::BadParam("invalid flow type"))?;
... |
132 | | }
133 | | }
warning: unreachable pattern
--> src/routes.rs:66:1
|
66 | / handle_login! {
67 | | #[get("/<date>/<flow>/<idx>")]
68 | | pub fn episode/episode_login(user: User, users: State<ActiveUsers>, date: Datestamp, flow: Option<FlowType>, idx: u32) -> Template {
69 | | let flow = flow.ok_or(ErrorKind::BadParam("invalid flow type"))?;
... |
132 | | }
133 | | }
let rate_error = cookies.get("rate_error").map(|c| c.value().to_owned());
if rate_error.is_some() {
cookies.remove(Cookie::named("rate_error"));
}
let report_error = cookies.get("report_error").map(|c| c.value().to_owned());
if report_error.is_some() {
cookies.remove(Cookie::named("report_error"));
}
#[get("/<date>/<flow>/<idx>", rank=1)]
#[allow(unused_variables)]
fn episode_login(uri: &URI, date: Datestamp, flow: Option<FlowType>, idx: u32) -> Redirect {
Redirect::to(&format!("/login?redir={}", URI::percent_encode(uri.as_str())))
}
#[get("/<date>/<flow>/<idx>")]
fn episode(uri: &URI, user: User, date: Datestamp, flow: Option<FlowType>, idx: u32) -> Template {
#[get("/<date>/<flow>/<idx>")]
fn episode_login(uri: &URI, date: Datestamp, flow: Option<FlowType>, idx: u32) -> Redirect {
Redirect::to(&format!("/login?redir={}", URI::percent_encode(uri.as_str())))
}
=> Error: Response was `Err`: Status { code: 404, reason: "Not Found" }.
=> Outcome: Failure
=> Warning: Responding with 500 Internal Server Error catcher.
=> Response succeeded.