diff options
| author | Urgau <urgau@numericable.fr> | 2022-05-25 16:25:18 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2022-05-30 17:04:27 +0200 |
| commit | a4d03c6c94b7c46a2d53a9412c447932d69316a4 (patch) | |
| tree | a46c49bbbc5f2f555872c1dcd5ee08b282a664f5 | |
| parent | 83373675c81dd0343ccbee55d9c3b6ba13e65d35 (diff) | |
| download | rust-a4d03c6c94b7c46a2d53a9412c447932d69316a4.tar.gz rust-a4d03c6c94b7c46a2d53a9412c447932d69316a4.zip | |
Add test for known-bugs of cfg_accessible
3 files changed, 46 insertions, 6 deletions
diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs b/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs new file mode 100644 index 00000000000..a95d397d3d2 --- /dev/null +++ b/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs @@ -0,0 +1,30 @@ +// This test is a collection of test that should pass. +// +// check-fail + +#![feature(cfg_accessible)] +#![feature(trait_alias)] + +enum Enum { + Existing { existing: u8 }, +} + +trait TraitAlias = std::fmt::Debug + Send; + +// FIXME: Currently returns `false` but should be "not sure" +#[cfg_accessible(Enum::Existing::existing)] +const A: bool = true; + +// FIXME: Currently returns `false` but should be "not sure" +#[cfg_accessible(Enum::Existing::unresolved)] +const B: bool = true; + +// FIXME: Currently shows "cannot determine" but should be `false` +#[cfg_accessible(unresolved)] //~ ERROR cannot determine +const C: bool = true; + +// FIXME: Currently shows "not sure" but should be `false` +#[cfg_accessible(TraitAlias::unresolved)] //~ ERROR not sure whether the path is accessible or not +const D: bool = true; + +fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr b/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr new file mode 100644 index 00000000000..30db6063041 --- /dev/null +++ b/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr @@ -0,0 +1,16 @@ +error: not sure whether the path is accessible or not + --> $DIR/cfg_accessible-bugs.rs:28:18 + | +LL | #[cfg_accessible(TraitAlias::unresolved)] + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the type may have associated items, but we are currently not checking them + +error: cannot determine whether the path is accessible or not + --> $DIR/cfg_accessible-bugs.rs:24:1 + | +LL | #[cfg_accessible(unresolved)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs index 3baf72b0de9..55b68ce0d63 100644 --- a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs +++ b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs @@ -33,12 +33,6 @@ enum Enum { Existing { existing: u8 }, } -// FIXME: Currently returns `false` but should be "not sure" -#[cfg_accessible(Enum::Existing::existing)] -const A: bool = true; -// FIXME: Currently returns `false` but should be "not sure" -#[cfg_accessible(Enum::Existing::unresolved)] -const B: bool = true; #[cfg_accessible(Enum::unresolved)] //~ ERROR not sure const C: bool = true; |
