addr-rs / addr

Parse domain names reliably and quickly in Rust
MIT License
51 stars 12 forks source link

Build failure #12

Closed ArniDagur closed 3 years ago

ArniDagur commented 3 years ago

When trying to build the latest master of adblock-rust for my python-adblock project, I get the following build error:

error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  --> /home/arni/.cargo/registry/src/github.com-1ecc6299db9ec823/addr-0.9.2/src/dns.rs:44:13
   |
44 |             suffix.is_known()
   |             ^^^^^^^^^^^^^^^^^

error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  --> /home/arni/.cargo/registry/src/github.com-1ecc6299db9ec823/addr-0.9.2/src/domain.rs:47:9
   |
47 |         self.suffix.is_known()
   |         ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

@rushmorem I wonder if you know what's going on?

rushmorem commented 3 years ago

Yes, this is related to https://github.com/addr-rs/psl-types/commit/199318a6056ccc4cd5e24e5e0e91bb4292b29f00. It means you are building with an older version of Rust which didn't support const is_some. I have already fixed this across the psl crates and addr. I will submit a pull request to update addr in adblock-rust shortly.

rushmorem commented 3 years ago

The pull request is now up. Thanks for reporting this!

ArniDagur commented 3 years ago

Thank you very much!

rushmorem commented 3 years ago

The PR has been merged.