mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Add test for known-bugs of cfg_accessible
This commit is contained in:
parent
83373675c8
commit
a4d03c6c94
30
src/test/ui/conditional-compilation/cfg_accessible-bugs.rs
Normal file
30
src/test/ui/conditional-compilation/cfg_accessible-bugs.rs
Normal 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() {}
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user