Skip to content

Use more generics and remove more code from mako files#17186

Merged
bors-servo merged 4 commits intomasterfrom
derive-all-the-things
Jun 6, 2017
Merged

Use more generics and remove more code from mako files#17186
bors-servo merged 4 commits intomasterfrom
derive-all-the-things

Conversation

@nox
Copy link
Copy Markdown
Contributor

@nox nox commented Jun 6, 2017

This change is Reviewable

@highfive
Copy link
Copy Markdown

highfive commented Jun 6, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/gecko.mako.rs, components/style/values/specified/gecko.rs, components/style/values/generics/box.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs and 5 more
  • @emilio: components/style/properties/gecko.mako.rs, components/style/values/specified/gecko.rs, components/style/values/generics/box.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs and 5 more

@highfive
Copy link
Copy Markdown

highfive commented Jun 6, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 6, 2017
@nox
Copy link
Copy Markdown
Contributor Author

nox commented Jun 6, 2017

@highfive highfive assigned emilio and unassigned jdm Jun 6, 2017
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit a9cb635 with merge 4576cc9...

bors-servo pushed a commit that referenced this pull request Jun 6, 2017
Use more generics and remove more code from mako files
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue, ToCss)]
pub enum VerticalAlign<LengthOrPercentage>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove?

/// A generic value for scroll snap points.
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue)]
pub enum ScrollSnapPoint<LengthOrPercentage> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is in a gecko-only module, so no need for a cfg_attr(feature = "servo"...). Though any reason why compiling it for both hurts?

@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - windows-msvc-dev

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jun 6, 2017
@jdm
Copy link
Copy Markdown
Member

jdm commented Jun 6, 2017

   Compiling style v0.0.1 (file:///C:/buildbot/slave/windows-msvc-dev/build/components/style)
error[E0432]: unresolved import `values::specified::ScrollSnapPoint`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16359:17
      |
16359 |         pub use values::specified::ScrollSnapPoint as SpecifiedValue;
      |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ScrollSnapPoint` in `values::specified`

error[E0432]: unresolved import `values::computed::ScrollSnapPoint`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16361:21
      |
16361 |             pub use values::computed::ScrollSnapPoint as T;
      |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ScrollSnapPoint` in `values::computed`

error[E0432]: unresolved import `values::specified::ScrollSnapPoint`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16521:17
      |
16521 |         pub use values::specified::ScrollSnapPoint as SpecifiedValue;
      |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ScrollSnapPoint` in `values::specified`

error[E0432]: unresolved import `values::computed::ScrollSnapPoint`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16523:21
      |
16523 |             pub use values::computed::ScrollSnapPoint as T;
      |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ScrollSnapPoint` in `values::computed`

error[E0433]: failed to resolve. Could not find `ScrollSnapPoint` in `computed`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16363:69
      |
16363 |         #[inline] pub fn get_initial_value() -> computed_value::T { computed::ScrollSnapPoint::none() }
      |                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `ScrollSnapPoint` in `computed`

error[E0433]: failed to resolve. Could not find `ScrollSnapPoint` in `specified`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16369:13
      |
16369 |             specified::ScrollSnapPoint::parse(context, input)
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `ScrollSnapPoint` in `specified`

error[E0433]: failed to resolve. Could not find `ScrollSnapPoint` in `computed`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16525:69
      |
16525 |         #[inline] pub fn get_initial_value() -> computed_value::T { computed::ScrollSnapPoint::none() }
      |                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `ScrollSnapPoint` in `computed`

error[E0433]: failed to resolve. Could not find `ScrollSnapPoint` in `specified`
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16531:13
      |
16531 |             specified::ScrollSnapPoint::parse(context, input)
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `ScrollSnapPoint` in `specified`

error: type `properties::DeclaredValue<'_, _>` cannot be dereferenced
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16407:31
      |
16407 |                         match *value {
      |                               ^^^^^^

error: type `properties::DeclaredValue<'_, _>` cannot be dereferenced
     --> c:\buildbot\slave\windows-msvc-dev\build\target\debug\build\style-56fbb21baf6b3c7d\out/properties.rs:16569:31
      |
16569 |                         match *value {
      |                               ^^^^^^

error: aborting due to previous error(s)

error: Could not compile `style`.

@nox nox force-pushed the derive-all-the-things branch from a9cb635 to 25931f9 Compare June 6, 2017 17:14
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jun 6, 2017
Copy link
Copy Markdown
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

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

r=me

return Ok(GenericScrollSnapPoint::None);
}
input.expect_function_matching("repeat")?;
let length = input.parse_nested_block(|i|
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Wrap on braces?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@nox nox force-pushed the derive-all-the-things branch from 25931f9 to 195e98e Compare June 6, 2017 17:27
@nox
Copy link
Copy Markdown
Contributor Author

nox commented Jun 6, 2017

@bors-servo r=emilio

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit 195e98e has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 6, 2017
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 195e98e with merge 80488c4...

bors-servo pushed a commit that referenced this pull request Jun 6, 2017
Use more generics and remove more code from mako files

<!-- 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/17186)
<!-- Reviewable:end -->
@bors-servo
Copy link
Copy Markdown
Contributor

☀️ 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
Approved by: emilio
Pushing 80488c4 to master...

@bors-servo bors-servo mentioned this pull request Jun 6, 2017
5 tasks
@bors-servo bors-servo merged commit 195e98e into master Jun 6, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 6, 2017
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.

5 participants