jiebi/CodeConvo huggingface dataset:
<ins> error[E0277]: the trait bound `&str: X` is not satisfied --> $DIR/issue-86530.rs:16:7 | LL |     z(" "); |       ^^^ the trait `X` is not implemented for `&str` | note: required by a bound in `z` --> $DIR/issue-86530.rs:10:8 | LL | fn z<T>(t: T) |    - required by a bound in this LL | where LL |     T: X, |        ^ required by this bound in `z` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
<ins> // run-pass #![feature(adt_const_params, generic_const_exprs)] #![allow(incomplete_features)] pub trait Foo { const ASSOC_C: usize; fn foo() where [(); Self::ASSOC_C]:; } struct Bar<const N: &'static ()>; impl<const N: &'static ()> Foo for Bar<N> { const ASSOC_C: usize = 3; fn foo() where [u8; Self::ASSOC_C]: { let _: [u8; Self::ASSOC_C] = loop {}; } } fn main() {} </ins>
<ins> // run-pass #![feature(adt_const_params, generic_const_exprs)] #![allow(incomplete_features, unused_variables)] struct F<const S: &'static str>; impl<const S: &'static str> X for F<{ S }> { const W: usize = 3; fn d(r: &[u8; Self::W]) -> F<{ S }> { let x: [u8; Self::W] = [0; Self::W]; F } } pub trait X { const W: usize; fn d(r: &[u8; Self::W]) -> Self; } fn main() {} </ins>
<ins> trait Trait<const N: usize> { const Assoc: usize; } impl<const N: usize> Trait<N> for () { const Assoc: usize = 1; } pub const fn foo<const N: usize>() where (): Trait<N> { let bar = [(); <()>::Assoc]; //~^ error: constant expression depends on a generic parameter } trait Trait2<const N: usize> { const Assoc2: usize; } impl<const N: usize> Trait2<N> for () { const Assoc2: usize = N - 1; } pub const fn foo2<const N: usize>() where (): Trait2<N> { let bar2 = [(); <()>::Assoc2]; //~^ error: constant expression depends on a generic parameter } fn main() { foo::<0>(); foo2::<0>(); } </ins>
<ins> error: constant expression depends on a generic parameter --> $DIR/sneaky-array-repeat-expr.rs:11:20 | LL |     let bar = [(); <()>::Assoc]; |                    ^^^^^^^^^^^ | = note: this may fail depending on what value the parameter takes error: constant expression depends on a generic parameter --> $DIR/sneaky-array-repeat-expr.rs:25:21 | LL |     let bar2 = [(); <()>::Assoc2]; |                     ^^^^^^^^^^^^ | = note: this may fail depending on what value the parameter takes error: aborting due to 2 previous errors </ins>
} macro_rules! tool_doc { <del> ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(, binary=$bin:expr)?) => { </del> <ins> ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], binary=$bin:expr) => { </ins> #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct $tool { stage: u32,
cargo.arg("-p").arg($krate); )+ <del> $(if !$bin { </del> <ins> if !$bin { </ins> cargo.rustdocflag("--document-private-items"); <del> })? </del> <ins> } </ins> cargo.rustdocflag("--enable-index-page"); cargo.rustdocflag("--show-type-layout"); cargo.rustdocflag("-Zunstable-options");
} } <del> tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]); </del> <ins> tool_doc!( Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"], binary = false ); </ins> tool_doc!( Rustfmt, "rustfmt-nightly",
<ins> // The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to // check that the rule isn't applied on other "<code>" elements. goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html // We need to show the text, otherwise the colors aren't "computed" by the web browser. show-text: true // We set the theme to ayu. local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} // We reload to get the text appearing and the theme applied. reload: assert-css: (".docblock code", {"color": "rgb(255, 180, 84)"}, ALL) // It includes variants and the "titles" as well (for example: "impl RefUnwindSafe for AnEnum"). assert-css: ("div:not(.docblock) > code", {"color": "rgb(197, 197, 197)"}, ALL) </ins>
impl<T: Copy> SpecFill<T> for [T] { fn spec_fill(&mut self, value: T) { <del> if size_of::<T>() == 1 { // SAFETY: The size_of check above ensures that values are 1 byte wide, as required // for the transmute and write_bytes unsafe { let value: u8 = transmute_copy(&value); write_bytes(self.as_mut_ptr(), value, self.len()); } } else { for item in self.iter_mut() { *item = value; } </del> <ins> for item in self.iter_mut() { *item = value; </ins> } } }
// of a macro that is not vendored by Rust and included in the toolchain. // See https://github.com/rust-analyzer/rust-analyzer/issues/6038. <ins> // On certain platforms right now the "main modules" modules that are // documented don't compile (missing things in `libc` which is empty), // so just omit them with an empty module and add the "unstable" attribute. // Unix, linux, wasi and windows are handled a bit differently. </ins> #[cfg(all( doc, <del> not(any( </del> <ins> any( </ins> all(target_arch = "wasm32", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") <del> )) </del> <ins> ) </ins> ))] <del> #[path = "."] mod doc { // When documenting std we want to show the `unix`, `windows`, `linux` and `wasi` // modules as these are the "main modules" that are used across platforms, // so these modules are enabled when `cfg(doc)` is set. // This should help show platform-specific functionality in a hopefully cross-platform // way in the documentation. pub mod unix; pub mod linux; pub mod wasi; pub mod windows; } </del> <ins> #[unstable(issue = "none", feature = "std_internals")] pub mod unix {} </ins> #[cfg(all( doc, any(
pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"]; pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"]; pub const PERMISSIONS: [&str; 3] = ["std", "fs", "Permissions"]; <del> pub const PERMISSIONS_FROM_MODE: [&str; 7] = ["std", "os", "imp", "unix", "fs", "PermissionsExt", "from_mode"]; </del> <ins> pub const PERMISSIONS_FROM_MODE: [&str; 6] = ["std", "os", "unix", "fs", "PermissionsExt", "from_mode"]; </ins> pub const POLL: [&str; 4] = ["core", "task", "poll", "Poll"]; pub const POLL_PENDING: [&str; 5] = ["core", "task", "poll", "Poll", "Pending"]; pub const POLL_READY: [&str; 5] = ["core", "task", "poll", "Poll", "Ready"];
use rustc_infer::infer::InferCtxt; use rustc_middle::hir::place::ProjectionKind; use rustc_middle::mir::FakeReadCause; <del> use rustc_middle::ty::{self, adjustment, TyCtxt}; </del> <ins> use rustc_middle::ty::{self, adjustment, Ty, TyCtxt}; </ins> use rustc_target::abi::VariantIdx; use std::iter;
needs_to_be_read = true; } } <del> PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..) => { // If the PatKind is a TupleStruct, Path, Struct or Tuple then we want to check // whether the Variant is a MultiVariant or a SingleVariant. We only want // to borrow discr if it is a MultiVariant. // If it is a SingleVariant and creates a binding we will handle that when // this callback gets called again. // Get the type of the Place after all projections have been applied let place_ty = place.place.ty(); if let ty::Adt(def, _) = place_ty.kind() { if def.variants.len() > 1 { </del> <ins> PatKind::Path(qpath) => { // A `Path` pattern is just a name like `Foo`. This is either a // named constant or else it refers to an ADT variant let res = self.mc.typeck_results.qpath_res(qpath, pat.hir_id); match res { Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => { // Named constants have to be equated with the value // being matched, so that's a read of the value being matched. // // FIXME: We don't actually  reads for ZSTs. </ins> needs_to_be_read = true; } <del> } else { // If it is not ty::Adt, then it should be read needs_to_be_read = true; </del> <ins> _ => { // Otherwise, this is a struct/enum variant, and so it's // only a read if we need to read the discriminant. needs_to_be_read |= is_multivariant_adt(place.place.ty()); } </ins> } } <ins> PatKind::TupleStruct(..) | PatKind::Struct(..) | PatKind::Tuple(..) => { // For `Foo(..)`, `Foo { ... }` and `(...)` patterns, check if we are matching // against a multivariant enum or struct. In that case, we have to read // the discriminant. Otherwise this kind of pattern doesn't actually // read anything (we'll get invoked for the `...`, which may indeed // perform some reads). let place_ty = place.place.ty(); needs_to_be_read |= is_multivariant_adt(place_ty); } </ins> PatKind::Lit(_) | PatKind::Range(..) => { // If the PatKind is a Lit or a Range then we want // to borrow discr.
<ins> // edition:2021 #[derive(Copy, Clone, PartialEq, Eq)] pub struct Opcode(pub u8); impl Opcode { pub const OP1: Opcode = Opcode(0x1); } pub fn example1(msg_type: Opcode) -> impl FnMut(&[u8]) { move |i| match msg_type { //~^ ERROR: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered Opcode::OP1 => unimplemented!(), } } #[derive(Copy, Clone, PartialEq, Eq)] pub struct Opcode2(Opcode); impl Opcode2 { pub const OP2: Opcode2 = Opcode2(Opcode(0x1)); } pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) { move |i| match msg_type { //~^ ERROR: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered Opcode2::OP2=> unimplemented!(), } } fn main() {} </ins>
<ins> error[E0004]: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered --> $DIR/issue-88331.rs:11:20 | LL | pub struct Opcode(pub u8); | -------------------------- `Opcode` defined here ... LL |     move |i| match msg_type { |                    ^^^^^^^^ patterns `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `Opcode` error[E0004]: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered --> $DIR/issue-88331.rs:27:20 | LL | pub struct Opcode2(Opcode); | --------------------------- `Opcode2` defined here ... LL |     move |i| match msg_type { |                    ^^^^^^^^ patterns `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `Opcode2` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0004`. </ins>
use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; use rustc_middle::ty::cast::CastTy; <del> use rustc_middle::ty::subst::GenericArgKind; </del> <ins> use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts}; </ins> use rustc_middle::ty::{self, adjustment::PointerCast, Instance, InstanceDef, Ty, TyCtxt}; use rustc_middle::ty::{Binder, TraitPredicate, TraitRef}; use rustc_span::{sym, Span, Symbol};
.iter() .find(|did| tcx.item_name(**did) == callee_name) { <ins> // using internal substs is ok here, since this is only // used for the `resolve` call below substs = InternalSubsts::identity_for_item(tcx, did); </ins> callee = did; } } <del> _ => { if !tcx.is_const_fn_raw(callee) { // At this point, it is only legal when the caller is marked with // #[default_method_body_is_const], and the callee is in the same // trait. let callee_trait = tcx.trait_of_item(callee); if callee_trait.is_some() { if tcx.has_attr(caller, sym::default_method_body_is_const) { if tcx.trait_of_item(caller) == callee_trait { nonconst_call_permission = true; } </del> <ins> _ if !tcx.is_const_fn_raw(callee) => { // At this point, it is only legal when the caller is marked with // #[default_method_body_is_const], and the callee is in the same // trait. let callee_trait = tcx.trait_of_item(callee); if callee_trait.is_some() { if tcx.has_attr(caller, sym::default_method_body_is_const) { if tcx.trait_of_item(caller) == callee_trait { nonconst_call_permission = true; </ins> } } <ins> } </ins> <del> if !nonconst_call_permission { self.check_op(ops::FnCallNonConst); return; } </del> <ins> if !nonconst_call_permission { self.check_op(ops::FnCallNonConst); return; </ins> } } <ins> _ => {} </ins> } // Resolve a trait method call to its concrete implementation, which may be in a
<ins> // build-pass #![feature(const_trait_impl)] trait Func<T> { type Output; fn call_once(self, arg: T) -> Self::Output; } struct Closure; impl const Func<&usize> for Closure { type Output = usize; fn call_once(self, arg: &usize) -> Self::Output { *arg } } enum Bug<T = [(); Closure.call_once(&0) ]> { V(T), } fn main() {} </ins>
//! Enforces the Rust effect system. Currently there is just one effect, /// `unsafe`. <del> use middle::ty::{ty_bare_fn, ty_closure, ty_ptr}; </del> use middle::ty; use middle::typeck::method_map; use util::ppaux; <del> use syntax::ast::{UnDeref, ExprCall, ExprInlineAsm, ExprMethodCall}; use syntax::ast::{ExprUnary, unsafe_fn, ExprPath}; </del> use syntax::ast; use syntax::codemap::Span; <del> use syntax::visit::{fk_item_fn, fk_method}; </del> use syntax::visit; <del> use syntax::visit::{Visitor,fn_kind}; use syntax::ast::{fn_decl,Block,NodeId,Expr}; </del> <ins> use syntax::visit::Visitor; </ins> #[deriving(Eq)] enum UnsafeContext {
UnsafeBlock(ast::NodeId), } <del> struct Context { /// The method map. method_map: method_map, /// Whether we're in an unsafe context. unsafe_context: UnsafeContext, } </del> fn type_is_unsafe_function(ty: ty::t) -> bool { match ty::get(ty).sty { <del> ty_bare_fn(ref f) => f.purity == unsafe_fn, ty_closure(ref f) => f.purity == unsafe_fn, </del> <ins> ty::ty_bare_fn(ref f) => f.purity == ast::unsafe_fn, ty::ty_closure(ref f) => f.purity == ast::unsafe_fn, </ins> _ => false, } } struct EffectCheckVisitor { tcx: ty::ctxt, <del> context: @mut Context, </del> <ins> /// The method map. method_map: method_map, /// Whether we're in an unsafe context. unsafe_context: UnsafeContext, </ins> } impl EffectCheckVisitor { fn require_unsafe(&mut self, span: Span, description: &str) { <del> match self.context.unsafe_context { </del> <ins> match self.unsafe_context { </ins> SafeContext => { // Report an error. self.tcx.sess.span_err(span,
<ins> // Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let mut s = ~"test"; s[0] = 3; //~ ERROR: not allowed s[0] += 3; //~ ERROR: not allowed { let _a = &mut s[0]; //~ ERROR: not allowed } } </ins>
<del> // check-fail // edition:2021 // known-bug: #88908 // This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] use std::future::Future; trait Stream { type Item; } struct Empty<T>(T); impl<T> Stream for Empty<T> { type Item = (); } fn empty<T>() -> Empty<T> { todo!() } trait X { type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a; type LineStreamFut<'a,Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a; fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream<Item = Repr>; type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async {empty()} } } fn main() {} </del>
<del> error[E0271]: type mismatch resolving `<Empty<_> as Stream>::Item == Repr` --> $DIR/issue-89008.rs:38:43 | LL |     fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { |                        ----               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Empty<_> as Stream>::Item == Repr` |                        | |                        this type parameter | note: expected this to be `()` --> $DIR/issue-89008.rs:17:17 | LL |     type Item = (); |                 ^^ = note:   expected unit type `()` found type parameter `Repr` error: aborting due to previous error For more information about this error, try `rustc --explain E0271`. </del>
<ins> // check-pass // edition:2021 #![feature(type_alias_impl_trait)] use std::future::Future; use std::marker::PhantomData; trait Stream { type Item; } struct Empty<T> { _phantom: PhantomData<T>, } impl<T> Stream for Empty<T> { type Item = T; } trait X { type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a; type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream<Item = Repr>; type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async { Empty { _phantom: PhantomData } } } } fn main() {} </ins>
} else if nanos >= MAX_NANOS_F64 { Err(FromSecsError { kind: FromSecsErrorKind::Overflow }) } else if nanos < 0.0 { <del> Err(FromSecsError { kind: FromSecsErrorKind::Underflow }) </del> <ins> Err(FromSecsError { kind: FromSecsErrorKind::Negative }) </ins> } else { let nanos = nanos as u128; Ok(Duration {
} else if nanos >= MAX_NANOS_F32 { Err(FromSecsError { kind: FromSecsErrorKind::Overflow }) } else if nanos < 0.0 { <del> Err(FromSecsError { kind: FromSecsErrorKind::Underflow }) </del> <ins> Err(FromSecsError { kind: FromSecsErrorKind::Negative }) </ins> } else { let nanos = nanos as u128; Ok(Duration {
impl FromSecsError { const fn description(&self) -> &'static str { match self.kind { <del> FromSecsErrorKind::NonFinite => { "got non-finite value when converting float to duration" } </del> <ins> FromSecsErrorKind::NonFinite => "non-finite value when converting float to duration", </ins> FromSecsErrorKind::Overflow => "overflow when converting float to duration", <del> FromSecsErrorKind::Underflow => "underflow when converting float to duration", </del> <ins> FromSecsErrorKind::Negative => "negative value when converting float to duration", </ins> } } }
#[derive(Debug, Clone, PartialEq, Eq)] enum FromSecsErrorKind { <del> // Value is not a finite value (either infinity or NaN). </del> <ins> // Value is not a finite value (either + or - infinity or NaN). </ins> NonFinite, // Value is too large to store in a `Duration`. Overflow, <del> // Value is less than `0.0`. Underflow, </del> <ins> // Value is negative. Negative, </ins> }
#![allow(incomplete_features)] #![feature(inline_const_pat)] <ins> #![feature(generic_const_exprs)] </ins> // rust-lang/rust#82518: ICE with inline-const in match referencing const-generic parameter fn foo<const V: usize>() { <del> match 0 { const { V } => {}, //~^ ERROR const parameters cannot be referenced in patterns [E0158] _ => {}, } </del> <ins> match 0 { const { V } => {}, //~^ ERROR const parameters cannot be referenced in patterns [E0158] _ => {}, } } const fn f(x: usize) -> usize { x + 1 } fn bar<const V: usize>() where [(); f(V)]: { match 0 { const { f(V) } => {}, //~^ ERROR constant pattern depends on a generic parameter //~| ERROR constant pattern depends on a generic parameter _ => {}, } </ins> } fn main() { foo::<1>(); <ins> bar::<1>(); </ins> }
error[E0158]: const parameters cannot be referenced in patterns <del> --> $DIR/const-match-pat-generic.rs:8:11 </del> <ins> --> $DIR/const-match-pat-generic.rs:9:9 </ins> | <del> LL |     const { V } => {}, |           ^^^^^ </del> <ins> LL |         const { V } => {}, |         ^^^^^^^^^^^ </ins> <del> error: aborting due to previous error </del> <ins> error: constant pattern depends on a generic parameter --> $DIR/const-match-pat-generic.rs:21:9 | LL |         const { f(V) } => {}, |         ^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter --> $DIR/const-match-pat-generic.rs:21:9 | LL |         const { f(V) } => {}, |         ^^^^^^^^^^^^^^ error: aborting due to 3 previous errors </ins> For more information about this error, try `rustc --explain E0158`.
drop(linker); save_temp_bitcode(cgcx, &module, "lto.input"); <del> // Fat LTO also suffers from the invalid DWARF issue similar to Thin LTO. // Here we rewrite all `DICompileUnit` pointers if there is only one `DICompileUnit`. // This only works around the problem when codegen-units = 1. // Refer to the comments in the `optimize_thin_module` function for more details. let mut cu1 = ptr::null_mut(); let mut cu2 = ptr::null_mut(); unsafe { llvm::LLVMRustLTOGetDICompileUnit(llmod, &mut cu1, &mut cu2) }; if !cu2.is_null() { let _timer = cgcx.prof.generic_activity_with_arg("LLVM_fat_lto_patch_debuginfo", &*module.name); unsafe { llvm::LLVMRustLTOPatchDICompileUnit(llmod, cu1) }; save_temp_bitcode(cgcx, &module, "fat-lto-after-patch"); } </del> // Internalize everything below threshold to help strip out more modules and such. unsafe { let ptr = symbols_below_threshold.as_ptr();
// an error. let mut cu1 = ptr::null_mut(); let mut cu2 = ptr::null_mut(); <del> llvm::LLVMRustLTOGetDICompileUnit(llmod, &mut cu1, &mut cu2); </del> <ins> llvm::LLVMRustThinLTOGetDICompileUnit(llmod, &mut cu1, &mut cu2); </ins> if !cu2.is_null() { let msg = "multiple source DICompileUnits found"; return Err(write::llvm_err(&diag_handler, msg));
let _timer = cgcx .prof .generic_activity_with_arg("LLVM_thin_lto_patch_debuginfo", thin_module.name()); <del> llvm::LLVMRustLTOPatchDICompileUnit(llmod, cu1); </del> <ins> llvm::LLVMRustThinLTOPatchDICompileUnit(llmod, cu1); </ins> save_temp_bitcode(cgcx, &module, "thin-lto-after-patch"); }
len: usize, out_len: &mut usize, ) -> *const u8; <del> pub fn LLVMRustLTOGetDICompileUnit(M: &Module, CU1: &mut *mut c_void, CU2: &mut *mut c_void); pub fn LLVMRustLTOPatchDICompileUnit(M: &Module, CU: *mut c_void); </del> <ins> pub fn LLVMRustThinLTOGetDICompileUnit( M: &Module, CU1: &mut *mut c_void, CU2: &mut *mut c_void, ); pub fn LLVMRustThinLTOPatchDICompileUnit(M: &Module, CU: *mut c_void); </ins> pub fn LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>; pub fn LLVMRustLinkerAdd(
// Rewrite all `DICompileUnit` pointers to the `DICompileUnit` specified. See // the comment in `back/lto.rs` for why this exists. extern "C" void <del> LLVMRustLTOGetDICompileUnit(LLVMModuleRef Mod, </del> <ins> LLVMRustThinLTOGetDICompileUnit(LLVMModuleRef Mod, </ins> DICompileUnit **A, DICompileUnit **B) { Module *M = unwrap(Mod);
// Rewrite all `DICompileUnit` pointers to the `DICompileUnit` specified. See // the comment in `back/lto.rs` for why this exists. extern "C" void <del> LLVMRustLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) { </del> <ins> LLVMRustThinLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) { </ins> Module *M = unwrap(Mod); // If the original source module didn't have a `DICompileUnit` then try to