} } <del> fn compute_components_recursive<'tcx>( </del> <ins> /// Collect [Component]s for *all* the substs of `parent`. /// /// This should not be used to get the components of `parent` itself. /// Use [push_outlives_components] instead. pub(super) fn compute_components_recursive<'tcx>( </ins> tcx: TyCtxt<'tcx>, parent: GenericArg<'tcx>, out: &mut SmallVec<[Component<'tcx>; 4]>,


<ins> // check-pass // aux-build:issue-112831-aux.rs mod zeroable { pub trait Zeroable {} } use zeroable::*; mod pod { use super::*; pub trait Pod: Zeroable {} } use pod::*; extern crate issue_112831_aux; use issue_112831_aux::Zeroable; fn main() {} </ins>


// Change value between simple literals --------------------------------------- <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_1: i16 = 1; #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_1: i16 = 2; </del> <ins> static STATIC_CHANGE_VALUE_1: i16 = { #[cfg(cfail1)] { 1 } #[cfg(not(cfail1))] { 2 } }; </ins> <del> // Change value between expressions ------------------------------------------- #[cfg(cfail1)] static STATIC_CHANGE_VALUE_2: i16 = 1 + 1; #[cfg(not(cfail1))] </del> <ins> // Change value between expressions ------------------------------------------- </ins> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_2: i16 = 1 + 2; </del> <ins> static STATIC_CHANGE_VALUE_2: i16 = { #[cfg(cfail1)] { 1 + 1 } </ins> <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_3: i16 = 2 + 3; </del> <ins> #[cfg(not(cfail1))] { 1 + 2 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_3: i16 = 2 * 3; </del> <ins> static STATIC_CHANGE_VALUE_3: i16 = { #[cfg(cfail1)] { 2 + 3 } </ins> <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 3; </del> <ins> #[cfg(not(cfail1))] { 2 * 3 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 4; </del> <ins> static STATIC_CHANGE_VALUE_4: i16 = { #[cfg(cfail1)] { 1 + 2 * 3 } #[cfg(not(cfail1))] { 1 + 2 * 4 } }; </ins> // Change type indirectly -----------------------------------------------------


<ins> error[E0308]: mismatched types --> $DIR/issue-107775.rs:35:16 | LL |         map.insert(1, Struct::do_something); |                    -  -------------------- this is of type `fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}`, which causes `map` to be inferred as `HashMap<{integer}, fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>` |                    | |                    this is of type `{integer}`, which causes `map` to be inferred as `HashMap<{integer}, fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>` LL |         Self { map } |                ^^^ expected `HashMap<u16, fn(u8) -> Pin<...>>`, found `HashMap<{integer}, ...>` | = note: expected struct `HashMap<u16, fn(_) -> Pin<Box<(dyn Future<Output = ()> + Send + 'static)>>>` found struct `HashMap<{integer}, fn(_) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>` error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>


spflags, maybe_definition_llfn, template_parameters, <del> None, ); } </del> <ins> decl, ) }; </ins> fn get_function_signature<'ll, 'tcx>( cx: &CodegenCx<'ll, 'tcx>,


<ins> // edition:2018 struct Ia<S>(S); impl<S> Ia<S> { fn partial(_: S) {} fn full(self) {} async fn crash(self) { Self::partial(self.0); Self::full(self); //~ ERROR use of moved value: `self` } } fn main() {} </ins>


linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { <del> features: "+v6,+vfp2".to_string(), </del> <ins> features: "+v6,+vfp2,-d32".to_string(), </ins> max_atomic_width: Some(64), abi_blacklist: super::arm_base::abi_blacklist(), target_mcount: "u{1}__gnu_mcount_nc".to_string(),


* `unboxed_closures` - Rust's new closure design, which is currently a work in progress feature with many known bugs. <del> * `unmarked_api` - Allows use of items within a `#![staged_api]` crate which have not been marked with a stability marker. Such items should not be allowed by the compiler to exist, so if you need this there probably is a compiler bug. </del> * `allow_internal_unstable` - Allows `macro_rules!` macros to be tagged with the `#[allow_internal_unstable]` attribute, designed to allow `std` macros to call


use std::sync::Arc; use crate::clean::cfg::Cfg; <ins> use crate::clean::inline::{load_attrs, merge_attrs}; </ins> use crate::clean::{Crate, Item}; use crate::core::DocContext; use crate::fold::DocFolder; use crate::passes::Pass; <ins> use rustc_hir::def_id::LocalDefId; </ins> pub(crate) const PROPAGATE_DOC_CFG: Pass = Pass { name: "propagate-doc-cfg", run: propagate_doc_cfg, description: "propagates `#[doc(cfg(...))]` to child items", }; <del> pub(crate) fn propagate_doc_cfg(cr: Crate, _: &mut DocContext<'_>) -> Crate { CfgPropagator { parent_cfg: None }.fold_crate(cr) </del> <ins> pub(crate) fn propagate_doc_cfg(cr: Crate, cx: &mut DocContext<'_>) -> Crate { CfgPropagator { parent_cfg: None, parent: None, cx }.fold_crate(cr) </ins> } <del> struct CfgPropagator { </del> <ins> struct CfgPropagator<'a, 'tcx> { </ins> parent_cfg: Option<Arc<Cfg>>, <ins> parent: Option<LocalDefId>, cx: &'a mut DocContext<'tcx>, </ins> } <del> impl DocFolder for CfgPropagator { </del> <ins> impl<'a, 'tcx> DocFolder for CfgPropagator<'a, 'tcx> { </ins> fn fold_item(&mut self, mut item: Item) -> Option<Item> { let old_parent_cfg = self.parent_cfg.clone(); <ins> if item.kind.is_non_assoc() && let Some(def_id) = item.item_id.as_def_id().and_then(|def_id| def_id.as_local()) { let hir = self.cx.tcx.hir(); let hir_id = hir.local_def_id_to_hir_id(def_id); let expected_parent = hir.get_parent_item(hir_id); // If parents are different, it means that `item` is a reexport and we need to compute // the actual `cfg` by iterating through its "real" parents. if self.parent != Some(expected_parent) { let mut attrs = Vec::new(); for (parent_hir_id, _) in hir.parent_iter(hir_id) { let def_id = hir.local_def_id(parent_hir_id).to_def_id(); attrs.extend_from_slice(load_attrs(self.cx, def_id)); } let (_, cfg) = merge_attrs(self.cx, None, item.attrs.other_attrs.as_slice(), Some(&attrs)); item.cfg = cfg; } } </ins> let new_cfg = match (self.parent_cfg.take(), item.cfg.take()) { (None, None) => None, (Some(rc), None) | (None, Some(rc)) => Some(rc),


<del> // The following code taken from https://stackoverflow.com/questions/2000296/innosetup-how-to-automatically-uninstall-previous-installed-version // It performs upgrades by running the uninstaller before the install ///////////////////////////////////////////////////////////////////// function GetUninstallString(): String; var sUnInstPath: String; sUnInstallString: String; begin sUnInstPath := ExpandConstant('SoftwareMicrosoftWindowsCurrentVersionUninstallRust_is1'); sUnInstallString := ''; if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString); Result := sUnInstallString; end; ///////////////////////////////////////////////////////////////////// function IsUpgrade(): Boolean; begin Result := (GetUninstallString() <> ''); end; ///////////////////////////////////////////////////////////////////// function UnInstallOldVersion(): Integer; var sUnInstallString: String; iResultCode: Integer; begin // Return Values: // 1 - uninstall string is empty // 2 - error executing the UnInstallString // 3 - successfully executed the UnInstallString // default return value Result := 0; // get the uninstall string of the old app sUnInstallString := GetUninstallString(); if sUnInstallString <> '' then begin sUnInstallString := RemoveQuotes(sUnInstallString); if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then Result := 3 else Result := 2; end else Result := 1; end; ///////////////////////////////////////////////////////////////////// procedure UpgradeCurStepChanged(CurStep: TSetupStep); begin if (CurStep=ssInstall) then begin if (IsUpgrade()) then begin UnInstallOldVersion(); end; end; end; </del>


/// Used to detect possible new binding written without `let` and to provide structured suggestion. in_assignment: Option<&'ast Expr>, <ins> is_assign_rhs: bool, </ins> /// If we are currently in a trait object definition. Used to point at the bounds when /// encountering a struct or enum.


<del> Subproject commit 5cb983338e924ec85898880d60e65f2a1291b7be </del> <ins> Subproject commit 52cebb1f8f8789b97d243c07bf4c961ca0017f7b </ins>


if (splitAt !== -1) { const implId = savedHash.slice(0, splitAt); const assocId = savedHash.slice(splitAt + 1); <del> const implElem = document.getElementById(implId); if (implElem && implElem.parentElement.tagName === "SUMMARY" && implElem.parentElement.parentElement.tagName === "DETAILS") { onEachLazy(implElem.parentElement.parentElement.querySelectorAll( </del> <ins> const implElems = document.querySelectorAll( `details > summary > section[id^="${implId}"]`, ); onEachLazy(implElems, implElem => { const numbered = /^(.+?)-([0-9]+)$/.exec(implElem.id); if (implElem.id !== implId && (!numbered || numbered[1] !== implId)) { return false; } return onEachLazy(implElem.parentElement.parentElement.querySelectorAll( </ins> `[id^="${assocId}"]`), item => { <del> const numbered = /([^-]+)-([0-9]+)/.exec(item.id); </del> <ins> const numbered = /^(.+?)-([0-9]+)$/.exec(item.id); </ins> if (item.id === assocId || (numbered && numbered[1] === assocId)) { openParentDetails(item); item.scrollIntoView();


<del> // Regression test for an ICE: https://github.com/rust-lang/rust/issues/120884 </del> <ins> // Test that we don't ICE for coercions with type errors. </ins> // We still need to properly go through coercions between types with errors instead of // shortcutting and returning success, because we need the adjustments for building the MIR. pub fn has_error() -> TypeError {} //~^ ERROR cannot find type `TypeError` in this scope <ins> // https://github.com/rust-lang/rust/issues/120884 // Casting a function item to a data pointer in valid in HIR, but invalid in MIR. // We need an adjustment (ReifyFnPointer) to insert a cast from the function item // to a function pointer as a separate MIR statement. </ins> pub fn cast() -> *const u8 { <del> // Casting a function item to a data pointer in valid in HIR, but invalid in MIR. // We need an adjustment (ReifyFnPointer) to insert a cast from the function item // to a function pointer as a separate MIR statement. </del> has_error as *const u8 } <ins> // https://github.com/rust-lang/rust/issues/120945 // This one ICEd, because we skipped the builtin deref from `&TypeError` to `TypeError`. pub fn autoderef_source(e: &TypeError) { //~^ ERROR cannot find type `TypeError` in this scope autoderef_target(e) } pub fn autoderef_target(_: &TypeError) {} //~^ ERROR cannot find type `TypeError` in this scope </ins> fn main() {}


use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt}; use rustc_infer::traits::util; use rustc_middle::ty::error::{ExpectedFound, TypeError}; <ins> use rustc_middle::ty::fold::BottomUpFolder; </ins> use rustc_middle::ty::util::ExplicitSelf; use rustc_middle::ty::{ self, GenericArgs, Ty, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt,


let lifetime_params: Vec<(Span, ParamName)> = this.in_scope_lifetimes .iter().cloned() <del> .map(|ident| (ident.span, ParamName::Plain(ident))) </del> <ins> .map(|name| (name.ident().span, name)) </ins> .chain(this.lifetimes_to_define.iter().cloned()) .collect(); <ins> debug!("lower_async_fn_ret_ty: in_scope_lifetimes={:#?}", this.in_scope_lifetimes); debug!("lower_async_fn_ret_ty: lifetimes_to_define={:#?}", this.lifetimes_to_define); debug!("lower_async_fn_ret_ty: lifetime_params={:#?}", lifetime_params); </ins> let generic_params = lifetime_params .iter().cloned()


plug_infer_with_placeholders(infcx, universe, (impl1_header.impl_args, impl2_header.impl_args)); <ins> // FIXME(with_negative_coherence): the infcx has constraints from equating // the impl headers. We should use these constraints as assumptions, not as // requirements, when proving the negated where clauses below. drop(equate_obligations); drop(infcx.take_registered_region_obligations()); drop(infcx.take_and_reset_region_constraints()); </ins> util::elaborate(tcx, tcx.predicates_of(impl2_def_id).instantiate(tcx, impl2_header.impl_args)) .any(|(clause, _)| try_prove_negated_where_clause(infcx, clause, param_env)) }


// @has impl_trait/fn.func2.html // @has - '//pre[@class="rust item-decl"]' "func2<T>(" // @has - '//pre[@class="rust item-decl"]' "_x: impl Deref<Target = Option<T>> + Iterator<Item = T>," <del> // @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator<Item = u8> )" </del> <ins> // @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator<Item = u8>, )" </ins> // @!has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func2;


return; } <del> let is_error = match self.level { </del> <ins> self.handler.emit_db(&self); self.cancel(); } pub fn is_error(&self) -> bool { match self.level { </ins> Level::Bug | Level::Fatal | Level::PhaseFatal |


<ins> error[E0451]: field `0` of struct `Box` is private --> $DIR/issue-82772.rs:5:15 | LL |     let Box { 0: _, .. }: Box<()>; |               ^^^^ private field error[E0451]: field `1` of struct `Box` is private --> $DIR/issue-82772.rs:6:15 | LL |     let Box { 1: _, .. }: Box<()>; |               ^^^^ private field error[E0451]: field `1` of struct `ModPrivateStruct` is private --> $DIR/issue-82772.rs:7:28 | LL |     let ModPrivateStruct { 1: _, .. } = ModPrivateStruct::default(); |                            ^^^^ private field error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0451`. </ins>


| LL |     semitransparent!; |                    + <ins> help: a unit struct with a similar name exists | LL |     SemiTransparent; |     ~~~~~~~~~~~~~~~ </ins> error[E0423]: expected value, found macro `opaque` --> $DIR/rustc-macro-transparency.rs:30:5 | <ins> LL |     struct Opaque; |     -------------- similarly named unit struct `Opaque` defined here ... </ins> LL |     opaque; |     ^^^^^^ not a value |


sig.decl.has_self(), sig.decl.inputs.iter().map(|Param { ty, .. }| (None, &**ty)), &sig.decl.output, <del> ) </del> <ins> ); this.record_lifetime_params_for_async( fn_id, sig.header.asyncness.opt_return_id(), ); </ins> }, ); return;


<ins> // build-pass #![feature(generators)] static mut A: [i32; 5] = [1, 2, 3, 4, 5]; fn is_send_sync<T: Send + Sync>(_: T) {} fn main() { unsafe { let gen_index = static || { let u = A[{ yield; 1 }]; }; let gen_match = static || match A { i if { yield; true } => { () } _ => (), }; is_send_sync(gen_index); is_send_sync(gen_match); } } </ins>


<ins> // Copyright 2015 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. macro_rules! invalid { _ => (); //~^ ERROR Invalid macro matcher } fn main() { } </ins>


<ins> // build-pass #![feature(dyn_star)] //~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes fn main() { let x: dyn* Send = &(); let x = Box::new(x) as Box<dyn Send>; } </ins>


<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>


use core::intrinsics::abort; use core::iter; use core::marker::{PhantomData, Unpin, Unsize}; <del> use core::mem::{self, align_of_val, size_of_val}; </del> <ins> use core::mem::{self, align_of_val_raw, size_of_val}; </ins> use core::ops::{CoerceUnsized, Deref, DispatchFromDyn, Receiver}; use core::pin::Pin; use core::ptr::{self, NonNull};


} } } <ins> declare_lint! { pub UNNECESSARY_EXTERN_CRATE, Allow, "suggest removing `extern crate` for the 2018 edition" } pub struct ExternCrate(/* depth */ u32); impl ExternCrate { pub fn new() -> Self { ExternCrate(0) } } impl LintPass for ExternCrate { fn get_lints(&self) -> LintArray { lint_array!(UNNECESSARY_EXTERN_CRATE) } } impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExternCrate { fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { if let hir::ItemExternCrate(ref orig) =  it.node { if it.attrs.iter().any(|a| a.check_name("macro_use")) { return } let mut err = cx.struct_span_lint(UNNECESSARY_EXTERN_CRATE, it.span, "`extern crate` is unnecessary in the new edition"); if it.vis == hir::Visibility::Public || self.0 > 1 || orig.is_some() { let pub_ = if it.vis == hir::Visibility::Public { "pub " } else { "" }; let help = format!("use `{}use`", pub_); if let Some(orig) = orig { err.span_suggestion(it.span, &help, format!("{}use {} as {}", pub_, orig, it.name)); } else { err.span_suggestion(it.span, &help, format!("{}use {}", pub_, it.name)); } } else { err.span_suggestion(it.span, "remove it", "".into()); } err.emit(); } } fn check_mod(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { self.0 += 1; } fn check_mod_post(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { self.0 += 1; } } </ins>


fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'gcx>, hasher: &mut StableHasher<W>) { <del> let hash_spans = match self.node { </del> <ins> let (is_const, hash_spans) = match self.node { </ins> hir::ItemStatic(..)      | <del> hir::ItemConst(..)       | hir::ItemFn(..)          => { hcx.hash_spans() </del> <ins> hir::ItemConst(..)       => { (true, hcx.hash_spans()) } hir::ItemFn(_, _, constness, ..) => { (constness == hir::Constness::Const, hcx.hash_spans()) </ins> } hir::ItemUse(..)         | hir::ItemExternCrate(..) |


} impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {} <ins> #[stable(feature = "box_slice_clone", since = "1.3.0")] impl<T: Clone> Clone for Box<[T]> { fn clone(&self) -> Self { let mut new = BoxBuilder { data: RawVec::with_capacity(self.len()), len: 0 }; let mut target = new.data.ptr(); for item in self.iter() { unsafe { ptr::write(target, item.clone()); target = target.offset(1); }; new.len += 1; } return unsafe { new.into_box() }; // Helper type for responding to panics correctly. struct BoxBuilder<T> { data: RawVec<T>, len: usize, } impl<T> BoxBuilder<T> { unsafe fn into_box(self) -> Box<[T]> { let raw = ptr::read(&self.data); mem::forget(self); raw.into_box() } } impl<T> Drop for BoxBuilder<T> { fn drop(&mut self) { let mut data = self.data.ptr(); let max = unsafe { data.offset(self.len as isize) }; while data != max { unsafe { ptr::read(data); data = data.offset(1); } } } } } } </ins>


css_file_extension: css_file_extension.clone(), markdown_warnings: RefCell::new(vec![]), created_dirs: RefCell::new(FxHashSet()), <ins> sort_modules_alphabetically, </ins> }; // If user passed in `--playground-url` arg, we fill in crate name here


/// of each element in the array. /// /// On arithmetic overflow, returns `None`. <ins> #[inline] </ins> pub fn repeat(&self, n: usize) -> Option<(Self, usize)> { let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) { None => return None,


false } }; if !eligible { return Ok(None); } <ins> // HACK: We may have overlapping `dyn Trait` built-in impls and // user-provided blanket impls. Detect that case here, and return // ambiguity. // // This should not affect totally monomorphized contexts, only // resolve calls that happen polymorphically, such as the mir-inliner // and const-prop (and also some lints). let self_ty = rcvr_args.type_at(0); if !self_ty.is_known_rigid() { let predicates = tcx .predicates_of(impl_data.impl_def_id) .instantiate(tcx, impl_data.args) .predicates; let sized_def_id = tcx.lang_items().sized_trait(); // If we find a `Self: Sized` bound on the item, then we know // that `dyn Trait` can certainly never apply here. if !predicates.into_iter().filter_map(ty::Clause::as_trait_clause).any(|clause| { Some(clause.def_id()) == sized_def_id && clause.skip_binder().self_ty() == self_ty }) { return Ok(None); } } </ins> // Any final impl is required to define all associated items. if !leaf_def.item.defaultness(tcx).has_value() { let guard = tcx.sess.delay_span_bug(


// For LTO purposes, the bytecode of this library is also inserted // into the archive. let bc = obj_filename.with_extension("bc"); <ins> let bc_deflated = obj_filename.with_extension("bc.deflate"); </ins> match fs::File::open(&bc).read_to_end().and_then(|data| { <del> fs::File::create(&bc).write(flate::deflate_bytes(data).as_slice()) </del> <ins> fs::File::create(&bc_deflated).write(flate::deflate_bytes(data).as_slice()) </ins> }) { Ok(()) => {} Err(e) => {


/// # Examples /// /// ```no_run <del> /// #![feature(rw_exact_all_at)] </del> /// use std::io; /// use std::fs::File; /// use std::os::unix::prelude::FileExt;


<ins> error: expected one of `.`, `?`, `]`, or an operator, found `:` --> $DIR/range-index-instead-of-colon.rs:4:17 | LL |     &[1, 2, 3][1:2]; |                 ^ expected one of `.`, `?`, `]`, or an operator | help: you might have meant a range expression | LL |     &[1, 2, 3][1..2]; |                 ~~ error: aborting due to 1 previous error </ins>


self.insert_def_id(def.non_enum_variant().fields[index].did); } ty::Tuple(..) => {} <del> _ => span_bug!(lhs.span, "named field access on non-ADT"), </del> <ins> ty::Error(_) => {} kind => span_bug!(lhs.span, "named field access on non-ADT: {kind:?}"), </ins> } }


// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> #![feature(associated_consts)] </ins> pub use self::sub::{Bar, Baz}; pub trait Trait { fn foo(&self); <ins> type Assoc; const CONST: u32; </ins> } struct Foo; impl Foo { pub fn new() {} <ins> pub const C: u32 = 0; </ins> } mod sub {


<ins> # ignore-cross-compile include ../tools.mk # With the upgrade to LLVM 16, this was getting: # #   error: Cannot represent a difference across sections # # The error stemmed from DI function definitions under type scopes, fixed by # only declaring in type scope and defining the subprogram elsewhere. all: $(RUSTC) lib.rs --test -C lto=fat -C debuginfo=2 -C incremental=$(TMPDIR)/inc-fat </ins>


|             ^^^^^^^ value used here after move | = note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info) <ins> help: consider borrowing instead of transferring ownership | LL |     let _ = dbg!(&a); |                  + </ins> error: aborting due to 1 previous error


match module.inner { ModuleItem(ref module) => { for it in &module.items { <del> if it.is_extern_crate() && it.attrs.has_doc_flag("masked") { </del> <ins> // `compiler_builtins` should be masked too, but we can't apply // `#[doc(masked)]` to the injected `extern crate` because it's unstable. if it.is_extern_crate() && (it.attrs.has_doc_flag("masked") || self.cx.tcx.is_compiler_builtins(it.def_id.krate)) { </ins> masked_crates.insert(it.def_id.krate); } }


} // We probe again, taking all traits into account (not only those in scope). <del> let mut candidates = </del> <ins> let candidates = </ins> match self.lookup_probe(segment.ident, self_ty, call_expr, ProbeScope::AllTraits) { // If we find a different result the caller probably forgot to import a trait. Ok(ref new_pick) if pick.differs_from(new_pick) => {


} } <ins> #[rustfmt::skip] fn baw<>(constraints: impl Iterator) { for constraint in constraints { qux(constraint); //~^ ERROR `<impl Iterator as Iterator>::Item` doesn't implement `Debug` } } </ins> fn qux(_: impl std::fmt::Debug) {} fn main() {}


} let (ours, theirs) = self.setup_io(default, needs_stdin)?; <ins> if let Some(ret) = self.posix_spawn(&theirs, envp.as_ref())? { return Ok((ret, ours)) } </ins> let (input, output) = sys::pipe::anon_pipe()?; let pid = unsafe {


impl FileAttr { pub fn size(&self) -> u64 { self.stat.st_size as u64 } pub fn perm(&self) -> FilePermissions { <del> FilePermissions { mode: (self.stat.st_mode as mode_t) & 0o777 } </del> <ins> FilePermissions { mode: (self.stat.st_mode as mode_t) } </ins> } pub fn file_type(&self) -> FileType {


{ // The dereferenced place must have type `&_`. let ty = Place::ty_from(local, proj_base, self.body, self.tcx).ty; <del> if let ty::Ref(_, _, mtbl) = ty.kind { self.optimizations.and_stars.insert(location, mtbl); </del> <ins> if let ty::Ref(_, _, Mutability::Not) = ty.kind { self.optimizations.and_stars.insert(location); </ins> } } }


<del> // no-prefer-dynamic </del> // pretty-expanded FIXME #23616 #![feature(rustc_private)]


<del> { "message": "unnecessary parentheses around `if` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 521, "byte_end": 525, "line_start": 18, "line_end": 18, "column_start": 8, "column_end": 12, "is_primary": true, "text": [ { "text": "    if (_b) {", "highlight_start": 8, "highlight_end": 12 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "lint level defined here", "code": null, "level": "note", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 435, "byte_end": 448, "line_start": 11, "line_end": 11, "column_start": 9, "column_end": 22, "is_primary": true, "text": [ { "text": "#![warn(unused_parens)]", "highlight_start": 9, "highlight_end": 22 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [], "rendered": null }, { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 521, "byte_end": 525, "line_start": 18, "line_end": 18, "column_start": 8, "column_end": 12, "is_primary": true, "text": [ { "text": "    if (_b) {", "highlight_start": 8, "highlight_end": 12 } ], "label": null, "suggested_replacement": "_b", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `if` condition --> $DIR/unused_parens_remove_json_suggestion.rs:18:8 </del> <ins> {"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":500,"byte_end":504,"line_start":17,"line_end":17,"column_start":8,"column_end":12,"is_primary":true,"text":[{"text":"    if (_b) { --> $DIR/unused_parens_remove_json_suggestion.rs:17:8 </ins> | LL |     if (_b) { |        ^^^^ help: remove these parentheses | note: lint level defined here <del> --> $DIR/unused_parens_remove_json_suggestion.rs:11:9 </del> <ins> --> $DIR/unused_parens_remove_json_suggestion.rs:10:9 </ins> | <del> LL | #![warn(unused_parens)] </del> <ins> LL | #![deny(unused_parens)] </ins> |         ^^^^^^^^^^^^^ <del> " } { "message": "unnecessary parentheses around `if` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 618, "byte_end": 621, "line_start": 29, "line_end": 29, "column_start": 7, "column_end": 10, "is_primary": true, "text": [ { "text": "    if(c) {", "highlight_start": 7, "highlight_end": 10 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 618, "byte_end": 621, "line_start": 29, "line_end": 29, "column_start": 7, "column_end": 10, "is_primary": true, "text": [ { "text": "    if(c) {", "highlight_start": 7, "highlight_end": 10 } ], "label": null, "suggested_replacement": " c", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `if` condition --> $DIR/unused_parens_remove_json_suggestion.rs:29:7 </del> <ins> "} {"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":631,"byte_end":634,"line_start":28,"line_end":28,"column_start":7,"column_end":10,"is_primary":true,"text":[{"text":"    if(c) { --> $DIR/unused_parens_remove_json_suggestion.rs:28:7 </ins> | LL |     if(c) { |       ^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `if` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 664, "byte_end": 667, "line_start": 33, "line_end": 33, "column_start": 8, "column_end": 11, "is_primary": true, "text": [ { "text": "    if (c){", "highlight_start": 8, "highlight_end": 11 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 664, "byte_end": 667, "line_start": 33, "line_end": 33, "column_start": 8, "column_end": 11, "is_primary": true, "text": [ { "text": "    if (c){", "highlight_start": 8, "highlight_end": 11 } ], "label": null, "suggested_replacement": "c ", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `if` condition --> $DIR/unused_parens_remove_json_suggestion.rs:33:8 </del> <ins> "} {"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":711,"byte_end":714,"line_start":32,"line_end":32,"column_start":8,"column_end":11,"is_primary":true,"text":[{"text":"    if (c){ --> $DIR/unused_parens_remove_json_suggestion.rs:32:8 </ins> | LL |     if (c){ |        ^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `while` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 712, "byte_end": 727, "line_start": 37, "line_end": 37, "column_start": 11, "column_end": 26, "is_primary": true, "text": [ { "text": "    while (false && true){", "highlight_start": 11, "highlight_end": 26 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 712, "byte_end": 727, "line_start": 37, "line_end": 37, "column_start": 11, "column_end": 26, "is_primary": true, "text": [ { "text": "    while (false && true){", "highlight_start": 11, "highlight_end": 26 } ], "label": null, "suggested_replacement": "false && true ", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `while` condition --> $DIR/unused_parens_remove_json_suggestion.rs:37:11 </del> <ins> "} {"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":808,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":"    while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":808,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":"    while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":"false && true ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition --> $DIR/unused_parens_remove_json_suggestion.rs:36:11 </ins> | LL |     while (false && true){ |           ^^^^^^^^^^^^^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `if` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 740, "byte_end": 743, "line_start": 38, "line_end": 38, "column_start": 12, "column_end": 15, "is_primary": true, "text": [ { "text": "        if (c) {", "highlight_start": 12, "highlight_end": 15 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 740, "byte_end": 743, "line_start": 38, "line_end": 38, "column_start": 12, "column_end": 15, "is_primary": true, "text": [ { "text": "        if (c) {", "highlight_start": 12, "highlight_end": 15 } ], "label": null, "suggested_replacement": "c", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `if` condition --> $DIR/unused_parens_remove_json_suggestion.rs:38:12 </del> <ins> "} {"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":821,"byte_end":824,"line_start":37,"line_end":37,"column_start":12,"column_end":15,"is_primary":true,"text":[{"text":"        if (c) { --> $DIR/unused_parens_remove_json_suggestion.rs:37:12 </ins> | LL |         if (c) { |            ^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `while` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 803, "byte_end": 818, "line_start": 44, "line_end": 44, "column_start": 10, "column_end": 25, "is_primary": true, "text": [ { "text": "    while(true && false) {", "highlight_start": 10, "highlight_end": 25 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 803, "byte_end": 818, "line_start": 44, "line_end": 44, "column_start": 10, "column_end": 25, "is_primary": true, "text": [ { "text": "    while(true && false) {", "highlight_start": 10, "highlight_end": 25 } ], "label": null, "suggested_replacement": " true && false", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `while` condition --> $DIR/unused_parens_remove_json_suggestion.rs:44:10 </del> <ins> "} {"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":918,"byte_end":933,"line_start":43,"line_end":43,"column_start":10,"column_end":25,"is_primary":true,"text":[{"text":"    while(true && false) { --> $DIR/unused_parens_remove_json_suggestion.rs:43:10 </ins> | LL |     while(true && false) { |          ^^^^^^^^^^^^^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `for` head expression", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 838, "byte_end": 846, "line_start": 45, "line_end": 45, "column_start": 18, "column_end": 26, "is_primary": true, "text": [ { "text": "        for _ in (0 .. 3){", "highlight_start": 18, "highlight_end": 26 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 838, "byte_end": 846, "line_start": 45, "line_end": 45, "column_start": 18, "column_end": 26, "is_primary": true, "text": [ { "text": "        for _ in (0 .. 3){", "highlight_start": 18, "highlight_end": 26 } ], "label": null, "suggested_replacement": "0 .. 3 ", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `for` head expression --> $DIR/unused_parens_remove_json_suggestion.rs:45:18 </del> <ins> "} {"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":987,"byte_end":995,"line_start":44,"line_end":44,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"        for _ in (0 .. 3){ --> $DIR/unused_parens_remove_json_suggestion.rs:44:18 </ins> | LL |         for _ in (0 .. 3){ |                  ^^^^^^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `for` head expression", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 905, "byte_end": 913, "line_start": 50, "line_end": 50, "column_start": 14, "column_end": 22, "is_primary": true, "text": [ { "text": "    for _ in (0 .. 3) {", "highlight_start": 14, "highlight_end": 22 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 905, "byte_end": 913, "line_start": 50, "line_end": 50, "column_start": 14, "column_end": 22, "is_primary": true, "text": [ { "text": "    for _ in (0 .. 3) {", "highlight_start": 14, "highlight_end": 22 } ], "label": null, "suggested_replacement": "0 .. 3", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `for` head expression --> $DIR/unused_parens_remove_json_suggestion.rs:50:14 </del> <ins> "} {"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1088,"byte_end":1096,"line_start":49,"line_end":49,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":"    for _ in (0 .. 3) { --> $DIR/unused_parens_remove_json_suggestion.rs:49:14 </ins> | LL |     for _ in (0 .. 3) { |              ^^^^^^^^ help: remove these parentheses <del> " } { "message": "unnecessary parentheses around `while` condition", "code": { "code": "unused_parens", "explanation": null }, "level": "warning", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 930, "byte_end": 945, "line_start": 51, "line_end": 51, "column_start": 15, "column_end": 30, "is_primary": true, "text": [ { "text": "        while (true && false) {", "highlight_start": 15, "highlight_end": 30 } ], "label": null, "suggested_replacement": null, "suggestion_applicability": null, "expansion": null } ], "children": [ { "message": "remove these parentheses", "code": null, "level": "help", "spans": [ { "file_name": "$DIR/unused_parens_remove_json_suggestion.rs", "byte_start": 930, "byte_end": 945, "line_start": 51, "line_end": 51, "column_start": 15, "column_end": 30, "is_primary": true, "text": [ { "text": "        while (true && false) {", "highlight_start": 15, "highlight_end": 30 } ], "label": null, "suggested_replacement": "true && false", "suggestion_applicability": "MachineApplicable", "expansion": null } ], "children": [], "rendered": null } ], "rendered": "warning: unnecessary parentheses around `while` condition --> $DIR/unused_parens_remove_json_suggestion.rs:51:15 </del> <ins> "} {"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1147,"byte_end":1162,"line_start":50,"line_end":50,"column_start":15,"column_end":30,"is_primary":true,"text":[{"text":"        while (true && false) { --> $DIR/unused_parens_remove_json_suggestion.rs:50:15 </ins> | LL |         while (true && false) { |               ^^^^^^^^^^^^^^^ help: remove these parentheses <del> " } </del> <ins> "} {"message":"aborting due to 9 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 9 previous errors "} </ins>


<del> // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. </del> <ins> // The Computer Language Benchmarks Game // http://benchmarksgame.alioth.debian.org/ </ins> // <del> // 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. </del> <ins> // contributed by the Rust Project Developers // Copyright (c) 2013-2014 The Rust Project Developers // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // - Redistributions of source code must retain the above copyright //   notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright //   notice, this list of conditions and the following disclaimer in //   the documentation and/or other materials provided with the //   distribution. // // - Neither the name of "The Computer Language Benchmarks Game" nor //   the name of "The Computer Language Shootout Benchmarks" nor the //   names of its contributors may be used to endorse or promote //   products derived from this software without specific prior //   written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. </ins> // ignore-pretty very bad with line comments // ignore-android doesn't terminate?


} } <ins> fn rustc_sysroot() -> str { alt os::get_exe_path() { some(_path) { let path = [_path, "..", "bin", "rustc"]; check vec::is_not_empty(path); let rustc = fs::normalize(fs::connect_many(path)); #debug("  rustc: %s", rustc); rustc } none { "rustc" } } } </ins> fn install_source(c: cargo, path: str) { #debug("source: %s", path); fs::change_dir(path);


} struct SelectionCandidateSet<'tcx> { <del> // A list of candidates that definitely apply to the current // obligation (meaning: types unify). </del> <ins> /// A list of candidates that definitely apply to the current /// obligation (meaning: types unify). </ins> vec: Vec<SelectionCandidate<'tcx>>, <del> // If `true`, then there were candidates that might or might // not have applied, but we couldn't tell. This occurs when some // of the input types are type variables, in which case there are // various "builtin" rules that might or might not trigger. </del> <ins> /// If `true`, then there were candidates that might or might /// not have applied, but we couldn't tell. This occurs when some /// of the input types are type variables, in which case there are /// various "builtin" rules that might or might not trigger. </ins> ambiguous: bool, }


# FIXME: we should probe the default azure image and see if we can use the MSYS2 # toolchain there. (if there's even one there). For now though this gets the job # done. <del> - script: | set MSYS_PATH=%CD%citoolsmsys64 choco install msys2 --params="/InstallDir:%MSYS_PATH% /NoPath" -y set PATH=%MSYS_PATH%usrbin;%PATH% pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar IF "%MINGW_URL%"=="" ( IF "%MSYS_BITS%"=="32" pacman -S --noconfirm --needed mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-gcc mingw-w64-i686-python2 IF "%MSYS_BITS%"=="64" pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-python2 ) where rev rev --help where make echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH% echo ##vso[task.prependpath]%MSYS_PATH%usrbin </del> <ins> - bash: | set -e choco install msys2 --params="/InstallDir:$(System.Workfolder)/msys2 /NoPath" -y --no-progress echo "##vso[task.prependpath]$(System.Workfolder)/msys2/usr/bin" mkdir -p "$(System.Workfolder)/msys2/home/$USERNAME" </ins> displayName: Install msys2 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) <ins> - bash: pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar displayName: Install msys2 base deps condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) </ins> # If we need to download a custom MinGW, do so here and set the path # appropriately. #


--> $DIR/rustc-macro-transparency.rs:26:5 | LL |     Opaque; <del> |     ^^^^^^ help: a local variable with a similar name exists (notice the capitalization): `opaque` </del> <ins> |     ^^^^^^ not found in this scope </ins> error[E0423]: expected value, found macro `semitransparent` --> $DIR/rustc-macro-transparency.rs:29:5 | <ins> LL |     struct SemiTransparent; |     ----------------------- similarly named unit struct `SemiTransparent` defined here ... </ins> LL |     semitransparent; |     ^^^^^^^^^^^^^^^ not a value |


} } <del> let sp = span_of_attrs(attrs).from_inner(InnerSpan::new( </del> <ins> Some(span_of_attrs(attrs)?.from_inner(InnerSpan::new( </ins> md_range.start + start_bytes, md_range.end + start_bytes + end_bytes, <del> )); Some(sp) </del> <ins> ))) </ins> }


<ins> // Regression test for #80468. #![crate_type = "lib"] pub trait Trait {} #[repr(transparent)] pub struct Wrapper<T: Trait>(T); #[repr(transparent)] pub struct Ref<'a>(&'a u8); impl Trait for Ref {} //~ ERROR:  implicit elided lifetime not allowed here extern "C" { pub fn repro(_: Wrapper<Ref>); //~ ERROR: mismatched types } </ins>


#[expect(invalid_nan_comparisons)] //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations] <ins> //~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations] //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` </ins> let _b = x == 5; } }


<del> # `macro_literal_matcher` The tracking issue for this feature is: [#35625] The RFC is: [rfc#1576]. With this feature gate enabled, the [list of designators] gains one more entry: * `literal`: a literal. Examples: 2, "string", 'c' A `literal` may be followed by anything, similarly to the `ident` specifier. [rfc#1576]: http://rust-lang.github.io/rfcs/1576-macros-literal-matcher.html [#35625]: https://github.com/rust-lang/rust/issues/35625 [list of designators]: ../reference/macros-by-example.html ------------------------ </del>


/// A specific scope in which a name can be looked up. /// This enum is currently used only for early resolution (imports and macros), /// but not for late resolution yet. <del> #[derive(Clone, Copy)] </del> <ins> #[derive(Clone, Copy, Debug)] </ins> enum Scope<'a> { DeriveHelpers(LocalExpnId), DeriveHelpersCompat,


pub use crate::sys_common::fs::remove_dir_all; } <del> // Dynamically choose implementation Macos x86-64: modern for 10.10+, fallback for older versions #[cfg(all(target_os = "macos", target_arch = "x86_64"))] </del> <ins> // Modern implementation using openat(), unlinkat() and fdopendir() #[cfg(not(any(target_os = "redox", target_os = "espidf")))] </ins> mod remove_dir_impl { <del> use super::{cstr, lstat, Dir, InnerReadDir, ReadDir}; </del> <ins> use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir}; </ins> use crate::ffi::CStr; use crate::io; use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd}; use crate::os::unix::prelude::{OwnedFd, RawFd}; use crate::path::{Path, PathBuf}; use crate::sync::Arc; <del> use crate::sys::weak::weak; </del> use crate::sys::{cvt, cvt_r}; <del> use libc::{c_char, c_int, DIR}; pub fn openat_nofollow_dironly(parent_fd: Option<RawFd>, p: &CStr) -> io::Result<OwnedFd> { weak!(fn openat(c_int, *const c_char, c_int) -> c_int); let fd = cvt_r(|| unsafe { openat.get().unwrap()( parent_fd.unwrap_or(libc::AT_FDCWD), p.as_ptr(), libc::O_CLOEXEC | libc::O_RDONLY | libc::O_NOFOLLOW | libc::O_DIRECTORY, ) })?; Ok(unsafe { OwnedFd::from_raw_fd(fd) }) } fn fdreaddir(dir_fd: OwnedFd) -> io::Result<(ReadDir, RawFd)> { weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64"); let ptr = unsafe { fdopendir.get().unwrap()(dir_fd.as_raw_fd()) }; if ptr.is_null() { return Err(io::Error::last_os_error()); } let dirp = Dir(ptr); // file descriptor is automatically closed by libc::closedir() now, so give up ownership let new_parent_fd = dir_fd.into_raw_fd(); // a valid root is not needed because we do not call any functions involving the full path // of the DirEntrys. let dummy_root = PathBuf::new(); Ok(( ReadDir { inner: Arc::new(InnerReadDir { dirp, root: dummy_root }), end_of_stream: false, }, new_parent_fd, )) } fn remove_dir_all_recursive(parent_fd: Option<RawFd>, p: &Path) -> io::Result<()> { weak!(fn unlinkat(c_int, *const c_char, c_int) -> c_int); </del> <ins> #[cfg(not(all(target_os = "macos", target_arch = "x86_64"),))] use libc::{fdopendir, openat, unlinkat}; #[cfg(all(target_os = "macos", target_arch = "x86_64"))] use macos_weak::{fdopendir, openat, unlinkat}; </ins> <del> let pcstr = cstr(p)?; </del> <ins> #[cfg(all(target_os = "macos", target_arch = "x86_64"))] mod macos_weak { use crate::sys::weak::weak; use libc::{c_char, c_int, DIR}; </ins> <del> // entry is expected to be a directory, open as such let fd = openat_nofollow_dironly(parent_fd, &pcstr)?; </del> <ins> fn get_openat_fn() -> Option<unsafe extern "C" fn(c_int, *const c_char, c_int) -> c_int> { weak!(fn openat(c_int, *const c_char, c_int) -> c_int); openat.get() } </ins> <del> // open the directory passing ownership of the fd let (dir, fd) = fdreaddir(fd)?; for child in dir { let child = child?; match child.entry.d_type { libc::DT_DIR => { remove_dir_all_recursive(Some(fd), Path::new(&child.file_name()))?; } libc::DT_UNKNOWN => { match cvt(unsafe { unlinkat.get().unwrap()(fd, child.name_cstr().as_ptr(), 0) }) { // type unknown - try to unlink Err(err) if err.raw_os_error() == Some(libc::EPERM) => { // if the file is a directory unlink fails with EPERM remove_dir_all_recursive(Some(fd), Path::new(&child.file_name()))?; } result => { result?; } } } _ => { // not a directory -> unlink cvt(unsafe { unlinkat.get().unwrap()(fd, child.name_cstr().as_ptr(), 0) })?; } } </del> <ins> pub fn has_openat() -> bool { get_openat_fn().is_some() </ins> } <del> // unlink the directory after removing its contents cvt(unsafe { unlinkat.get().unwrap()( parent_fd.unwrap_or(libc::AT_FDCWD), pcstr.as_ptr(), libc::AT_REMOVEDIR, ) })?; Ok(()) } </del> <ins> pub unsafe fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int { get_openat_fn().map(|openat| openat(dirfd, pathname, flags)).unwrap_or_else(|| { crate::sys::unix::os::set_errno(libc::ENOSYS); -1 }) } </ins> <del> fn remove_dir_all_modern(p: &Path) -> io::Result<()> { // We cannot just call remove_dir_all_recursive() here because that would not delete a passed // symlink. No need to worry about races, because remove_dir_all_recursive() does not recurse // into symlinks. let attr = lstat(p)?; if attr.file_type().is_symlink() { crate::fs::remove_file(p) } else { remove_dir_all_recursive(None, p) </del> <ins> pub unsafe fn fdopendir(fd: c_int) -> *mut DIR { weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64"); fdopendir.get().map(|fdopendir| fdopendir(fd)).unwrap_or_else(|| { crate::sys::unix::os::set_errno(libc::ENOSYS); crate::ptr::null_mut() }) </ins> } <del> } pub fn remove_dir_all(p: &Path) -> io::Result<()> { weak!(fn openat(c_int, *const c_char, c_int) -> c_int); if openat.get().is_some() { // openat() is available with macOS 10.10+, just like unlinkat() and fdopendir() remove_dir_all_modern(p) } else { // fall back to classic implementation crate::sys_common::fs::remove_dir_all(p) </del> <ins> pub unsafe fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int { weak!(fn unlinkat(c_int, *const c_char, c_int) -> c_int); unlinkat.get().map(|unlinkat| unlinkat(dirfd, pathname, flags)).unwrap_or_else(|| { crate::sys::unix::os::set_errno(libc::ENOSYS); -1 }) </ins> } } <del> } // Modern implementation using openat(), unlinkat() and fdopendir() #[cfg(not(any( all(target_os = "macos", target_arch = "x86_64"), target_os = "redox", target_os = "espidf" )))] mod remove_dir_impl { use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir}; use crate::ffi::CStr; use crate::io; use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd}; use crate::os::unix::prelude::{OwnedFd, RawFd}; use crate::path::{Path, PathBuf}; use crate::sync::Arc; use crate::sys::{cvt, cvt_r}; use libc::{fdopendir, openat, unlinkat}; </del> pub fn openat_nofollow_dironly(parent_fd: Option<RawFd>, p: &CStr) -> io::Result<OwnedFd> { let fd = cvt_r(|| unsafe {


BufWriter { inner: Some(inner), buf: Vec::with_capacity(cap), <ins> panicked: false, </ins> } }


<del> error[E0658]: trait upcasting coercion is experimental </del> <ins> error[E0658]: cannot cast `dyn Fn()` to `dyn FnMut()`, trait upcasting coercion is experimental </ins> --> $DIR/issue-11515.rs:9:33 | LL |     let test = box Test { func: closure };


<ins> error[E0433]: failed to resolve: there are too many leading `super` keywords --> $DIR/issue-117920.rs:3:5 | LL | use super::A; |     ^^^^^ there are too many leading `super` keywords error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0433`. </ins>


<ins> // Copyright 2015 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. // ignore-pretty #27582 // Check that when a `let`-binding occurs in a loop, its associated // drop-flag is reinitialized (to indicate "needs-drop" at the end of // the owning variable's scope). struct A<'a>(&'a mut i32); impl<'a> Drop for A<'a> { fn drop(&mut self) { *self.0 += 1; } } fn main() { let mut cnt = 0; for i in 0..2 { let a = A(&mut cnt); if i == 1 { // Note that break;  //  both this break }           //   and also drop(a);    //    this move of `a` // are necessary to expose the bug } assert_eq!(cnt, 2); } </ins>


// except according to those terms. // run-pass <del> #![feature(macro_literal_matcher)] </del> macro_rules! mtester { ($l:literal) => {


displayName: Install wix condition: and(succeeded(), not(variables.SKIP_JOB)) <del> - bash: src/ci/scripts/install-innosetup.sh displayName: Install InnoSetup condition: and(succeeded(), not(variables.SKIP_JOB)) </del> - bash: src/ci/scripts/symlink-build-dir.sh displayName: Ensure the build happens on a partition with enough space condition: and(succeeded(), not(variables.SKIP_JOB))


// `PathSegment`, for which there is no associated `'_` or `&T` with no explicit // lifetime. Instead, we simply create an implicit lifetime, which will be checked // later, at which point a suitable error will be emitted. <del> LifetimeRibKind::AnonymousPassThrough(..) | LifetimeRibKind::AnonymousReportError | LifetimeRibKind::Item => break, </del> <ins> LifetimeRibKind::AnonymousPassThrough(binder) => { res = LifetimeRes::Anonymous { binder, elided: true }; break; } LifetimeRibKind::AnonymousReportError | LifetimeRibKind::Item => { // FIXME(cjgillot) This resolution is wrong, but this does not matter // since these cases are erroneous anyway.  Lifetime resolution should // emit a "missing lifetime specifier" diagnostic. res = LifetimeRes::Anonymous { binder: DUMMY_NODE_ID, elided: true }; break; } </ins> _ => {} } } <del> let res = if error { LifetimeRes::Error } else { LifetimeRes::Anonymous { binder: segment_id, elided: true } }; </del> let node_ids = self.r.next_node_ids(expected_lifetimes); self.record_lifetime_res( segment_id,


assert_eq!(ys, [1, 2, 3]); } <ins> #[test] fn test_box_slice_clone() { let data = vec![vec![0, 1], vec![0], vec![1]]; let data2 = data.clone().into_boxed_slice().clone().to_vec(); assert_eq!(data, data2); } #[test] fn test_box_slice_clone_panics() { use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use std::thread::spawn; struct Canary { count: Arc<AtomicUsize>, panics: bool } impl Drop for Canary { fn drop(&mut self) { self.count.fetch_add(1, Ordering::SeqCst); } } impl Clone for Canary { fn clone(&self) -> Self { if self.panics { panic!() } Canary { count: self.count.clone(), panics: self.panics } } } let drop_count = Arc::new(AtomicUsize::new(0)); let canary = Canary { count: drop_count.clone(), panics: false }; let panic = Canary { count: drop_count.clone(), panics: true }; spawn(move || { // When xs is dropped, +5. let xs = vec![canary.clone(), canary.clone(), canary.clone(), panic, canary].into_boxed_slice(); // When panic is cloned, +3. xs.clone(); }).join().unwrap_err(); // Total = 8 assert_eq!(drop_count.load(Ordering::SeqCst), 8); } </ins> mod bench { use std::iter::repeat; use std::{mem, ptr};


= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> <del> error: aborting due to 47 previous errors </del> <ins> error: any use of this value will cause an error --> $DIR/const-int-unchecked.rs:191:25 | LL | const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) }; | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- |                         | |                         `ctlz_nonzero` called on 0 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> error: any use of this value will cause an error --> $DIR/const-int-unchecked.rs:194:25 | LL | const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) }; | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- |                         | |                         `cttz_nonzero` called on 0 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> error: aborting due to 49 previous errors </ins>


assert_eq!(vec![1; 2], vec![1, 1]); assert_eq!(vec![1; 1], vec![1]); assert_eq!(vec![1; 0], vec![]); <ins> // from_elem syntax (see RFC 832) let el = Box::new(1); let n = 3; assert_eq!(vec![el; n], vec![Box::new(1), Box::new(1), Box::new(1)]); </ins> }


use rustc_hir::def::{self, DefKind, NonMacroAttrKind}; use rustc_hir::def_id; use rustc_middle::middle::stability; <del> use rustc_middle::{span_bug, ty}; </del> <ins> use rustc_middle::ty; </ins> use rustc_session::lint::builtin::UNUSED_MACROS; use rustc_session::Session; use rustc_span::edition::Edition;


<ins> error: requires `generator` lang_item error: aborting due to previous error </ins>


<ins> // In rustc_typeck::check::expr::no_such_field_err we recursively // look in subfields for the field. This recursive search is limited // in depth for compile-time reasons and to avoid infinite recursion // in case of cycles. This file tests that the limit in the recursion // depth is enforced. struct Foo { first: Bar, second: u32, third: u32, } struct Bar { bar: C, } struct C { c: D, } struct D { test: E, } struct E { e: F, } struct F { f: u32, } fn main() { let f = F { f: 6 }; let e = E { e: f }; let d = D { test: e }; let c = C { c: d }; let bar = Bar { bar: c }; let fooer = Foo { first: bar, second: 4, third: 5 }; let test = fooer.f; //~^ ERROR no field } </ins>


<ins> // run-rustfix fn main() { let a: usize = 123; let b: &usize = &a; if true { a } else { b //~ ERROR `if` and `else` have incompatible types [E0308] }; if true { 1 } else { &1 //~ ERROR `if` and `else` have incompatible types [E0308] }; if true { 1 } else { &mut 1 //~ ERROR `if` and `else` have incompatible types [E0308] }; } </ins>


<ins> // rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is // missing the feature gate. struct Foo; impl Iterator for Foo { type Item<'b> = &'b Foo; //~ ERROR generic associated types are unstable [E0658] fn next(&mut self) -> Option<Self::Item> { None } } fn main() { } </ins>


// SAFETY: left and right must be valid and part of v same for out. unsafe { <del> let to_copy = if is_less(&*right, &**left) { get_and_increment(&mut right) } else { get_and_increment(left) }; ptr::copy_nonoverlapping(to_copy, get_and_increment(out), 1); </del> <ins> let is_l = is_less(&*right, &**left); let to_copy = if is_l { right } else { *left }; ptr::copy_nonoverlapping(to_copy, *out, 1); *out = out.add(1); right = right.add(is_l as usize); *left = left.add(!is_l as usize); </ins> } } } else {


)]; let mut has_unsized_tuple_coercion = false; <del> let mut has_trait_upcasting_coercion = false; </del> <ins> let mut has_trait_upcasting_coercion = None; </ins> // Keep resolving `CoerceUnsized` and `Unsize` predicates to avoid // emitting a coercion in cases like `Foo<$1>` -> `Foo<$2>`, where


// More information on the environment variable is available here: // https://www.gnu.org/prep/standards/html_node/DESTDIR.html if let Some(destdir) = env::var_os("DESTDIR").map(PathBuf::from) { <ins> // Sanity check for the user write access on DESTDIR assert!(is_dir_writable_for_user(&destdir), "User doesn't have write access on DESTDIR."); </ins> let without_destdir = path.clone(); path = destdir; // Custom .join() which ignores disk roots.


# "-C", "linker=arm-none-eabi-gcc", # "-C", "link-arg=-Wl,-Tlink.x", # "-C", "link-arg=-nostartfiles", <del> ] </del>  No newline at end of file <ins> ] </ins>


if x == 0.0 { 0 } else { 1 } } <ins> pub fn bitwise_not() -> i32 { // CHECK-LABEL: fn bitwise_not( // CHECK: switchInt( // Test for #131195, which was optimizing `!a == b` into `a != b`. let mut a: i32 = 0; a = 1; if !a == 0 { 1 } else { 0 } } </ins> fn main() { // CHECK-LABEL: fn main( too_complex(Ok(0));


None, ); if let Some(infer::RelateParamBound(_, t, _)) = origin { <del> let return_impl_trait = self.tcx.return_type_impl_trait(generic_param_scope).is_some(); </del> let t = self.resolve_vars_if_possible(t); match t.kind() { // We've got: // fn get_later<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ // suggest: // fn get_later<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a <del> ty::Closure(..) | ty::Alias(ty::Opaque, ..) if return_impl_trait => { </del> <ins> ty::Closure(..) | ty::Alias(ty::Opaque, ..) => { </ins> new_binding_suggestion(&mut err, type_param_span); } _ => {


<ins> error[E0046]: not all trait items implemented, missing: `Error`, `try_from` --> $DIR/issue-74047.rs:14:1 | LL | impl TryFrom<OtherStream> for MyStream {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Error`, `try_from` in implementation | = help: implement the missing item: `type Error = Type;` = help: implement the missing item: `fn try_from(_: T) -> std::result::Result<Self, <Self as std::convert::TryFrom<T>>::Error> { todo!() }` error: aborting due to previous error For more information about this error, try `rustc --explain E0046`. </ins>


// Since this is a return parameter type it is safe to unwrap. let ret_param_ty = projection.skip_binder().term.expect_type(); <del> let ret_param_ty = self.resolve_vars_if_possible(ret_param_ty); </del> debug!(?ret_param_ty); let sig = projection.rebind(self.tcx.mk_fn_sig(


gate_feature_post!(&self, generic_associated_types, ti.span, "generic associated types are unstable"); } <ins> if !ti.generics.where_clause.predicates.is_empty() { gate_feature_post!(&self, generic_associated_types, ti.span, "where clauses on associated types are unstable"); } </ins> } _ => {} }


let path = match bounds.remove(0) { GenericBound::Trait(pt, ..) => pt.trait_ref.path, GenericBound::Outlives(..) => { <del> self.span_bug(ty.span, "unexpected lifetime bound") </del> <ins> return Err(self.struct_span_err( ty.span, "expected trait bound, not lifetime bound", )); </ins> } }; self.parse_remaining_bounds(Vec::new(), path, lo, true)


// memory, which makes for some *confusing* logs. That's why these are here // instead of in std. <del> #![reexport_test_harness_main = "test_main"] </del> #![feature(libc, std_misc, duration)] extern crate libc;


<ins> trait PrivateTrait { const FOO: usize; } </ins>


<ins> // Test a method call where the parameter `B` would (illegally) be // inferred to a region bound in the method argument. If this program // were accepted, then the closure passed to `s.f` could escape its // argument. //@ run-rustfix struct S; impl S { fn f<B, F>(&self, _: F) where F: FnOnce(&i32) -> B { } } fn main() { let s = S; s.f(|p| *p) //~ ERROR lifetime may not live long enough } </ins>


trait_def_id, ty, params, param_env ); <del> // Do not check on infer_types to avoid panic in evaluate_obligation. if ty.has_infer_types() { return false; } let ty = tcx.erase_regions(&ty); </del> let trait_ref = ty::TraitRef { def_id: trait_def_id, substs: tcx.mk_substs_trait(ty, params) }; let obligation = Obligation {


<ins> //@ check-pass #![feature(adt_const_params)] // Regression test for #116308 pub trait Identity { type Identity; } impl<T> Identity for T { type Identity = Self; } pub fn foo<const X: <i32 as Identity>::Identity>() {} fn main() { foo::<12>(); } </ins>


name: FieldName) { let fields = ty::lookup_struct_fields(self.tcx, id); let field = match name { <del> NamedField(ident) => { debug!("privacy - check named field {} in struct {:?}", ident.name, id); fields.iter().find(|f| f.name == ident.name).unwrap() </del> <ins> NamedField(f_name) => { debug!("privacy - check named field {} in struct {:?}", f_name, id); fields.iter().find(|f| f.name == f_name).unwrap() </ins> } UnnamedField(idx) => &fields[idx] };


// the specialized routine `ty::replace_late_regions()`. match *r { ty::ReEarlyBound(data) => { <del> let r = self.substs.get(data.index as usize).map(|k| k.unpack()); match r { </del> <ins> let rk = self.substs.get(data.index as usize).map(|k| k.unpack()); match rk { </ins> Some(UnpackedKind::Lifetime(lt)) => { self.shift_region_through_binders(lt) } _ => { let span = self.span.unwrap_or(DUMMY_SP); <del> span_bug!( span, </del> <ins> let msg = format!( </ins> "Region parameter out of range  when substituting in region {} (root type={:?})  (index={})", data.name, self.root_ty, data.index); <ins> self.tcx.sess.delay_span_bug(span, &msg); r </ins> } } }


def gh_url(): <ins> # type: () -> str </ins> return os.environ['TOOLSTATE_ISSUES_API_URL'] def maybe_delink(message): <ins> # type: (str) -> str </ins> if os.environ.get('TOOLSTATE_SKIP_MENTIONS') is not None: return message.replace("@", "") return message


//~ TRANS_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u64> let _ = &s1 as &Trait; } <del> //~ TRANS_ITEM drop-glue i8 </del>


.and_then(|ur_vid| self.definitions[*ur_vid].external_name) .unwrap_or(infcx.tcx.lifetimes.re_root_empty), ty::ReLateBound(..) => region, <ins> ty::ReStatic => region, </ins> _ => { infcx.tcx.sess.delay_span_bug( span,


<ins> //@ check-pass #![feature(generic_const_exprs)] //~^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use pub fn y<'a, U: 'a>() -> impl IntoIterator<Item = impl IntoIterator<Item = [u8; { 1 + 2 }]> + 'a> { [[[1, 2, 3]]] } // Make sure that the `predicates_of` for `{ 1 + 2 }` don't mention the duplicated lifetimes of // the *outer* iterator. Whether they should mention the duplicated lifetimes of the *inner* // iterator are another question, but not really something we need to answer immediately. fn main() {} </ins>


<ins> error: arbitrary expressions aren't allowed in patterns --> $DIR/expr_before_ident_pat.rs:12:12 | LL |     funny!(a, a); |            ^ error[E0425]: cannot find value `a` in this scope --> $DIR/expr_before_ident_pat.rs:12:12 | LL |     funny!(a, a); |            ^ not found in this scope error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>


{ <del> "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128", </del> <ins> "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128", </ins> "linker-flavor": "gcc", "llvm-target": "i686-unknown-linux-gnu", "target-endian": "little",


where L: HasLocalDecls<'tcx>, { <del> for (place_base, elem) in place.iter_projections().rev() { match elem { // encountered a Deref, which is ABI-aligned ProjectionElem::Deref => break, ProjectionElem::Field(..) => { let ty = place_base.ty(local_decls, tcx).ty; match ty.kind() { ty::Adt(def, _) => return def.repr().pack, _ => {} } } _ => {} } } None </del> <ins> place .iter_projections() .rev() // Stop at `Deref`; standard ABI alignment applies there. .take_while(|(_base, elem)| !matches!(elem, ProjectionElem::Deref)) // Consider the packed alignments at play here... .filter_map(|(base, _elem)| { base.ty(local_decls, tcx).ty.ty_adt_def().and_then(|adt| adt.repr().pack) }) // ... and compute their minimum. // The overall smallest alignment is what matters. .min() </ins> }


- name: install WIX run: src/ci/scripts/install-wix.sh if: success() && !env.SKIP_JOB <del> - name: install InnoSetup run: src/ci/scripts/install-innosetup.sh if: success() && !env.SKIP_JOB </del> - name: ensure the build happens on a partition with enough space run: src/ci/scripts/symlink-build-dir.sh if: success() && !env.SKIP_JOB


// See the discussion in the stream implementation for why we we // might decrement steals. Some(data) => { <del> self.steals += 1; </del> if self.steals > MAX_STEALS { match self.cnt.swap(0, atomics::SeqCst) { DISCONNECTED => {


<ins> // Copyright 2012 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. // Tests that the trait matching code takes lifetime parameters into account. // (Issue #15517.) struct Foo<'a,'b> { x: &'a int, y: &'b int, } trait Tr { fn foo(x: Self) {} } impl<'a,'b> Tr for Foo<'a,'b> { fn foo(x: Foo<'b,'a>) { //~^ ERROR method not compatible with trait //~^^ ERROR method not compatible with trait } } fn main(){} </ins>


use super::{check_fn, Expectation, FnCtxt, GeneratorTypes}; use crate::astconv::AstConv; <del> use crate::middle::region; </del> <ins> use crate::middle::{lang_items, region}; </ins> use rustc::hir::def_id::DefId; use rustc::infer::{InferOk, InferResult}; use rustc::infer::LateBoundRegionConversionTime;


<del> error: the `wait` method cannot be invoked on a trait object --> $DIR/issue-35976.rs:14:9 | LL |         fn wait(&self) where Self: Sized; |                                    ----- this has a `Sized` requirement ... LL |     arg.wait(); |         ^^^^ error: aborting due to previous error </del>


Decl: Option<&'a DIDescriptor>, ) -> &'a DISubprogram; <ins> pub fn LLVMRustDIBuilderCreateMethod<'a>( Builder: &DIBuilder<'a>, Scope: &'a DIDescriptor, Name: *const c_char, NameLen: size_t, LinkageName: *const c_char, LinkageNameLen: size_t, File: &'a DIFile, LineNo: c_uint, Ty: &'a DIType, Flags: DIFlags, SPFlags: DISPFlags, TParam: &'a DIArray, ) -> &'a DISubprogram; </ins> pub fn LLVMRustDIBuilderCreateBasicType<'a>( Builder: &DIBuilder<'a>, Name: *const c_char,


<ins> // Verify that move before the call of the function with noalias, nocapture, readonly. // #107436 // compile-flags: -O // min-llvm-version: 17 #![crate_type = "lib"] #[repr(C)] pub struct ThreeSlices<'a>(&'a [u32], &'a [u32], &'a [u32]); #[no_mangle] pub fn sum_slices(val: ThreeSlices) -> u32 { // CHECK-NOT: memcpy let val = val; sum(&val) } #[no_mangle] #[inline(never)] pub fn sum(val: &ThreeSlices) -> u32 { val.0.iter().sum::<u32>() + val.1.iter().sum::<u32>() + val.2.iter().sum::<u32>() } </ins>


/// # Examples /// /// ``` <del> /// #![feature(osstring_ascii)] </del> /// use std::ffi::OsString; /// let s = OsString::from("Grüße, Jürgen ❤"); /// /// assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase()); /// ``` <del> #[unstable(feature = "osstring_ascii", issue = "70516")] </del> <ins> #[stable(feature = "osstring_ascii", since = "1.53.0")] </ins> pub fn to_ascii_uppercase(&self) -> OsString { OsString::from_inner(self.inner.to_ascii_uppercase()) }


} hir::ImplItemKind::Type(_) => false, }, <ins> Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => true, </ins> _ => false, } }


<ins> // edition:2018 // compile-flags: -Cincremental=tmp/issue-72766 pub struct SadGirl; impl SadGirl { pub async fn call(&self) -> Result<(), ()> { Ok(()) } } async fn async_main() -> Result<(), ()> { // should be `.call().await?` SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values Ok(()) } fn main() { let _ = async_main(); } </ins>


<ins> error[E0603]: tuple struct constructor `A` is private --> $DIR/issue-111220-2-tuple-struct-fields-projection.rs:27:13 | LL |         let Self(a) = self; |             ^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0603`. </ins>


//@[rust2021] edition:2021 fn main() { println!('hello world'); <del> //[rust2015,rust2018,rust2021]~^ ERROR unterminated character literal </del> <ins> //~^ ERROR unterminated character literal //[rust2021]~| ERROR prefix `world` is unknown </ins> }


<ins> #![feature(never_type)] #![deny(dead_code)] pub struct T1(!); pub struct T2(()); pub struct T3<X>(std::marker::PhantomData<X>); pub struct T4 { _x: !, } pub struct T5<X> { _x: !, _y: X, } pub struct T6 { _x: (), } pub struct T7<X> { _x: (), _y: X, } pub struct T8<X> { _x: std::marker::PhantomData<X>, } pub struct T9<X> { //~ ERROR struct `T9` is never constructed _x: std::marker::PhantomData<X>, _y: i32, } fn main() {} </ins>


return krate; } <del> krate.module.items.push(mk_decls(&mut cx, &derives, &attr_macros, &bang_macros)); </del> <ins> krate.module.items.push(mk_decls(&mut cx, &macros)); </ins> krate }


attrs: Vec<ast::Name>, } <ins> enum ProcMacroDefType { Attr, Bang } </ins> struct ProcMacroDef { function_name: Ident, span: Span, <ins> def_type: ProcMacroDefType } enum ProcMacro { Derive(ProcMacroDerive), Def(ProcMacroDef) </ins> } struct CollectProcMacros<'a> { <del> derives: Vec<ProcMacroDerive>, attr_macros: Vec<ProcMacroDef>, bang_macros: Vec<ProcMacroDef>, </del> <ins> macros: Vec<ProcMacro>, </ins> in_root: bool, handler: &'a errors::Handler, is_proc_macro_crate: bool,


let ecfg = ExpansionConfig::default("proc_macro".to_string()); let mut cx = ExtCtxt::new(sess, ecfg, resolver); <del> let (derives, attr_macros, bang_macros) = { let mut collect = CollectProcMacros { derives: Vec::new(), attr_macros: Vec::new(), bang_macros: Vec::new(), in_root: true, handler, is_proc_macro_crate, is_test_crate, }; if has_proc_macro_decls || is_proc_macro_crate { visit::walk_crate(&mut collect, &krate); } (collect.derives, collect.attr_macros, collect.bang_macros) </del> <ins> let mut collect = CollectProcMacros { macros: Vec::new(), in_root: true, handler, is_proc_macro_crate, is_test_crate, </ins> }; <ins> if has_proc_macro_decls || is_proc_macro_crate { visit::walk_crate(&mut collect, &krate); } // NOTE: If you change the order of macros in this vec // for any reason, you must also update 'raw_proc_macro' // in src/librustc_metadata/decoder.rs let macros = collect.macros; </ins> if !is_proc_macro_crate { return krate }


<ins> // edition:2021 // run-rustfix #![allow(dead_code)] async fn a() {} async fn foo() -> Result<(), i32> { a().await //~ ERROR mismatched types } fn main() {} </ins>


use prelude::v1::*; use io::prelude::*; use io::{self, BufReader, BufWriter, LineWriter, SeekFrom}; <ins> use sync::atomic::{AtomicUsize, Ordering}; use thread; </ins> use test; /// A dummy reader intended at testing short-reads propagation.


// this function uses `unwrap` copiously, because an already validated constant must have valid // fields and can thus never fail outside of compiler bugs <del> pub fn const_variant_index<'tcx>( </del> <ins> pub(crate) fn const_variant_index<'tcx>( </ins> tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, val: &'tcx ty::Const<'tcx>,


/// [`NonNull::dangling()`]: ptr::NonNull::dangling #[inline] #[stable(feature = "rust1", since = "1.0.0")] <del> pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { debug_assert!(is_aligned_and_not_null(data), "attempt to create unaligned or null slice"); debug_assert!( mem::size_of::<T>().saturating_mul(len) <= isize::MAX as usize, "attempt to create slice covering at least half the address space" ); </del> <ins> #[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")] pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { debug_check_data_len(data, len); </ins> // SAFETY: the caller must uphold the safety contract for `from_raw_parts`. unsafe { &*ptr::slice_from_raw_parts(data, len) } }


.span_to_snippet(self.prev_span) .map(|s| s.ends_with(")") || s.ends_with("]")) .unwrap_or(false); <del> let right_brace_span = if has_close_delim { // it's safe to peel off one character only when it has the close delim self.prev_span.with_lo(self.prev_span.hi() - BytePos(1)) } else { self.prev_span.shrink_to_hi() }; self.struct_span_err( </del> <ins> let mut err = self.struct_span_err( </ins> self.prev_span, "macros that expand to items must be delimited with braces or followed by a semicolon", <del> ) .multipart_suggestion( "change the delimiters to curly braces", vec![ (self.prev_span.with_hi(self.prev_span.lo() + BytePos(1)), "{".to_string()), (right_brace_span, '}'.to_string()), ], Applicability::MaybeIncorrect, ) .span_suggestion( </del> <ins> ); // To avoid ICE, we shouldn't emit actual suggestions when it hasn't closing delims if has_close_delim { err.multipart_suggestion( "change the delimiters to curly braces", vec![ (self.prev_span.with_hi(self.prev_span.lo() + BytePos(1)), '{'.to_string()), (self.prev_span.with_lo(self.prev_span.hi() - BytePos(1)), '}'.to_string()), ], Applicability::MaybeIncorrect, ); } else { err.span_suggestion( self.prev_span, "change the delimiters to curly braces", " { /* items */ }".to_string(), Applicability::HasPlaceholders, ); } err.span_suggestion( </ins> self.prev_span.shrink_to_hi(), "add a semicolon", ';'.to_string(),


/// /// assert_eq!(n.leading_zeros(), 0); /// ``` <ins> #[doc = concat!("[`ilog2`]: ", stringify!($SelfT), "::ilog2")] </ins> #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation,


// MIR-level lints. &check_packed_ref::CheckPackedRef, &check_const_item_mutation::CheckConstItemMutation, <ins> &function_item_references::FunctionItemReferences, </ins> // What we need to do constant evaluation. &simplify::SimplifyCfg::new("initial"), &rustc_peek::SanityCheck,


/// /// This should not be used to get the components of `parent` itself. /// Use [push_outlives_components] instead. <del> pub(super) fn compute_components_recursive<'tcx>( </del> <ins> pub(super) fn compute_alias_components_recursive<'tcx>( tcx: TyCtxt<'tcx>, alias_ty: Ty<'tcx>, out: &mut SmallVec<[Component<'tcx>; 4]>, visited: &mut SsoHashSet<GenericArg<'tcx>>, ) { let ty::Alias(kind, alias_ty) = alias_ty.kind() else { bug!() }; let opt_variances = if *kind == ty::Opaque { tcx.variances_of(alias_ty.def_id) } else { &[] }; for (index, child) in alias_ty.substs.iter().enumerate() { if opt_variances.get(index) == Some(&ty::Bivariant) { continue; } if !visited.insert(child) { continue; } match child.unpack() { GenericArgKind::Type(ty) => { compute_components(tcx, ty, out, visited); } GenericArgKind::Lifetime(lt) => { // Ignore late-bound regions. if !lt.is_late_bound() { out.push(Component::Region(lt)); } } GenericArgKind::Const(_) => { compute_components_recursive(tcx, child, out, visited); } } } } /// Collect [Component]s for *all* the substs of `parent`. /// /// This should not be used to get the components of `parent` itself. /// Use [push_outlives_components] instead. fn compute_components_recursive<'tcx>( </ins> tcx: TyCtxt<'tcx>, parent: GenericArg<'tcx>, out: &mut SmallVec<[Component<'tcx>; 4]>,


use std::fmt::{Debug, Display}; <del> #[marker] trait MyMarker {} </del> <ins> #[marker] trait MyMarker {} </ins> impl<T: Debug> MyMarker for T {} impl<T: Display> MyMarker for T {}


<ins> error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:28:20 | LL |     if let [ref first, ref second, ..] = *s { |                        ---------- immutable borrow occurs here LL |         if let [_, ref mut  second2, ref mut third, ..] = *s { //~ERROR |                    ^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[first, second, second2, third]); |                          ------ borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:44:21 | LL |     if let [.., ref fourth, ref third, _, ref first] = *s { |                             --------- immutable borrow occurs here LL |         if let [.., ref mut third2, _, _] = *s { //~ERROR |                     ^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[first, third, third2, fourth]); |                          ----- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:55:20 | LL |     if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s { |                    ------------- immutable borrow occurs here ... LL |         if let [_, ref mut from_begin1, ..] = *s { //~ERROR |                    ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin1, from_end1, from_end3, from_end4]); |                                                      --------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:58:23 | LL |     if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s { |                                   ------------- immutable borrow occurs here ... LL |         if let [_, _, ref mut from_begin2, ..] = *s { //~ERROR |                       ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin2, from_end1, from_end3, from_end4]); |                                           --------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:61:26 | LL |     if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s { |                                   ------------- immutable borrow occurs here ... LL |         if let [_, _, _, ref mut from_begin3, ..] = *s { //~ERROR |                          ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin3, from_end1, from_end3, from_end4]); |                                           --------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:69:21 | LL |     if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s { |                                                  --------------- immutable borrow occurs here ... LL |         if let [.., ref mut from_end2, _] = *s { //~ERROR |                     ^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin0, from_begin1, from_begin3, from_end2]); |                                             ----------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:72:21 | LL |     if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s { |                                                  --------------- immutable borrow occurs here ... LL |         if let [.., ref mut from_end3, _,  _] = *s { //~ERROR |                     ^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin0, from_begin1, from_begin3, from_end3]); |                                             ----------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:75:21 | LL |     if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s { |                              --------------- immutable borrow occurs here ... LL |         if let [.., ref mut from_end4, _, _, _] = *s { //~ERROR |                     ^^^^^^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[from_begin0, from_begin1, from_begin3, from_end4]); |                                ----------- borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:92:20 | LL |     if let [ref first, ref second, ..] = *s { |                        ---------- immutable borrow occurs here LL |         if let [_, ref mut tail..] = *s { //~ERROR |                    ^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[first, second]); |                          ------ borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:110:17 | LL |     if let [.., ref second, ref first] = *s { |                 ---------- immutable borrow occurs here LL |         if let [ref mut tail.., _] = *s { //~ERROR |                 ^^^^^^^^^^^^ mutable borrow occurs here LL |             nop(&[first, second]); |                          ------ borrow later used here error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable --> $DIR/borrowck-slice-pattern-element-loan.rs:119:17 | LL |     if let [_, _, _, ref s1..] = *s { |                      ------ immutable borrow occurs here LL |         if let [ref mut s2.., _, _, _] = *s { //~ERROR |                 ^^^^^^^^^^ mutable borrow occurs here LL |             nop_subslice(s1); |                          -- borrow later used here error: aborting due to 11 previous errors For more information about this error, try `rustc --explain E0502`. </ins>


rm $(TMPDIR)/foo $(RUSTC) foo.rs --crate-type=bin -o $(TMPDIR)/foo rm $(TMPDIR)/foo <ins> mv $(TMPDIR)/bar.bc $(TMPDIR)/foo.bc </ins> $(RUSTC) foo.rs --emit=bc,link --crate-type=rlib <ins> cmp $(TMPDIR)/foo.bc $(TMPDIR)/bar.bc </ins> rm $(TMPDIR)/bar.bc <ins> rm $(TMPDIR)/foo.bc </ins> rm $(TMPDIR)/$(call RLIB_GLOB,bar)


expr } <ins> pub fn peel_blocks(&self) -> &Self { let mut expr = self; while let ExprKind::Block(Block { expr: Some(inner), .. }, _) = &expr.kind { expr = inner; } expr } </ins> pub fn can_have_side_effects(&self) -> bool { match self.peel_drop_temps().kind { ExprKind::Path(_) | ExprKind::Lit(_) => false,


<ins> //! This test makes sure that with never show the inner fields in the //! aliased type view of type alias. //@ compile-flags: -Z unstable-options --document-private-items #![crate_name = "foo"] use std::collections::BTreeMap; // @has 'foo/type.FooBar.html' '//*[@class="rust item-decl"]/code' 'struct FooBar { /* private fields */ }' pub type FooBar = BTreeMap<u32, String>; </ins>


<del> pub fn tadam() {} </del> <ins> pub struct MultiImplBlockStruct; impl MultiImplBlockStruct { pub fn first_fn() {} } impl MultiImplBlockStruct { pub fn second_fn(self) -> bool { true } } pub trait MultiImplBlockTrait { fn first_fn(); fn second_fn(self) -> u32; } impl MultiImplBlockTrait for MultiImplBlockStruct { fn first_fn() {} fn second_fn(self) -> u32 { 1 } } </ins>


} }; let attrs = &item.attrs; <del> let sp = span_of_attrs(attrs); </del> <ins> let sp = span_of_attrs(attrs).unwrap_or(item.source.span()); </ins> let mut msg = format!("`{}` is ", path_str);


/// The directories that have already been created in this doc run. Used to reduce the number /// of spurious `create_dir_all` calls. pub created_dirs: RefCell<FxHashSet<PathBuf>>, <ins> /// This flag indicates whether listings of modules (in the side bar and documentation itself) /// should be ordered alphabetically or in order of appearance (in the source code). pub sort_modules_alphabetically: bool, </ins> } impl SharedContext {


<ins> trait A { const C: usize; fn f() -> ([u8; A::C], [u8; A::C]); //~^ ERROR: type annotations needed: cannot resolve //~| ERROR: type annotations needed: cannot resolve } fn main() {} </ins>


//! recording the output. use rustc_ast as ast; <del> use rustc_ast::{token, walk_list}; </del> <ins> use rustc_ast::walk_list; </ins> use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; use rustc_hir::def::{DefKind as HirDefKind, Res};


fn print_tts(&mut self, tts: tokenstream::TokenStream, convert_dollar_crate: bool) { for (i, tt) in tts.into_trees().enumerate() { <del> if i != 0 { </del> <ins> if i != 0 && tt_prepend_space(&tt) { </ins> self.space(); } self.print_tt(tt, convert_dollar_crate);


} #[derive(Diagnostic)] <del> #[diag(ast_passes_const_and_async)] pub(crate) struct ConstAndAsync { </del> <ins> #[diag(ast_passes_const_and_coroutine)] pub(crate) struct ConstAndCoroutine { </ins> #[primary_span] pub spans: Vec<Span>, #[label(ast_passes_const)] <del> pub cspan: Span, #[label(ast_passes_async)] pub aspan: Span, </del> <ins> pub const_span: Span, #[label(ast_passes_coroutine)] pub coroutine_span: Span, </ins> #[label] pub span: Span, <ins> pub coroutine_kind: &'static str, </ins> } #[derive(Diagnostic)]


* `MIRI_LOCAL_CRATES` is set by `cargo-miri` to tell the Miri driver which crates should be given special treatment in diagnostics, in addition to the crate currently being compiled. <ins> * `MIRI_ORIG_RUSTDOC` is set and read by different phases of `cargo-miri` to remember the value of `RUSTDOC` from before it was overwritten. </ins> * `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to perform verbose logging. * `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*


<ins> error[E0659]: `bar` is ambiguous --> $DIR/issue-109153.rs:11:5 | LL | use bar::bar; |     ^^^ ambiguous name | = note: ambiguous because of multiple glob imports of a name in the same module note: `bar` could refer to the module imported here --> $DIR/issue-109153.rs:1:5 | LL | use foo::*; |     ^^^^^^ = help: consider adding an explicit import of `bar` to disambiguate note: `bar` could also refer to the module imported here --> $DIR/issue-109153.rs:12:5 | LL | use bar::*; |     ^^^^^^ = help: consider adding an explicit import of `bar` to disambiguate error: aborting due to previous error For more information about this error, try `rustc --explain E0659`. </ins>


} } <ins> /// Try to match an implementation of `Index` against a self type, and report /// the unsatisfied predicates that result from confirming this impl. /// /// Given an index expression, sometimes the `Self` type shallowly but does not /// deeply satisfy an impl predicate. Instead of simply saying that the type /// does not support being indexed, we want to point out exactly what nested /// predicates cause this to be, so that the user can add them to fix their code. fn find_and_report_unsatisfied_index_impl( &self, index_expr_hir_id: HirId, base_expr: &hir::Expr<'_>, base_ty: Ty<'tcx>, ) -> Option<(ErrorGuaranteed, Ty<'tcx>, Ty<'tcx>)> { let index_trait_def_id = self.tcx.lang_items().index_trait()?; let index_trait_output_def_id = self.tcx.get_diagnostic_item(sym::IndexOutput)?; let mut relevant_impls = vec![]; self.tcx.for_each_relevant_impl(index_trait_def_id, base_ty, |impl_def_id| { relevant_impls.push(impl_def_id); }); let [impl_def_id] = relevant_impls[..] else { // Only report unsatisfied impl predicates if there's one impl return None; }; self.commit_if_ok(|_| { let ocx = ObligationCtxt::new_in_snapshot(self); let impl_substs = self.fresh_substs_for_item(base_expr.span, impl_def_id); let impl_trait_ref = self.tcx.impl_trait_ref(impl_def_id).unwrap().subst(self.tcx, impl_substs); let cause = self.misc(base_expr.span); // Match the impl self type against the base ty. If this fails, // we just skip this impl, since it's not particularly useful. let impl_trait_ref = ocx.normalize(&cause, self.param_env, impl_trait_ref); ocx.eq(&cause, self.param_env, impl_trait_ref.self_ty(), base_ty)?; // Register the impl's predicates. One of these predicates // must be unsatisfied, or else we wouldn't have gotten here // in the first place. ocx.register_obligations(traits::predicates_for_generics( |idx, span| { traits::ObligationCause::new( base_expr.span, self.body_id, if span.is_dummy() { traits::ExprItemObligation(impl_def_id, index_expr_hir_id, idx) } else { traits::ExprBindingObligation(impl_def_id, span, index_expr_hir_id, idx) }, ) }, self.param_env, self.tcx.predicates_of(impl_def_id).instantiate(self.tcx, impl_substs), )); // Normalize the output type, which we can use later on as the // return type of the index expression... let element_ty = ocx.normalize( &cause, self.param_env, self.tcx.mk_projection(index_trait_output_def_id, impl_trait_ref.substs), ); let errors = ocx.select_where_possible(); // There should be at least one error reported. If not, we // will still delay a span bug in `report_fulfillment_errors`. Ok::<_, NoSolution>(( self.err_ctxt().report_fulfillment_errors(&errors), impl_trait_ref.substs.type_at(1), element_ty, )) }) .ok() } </ins> fn point_at_index_if_possible( &self, errors: &mut Vec<traits::FulfillmentError<'tcx>>,


/// move in the future, and this method does not enable the pointee to move. "Malicious" /// implementations of `Ptr::DerefMut` are likewise ruled out by the contract of /// `Pin::new_unchecked`. <del> #[unstable(feature = "pin_deref_mut", issue = "86918")] </del> <ins> #[stable(feature = "pin_deref_mut", since = "CURRENT_RUSTC_VERSION")] </ins> #[must_use = "`self` will be dropped if the result is not used"] #[inline(always)] pub fn as_deref_mut(self: Pin<&mut Pin<Ptr>>) -> Pin<&mut Ptr::Target> {


| LL |         E::Empty3 => () |         ^^^^^^^^^ not a unit struct, unit variant or constant <ins> | help: use the struct variant pattern syntax | LL |         E::Empty3 {} => () |                   ++ </ins> error[E0533]: expected unit struct, unit variant or constant, found struct variant `XE::XEmpty3` --> $DIR/empty-struct-braces-pat-1.rs:31:9 | LL |         XE::XEmpty3 => () |         ^^^^^^^^^^^ not a unit struct, unit variant or constant <ins> | help: use the struct variant pattern syntax | LL |         XE::XEmpty3 {} => () |                     ++ </ins> error: aborting due to 2 previous errors


// Inline format with parent. let len_or_tag = len_or_tag | PARENT_MASK; let parent2 = parent.local_def_index.as_u32(); <del> if ctxt2 == SyntaxContext::root().as_u32() && parent2 <= MAX_CTXT { </del> <ins> if ctxt2 == SyntaxContext::root().as_u32() && parent2 <= MAX_CTXT && len_or_tag < LEN_TAG { debug_assert_ne!(len_or_tag, LEN_TAG); </ins> return Span { base_or_index: base, len_or_tag, ctxt_or_tag: parent2 as u16 }; } } else { // Inline format with ctxt. <ins> debug_assert_ne!(len_or_tag, LEN_TAG); </ins> return Span { base_or_index: base, len_or_tag: len as u16,