internal: cross-crate cov-marks

This commit is contained in:
Aleksey Kladov 2021-06-12 23:39:57 +03:00
parent 124123a53b
commit 0463d76a1f
12 changed files with 15 additions and 12 deletions

4
Cargo.lock generated
View file

@ -245,9 +245,9 @@ dependencies = [
[[package]]
name = "cov-mark"
version = "1.1.0"
version = "2.0.0-pre.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ffa3d3e0138386cd4361f63537765cac7ee40698028844635a54495a92f67f3"
checksum = "0d48d8f76bd9331f19fe2aaf3821a9f9fb32c3963e1e3d6ce82a8c09cef7444a"
[[package]]
name = "crc32fast"

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
dashmap = { version = "4.0.2", features = ["raw-api"] }
log = "0.4.8"
once_cell = "1.3.1"

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
itertools = "0.10.0"
arrayvec = "0.7"
smallvec = "1.2.0"

View file

@ -116,6 +116,7 @@ impl<'a> DeclValidator<'a> {
fn validate_func(&mut self, func: FunctionId) {
let data = self.db.function_data(func);
if data.is_in_extern_block() {
cov_mark::hit!(extern_func_incorrect_case_ignored);
return;
}
@ -572,6 +573,7 @@ impl<'a> DeclValidator<'a> {
fn validate_static(&mut self, static_id: StaticId) {
let data = self.db.static_data(static_id);
if data.is_extern {
cov_mark::hit!(extern_static_incorrect_case_ignored);
return;
}

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
either = "1.5.3"
indexmap = "1.4.0"
itertools = "0.10.0"
@ -39,4 +39,3 @@ hir = { path = "../hir", version = "0.0.0" }
[dev-dependencies]
test_utils = { path = "../test_utils" }
expect-test = "1.1"
cov-mark = "1.1.0"

View file

@ -2571,6 +2571,8 @@ trait BAD_TRAIT {
#[test]
fn ignores_extern_items() {
cov_mark::check!(extern_func_incorrect_case_ignored);
cov_mark::check!(extern_static_incorrect_case_ignored);
check_diagnostics(
r#"
extern {

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
rustc-hash = "1.1.0"
itertools = "0.10.0"
either = "1.6.1"

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
itertools = "0.10.0"
log = "0.4.8"
rustc-hash = "1.1.0"

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
log = "0.4.8"
rayon = "1.5.0"
fst = { version = "0.4", default-features = false }

View file

@ -11,7 +11,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
rustc-hash = "1.1.0"
itertools = "0.10.0"

View file

@ -10,7 +10,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
rustc-hash = "1.1.0"
smallvec = "1.2.0"
log = "0.4.8"

View file

@ -11,7 +11,7 @@ edition = "2018"
doctest = false
[dependencies]
cov-mark = { version = "1.1", features = ["thread-local"] }
cov-mark = "2.0.0-pre.1"
itertools = "0.10.0"
rowan = "=0.13.0-pre.6"
rustc_lexer = { version = "721.0.0", package = "rustc-ap-rustc_lexer" }