Skip to content

RA enable miri by default and cannot disable it #16122

Closed
@huang-jl

Description

@huang-jl

I am reading codes of rust-vmm project, there is a code snippet like in the following:

 #[cfg(not(miri))]
if addr == libc::MAP_FAILED {
    return Err(Error::Mmap(io::Error::last_os_error()));
}

#[cfg(miri)]
if self.size == 0 {
    return Err(Error::Mmap(io::Error::from_raw_os_error(libc::EINVAL)));
}

Note that there are both cfg(miri) and cfg(not(miri)).

However, I found that PR #15284 has enabled cfg(miri) in analysis by default.

Currently my editor deactivates all the code blocks annotated with #[cfg(not(miri))], and I do not know how to activate those blocks or disable cfg(miri).

image

Is there any possible method in RA to activate code blocks with #[cfg(not(miri))]?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-supportCategory: support questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions