Skip to content

Super-weird compiler bug, and seemingly paradox behaviour when using non-absolute imports in 1.30 #55897

Closed
@axos88

Description

@axos88

Repro repo: https://github.com/axos88/out_dir_bug/blob/master/src/foo.rs#L1

Apparently that line causes env!("whatever") to resolve to "false", so the include! fails, because it cannot find the file.

I'm a bit baffled on why this doesn't create a more meaningful compile error. Seems like it gets confused due to there being a module named env and a macro named env! in std?

By completing that line to std::env, it will compile fine.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions