Skip to content

Macro path resolution ignores preludes #52512

Closed
@petrochenkov

Description

@petrochenkov

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() {}

Metadata

Metadata

Assignees

Labels

A-decl-macros-1-2Area: Declarative macros 1.2A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions