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

RA resolves 'Provenance' to the wrong item in Miri #13504

Open
RalfJung opened this issue Oct 28, 2022 · 3 comments
Open

RA resolves 'Provenance' to the wrong item in Miri #13504

RalfJung opened this issue Oct 28, 2022 · 3 comments
Labels
A-nameres name, path and module resolution C-bug Category: bug

Comments

@RalfJung
Copy link
Member

To reproduce, check out Miri and follow the setup described here. Then open, for example, this code:

    fn malloc(
        &mut self,
        size: u64,
        zero_init: bool,
        kind: MiriMemoryKind,
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> {

Hovering over Provenance, RA shows this trait. It seems to think that this is actually using dyn Provenance as a type here. However that is wrong, the name Provenance in this scope refers to this type. Looks like somewhere the precedence of blog imports is going wrong.

rust-analyzer version: rust-analyzer version: 0.3.1221-standalone

rustc version: rustc 1.66.0-nightly (85d089b41 2022-10-25)

relevant settings:

    "rust-analyzer.lens.enable": false,
    "rust-analyzer.cargo.buildScripts.useRustcWrapper": false,
    "rust-analyzer.cargo.buildScripts.enable": true,
    "rust-analyzer.procMacro.enable": true,
    "rust-analyzer.diagnostics.disabled": [
        "unlinked-file", // I guess for "normal" projects unlinked files are strange, for me they are common
        "unresolved-module", // https://github.com/rust-lang/rust-analyzer/issues/9173
        "type-mismatch", // https://github.com/rust-lang/rust-analyzer/issues/1109
    ],
    "rust-analyzer.rustc.source": "discover",
    "rust-analyzer.linkedProjects": [
        "./Cargo.toml",
        "./cargo-miri/Cargo.toml"
    ],
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./miri",
        "cargo",
        "clippy",
        "--message-format=json"
    ],
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "./miri",
        "cargo",
        "check",
        "--message-format=json",
    ],
@Veykril
Copy link
Member

Veykril commented Oct 28, 2022

Probably related to #12709

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

Veykril commented Nov 11, 2022

This might be fixed by #13602

@lowr
Copy link
Contributor

lowr commented Nov 11, 2022

This might be fixed by #13602

Unfortunately no, I’ve tested with my local build only to find it still reproduces… I have yet to reduce this to a minimum reproducible example.

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