jiebi/CodeConvo huggingface dataset:
// are contravariant while return-position lifetimes are // covariant). _marker: PhantomData<fn(&'a ()) -> &'a ()>, <ins> // Ensure `Context` is `!Send` and `!Sync` in order to allow // for future `!Send` and / or `!Sync` fields. _marker2: PhantomData<*mut ()>, </ins> } impl<'a> Context<'a> {
static WAKER: Waker = unsafe { Waker::from_raw(VOID_WAKER) }; <del> static CONTEXT: Context<'static> = Context::from_waker(&WAKER); static WAKER_REF: &'static Waker = CONTEXT.waker(); WAKER_REF.wake_by_ref(); </del> <ins> WAKER.wake_by_ref(); </ins> }
variant_index: VariantIdx, dest: PlaceTy<'tcx, M::PointerTag>, ) -> InterpResult<'tcx> { <del> let variant_scalar = Scalar::from_u32(variant_index.as_u32()).into(); </del> <ins> // Layout computation excludes uninhabited variants from consideration // therefore there's no way to represent those variants in the given layout. if dest.layout.for_variant(self, variant_index).abi.is_uninhabited() { throw_ub!(Unreachable); } </ins> match dest.layout.variants { layout::Variants::Single { index } => { <del> if index != variant_index { throw_ub!(InvalidDiscriminant(variant_scalar)); } </del> <ins> assert_eq!(index, variant_index); </ins> } layout::Variants::Multiple { discr_kind: layout::DiscriminantKind::Tag,
discr_index, .. } => { <del> if !dest.layout.ty.variant_range(*self.tcx).unwrap().contains(&variant_index) { throw_ub!(InvalidDiscriminant(variant_scalar)); } </del> <ins> // No need to validate that the discriminant here because the // `TyLayout::for_variant()` call earlier already checks the variant is valid. </ins> let discr_val = dest.layout.ty.discriminant_for_variant(*self.tcx, variant_index).unwrap().val;
discr_index, .. } => { <del> if !variant_index.as_usize() < dest.layout.ty.ty_adt_def().unwrap().variants.len() { throw_ub!(InvalidDiscriminant(variant_scalar)); } </del> <ins> // No need to validate that the discriminant here because the // `TyLayout::for_variant()` call earlier already checks the variant is valid. </ins> if variant_index != dataful_variant { let variants_start = niche_variants.start().as_u32(); let variant_index_relative = variant_index.as_u32()
<ins> // build-pass // compile-flags: --crate-type lib // Regression test for ICE which occurred when const propagating an enum with three variants // one of which is uninhabited. pub enum ApiError {} #[allow(dead_code)] pub struct TokioError { b: bool, } pub enum Error { Api { source: ApiError, }, Ethereum, Tokio { source: TokioError, }, } struct Api; impl IntoError<Error> for Api { type Source = ApiError; fn into_error(self, error: Self::Source) -> Error { Error::Api { source: (|v| v)(error), } } } pub trait IntoError<E> { /// The underlying error type Source; /// Combine the information to produce the error fn into_error(self, source: Self::Source) -> E; } </ins>
/// Typically doesn’t need to be used directly. #[unstable(feature = "convert_float_to_int", issue = "67057")] pub trait FloatToInt<Int>: private::Sealed + Sized { <del> #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] </del> <ins> #[unstable(feature = "convert_float_to_int", issue = "67057")] </ins> #[doc(hidden)] <del> unsafe fn approx_unchecked(self) -> Int; </del> <ins> unsafe fn to_int_unchecked(self) -> Int; </ins> } macro_rules! impl_float_to_int {
impl FloatToInt<$Int> for $Float { #[doc(hidden)] #[inline] <del> unsafe fn approx_unchecked(self) -> $Int { crate::intrinsics::float_to_int_approx_unchecked(self) </del> <ins> unsafe fn to_int_unchecked(self) -> $Int { #[cfg(bootstrap)] { crate::intrinsics::float_to_int_approx_unchecked(self) } #[cfg(not(bootstrap))] { crate::intrinsics::float_to_int_unchecked(self) } </ins> } } )+
/// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range /// (<https://github.com/rust-lang/rust/issues/10184>) /// This is under stabilization at <https://github.com/rust-lang/rust/issues/67058> <ins> #[cfg(bootstrap)] </ins> pub fn float_to_int_approx_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int; <ins> /// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range /// (<https://github.com/rust-lang/rust/issues/10184>) /// /// Stabilized as `f32::to_int_unchecked` and `f64::to_int_unchecked`. #[cfg(not(bootstrap))] pub fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int; </ins> /// Returns the number of bits set in an integer type `T` /// /// The stabilized versions of this intrinsic are available on the integer
/// * Not be `NaN` /// * Not be infinite /// * Be representable in the return type `Int`, after truncating off its fractional part <del> #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] </del> <ins> #[stable(feature = "float_approx_unchecked_to", since = "1.44.0")] </ins> #[inline] <del> pub unsafe fn approx_unchecked_to<Int>(self) -> Int </del> <ins> pub unsafe fn to_int_unchecked<Int>(self) -> Int </ins> where Self: FloatToInt<Int>, { <del> FloatToInt::<Int>::approx_unchecked(self) </del> <ins> FloatToInt::<Int>::to_int_unchecked(self) </ins> } /// Raw transmutation to `u32`.
/// assuming that the value is finite and fits in that type. /// /// ``` <del> /// #![feature(float_approx_unchecked_to)] /// </del> /// let value = 4.6_f32; <del> /// let rounded = unsafe { value.approx_unchecked_to::<u16>() }; </del> <ins> /// let rounded = unsafe { value.to_int_unchecked::<u16>() }; </ins> /// assert_eq!(rounded, 4); /// /// let value = -128.9_f32; <del> /// let rounded = unsafe { value.approx_unchecked_to::<i8>() }; </del> <ins> /// let rounded = unsafe { value.to_int_unchecked::<i8>() }; </ins> /// assert_eq!(rounded, std::i8::MIN); /// ``` ///
/// * Not be `NaN` /// * Not be infinite /// * Be representable in the return type `Int`, after truncating off its fractional part <del> #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] </del> <ins> #[stable(feature = "float_approx_unchecked_to", since = "1.44.0")] </ins> #[inline] <del> pub unsafe fn approx_unchecked_to<Int>(self) -> Int </del> <ins> pub unsafe fn to_int_unchecked<Int>(self) -> Int </ins> where Self: FloatToInt<Int>, { <del> FloatToInt::<Int>::approx_unchecked(self) </del> <ins> FloatToInt::<Int>::to_int_unchecked(self) </ins> } /// Raw transmutation to `u64`.
} } <del> "float_to_int_approx_unchecked" => { </del> <ins> "float_to_int_unchecked" => { </ins> if float_type_width(arg_tys[0]).is_none() { span_invalid_monomorphization_error( tcx.sess, span, &format!( <del> "invalid monomorphization of `float_to_int_approx_unchecked`  </del> <ins> "invalid monomorphization of `float_to_int_unchecked`  </ins> intrinsic: expected basic float type,  found `{}`", arg_tys[0]
"fadd_fast" | "fsub_fast" | "fmul_fast" | "fdiv_fast" | "frem_fast" => { (1, vec![param(0), param(0)], param(0)) } <del> "float_to_int_approx_unchecked" => (2, vec![param(0)], param(1)), </del> <ins> "float_to_int_unchecked" => (2, vec![param(0)], param(1)), </ins> "assume" => (0, vec![tcx.types.bool], tcx.mk_unit()), "likely" => (0, vec![tcx.types.bool], tcx.types.bool),
let show_underline = !(parts.len() == 1 && parts[0].snippet.trim() == complete.trim()) && complete.lines().count() == 1; <del> let lines = sm.span_to_lines(parts[0].span).unwrap(); </del> <ins> let lines = sm .span_to_lines(parts[0].span) .expect("span_to_lines failed when emitting suggestion"); </ins> assert!(!lines.lines.is_empty());
self.substitutions .iter() <ins> .filter(|subst| { // Suggestions coming from macros can have malformed spans. This is a heavy // handed approach to avoid ICEs by ignoring the suggestion outright. let invalid = subst.parts.iter().any(|item| cm.is_valid_span(item.span).is_err()); if invalid { debug!("splice_lines: suggestion contains an invalid span: {:?}", subst); } !invalid }) </ins> .cloned() .map(|mut substitution| { // Assumption: all spans are in the same file, and all spans
lo.line != hi.line } <del> pub fn span_to_lines(&self, sp: Span) -> FileLinesResult { debug!("span_to_lines(sp={:?})", sp); </del> <ins> pub fn is_valid_span(&self, sp: Span) -> Result<(Loc, Loc), SpanLinesError> { </ins> let lo = self.lookup_char_pos(sp.lo()); debug!("span_to_lines: lo={:?}", lo); let hi = self.lookup_char_pos(sp.hi()); debug!("span_to_lines: hi={:?}", hi); if lo.file.start_pos != hi.file.start_pos { return Err(SpanLinesError::DistinctSources(DistinctSources { begin: (lo.file.name.clone(), lo.file.start_pos), end: (hi.file.name.clone(), hi.file.start_pos), })); } <ins> Ok((lo, hi)) } pub fn span_to_lines(&self, sp: Span) -> FileLinesResult { debug!("span_to_lines(sp={:?})", sp); let (lo, hi) = self.is_valid_span(sp)?; </ins> assert!(hi.line >= lo.line); let mut lines = Vec::with_capacity(hi.line - lo.line + 1);
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <del> thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:346:17 </del> <ins> thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:356:17 </ins> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: internal compiler error: unexpected panic
<ins> //xfail-test // Creating a stack closure which references an owned pointer and then // transferring ownership of the owned box before invoking the stack // closure results in a crash. fn twice(x: ~uint) -> uint { *x * 2 } fn invoke(f : &fn() -> uint) { f(); } fn main() { let x  : ~uint         = ~9; let sq : &fn() -> uint = || { *x * *x }; twice(x); invoke(sq); } </ins>  No newline at end of file
if self.regioncx.universal_regions().is_universal_region(r) { Some(r) } else { <del> let upper_bound = self.regioncx.universal_upper_bound(r); </del> <ins> // We just want something nameable, even if it's not // actually an upper bound. let upper_bound = self.regioncx.approx_universal_upper_bound(r); </ins> if self.regioncx.upper_bound_in_region_scc(r, upper_bound) { self.to_error_region_vid(upper_bound)
lub } <ins> /// Like `universal_upper_bound`, but returns an approximation more suitable /// for diagnostics. If `r` contains multiple disjoint universal regions /// (e.g. 'a and 'b in `fn foo<'a, 'b> { ... }`, we pick the lower-numbered region. /// This corresponds to picking named regions over unnamed regions /// (e.g. picking early-bound regions over a closure late-bound region). /// /// This means that the returned value may not be a true upper bound, since /// only 'static is known to outlive disjoint universal regions. /// Therefore, this method should only be used in diagnostic code, /// where displaying *some* named universal region is better than /// falling back to 'static. pub(in crate::borrow_check) fn approx_universal_upper_bound(&self, r: RegionVid) -> RegionVid { debug!("approx_universal_upper_bound(r={:?}={})", r, self.region_value_str(r)); // Find the smallest universal region that contains all other // universal regions within `region`. let mut lub = self.universal_regions.fr_fn_body; let r_scc = self.constraint_sccs.scc(r); let static_r = self.universal_regions.fr_static; for ur in self.scc_values.universal_regions_outlived_by(r_scc) { let new_lub = self.universal_region_relations.postdom_upper_bound(lub, ur); debug!("approx_universal_upper_bound: ur={:?} lub={:?} new_lub={:?}", ur, lub, new_lub); if ur != static_r && lub != static_r && new_lub == static_r { lub = std::cmp::min(ur, lub); } else { lub = new_lub; } } debug!("approx_universal_upper_bound: r={:?} lub={:?}", r, lub); lub } </ins> /// Tests if `test` is true when applied to `lower_bound` at /// `point`. fn eval_verify_bound(
{ tcx.fold_regions(&ty, &mut false, |region, _| match *region { ty::ReVar(vid) => { <del> let upper_bound = self.universal_upper_bound(vid); </del> <ins> // Find something that we can name let upper_bound = self.approx_universal_upper_bound(vid); </ins> self.definitions[upper_bound].external_name.unwrap_or(region) } _ => region,
<ins> error[E0515]: cannot return value referencing local variable `s` --> $DIR/issue-67765-async-diagnostic.rs:13:11 | LL |     let b = &s[..]; |              - `s` is borrowed here LL | LL |     Err(b)?; |           ^ returns a value referencing data owned by the current function error: aborting due to previous error For more information about this error, try `rustc --explain E0515`. </ins>
<del> error[E0597]: `a` does not live long enough --> $DIR/unnamed-closure-doesnt-life-long-enough-issue-67634.rs:2:49 </del> <ins> error[E0373]: closure may outlive the current function, but it borrows `a`, which is owned by the current function --> $DIR/unnamed-closure-doesnt-life-long-enough-issue-67634.rs:2:44 </ins> | LL |     [0].iter().flat_map(|a| [0].iter().map(|_| &a)); <del> |                                             -   ^- ...but `a` will be dropped here, when the enclosing closure returns |                                             |   | |                                             |   `a` would have to be valid for `'_`... |                                             has type `&i32` </del> <ins> |                                            ^^^  - `a` is borrowed here |                                            | |                                            may outlive borrowed value `a` </ins> | <del> = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments = note: to learn more, visit <https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references> </del> <ins> note: closure is returned here --> $DIR/unnamed-closure-doesnt-life-long-enough-issue-67634.rs:2:29 | LL |     [0].iter().flat_map(|a| [0].iter().map(|_| &a)); |                             ^^^^^^^^^^^^^^^^^^^^^^ help: to force the closure to take ownership of `a` (and any other referenced variables), use the `move` keyword | LL |     [0].iter().flat_map(|a| [0].iter().map(move |_| &a)); |                                            ^^^^^^^^ </ins> error: aborting due to previous error <del> For more information about this error, try `rustc --explain E0597`. </del> <ins> For more information about this error, try `rustc --explain E0373`. </ins>
<ins> error[E0515]: cannot return value referencing function parameter `x` --> $DIR/return-disjoint-regions.rs:4:5 | LL |     let y = &x; |             -- `x` is borrowed here LL |     (y, y) |     ^^^^^^ returns a value referencing data owned by the current function error: aborting due to previous error For more information about this error, try `rustc --explain E0515`. </ins>
use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::{ hir::place::PlaceBase, <del> mir::{self, ClearCrossCrate, Local, LocalDecl, LocalInfo, Location}, </del> <ins> mir::{self, ClearCrossCrate, Local, LocalDecl, LocalInfo, LocalKind, Location}, </ins> }; use rustc_span::source_map::DesugaringKind; use rustc_span::symbol::{kw, Symbol};
match label { Some((true, err_help_span, suggested_code)) => { <del> err.span_suggestion( err_help_span, &format!( "consider changing this to be a mutable {}", pointer_desc ), suggested_code, Applicability::MachineApplicable, ); </del> <ins> let (is_trait_sig, local_trait) = self.is_error_in_trait(local); if !is_trait_sig { err.span_suggestion( err_help_span, &format!( "consider changing this to be a mutable {}", pointer_desc ), suggested_code, Applicability::MachineApplicable, ); } else if let Some(x) = local_trait { err.span_suggestion( x, &format!( "consider changing that to be a mutable {}", pointer_desc ), suggested_code, Applicability::MachineApplicable, ); } </ins> } Some((false, err_label_span, message)) => { err.span_label(err_label_span, &message);
err.buffer(&mut self.errors_buffer); } <ins> /// User cannot make signature of a trait mutable without changing the /// trait. So we find if this error belongs to a trait and if so we move /// suggestion to the trait or disable it if it is out of scope of this crate fn is_error_in_trait(&self, local: Local) -> (bool, Option<Span>) { if self.body.local_kind(local) != LocalKind::Arg { return (false, None); } let hir_map = self.infcx.tcx.hir(); let my_def = self.body.source.def_id(); let my_hir = hir_map.local_def_id_to_hir_id(my_def.as_local().unwrap()); let td = if let Some(a) = self.infcx.tcx.impl_of_method(my_def).and_then(|x| self.infcx.tcx.trait_id_of_impl(x)) { a } else { return (false, None); }; ( true, td.as_local().and_then(|tld| { let h = hir_map.local_def_id_to_hir_id(tld); match hir_map.find(h) { Some(Node::Item(hir::Item { kind: hir::ItemKind::Trait(_, _, _, _, items), .. })) => { let mut f_in_trait_opt = None; for hir::TraitItemRef { id: fi, kind: k, .. } in *items { let hi = fi.hir_id(); if !matches!(k, hir::AssocItemKind::Fn { .. }) { continue; } if hir_map.name(hi) != hir_map.name(my_hir) { continue; } f_in_trait_opt = Some(hi); break; } f_in_trait_opt.and_then(|f_in_trait| match hir_map.find(f_in_trait) { Some(Node::TraitItem(hir::TraitItem { kind: hir::TraitItemKind::Fn( hir::FnSig { decl: hir::FnDecl { inputs, .. }, .. }, _, ), .. })) => { let hir::Ty { span, .. } = inputs[local.index() - 1]; Some(span) } _ => None, }) } _ => None, } }), ) } </ins> // point to span of upvar making closure call require mutable borrow fn show_mutating_upvar( &self,
<ins> use std::alloc::{GlobalAlloc, Layout}; struct Test(u32); unsafe impl GlobalAlloc for Test { unsafe fn alloc(&self, _layout: Layout) -> *mut u8 { self.0 += 1; //~ ERROR cannot assign 0 as *mut u8 } unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) { unimplemented!(); } } fn main() { } </ins>
<ins> error[E0594]: cannot assign to `self.0` which is behind a `&` reference --> $DIR/issue-68049-1.rs:7:9 | LL |         self.0 += 1; |         ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written error: aborting due to previous error For more information about this error, try `rustc --explain E0594`. </ins>
<ins> trait Hello { fn example(&self, input: &i32); // should suggest here } struct Test1(i32); impl Hello for Test1 { fn example(&self, input: &i32) { // should not suggest here *input = self.0; //~ ERROR cannot assign } } struct Test2(i32); impl Hello for Test2 { fn example(&self, input: &i32) { // should not suggest here self.0 += *input; //~ ERROR cannot assign } } fn main() { } </ins>
<ins> error[E0594]: cannot assign to `*input` which is behind a `&` reference --> $DIR/issue-68049-2.rs:9:7 | LL |   fn example(&self, input: &i32); // should suggest here |                            ---- help: consider changing that to be a mutable reference: `&mut i32` ... LL |       *input = self.0; |       ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `self.0` which is behind a `&` reference --> $DIR/issue-68049-2.rs:17:5 | LL |   fn example(&self, input: &i32); // should suggest here |              ----- help: consider changing that to be a mutable reference: `&mut self` ... LL |     self.0 += *input; |     ^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0594`. </ins>
<ins> error: expected one of `extern` or `fn`, found `WhereIsFerris` --> $DIR/issue-68062-const-extern-fns-dont-need-fn-specifier-2.rs:5:18 | LL |     const unsafe WhereIsFerris Now() {} |                  ^^^^^^^^^^^^^ expected one of `extern` or `fn` error: aborting due to previous error </ins>
<ins> error: expected `fn`, found `PUT_ANYTHING_YOU_WANT_HERE` --> $DIR/issue-68062-const-extern-fns-dont-need-fn-specifier.rs:5:25 | LL |     const extern "Rust" PUT_ANYTHING_YOU_WANT_HERE bug() -> usize { 1 } |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `fn` error[E0658]: `const extern fn` definitions are unstable --> $DIR/issue-68062-const-extern-fns-dont-need-fn-specifier.rs:5:5 | LL |     const extern "Rust" PUT_ANYTHING_YOU_WANT_HERE bug() -> usize { 1 } |     ^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/64926 = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. </ins>
[[package]] name = "compiler_builtins" <del> version = "0.1.24" </del> <ins> version = "0.1.25" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "b9975aefa63997ef75ca9cf013ff1bb81487aaa0b622c21053afd3b92979a7af" </del> <ins> checksum = "438ac08ddc5efe81452f984a9e33ba425b00b31d1f48e6acd9e2210aa28cc52e" </ins> dependencies = [ "cc", "rustc-std-workspace-core",
let post = format!(", consider renaming `{}` into `{snippet}`", suggestion.candidate); (span, snippet, post) } else { <del> (span, suggestion.candidate.to_string(), String::new()) </del> <ins> (span, suggestion.candidate.to_ident_string(), String::new()) </ins> }; let msg = match suggestion.target { SuggestionTarget::SimilarlyNamed => format!(
<ins> error[E0425]: cannot find value `fina` in this scope --> $DIR/suggestion-raw-68962.rs:7:5 | LL |     fina; |     ^^^^ help: a local variable with a similar name exists: `r#final` error[E0425]: cannot find function `f` in this scope --> $DIR/suggestion-raw-68962.rs:10:5 | LL | fn r#fn() {} | --------- similarly named function `r#fn` defined here ... LL |     f(); |     ^ help: a function with a similar name exists: `r#fn` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>
# Use LLVM libunwind as the implementation for Rust's unwinder. # Accepted values are 'in-tree' (formerly true), 'system' or 'no' (formerly false). <ins> # This option only applies for Linux and Fuchsia targets. # On Linux target, if crt-static is not enabled, 'no' means dynamic link to # `libgcc_s.so`, 'in-tree' means static link to the in-tree build of llvm libunwind # and 'system' means dynamic link to `libunwind.so`. If crt-static is enabled, # the behavior is depend on the libc. On musl target, 'no' and 'in-tree' both # means static link to the in-tree build of llvm libunwind, and 'system' means # static link to `libunwind.a` provided by system. Due to the limitation of glibc, # it must link to `libgcc_eh.a` to get a working output, and this option have no effect. </ins> #llvm-libunwind = 'no' # Enable Windows Control Flow Guard checks in the standard library.
cc = "1.0.67" [features] <ins> # Only applies for Linux and Fuchsia targets # Static link to the in-tree build of llvm libunwind </ins> llvm-libunwind = [] <ins> # Only applies for Linux and Fuchsia targets # If crt-static is enabled, static link to `libunwind.a` provided by system # If crt-static is disabled, dynamic link to `libunwind.so` provided by system </ins> system-llvm-libunwind = []
} #[cfg(target_env = "musl")] <del> #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] extern "C" {} </del> <ins> cfg_if::cfg_if! { if #[cfg(all(feature = "llvm-libunwind", feature = "system-llvm-libunwind"))] { compile_error!("`llvm-libunwind` and `system-llvm-libunwind` cannot be enabled at the same time"); } else if #[cfg(feature = "llvm-libunwind")] { #[link(name = "unwind", kind = "static")] extern "C" {} } else if #[cfg(feature = "system-llvm-libunwind")] { #[link(name = "unwind", kind = "static-nobundle", cfg(target_feature = "crt-static"))] #[link(name = "unwind", cfg(not(target_feature = "crt-static")))] extern "C" {} } else { #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] extern "C" {} } } </ins> // When building with crt-static, we get `gcc_eh` from the `libc` crate, since // glibc needs it, and needs it listed later on the linker command line. We
/// // x is no longer available /// ``` /// <ins> /// `move` is also valid before an async block. /// /// ```rust /// let capture = "hello"; /// let block = async move { ///     println!("rust says {} from async block", capture); /// }; /// ``` /// </ins> /// For more information on the `move` keyword, see the [closure]'s section /// of the Rust book or the [threads] section ///