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
Update cssparser to 0.18 #17820
Update cssparser to 0.18 #17820
Conversation
Heads up! This PR modifies the following files:
|
@bors-servo try |
Update cssparser to 0.18 Do not merge yet, depends on servo/rust-cssparser#171.
💔 Test failed - linux-rel-wpt |
☔ The latest upstream changes (presumably #17813) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors-servo try |
Update cssparser to 0.18 Do not merge yet, depends on servo/rust-cssparser#171. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17820) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good... I don't love the fact that the code looks uglier in many places, but... r=me
@@ -1231,16 +1232,17 @@ fn parse_qualified_name<'i, 't, P, E, Impl> | |||
}, | |||
Ok(Token::Delim('*')) => { | |||
let position = input.position(); | |||
match input.next_including_whitespace() { | |||
// FIXME: remove clone() when lifetimes are non-lexical | |||
match input.next_including_whitespace().map(|t| t.clone()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: cloned()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloned
exists on Option
but not on Result
, unfortunately :(
components/selectors/parser.rs
Outdated
Ok(Token::Delim('|')) => { | ||
explicit_namespace(input, QNamePrefix::ExplicitAnyNamespace) | ||
} | ||
result => { | ||
input.reset(position); | ||
if in_attr_selector { | ||
match result { | ||
Ok(t) => Err(ParseError::Basic(BasicParseError::UnexpectedToken(t))), | ||
Err(e) => Err(ParseError::Basic(e)), | ||
Ok(t) => Err(ParseError::Basic(BasicParseError::UnexpectedToken(t.clone()))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, I think that means this clone is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -1603,27 +1605,28 @@ fn parse_one_simple_selector<'i, 't, P, E, Impl>(parser: &P, | |||
where P: Parser<'i, Impl=Impl, Error=E>, Impl: SelectorImpl | |||
{ | |||
let start_position = input.position(); | |||
match input.next_including_whitespace() { | |||
// FIXME: remove clone() when lifetimes are non-lexical | |||
match input.next_including_whitespace().map(|t| t.clone()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should be able to use cloned()
here too.
let mut flags = 0; | ||
let result = { | ||
let mut feature_name = &*ident; | ||
// FIXME: remove extra indented block when lifetimes are non-lexical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an ETA on this? :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a draft RFC and prototype: http://smallcultfollowing.com/babysteps/blog/2017/07/11/non-lexical-lifetimes-draft-rfc-and-prototype-available/ . I’m hopeful it’ll land in stable in 2018.
📌 Commit eb98ae6 has been approved by |
Update cssparser to 0.18 Do not merge yet, depends on servo/rust-cssparser#171. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17820) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Do not merge yet, depends on servo/rust-cssparser#171.This change is