Skip to content

Macro path resolution ignores preludes #52512

Closed

Description

All kinds of them - extern prelude, standard library prelude, language prelude, except for the macro prelude of course (which contains of builtin macros and macros from #[macro_use] extern crate).

#![feature(extern_prelude, use_extern_macros)]
#![allow(unused)]

mod m {
    fn f() {
        std::mem::drop(0); // OK, extern prelude
        Result::Ok::<u8, u8>(0); // OK, standard library prelude
        u8::clone(&0); // OK, language prelude
        
        std::panic!(); // ERROR failed to resolve. Use of undeclared type or module `std`
        Result::Ok!(); //  ERROR failed to resolve. Use of undeclared type or module `Result`
        u8::clone!(); // ERROR failed to resolve. Use of undeclared type or module `u8`
    }
}

fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-macros-1.2Area: Declarative macros 1.2A-macros-2.0Area: Declarative macros 2.0 (#39412)A-resolveArea: Name resolution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions