mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Fix panics with #[cfg]
'd-out self
parameter
This commit is contained in:
parent
8765baaf9d
commit
67495b618b
2 changed files with 26 additions and 0 deletions
|
@ -1488,3 +1488,20 @@ fn test<T: Crash>() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cfgd_out_self_param() {
|
||||
cov_mark::check!(cfgd_out_self_param);
|
||||
check_no_mismatches(
|
||||
r#"
|
||||
struct S;
|
||||
impl S {
|
||||
fn f(#[cfg(never)] &self) {}
|
||||
}
|
||||
|
||||
fn f(s: S) {
|
||||
s.f();
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue