-
Notifications
You must be signed in to change notification settings - Fork 383
Closed
Labels
bugduplicateIssue duplicates another oneIssue duplicates another onesubsystem::cfgIssues related to conditional compilation (processing of `cfg` attributes)Issues related to conditional compilation (processing of `cfg` attributes)subsystem::highlightingIssues related to code highlightingIssues related to code highlighting
Description
Environment
- IntelliJ Rust plugin version: 0.4.186.5143-223
- Rust toolchain version: rustc 1.66.0 (69f9c33d7 2022-12-12)
- IDE name and version: CLion 2022.3.1 Build #CL-223.8214.51, built on December 20, 2022
- Operating system: macOS
Problem description
IntelliJ Rust Can't figure out that two #[cfg(... type parameters are disjoint.
Steps to reproduce
Enter this code into CLion:
use std::marker::PhantomData;
pub trait A {
fn args<
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] T: Send + 'static,
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] T,
>(&self, phantom: PhantomData<T>);
}
#[derive(Debug)]
struct B;
impl A for B {
fn args<T: Send + 'static>(&self, _phantom: PhantomData<T>) {
println!("Foo!");
}
}
fn main() {
let b = B;
b.args::<String>(PhantomData::default());
println!("{:?}", b);
}CLion will complain that we have error E0049, when infact we have not:
Cargo check is clean:
% cargo check
Finished dev [unoptimized + debuginfo] target(s) in 0.03sCargo clippy is clean:
% cargo clippy
Checking m3u8-hang v0.1.0 (/Users/bes/repos/github/m3u8-hang)
Finished dev [unoptimized + debuginfo] target(s) in 1.20sCompiling and running is clean:
% cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.39s
Running `target/debug/m3u8-hang`
Foo!
BMetadata
Metadata
Assignees
Labels
bugduplicateIssue duplicates another oneIssue duplicates another onesubsystem::cfgIssues related to conditional compilation (processing of `cfg` attributes)Issues related to conditional compilation (processing of `cfg` attributes)subsystem::highlightingIssues related to code highlightingIssues related to code highlighting
