Skip to content

Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core < 0.8.3 is in the dependency graph #992

@TotalKrill

Description

@TotalKrill

Edited by @hsivonen to put resolution options at the top for folks who come here:

To resolve this compilation error, update SQLx to 0.8.3 and/or update Rust to 1.81 or later.

This compilation error is due to a combination of:

  1. SQLx unnecessarily turning off the default features of url, and from a proc macro context specifically. (Request for SQLx not to do that: Please do not turn off default features for url transact-rs/sqlx#3589)
  2. url 2.5.3 (and idna 1.0.3) conditionally raising MSRV to 1.81 when default features are off (from no_std support for the url crate #831). Conditionally raising MSRV to 1.81 is not a semver break, because raising MSRV isn't a semver break.
  3. resolver = "2", which is implied by edition = "2021" performing feature resolution for proc macro dependencies separately from normal dependencies, so a normal dependency on url with default features enabled does not cause default features to be enabled for the proc macro case.

Original report follows:

  • Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

Describe the bug

After update to v1.0.3 wich is picked up automatically since its a patch upgrade, our code no longer compiles the same.

rust versions tested:

  • rustc 1.80.1
  • rustc 1.81.0
   Compiling idna v1.0.3
error[E0658]: use of unstable library feature 'error_in_core'
  --> /home/krille/.cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6
   |
78 | impl core::error::Error for Errors {}
   |      ^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #103765 <https://github.com/rust-lang/rust/issues/103765> for more information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions