zargony/rust-fuse — pull request #23 by suhr (2014-06-30 14:39:03+00:00)
Title: update to recent rust changes: * -> *const [need lifetime fix]

Subj. There's still a problem through:

% make
mkdir -p build
rustc -O --cfg ndebug --dep-info build/libfuse.d --out-dir build/ src/lib.rs
src/reply.rs:125:11: 125:26 error: cannot infer an appropriate lifetime due to conflicting requirements
src/reply.rs:125	sender(Vec::from_slice(headerbytes).append(bytes).as_slice());
^~~~~~~~~~~~~~~
src/reply.rs:115:51: 127:3 note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the block at 115:50...
src/reply.rs:115	fn send (&mut self, err: c_int, bytes: &[&[u8]]) {
src/reply.rs:116	assert!(self.sender.is_some());
src/reply.rs:117	let len = bytes.iter().fold(0, |l, b| { l + b.len()});
src/reply.rs:118	let header = fuse_out_header {
src/reply.rs:119	len: (mem::size_of::() + len) as u32,
src/reply.rs:120	error: -err,
...
src/reply.rs:125:47: 125:52 note: ...so that expression is assignable (expected `&[&[u8]]` but found `&[&[u8]]`)
src/reply.rs:125	sender(Vec::from_slice(headerbytes).append(bytes).as_slice());
^~~~~
src/reply.rs:123:35: 126:4 note: but, the lifetime must be valid for an anonymous lifetime defined on the block at 123:34...
src/reply.rs:123	as_bytes(&header, |headerbytes| {
src/reply.rs:124	let sender = self.sender.take_unwrap();
src/reply.rs:125	sender(Vec::from_slice(headerbytes).append(bytes).as_slice());
src/reply.rs:126	});
src/reply.rs:125:11: 125:26 note: ...so that type matches impl (expected `&[u8]` but found `&[u8]`)
src/reply.rs:125	sender(Vec::from_slice(headerbytes).append(bytes).as_slice());

I don't know about lifetimes much, so I have no idea how to make it work.