Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved-macro-call: vec! in library/proc_macro/src/bridge #9446

Closed
lf- opened this issue Jul 1, 2021 · 2 comments
Closed

unresolved-macro-call: vec! in library/proc_macro/src/bridge #9446

lf- opened this issue Jul 1, 2021 · 2 comments
Labels
A-nameres name, path and module resolution C-bug Category: bug

Comments

@lf-
Copy link
Contributor

lf- commented Jul 1, 2021

r-a version: 11b9233

.vim/coc-settings.json:

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--json-output"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
      "./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt"
    ],
    "rust-analyzer.cargo.runBuildScripts": false,
    "rust-analyzer.procMacro.enable": false
}

Reproduction steps:

  • Open library/proc_macro/src/bridge/buffer.rs in the rust repo (I happened to use 64de4979) with the recommended config.
  • Get an unresolved-macro-call here:
impl<T: Copy> Default for Buffer<T> {
    fn default() -> Self {
        Self::from(vec![])
                // ^^^
    }
}

cc #8915

@jonas-schievink
Copy link
Contributor

This happens because we use libstd and liballoc from the workspace and turn on cfg(test) for them. The vec! macro has a #[macro_export]ed version behind #[cfg(not(test))] here, and a private version behind #[cfg(test)] here.

@Veykril Veykril added A-nameres name, path and module resolution C-bug Category: bug labels May 28, 2022
@Veykril
Copy link
Member

Veykril commented Aug 5, 2024

This no longer happens

@Veykril Veykril closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-nameres name, path and module resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants