-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Handle more cases in cfg_accessible #97391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1633746
c413250
8337367
a4d03c6
b76d112
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This test is a collection of test that should pass. | ||
// | ||
// check-fail | ||
|
||
#![feature(cfg_accessible)] | ||
#![feature(trait_alias)] | ||
|
||
trait TraitAlias = std::fmt::Debug + Send; | ||
|
||
// FIXME: Currently shows "cannot determine" but should be `false` | ||
#[cfg_accessible(unresolved)] //~ ERROR cannot determine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a bug, if the compiler says "cannot determine" (rather than "not sure") then it's legitimately stuck, and it's unlikely we can do anything here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is that we return an error instead of |
||
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() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-bugs.rs:15: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:11:1 | ||
| | ||
LL | #[cfg_accessible(unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:14:18 | ||
| | ||
LL | #[cfg_accessible(Struct::existing)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:16:18 | ||
| | ||
LL | #[cfg_accessible(Struct::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:25:18 | ||
| | ||
LL | #[cfg_accessible(Union::existing)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:27:18 | ||
| | ||
LL | #[cfg_accessible(Union::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:36:18 | ||
| | ||
LL | #[cfg_accessible(Enum::Existing::existing)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:38:18 | ||
| | ||
LL | #[cfg_accessible(Enum::Existing::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:40:18 | ||
| | ||
LL | #[cfg_accessible(Enum::unresolved)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:50:18 | ||
| | ||
LL | #[cfg_accessible(Trait::existing)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:52:18 | ||
| | ||
LL | #[cfg_accessible(Trait::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:59:18 | ||
| | ||
LL | #[cfg_accessible(TypeAlias::existing)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:61:18 | ||
| | ||
LL | #[cfg_accessible(TypeAlias::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:70:18 | ||
| | ||
LL | #[cfg_accessible(ForeignType::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:79:18 | ||
| | ||
LL | #[cfg_accessible(AssocType::AssocType::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:84:18 | ||
| | ||
LL | #[cfg_accessible(u8::unresolved)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:86:18 | ||
| | ||
LL | #[cfg_accessible(u8::is_ascii)] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: aborting due to 15 previous errors | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:14:18 | ||
| | ||
LL | #[cfg_accessible(Struct::existing)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:16:18 | ||
| | ||
LL | #[cfg_accessible(Struct::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:25:18 | ||
| | ||
LL | #[cfg_accessible(Union::existing)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:27:18 | ||
| | ||
LL | #[cfg_accessible(Union::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:36:18 | ||
| | ||
LL | #[cfg_accessible(Enum::Existing::existing)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:38:18 | ||
| | ||
LL | #[cfg_accessible(Enum::Existing::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:40:18 | ||
| | ||
LL | #[cfg_accessible(Enum::unresolved)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:50:18 | ||
| | ||
LL | #[cfg_accessible(Trait::existing)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:52:18 | ||
| | ||
LL | #[cfg_accessible(Trait::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:59:18 | ||
| | ||
LL | #[cfg_accessible(TypeAlias::existing)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:61:18 | ||
| | ||
LL | #[cfg_accessible(TypeAlias::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:70:18 | ||
| | ||
LL | #[cfg_accessible(ForeignType::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:79:18 | ||
| | ||
LL | #[cfg_accessible(AssocType::AssocType::unresolved)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:84:18 | ||
| | ||
LL | #[cfg_accessible(u8::unresolved)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: not sure whether the path is accessible or not | ||
--> $DIR/cfg_accessible-not_sure.rs:86:18 | ||
| | ||
LL | #[cfg_accessible(u8::is_ascii)] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: the type may have associated items, but we are currently not checking them | ||
|
||
error: aborting due to 15 previous errors | ||
|
Uh oh!
There was an error while loading. Please reload this page.