Skip to content

Unexpected error related to item visibility #2

@pedromfedricci

Description

@pedromfedricci

Hi, I've been experimenting with this crate and came across this error. I couldn't tell if it's a bug here or just an underlying problem with the unfinished feature itself.

Here is a small reproduction:

#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use const_guards::guard;

// `guard` doesn't like either pub(crate) or pub(super) in this completely unrelated item.
// By removing the visibility, or just setting it to `pub`, it compiles fine then. 
pub struct Unrelated(pub(crate) ());

#[guard(<const U: u8> { U > 10 })]
pub struct Struct<const U: u8>;

The unexpected error is:

error[E0446]: private type `fn() -> bool {_Struct_guard::<U>}` in public interface

I know this sorts of problems are expected with incomplete features, I just figured this could be interesting to you.
Ty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions