Add test for known-bugs of cfg_accessible

This commit is contained in:
Urgau 2022-05-25 16:25:18 +02:00
parent 83373675c8
commit a4d03c6c94
3 changed files with 46 additions and 6 deletions

View File

@ -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() {}

View File

@ -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

View File

@ -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;