1
Fork 0

Rollup merge of #78963 - richkadel:llvm-coverage-counters-2.0.4, r=tmandry

Added some unit tests as requested

As discussed in PR #78267, for example:

* https://github.com/rust-lang/rust/pull/78267#discussion_r515404722
* https://github.com/rust-lang/rust/pull/78267#discussion_r515405958

r? ```````@tmandry```````
FYI: ```````@wesleywiser```````

This is pretty much self contained, but depending on feedback and timing, I may have a chance to add a few more unit tests requested against `counters.rs`. I'm looking at those now.
This commit is contained in:
Dylan DPC 2020-11-15 03:02:46 +01:00 committed by GitHub
commit 335a2554f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 788 additions and 25 deletions

View file

@ -611,6 +611,18 @@ pub struct TyS<'tcx> {
outer_exclusive_binder: ty::DebruijnIndex,
}
impl<'tcx> TyS<'tcx> {
/// A constructor used only for internal testing.
#[allow(rustc::usage_of_ty_tykind)]
pub fn make_for_test(
kind: TyKind<'tcx>,
flags: TypeFlags,
outer_exclusive_binder: ty::DebruijnIndex,
) -> TyS<'tcx> {
TyS { kind, flags, outer_exclusive_binder }
}
}
// `TyS` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
static_assert_size!(TyS<'_>, 32);