forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds feature gating of
no_coverage
at either crate- or function-level
- Loading branch information
Showing
13 changed files
with
142 additions
and
63 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
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
34 changes: 0 additions & 34 deletions
34
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.issue-84561.txt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.no_cov_crate.txt
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,18 @@ | ||
1| |// Enables `no_coverage` on the entire crate | ||
2| |#![feature(no_coverage)] | ||
3| | | ||
4| |#[no_coverage] | ||
5| |fn do_not_add_coverage_1() { | ||
6| | println!("called but not covered"); | ||
7| |} | ||
8| | | ||
9| |#[no_coverage] | ||
10| |fn do_not_add_coverage_2() { | ||
11| | println!("called but not covered"); | ||
12| |} | ||
13| | | ||
14| 1|fn main() { | ||
15| 1| do_not_add_coverage_1(); | ||
16| 1| do_not_add_coverage_2(); | ||
17| 1|} | ||
|
19 changes: 19 additions & 0 deletions
19
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.no_cov_func.txt
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,19 @@ | ||
1| |// Enables `no_coverage` on individual functions | ||
2| | | ||
3| |#[feature(no_coverage)] | ||
4| |#[no_coverage] | ||
5| |fn do_not_add_coverage_1() { | ||
6| | println!("called but not covered"); | ||
7| |} | ||
8| | | ||
9| |#[no_coverage] | ||
10| |#[feature(no_coverage)] | ||
11| |fn do_not_add_coverage_2() { | ||
12| | println!("called but not covered"); | ||
13| |} | ||
14| | | ||
15| 1|fn main() { | ||
16| 1| do_not_add_coverage_1(); | ||
17| 1| do_not_add_coverage_2(); | ||
18| 1|} | ||
|
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
// Enables `no_coverage` on the entire crate | ||
#![feature(no_coverage)] | ||
|
||
#[no_coverage] | ||
fn do_not_add_coverage_1() { | ||
println!("called but not covered"); | ||
} | ||
|
||
#[no_coverage] | ||
fn do_not_add_coverage_2() { | ||
println!("called but not covered"); | ||
} | ||
|
||
fn main() { | ||
do_not_add_coverage_1(); | ||
do_not_add_coverage_2(); | ||
} |
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,18 @@ | ||
// Enables `no_coverage` on individual functions | ||
|
||
#[feature(no_coverage)] | ||
#[no_coverage] | ||
fn do_not_add_coverage_1() { | ||
println!("called but not covered"); | ||
} | ||
|
||
#[no_coverage] | ||
#[feature(no_coverage)] | ||
fn do_not_add_coverage_2() { | ||
println!("called but not covered"); | ||
} | ||
|
||
fn main() { | ||
do_not_add_coverage_1(); | ||
do_not_add_coverage_2(); | ||
} |
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 @@ | ||
#![crate_type = "lib"] | ||
|
||
#[no_coverage] | ||
#[feature(no_coverage)] // does not have to be enabled before `#[no_coverage]` | ||
fn no_coverage_is_enabled_on_this_function() {} | ||
|
||
#[no_coverage] //~ ERROR the `#[no_coverage]` attribute is an experimental feature | ||
fn requires_feature_no_coverage() {} |
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,13 @@ | ||
error[E0658]: the `#[no_coverage]` attribute is an experimental feature | ||
--> $DIR/feature-gate-no_coverage.rs:7:1 | ||
| | ||
LL | #[no_coverage] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information | ||
= help: add `#![feature(no_coverage)]` to the crate attributes to enable | ||
= help: or, alternatively, add `#[feature(no_coverage)]` to the function | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |