-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
passes: check implied feature exists
Add a check confirming that features referenced in `implied_by` meta items actually exist. Signed-off-by: David Wood <david.wood@huawei.com>
- Loading branch information
Showing
5 changed files
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/test/ui/stability-attribute/stability-attribute-implies-missing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(staged_api)] | ||
#![stable(feature = "stability_attribute_implies", since = "1.0.0")] | ||
|
||
// Tests that `implied_by = "bar"` results in an error being emitted if `bar` does not exist. | ||
|
||
#[unstable(feature = "foobar", issue = "1", implied_by = "bar")] | ||
//~^ ERROR feature `bar` implying `foobar` does not exist | ||
pub fn foobar() {} | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/stability-attribute/stability-attribute-implies-missing.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: feature `bar` implying `foobar` does not exist | ||
--> $DIR/stability-attribute-implies-missing.rs:6:1 | ||
| | ||
LL | #[unstable(feature = "foobar", issue = "1", implied_by = "bar")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|