Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building with current rust #16

Merged
merged 1 commit into from Aug 26, 2014
Merged

Fix building with current rust #16

merged 1 commit into from Aug 26, 2014

Conversation

@dotdash
Copy link
Contributor

dotdash commented Aug 26, 2014

&[T, ..n] isn't coerced to &[T] anymore, so we have to manually do that
in a few places.

Björn Steinbrink
&[T, ..n] isn't coerced to &[T] anymore, so we have to manually do that
in a few places.
None => if isindex { (&[], piece) } else { (piece, &[]) }
None => {
let tmp: (&[u8], &[u8]) = if isindex { (&[], piece) } else { (piece, &[]) };
tmp

This comment has been minimized.

@SimonSapin

SimonSapin Aug 26, 2014

Member

I think I’d prefer [].as_slice(). Does that work?

This comment has been minimized.

@dotdash

dotdash Aug 26, 2014

Author Contributor

No, the special rules for let foo = &rvalue expand the lifetime of the vector here. Those rules don't apply for [].as_slice() so you get a lifetime error.

This comment has been minimized.

@SimonSapin

SimonSapin Aug 26, 2014

Member

This is unfortunate, but oh well.

SimonSapin added a commit that referenced this pull request Aug 26, 2014
Fix building with current rust
@SimonSapin SimonSapin merged commit 23fb9ec into servo:master Aug 26, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@SimonSapin
Copy link
Member

SimonSapin commented Aug 26, 2014

Merged, thanks!

@dotdash
Copy link
Contributor Author

dotdash commented Aug 26, 2014

D'oh, actually I'm an idiot. I'm at a different box now and didn't upgrade rustc yet. [].as_slice() works with the new rustc (not sure why). I'll send a follow-up PR to fix that and also fix the tests sigh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.