Skip to content

Conversation

reem
Copy link

@reem reem commented Aug 28, 2014

The doctests do not run, but that is a separate issue. cargo test doctest=false works fine.

@SimonSapin
Copy link
Member

I’m confused. This is the code we had originally, then &[] expressions went from type &[T] to &[T, ..N] so we worked around it in #16 and #17. Did the language change again?

@reem
Copy link
Author

reem commented Aug 28, 2014

I believe this is fallout from DST changes, but I could be wrong. Ithink that the language changed again

@SimonSapin
Copy link
Member

What’s the error message you’re getting without this change?

@reem
Copy link
Author

reem commented Aug 28, 2014

   Fresh encoding v0.1.0 (https://github.com/lifthrasiir/rust-encoding#7e7950dd)
   Compiling url v0.1.0 (file:///Users/Jonathan/hackreactor/rust/rust-url)
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55:39: 55:41 error: borrowed value does not live long enough
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
                                                                                                          ^~
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:52:16: 68:10 note: reference must be valid for the block at 52:15...
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:52         } else {
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:53             let (name, value) = match piece.position_elem(&b'=') {
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:54                 Some(position) => (piece.slice_to(position), piece.slice_from(position + 1)),
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:56             };
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:57             let name = replace_plus(name);
                                                                    ...
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55:36: 55:62 note: ...but borrowed value is only valid for the block at 55:35
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55:78: 55:80 error: borrowed value does not live long enough
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
                                                                                                                                                 ^~
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:52:16: 68:10 note: reference must be valid for the block at 52:15...
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:52         } else {
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:53             let (name, value) = match piece.position_elem(&b'=') {
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:54                 Some(position) => (piece.slice_to(position), piece.slice_from(position + 1)),
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:56             };
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:57             let name = replace_plus(name);
                                                                    ...
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55:68: 55:94 note: ...but borrowed value is only valid for the expression at 55:67
/Users/Jonathan/hackreactor/rust/rust-url/src/form_urlencoded.rs:55                 None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) }
                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `url`.

@SimonSapin
Copy link
Member

And what’s rustc --version? This looks like #16 (comment). master builds fine for me on rustc 0.12.0-pre-nightly (e61ec99af 2014-08-27 00:31:25 +0000)

@reem
Copy link
Author

reem commented Aug 28, 2014

@SimonSapin Huh. It was failing on travis earlier, but a fresh rustup makes the current master compile no problem.

Nevermind, I guess.

@reem reem closed this Aug 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants