Skip to content

NR2 does not error out on public crate item usage #3389

Open
@P-E-P

Description

Summary

The compiler should error out as MyStruct cannot be accessed.

Reproducer

I tried this code with flag -frust-name-resolution-2.0:

pub struct Str(i32);

mod test {

    pub fn test() -> Str {
        Str(0)
    }
}

Does the code make use of any (1.49) nightly feature ?

  • Nightly

Godbolt link

https://godbolt.org/z/fr1Gs3dTc

Actual behavior

The compiler does not emit an error

Expected behavior

I expected to see an error suggesting use MyStruct.

GCC Version

commit hash: 9c6e09e

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions