Skip to content

allow_internal_unstable does not work for min_specialization #119950

Closed
@clubby789

Description

@clubby789

This also applies to proc macros
https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.60SpecOptionPartialEq.60.20error

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=45d821a040bf825549fe07efa2c87572

#![allow(internal_features)]
#![feature(allow_internal_unstable)]

#[allow_internal_unstable(min_specialization)]
macro_rules! test {
    () => {
        struct T<U>(U);
        trait Tr {}
        impl<U> Tr for T<U> {}
        impl Tr for T<u8> {}
    }
}

test! {}
   Compiling playground v0.0.1 (/playground)
error[E0119]: conflicting implementations of trait `Tr` for type `T<u8>`
  --> src/lib.rs:10:9
   |
9  |         impl<U> Tr for T<U> {}
   |         ------------------- first implementation here
10 |         impl Tr for T<u8> {}
   |         ^^^^^^^^^^^^^^^^^ conflicting implementation for `T<u8>`
...
14 | test! {}
   | -------- in this macro invocation```

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-specializationArea: Trait impl specializationC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions