diff options
| author | Jonas Schievink <[email protected]> | 2021-03-17 17:35:17 +0000 |
|---|---|---|
| committer | Jonas Schievink <[email protected]> | 2021-03-17 17:35:17 +0000 |
| commit | 9436436d20db4d7b13809844ef3e12563dc6be65 (patch) | |
| tree | daca310d9e603096737b5da12cdd573fdaf1d530 /crates/hir_ty | |
| parent | ba0e4c745d60ea1a0e32d1469648394410f6c450 (diff) | |
Improve test
Diffstat (limited to 'crates/hir_ty')
| -rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 9a3258955..3909ad354 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs | |||
| @@ -720,8 +720,29 @@ fn main() { | |||
| 720 | r#" | 720 | r#" |
| 721 | fn foo(#[cfg(NEVER)] x: ()) {} | 721 | fn foo(#[cfg(NEVER)] x: ()) {} |
| 722 | 722 | ||
| 723 | struct S; | ||
| 724 | |||
| 725 | impl S { | ||
| 726 | fn method(#[cfg(NEVER)] self) {} | ||
| 727 | fn method2(#[cfg(NEVER)] self, arg: u8) {} | ||
| 728 | fn method3(self, #[cfg(NEVER)] arg: u8) {} | ||
| 729 | } | ||
| 730 | |||
| 731 | extern "C" { | ||
| 732 | fn fixed(fixed: u8, #[cfg(NEVER)] ...); | ||
| 733 | fn varargs(#[cfg(not(NEVER))] ...); | ||
| 734 | } | ||
| 735 | |||
| 723 | fn main() { | 736 | fn main() { |
| 724 | foo(); | 737 | foo(); |
| 738 | S::method(); | ||
| 739 | S::method2(0); | ||
| 740 | S::method3(S); | ||
| 741 | S.method3(); | ||
| 742 | unsafe { | ||
| 743 | fixed(0); | ||
| 744 | varargs(1, 2, 3); | ||
| 745 | } | ||
| 725 | } | 746 | } |
| 726 | "#, | 747 | "#, |
| 727 | ) | 748 | ) |
