diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-20 16:43:05 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-01 23:35:35 +0100 |
| commit | 1d280b012d52fa95ed59942701e1a32c662e58a3 (patch) | |
| tree | e13affc7fd15c93c94c98bab34082a868a40157d /compiler/rustc_codegen_llvm/src/coverageinfo | |
| parent | b763d9a40c526f5f72c0668d26f69241e7a42511 (diff) | |
| download | rust-1d280b012d52fa95ed59942701e1a32c662e58a3.tar.gz rust-1d280b012d52fa95ed59942701e1a32c662e58a3.zip | |
Don't directly expose coverage::CounterMappingRegion via FFI
The definition of this struct changes in LLVM 12 due to the addition of branch coverage support. To avoid future mismatches, declare our own struct and then convert between them.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index e777f363eb0..e47b8fde40f 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -162,7 +162,7 @@ pub(crate) fn write_filenames_section_to_buffer<'a>( pub(crate) fn write_mapping_to_buffer( virtual_file_mapping: Vec<u32>, expressions: Vec<CounterExpression>, - mut mapping_regions: Vec<CounterMappingRegion>, + mapping_regions: Vec<CounterMappingRegion>, buffer: &RustString, ) { unsafe { @@ -171,7 +171,7 @@ pub(crate) fn write_mapping_to_buffer( virtual_file_mapping.len() as c_uint, expressions.as_ptr(), expressions.len() as c_uint, - mapping_regions.as_mut_ptr(), + mapping_regions.as_ptr(), mapping_regions.len() as c_uint, buffer, ); |
