servo / font-kit

A cross-platform font loading library written in Rust
Apache License 2.0
660 stars 98 forks source link

fix compilation errors in tests #196

Closed alexanderkjall closed 1 year ago

alexanderkjall commented 2 years ago

With this command line:

cargo test --features="source,loader-freetype-default"

Then these errors are produced:

error[E0428]: the name `get_vertically_hinted_glyph_outline` is defined multiple times
   --> tests/tests.rs:270:1
    |
226 | pub fn get_vertically_hinted_glyph_outline() {
    | -------------------------------------------- previous definition of the value `get_vertically_hinted_glyph_outline` here
...
270 | pub fn get_vertically_hinted_glyph_outline() {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `get_vertically_hinted_glyph_outline` redefined here
    |
    = note: `get_vertically_hinted_glyph_outline` must be defined only once in the value namespace of this module

error[E0428]: the name `get_fully_hinted_glyph_outline` is defined multiple times
   --> tests/tests.rs:360:1
    |
316 | pub fn get_fully_hinted_glyph_outline() {
    | --------------------------------------- previous definition of the value `get_fully_hinted_glyph_outline` here
...
360 | pub fn get_fully_hinted_glyph_outline() {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `get_fully_hinted_glyph_outline` redefined here
    |
    = note: `get_fully_hinted_glyph_outline` must be defined only once in the value namespace of this module

This PR fixes those by adding a conditional config, so that the two compiles are exclusive to each other.

jdm commented 1 year ago

@bors-servo r+

bors-servo commented 1 year ago

:pushpin: Commit 0893ab9 has been approved by jdm

bors-servo commented 1 year ago

:hourglass: Testing commit 0893ab936326885e75ef40b8eb1ea4c715df98bb with merge 75b37025b48d9e5f778607f478c650b82e34312f...

bors-servo commented 1 year ago

:sunny: Test successful - checks-github Approved by: jdm Pushing 75b37025b48d9e5f778607f478c650b82e34312f to master...