Skip to content

1.100-beta regression: the trait Parser is not dyn compatible #163834

Closed

Description

@mejrs

Found in https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/reg/git-url-parse-0.6.0/log.txt

Playground: https://play.rust-lang.org/?version=beta&mode=debug&edition=2024&gist=6a7ae8c4736ab36ccb130ecc41dfd973

Simplified:

// nom 8.0.0
use nom::Parser;
use nom::bytes::complete::{tag, take_while};
use nom::combinator::recognize;
use nom::error::context;
use nom::multi::many1;
use nom::sequence::pair;

pub
    fn path_abempty_parser<'url>(
    ) -> impl Parser<
        &'url str,
        Output = <dyn Parser<&'url str, Output = &'url str, Error = nom::error::Error<&'url str>> as Parser<
            &'url str,
        >>::Output,
        Error = nom::error::Error<&'url str>,
>{
    // Starts with '/' or empty
    context(
        "Path parser (abempty)",
        recognize(many1(pair(tag("/"), take_while(|_| true)))),
    )
}

Compiles on stable:
Errors on beta:

error[E0038]: the trait `Parser` is not dyn compatible
   --> src/lib.rs:11:10
    |
 11 |       ) -> impl Parser<
    |  __________^
 12 | |         &'url str,
 13 | |         Output = <dyn Parser<&'url str, Output = &'url str, Error = nom::error::Error<&'url str>> as Parser<
 14 | |             &'url str,
 15 | |         >>::Output,
 16 | |         Error = nom::error::Error<&'url str>,
 17 | | >{
    | |_^ `Parser` is not dyn compatible
    |
note: for a trait to be dyn compatible it needs to allow building a vtable
      for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
   --> /playground/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nom-8.0.0/src/internal.rs:425:6
    |
425 |   fn process<OM: OutputMode>(
    |      ^^^^^^^ the trait is not dyn compatible because method `process` has generic type parameters

Error on nightly:

error[E0271]: type mismatch resolving `path_abempty_parser<'url>::{opaque#0}<'url> == _`
  --> src/lib.rs:11:10
   |
11 |       ) -> impl Parser<
   |  __________^
12 | |         &'url str,
13 | |         Output = <dyn Parser<&'url str, Output = &'url str, Error = nom::error::Error<&'url str>> as Parser<
14 | |             &'url str,
15 | |         >>::Output,
16 | |         Error = nom::error::Error<&'url str>,
17 | | >{
   | |_^ types differ

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2026
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 5, 2026
  3. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Oct 5, 2026
  4. cyrgani commented on Oct 5, 2026

    @cyrgani
    Contributor

    this is expected breakage from #154992

  5. lcnr commented on Oct 6, 2026

    @lcnr
    Contributor

    closing as intended breakage

  6. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 6, 2026
  7. removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions