Skip to content

Conversation

@dotdash
Copy link
Contributor

@dotdash dotdash commented Aug 26, 2014

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@SimonSapin
Copy link
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants