} #[test] <ins> #[cfg(unix)] fn set_get_unix_permissions() { use os::unix::fs::PermissionsExt; let tmpdir = tmpdir(); let filename = &tmpdir.join("set_get_unix_permissions"); check!(fs::create_dir(filename)); let mask = 0o7777; check!(fs::set_permissions(filename, fs::Permissions::from_mode(0))); let metadata0 = check!(fs::metadata(filename)); assert_eq!(mask & metadata0.permissions().mode(), 0); check!(fs::set_permissions(filename, fs::Permissions::from_mode(0o1777))); let metadata1 = check!(fs::metadata(filename)); assert_eq!(mask & metadata1.permissions().mode(), 0o1777); } #[test] </ins> #[cfg(windows)] fn file_test_io_seek_read_write() { use os::windows::fs::FileExt;


LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { LL + fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) { | <ins> help: consider borrowing here | LL |     let y: &Y; |            + </ins> error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized6.rs:7:12


&Path("lib/libstd.so")); assert_eq!(res.to_str(), ~"@executable_path/../lib"); } <ins> #[test] fn test_get_absolute_rpath() { let res = get_absolute_rpath(&Path("lib/libstd.so")); debug!("test_get_absolute_rpath: %s vs. %s", res.to_str(), os::make_absolute(&Path("lib")).to_str()); assert_eq!(res, os::make_absolute(&Path("lib"))); } </ins> }


} #[derive(Diagnostic)] <ins> #[diag(parse_at_dot_dot_in_struct_pattern)] pub(crate) struct AtDotDotInStructPattern { #[primary_span] pub span: Span, #[suggestion(code = "", style = "verbose", applicability = "machine-applicable")] pub remove: Span, pub ident: Ident, } #[derive(Diagnostic)] #[diag(parse_at_in_struct_pattern)] #[note] #[help] pub(crate) struct AtInStructPattern { #[primary_span] pub span: Span, } #[derive(Diagnostic)] </ins> #[diag(parse_dot_dot_dot_for_remaining_fields)] pub(crate) struct DotDotDotForRemainingFields { #[primary_span]


// 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. <ins> //@ run-rustfix </ins> struct S;


let libdir = builder.sysroot_libdir(target_compiler, target); let hostdir = builder.sysroot_libdir(target_compiler, compiler.host); add_to_sysroot(builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target)); <ins> if compiler.stage == 0 { // special handling for stage0, to make `rustup toolchain link` and `x dist --stage 0` // work for stage0-sysroot let sysroot = builder.out.join(&compiler.host.triple).join("stage0-sysroot"); let host_lib_dir = builder.initial_rustc.ancestors().nth(2).unwrap().join("lib"); let host_bin_dir = builder.out.join(&builder.initial_rustc.parent().unwrap()); let host_codegen_backends = host_lib_dir.join("rustlib").join(&compiler.host.triple).join("codegen-backends"); let sysroot_bin_dir = sysroot.join("bin"); let sysroot_lib_dir = sysroot.join("lib"); let sysroot_codegen_backends = builder.sysroot_codegen_backends(compiler); // Create the `bin` directory in stage0-sysroot t!(fs::create_dir_all(&sysroot_bin_dir)); // copy bin files from `builder.initial_rustc/./` to `stage0-sysroot/bin` if let Ok(files) = fs::read_dir(&host_bin_dir) { for file in files { let file = t!(file); if file.file_name() == "rustfmt" { // This is when `rustc` and `cargo` are set in `config.toml` if !file.path().starts_with(&builder.out) { builder.copy( &file.path().into_boxed_path(), &sysroot_bin_dir.join(file.file_name()), ); } else { builder.copy( &builder .out .join(&compiler.host.triple) .join("rustfmt/bin/rustfmt"), &sysroot_bin_dir.join(file.file_name()), ); } } else { builder.copy( &file.path().into_boxed_path(), &sysroot_bin_dir.join(file.file_name()), ); } } } // copy dylib files from `builder.initial_rustc/../lib/*` while excluding the `rustlib` directory to `stage0-sysroot/lib` if let Ok(files) = fs::read_dir(&host_lib_dir) { for file in files { let file = t!(file); let path = file.path(); if path.is_file() && is_dylib(&file.file_name().into_string().unwrap()) && !path.starts_with(sysroot_lib_dir.join("rustlib").into_boxed_path()) { builder.copy(&path, &sysroot_lib_dir.join(path.file_name().unwrap())); } } } t!(fs::create_dir_all(&sysroot_codegen_backends)); // copy `codegen-backends` from `host_lib_dir/rustlib/codegen_backends` to `stage0-sysroot/lib/rustlib/host-triple/codegen-backends` if it exists. if host_codegen_backends.exists() { builder.cp_r(&host_codegen_backends, &sysroot_codegen_backends); } } </ins> } }


<ins> // build-fail // ignore-emscripten no asm! support #![feature(asm)] fn main() { unsafe { asm!("nop" : "+r"("r15")); //~^ malformed inline assembly } } </ins>


/// # Examples /// /// ```rust <del> /// #![feature(fmt_as_str)] /// </del> /// use std::fmt::Arguments; /// /// fn write_str(_: &str) { /* ... */ }


let fty = self.sanitize_type(place, fty); match self.field_ty(place, base, field, location) { Ok(ty) => { <ins> let ty = self.cx.normalize(ty, location); </ins> if let Err(terr) = self.cx.eq_types( ty, fty,


} fn visit_rvalue(&mut self, rvalue: &mut Rvalue<'tcx>, location: Location) { <del> if let Some(mtbl) = self.optimizations.and_stars.remove(&location) { </del> <ins> if self.optimizations.and_stars.remove(&location) { </ins> debug!("replacing `&*`: {:?}", rvalue); let new_place = match rvalue { Rvalue::Ref(_, _, place) => {


} } (false, false) => { <del> t = Err(old_binding); </del> <ins> return Err(old_binding); </ins> } } <ins> } else { resolution.binding = Some(binding); </ins> } <del> } else { resolution.binding = Some(binding); }; </del> <ins> Ok(()) }) } fn ambiguity( &self, kind: AmbiguityKind, primary_binding: &'a NameBinding<'a>, secondary_binding: &'a NameBinding<'a>, ) -> &'a NameBinding<'a> { self.arenas.alloc_name_binding(NameBinding { ambiguity: Some((secondary_binding, kind)), ..primary_binding.clone() }) } // Use `f` to mutate the resolution of the name in the module. // If the resolution becomes a success, define it in the module's glob importers. fn update_resolution<T, F>(&mut self, module: Module<'a>, key: BindingKey, f: F) -> T where F: FnOnce(&mut Resolver<'a, 'tcx>, &mut NameResolution<'a>) -> T, { </ins> // Ensure that `resolution` isn't borrowed when defining in the module's glob importers, // during which the resolution might end up getting re-defined via a glob cycle. <del> let (binding, t) = match resolution.binding() { _ if old_binding.is_some() => return t, None => return t, Some(binding) => match old_binding { Some(old_binding) if ptr::eq(old_binding, binding) => return t, _ => (binding, t), }, </del> <ins> let (binding, t) = { let resolution = &mut *self.resolution(module, key).borrow_mut(); let old_binding = resolution.binding(); let t = f(self, resolution); match resolution.binding() { _ if old_binding.is_some() => return t, None => return t, Some(binding) => match old_binding { Some(old_binding) if ptr::eq(old_binding, binding) => return t, _ => (binding, t), }, } </ins> }; <del> drop(resolution); </del> // Define `binding` in `module`s glob importers. for import in module.glob_importers.borrow_mut().iter() { let mut ident = key.ident;


} }; 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 diag = cx.tcx.struct_span_lint_hir( lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE,


nightly ) msg "overriding settings for $CFG_RELEASE_CHANNEL" CFG_ENABLE_LLVM_ASSERTIONS=1 <del> CFG_ENABLE_DEBUGINFO_LINES=1 </del> <ins> # FIXME(#37364) shouldn't have to disable this on windows-gnu case "$CFG_BUILD" in *-pc-windows-gnu) ;; *) CFG_ENABLE_DEBUGINFO_LINES=1 ;; esac </ins> ;; beta | stable) msg "overriding settings for $CFG_RELEASE_CHANNEL" <del> CFG_ENABLE_DEBUGINFO_LINES=1 </del> <ins> case "$CFG_BUILD" in *-pc-windows-gnu) ;; *) CFG_ENABLE_DEBUGINFO_LINES=1 ;; esac </ins> ;; dev) ;;


let trait_to_placeholder_args = impl_to_placeholder_args.rebase_onto(tcx, impl_m.container_id(tcx), trait_to_impl_args); <ins> let hybrid_preds = tcx .predicates_of(impl_m.container_id(tcx)) .instantiate_identity(tcx) .into_iter() .chain(tcx.predicates_of(trait_m.def_id).instantiate_own(tcx, trait_to_placeholder_args)) .map(|(clause, _)| clause); let param_env = ty::ParamEnv::new(tcx.mk_clauses_from_iter(hybrid_preds), Reveal::UserFacing); let param_env = traits::normalize_param_env_or_error( tcx, param_env, ObligationCause::misc(tcx.def_span(impl_m_def_id), impl_m_def_id), ); </ins> let infcx = &tcx.infer_ctxt().build(); let ocx = ObligationCtxt::new(infcx); // Normalize the impl signature with fresh variables for lifetime inference. <del> let norm_cause = ObligationCause::misc(return_span, impl_m_def_id); </del> <ins> let misc_cause = ObligationCause::misc(return_span, impl_m_def_id); </ins> let impl_sig = ocx.normalize( <del> &norm_cause, </del> <ins> &misc_cause, </ins> param_env, tcx.liberate_late_bound_regions( impl_m.def_id,


<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. // Check that we cannot have two sequence repetitions in a row. macro_rules! foo { ( $($a:expr)* $($b:tt)* ) => { }; //~ ERROR sequence repetition followed by another sequence ( $($a:tt)* $($b:tt)* ) => { }; //~ ERROR sequence repetition followed by another sequence } fn main() { } </ins>


// #[rustc_main] let main_attr = ecx.attr_word(sym::rustc_main, sp); <ins> // #[no_coverage] let no_coverage_attr = ecx.attr_word(sym::no_coverage, sp); </ins> // pub fn main() { ... } let main_ret_ty = ecx.ty(sp, ast::TyKind::Tup(ThinVec::new()));


(Some(Mode::ToolRustc), "rust_analyzer", None), (Some(Mode::ToolStd), "rust_analyzer", None), (Some(Mode::Codegen), "parallel_compiler", None), <ins> // NOTE: consider updating `check-cfg` entries in `std/Cargo.toml` too. // cfg(bootstrap) remove these once the bootstrap compiler supports // `lints.rust.unexpected_cfgs.check-cfg` </ins> (Some(Mode::Std), "stdarch_intel_sde", None), (Some(Mode::Std), "no_fp_fmt_parse", None), (Some(Mode::Std), "no_global_oom_handling", None),


write!(w, "{}", impl_header)?; for implementor in local {  write!(w, "
")?;   write!(w, "
")?; if let Some(item) = implementor2item(&cache, implementor) { if let Some(l) = (Item { cx, item }).src_href() { write!(w, "
")?; write!(w, "[src]", l, "goto source code")?; write!(w, "
")?; } } write!(w, "")?;  // If there's already another implementor that has the same abbridged name, use the // full path, for example in `std::iter::ExactSizeIterator` let use_absolute = match implementor.impl_.for_ {


// extensions <ins> pub fn get_args(&self) -> &[OsString] { &self.args } </ins> pub fn take_args(&mut self) -> Vec<OsString> { mem::replace(&mut self.args, Vec::new()) }


find_testable_code(&dox, &mut tests, ErrorCodes::No); if check_missing_code == true && tests.found_tests == 0 { <del> let sp = span_of_attrs(&item.attrs).substitute_dummy(item.source.span()); </del> <ins> let sp = span_of_attrs(&item.attrs).unwrap_or(item.source.span()); </ins> let mut diag = cx.tcx.struct_span_lint_hir( lint::builtin::MISSING_DOC_CODE_EXAMPLES, hir_id,


} } <del> debug!("enforce_member_constraint: final least choice = {:?}", least_choice); if least_choice != member_lower_bound { </del> <ins> // (#72087) Different `ty::Regions` can be known to be equal, for // example, we know that `'a` and `'static` are equal in a function // with a parameter of type `&'static &'a ()`. // // When we have two equal regions like this `expansion` will use // `lub_concrete_regions` to pick a canonical representative. The same // choice is needed here so that we don't end up in a cycle of // `expansion` changing the region one way and the code here changing // it back. let lub = self.lub_concrete_regions(least_choice, member_lower_bound); debug!( "enforce_member_constraint: final least choice = {:?}nlub = {:?}", least_choice, lub ); if lub != member_lower_bound { </ins> *var_values.value_mut(member_vid) = VarValue::Value(least_choice); true } else {


const LEN: usize = 4; <del> struct SingleUnused(i32, [u8; LEN], String); //~^ ERROR: field `1` is never read </del> <ins> struct UnusedAtTheEnd(i32, f32, [u8; LEN], String, u8); //~^ ERROR:fields `1`, `2`, `3`, and `4` are never read //~| NOTE: fields in this struct //~| HELP: consider removing these fields struct UnusedJustOneField(i32); //~^ ERROR: field `0` is never read </ins> //~| NOTE: field in this struct <del> //~| HELP: consider changing the field to be of unit type </del> <ins> //~| HELP: consider removing this field </ins> <del> struct MultipleUnused(i32, f32, String, u8); //~^ ERROR: fields `0`, `1`, `2`, and `3` are never read </del> <ins> struct UnusedInTheMiddle(i32, f32, String, u8, u32); //~^ ERROR: fields `1`, `2`, and `4` are never read </ins> //~| NOTE: fields in this struct <del> //~| HELP: consider changing the fields to be of unit type </del> <ins> //~| HELP: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields </ins> struct GoodUnit(());


<ins> error: prefix `world` is unknown --> $DIR/lex-bad-str-literal-as-char-4.rs:4:25 | LL |         println!('hello world'); |                         ^^^^^ unknown prefix | = note: prefixed identifiers and literals are reserved since Rust 2021 help: if you meant to write a string literal, use double quotes | LL |         println!("hello world"); |                  ~           ~ error[E0762]: unterminated character literal --> $DIR/lex-bad-str-literal-as-char-4.rs:4:30 | LL |         println!('hello world'); |                              ^^^ | help: if you meant to write a string literal, use double quotes | LL |         println!("hello world"); |                  ~           ~ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0762`. </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. // Test to ensure we only report an error for the first issued loan that // conflicts with a new loan, as opposed to every issued loan.  This keeps us // down to O(n) errors (for n problem lines), instead of O(n^2) errors. fn main() { let mut x = 1; let mut addr; loop { match 1 { 1 => { addr = &mut x; } //~^ ERROR cannot borrow `x` as mutable more than once at a time 2 => { addr = &mut x; } //~^ ERROR cannot borrow `x` as mutable more than once at a time _ => { addr = &mut x; } //~^ ERROR cannot borrow `x` as mutable more than once at a time } } } </ins>


} OptLevel::Default } else { <del> match ( cg.opt_level.as_ref().map(String::as_ref), nightly_options::is_nightly_build(), ) { (None, _) => OptLevel::No, (Some("0"), _) => OptLevel::No, (Some("1"), _) => OptLevel::Less, (Some("2"), _) => OptLevel::Default, (Some("3"), _) => OptLevel::Aggressive, (Some("s"), true) => OptLevel::Size, (Some("z"), true) => OptLevel::SizeMin, (Some("s"), false) | (Some("z"), false) => { early_error( error_format, &format!( "the optimizations s or z are only  accepted on the nightly compiler" ), ); } (Some(arg), _) => { </del> <ins> match cg.opt_level.as_ref().map(String::as_ref) { None => OptLevel::No, Some("0") => OptLevel::No, Some("1") => OptLevel::Less, Some("2") => OptLevel::Default, Some("3") => OptLevel::Aggressive, Some("s") => OptLevel::Size, Some("z") => OptLevel::SizeMin, Some(arg) => { </ins> early_error( error_format, &format!(


use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_trait_selection::traits::{self, ObligationCauseCode}; <del> use std::fmt::Display; </del> impl<'a, 'tcx> FnCtxt<'a, 'tcx> { fn check_expr_eq_type(&self, expr: &'tcx hir::Expr<'tcx>, expected: Ty<'tcx>) { let ty = self.check_expr_with_hint(expr, expected);


} } ast::TraitItemKind::Type(_, ref default) => { <del> // We use two if statements instead of something like match guards so that both // of these errors can be emitted if both cases apply. </del> <ins> // We use three if statements instead of something like match guards so that all // of these errors can be emitted if all cases apply. </ins> if default.is_some() { gate_feature_post!(&self, associated_type_defaults, ti.span, "associated type defaults are unstable");


<del> use crate::t; </del> <ins> use crate::{t, VERSION}; </ins> use std::path::{Path, PathBuf}; use std::str::FromStr; use std::{


"test/bench/shootout-meteor.rs", # BSD "test/bench/shootout-pidigits.rs", # BSD "test/bench/shootout-regex-dna.rs", # BSD <ins> "test/bench/shootout-reverse-complement.rs", # BSD </ins> "test/bench/shootout-threadring.rs", # BSD ]


// collect results based on the filter function if ident.name == lookup_ident.name && ns == namespace { <del> if filter_fn(name_binding.def()) { </del> <ins> let def = name_binding.def(); if filter_fn(def) { </ins> // create the path let mut segms = path_segments.clone(); if lookup_ident.span.rust_2018() {


<ins> // run-pass // ignore-emscripten no subprocess support #![feature(set_stdio)] use std::fmt; use std::fmt::{Display, Formatter}; use std::io::set_panic; pub struct A; impl Display for A { fn fmt(&self, _f: &mut Formatter<'_>) -> fmt::Result { panic!(); } } fn main() { set_panic(Some(Box::new(Vec::new()))); assert!(std::panic::catch_unwind(|| { eprintln!("{}", A); }) .is_err()); } </ins>


fn main() -> () { let mut _0: ();                      // return place in scope 0 at $DIR/inline-generator.rs:8:11: 8:11 <del> let _1: std::ops::GeneratorState<<impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Yield, <impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Return>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11 let mut _2: std::pin::Pin<&mut impl std::ops::Generator<bool>>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32 let mut _3: &mut impl std::ops::Generator<bool>; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31 let mut _4: impl std::ops::Generator<bool>; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31 </del> <ins> let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11 let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32 let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31 let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31 </ins> +     let mut _7: bool;                    // in scope 0 at $DIR/inline-generator.rs:9:14: 9:46 scope 1 { debug _r => _1;                  // in scope 1 at $DIR/inline-generator.rs:9:9: 9:11


| = help: add #![feature(generic_associated_types)] to the crate attributes to enable <ins> error[E0658]: where clauses on associated types are unstable (see issue #44265) --> $DIR/feature-gate-generic_associated_types.rs:16:5 | LL |     type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(generic_associated_types)] to the crate attributes to enable </ins> error[E0658]: generic associated types are unstable (see issue #44265) <del> --> $DIR/feature-gate-generic_associated_types.rs:22:5 </del> <ins> --> $DIR/feature-gate-generic_associated_types.rs:23:5 </ins> | LL |     type Pointer<usize> = Box<usize>; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


<ins> fn part(_: u16) -> u32 { 1 } fn main() { for n in 100_000.. { //~^ ERROR: literal out of range for `u16` let _ = part(n); } } </ins>


<ins> error[E0726]: implicit elided lifetime not allowed here --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:16 | LL | impl Trait for Ref {} |                ^^^- help: indicate the anonymous lifetime: `<'_>` error[E0308]: mismatched types --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:21 | LL |     pub fn repro(_: Wrapper<Ref>); |                     ^^^^^^^^^^^^ lifetime mismatch | = note: expected trait `Trait` found trait `Trait` note: the anonymous lifetime #1 defined on the method body at 16:5... --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:5 | LL |     pub fn repro(_: Wrapper<Ref>); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...does not necessarily outlive the static lifetime error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. </ins>


} // walk type and init value <del> self.visit_ty(typ); if let Some(expr) = expr { self.visit_expr(expr); } </del> <ins> self.nest_tables(id, |v| { v.visit_ty(typ); if let Some(expr) = expr { v.visit_expr(expr); } }); </ins> } // FIXME tuple structs should generate tuple-specific data.


LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { | <ins> help: consider borrowing here | LL |     let y: &X = *x1; |            + </ins> error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized6.rs:32:9


<ins> #![deny(unused_must_use)] use std::{ops::Deref, pin::Pin}; #[must_use] struct MustUse; #[must_use] struct MustUsePtr<'a, T>(&'a T); impl<'a, T> Deref for MustUsePtr<'a, T> { type Target = T; fn deref(&self) -> &Self::Target { self.0 } } fn pin_ref() -> Pin<&'static ()> { Pin::new(&()) } fn pin_ref_mut() -> Pin<&'static mut ()> { Pin::new(unimplemented!()) } fn pin_must_use_ptr() -> Pin<MustUsePtr<'static, ()>> { Pin::new(MustUsePtr(&())) } fn pin_box() -> Pin<Box<()>> { Box::pin(()) } fn pin_box_must_use() -> Pin<Box<MustUse>> { Box::pin(MustUse) } fn main() { pin_ref(); pin_ref_mut(); pin_must_use_ptr(); //~ ERROR unused pinned `MustUsePtr` that must be used pin_box(); pin_box_must_use(); //~ ERROR unused pinned boxed `MustUse` that must be used } </ins>


} else { // recent versions of gcc can be configured to generate position // independent executables by default. We have to pass -no-pie to <del> // explicitly turn that off. if sess.target.target.options.linker_is_gnu { </del> <ins> // explicitly turn that off. Not applicable to ld. if sess.target.target.options.linker_is_gnu && sess.linker_flavor() != LinkerFlavor::Ld { </ins> cmd.no_position_independent_executable(); } }


<ins> // Regression test for issue #124935 // Tests that we still emit an error after an item. fn main() { } ; //~ ERROR expected item, found `;` </ins>


} } <ins> fn bound_from_single_component( &self, component: &Component<'tcx>, visited: &mut SsoHashSet<GenericArg<'tcx>>, ) -> VerifyBound<'tcx> { match *component { Component::Region(lt) => VerifyBound::OutlivedBy(lt), Component::Param(param_ty) => self.param_bound(param_ty), Component::Projection(projection_ty) => self.projection_bound(projection_ty, visited), Component::EscapingProjection(ref components) => { self.bound_from_components(components, visited) } Component::UnresolvedInferenceVariable(v) => { // ignore this, we presume it will yield an error // later, since if a type variable is not resolved by // this point it never will be self.tcx.sess.delay_span_bug( rustc_span::DUMMY_SP, &format!("unresolved inference variable in outlives: {:?}", v), ); // add a bound that never holds VerifyBound::AnyBound(vec![]) } } } </ins> /// Searches the environment for where-clauses like `G: 'a` where /// `G` is either some type parameter `T` or a projection like /// `T::Item`. Returns a vector of the `'a` bounds it can find.


for (region_a, region_a_idx) in &regions { // Ignore `'static` lifetimes for the purpose of this lint: it's // because we know it outlives everything and so doesn't give meaningful <del> // clues if let ty::ReStatic = **region_a { </del> <ins> // clues. Also ignore `ReError`, to avoid knock-down errors. if let ty::ReStatic | ty::ReError(_) = **region_a { </ins> continue; } // For each region argument (e.g., `'a` in our example), check for a


<ins> // edition:2018 use std::{future::Future, marker::PhantomData}; fn spawn<T>(future: T) -> PhantomData<T::Output> where T: Future, { loop {} } #[derive(Debug)] struct IncomingServer {} impl IncomingServer { async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> { //~^ ERROR expected type, found variant `Ok` [E0573] loop {} } async fn spawn(&self, request_handler: impl Sized) { async move { spawn(Self::connection_handler(&request_handler)); }; } } fn main() {} </ins>


<ins> // Copyright 2016 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. use std::fmt::Debug; const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); //~^ ERROR `std::fmt::Debug + Sync + 'static: std::marker::Sized` is not satisfied //~| NOTE does not have a constant size known at compile-time //~| NOTE constant expressions must have a statically known size const CONST_FOO: str = *"foo"; //~^ ERROR `str: std::marker::Sized` is not satisfied //~| NOTE does not have a constant size known at compile-time //~| NOTE constant expressions must have a statically known size static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); //~^ ERROR `std::fmt::Debug + Sync + 'static: std::marker::Sized` is not satisfied //~| NOTE does not have a constant size known at compile-time //~| NOTE constant expressions must have a statically known size static STATIC_BAR: str = *"bar"; //~^ ERROR `str: std::marker::Sized` is not satisfied //~| NOTE does not have a constant size known at compile-time //~| NOTE constant expressions must have a statically known size fn main() { println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); } </ins>


let tcx = self.infcx.tcx; let generics = tcx.generics_of(self.mir_def_id); let param = generics.type_param(&param_ty, tcx); <del> let generics = tcx.hir().get_generics(self.mir_def_id).unwrap(); suggest_constraining_type_param( generics, &mut err, &param.name.as_str(), "Copy", tcx.sess.source_map(), span, ); </del> <ins> if let Some(generics) = tcx.hir().get_generics(self.mir_def_id) { suggest_constraining_type_param( generics, &mut err, &param.name.as_str(), "Copy", tcx.sess.source_map(), span, ); } </ins> } let span = if let Some(local) = place.as_local() { let decl = &self.body.local_decls[local];


<ins> #![deny(suspicious_auto_trait_impls)] auto trait Trait<P> {} //~ ERROR auto traits cannot have generic parameters //~^ ERROR auto traits are experimental and possibly buggy impl<P> Trait<P> for () {} fn main() {} </ins>


} } <ins> fn async_block_with_borrow_named_lifetime<'a>(x: &'a u8) -> impl Future<Output = u8> + 'a { async move { await!(wake_and_yield_once()); *x } } </ins> fn async_nonmove_block(x: u8) -> impl Future<Output = u8> { async move { let future = async {


err.multipart_suggestion_verbose(descr, suggestion, Applicability::MaybeIncorrect); err } <ins> Res::Def(DefKind::Variant, _) if expr.is_none() => { err.span_label(span, format!("not a {expected}")); let fields = &tcx.expect_variant_res(res).fields.raw; let span = qpath.span().shrink_to_hi().to(span.shrink_to_hi()); let (msg, sugg) = if fields.is_empty() { ("use the struct variant pattern syntax".to_string(), " {}".to_string()) } else { let msg = format!( "the struct variant's field{s} {are} being ignored", s = pluralize!(fields.len()), are = pluralize!("is", fields.len()) ); let fields = fields .iter() .map(|field| format!("{}: _", field.name.to_ident_string())) .collect::<Vec<_>>() .join(", "); let sugg = format!(" {{ {} }}", fields); (msg, sugg) }; err.span_suggestion_verbose( qpath.span().shrink_to_hi().to(span.shrink_to_hi()), msg, sugg, Applicability::HasPlaceholders, ); err } </ins> _ => err.with_span_label(span, format!("not a {expected}")), } .emit()


LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { | <ins> help: consider borrowing here | LL |     let y: &X = *x1; |            + </ins> error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized6.rs:24:9


if c.pgp { pgp::init(c.root); <ins> } else { warn("command "gpg" is not found"); warn("you have to install "gpg" from source " + " or package manager to get it to work correctly"); </ins> } c


<ins> error[E0425]: cannot find function `foo1` in crate `similar_unstable_method` --> $DIR/issue-109177.rs:7:30 | LL |     similar_unstable_method::foo1(); |                              ^^^^ help: a function with a similar name exists: `foo` | ::: $DIR/auxiliary/similar-unstable-method.rs:5:1 | LL | pub fn foo() {} | ------------ similarly named function `foo` defined here error[E0599]: no method named `foo1` found for struct `Foo` in the current scope --> $DIR/issue-109177.rs:11:9 | LL |     foo.foo1(); |         ^^^^ method not found in `Foo` error: aborting due to 2 previous errors Some errors have detailed explanations: E0425, E0599. For more information about an error, try `rustc --explain E0425`. </ins>


n => { let m = cmp::min(n, self.steals); self.steals -= m; <del> self.cnt.fetch_add(n - m, atomics::SeqCst); </del> <ins> self.bump(n - m); </ins> } } assert!(self.steals >= 0); } <ins> self.steals += 1; </ins> match data { Data(t) => Ok(t), GoUp(up) => Err(Upgraded(up)),


impl Foo for SignedBar { const BAR: i32 = -1; <del> //~^ ERROR E0326 </del> <ins> //~^ ERROR implemented const `BAR` has an incompatible type for trait //~| expected u32, //~| found i32 [E0326] </ins> } fn main() {}


}; fn a_test() {} #[rustc_main] <ins> #[no_coverage] </ins> pub fn main() -> () { extern crate test; test::test_main_static(&[&a_test, &m_test, &z_test])


variant_index: VariantIdx, dest: PlaceTy<'tcx, M::PointerTag>, ) -> InterpResult<'tcx> { <del> let variant_scalar = Scalar::from_u32(variant_index.as_u32()).into(); </del> <ins> // Layout computation excludes uninhabited variants from consideration // therefore there's no way to represent those variants in the given layout. if dest.layout.for_variant(self, variant_index).abi.is_uninhabited() { throw_ub!(Unreachable); } </ins> match dest.layout.variants { layout::Variants::Single { index } => { <del> if index != variant_index { throw_ub!(InvalidDiscriminant(variant_scalar)); } </del> <ins> assert_eq!(index, variant_index); </ins> } layout::Variants::Multiple { discr_kind: layout::DiscriminantKind::Tag,


/// expression of type `&'static str` which represents all of the literals /// concatenated left-to-right. /// <del> /// Integer and floating point literals are stringified in order to be </del> <ins> /// Integer and floating point literals are [stringified](core::stringify) in order to be </ins> /// concatenated. /// /// # Examples


add_lint_group!(sess, "rust_2018_idioms", BARE_TRAIT_OBJECT, <del> UNREACHABLE_PUB); </del> <ins> UNREACHABLE_PUB, UNNECESSARY_EXTERN_CRATE); </ins> // Guidelines for creating a future incompatibility lint: //


//~^ ERROR generic associated types are unstable type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; //~^ ERROR generic associated types are unstable <ins> //~| ERROR where clauses on associated types are unstable </ins> } struct Foo;


} } <del> if dont_insert_main || already_has_main { </del> <ins> // FIXME: This code cannot yet handle no_std test cases yet if dont_insert_main || already_has_main || prog.contains("![no_std]") { </ins> prog.push_str(everything_else); } else { <del> prog.push_str("fn main() {n"); </del> <ins> let returns_result = everything_else.trim_end().ends_with("(())"); let (main_pre, main_post) = if returns_result { ("fn main() { fn _inner() -> Result<(), impl core::fmt::Debug> {", "}n_inner().unwrap() }") } else { ("fn main() {n", "n}") }; prog.extend([main_pre, everything_else, main_post].iter().cloned()); </ins> line_offset += 1; <del> prog.push_str(everything_else); prog.push_str("n}"); </del> } debug!("final doctest:n{}", prog);


fn raw_proc_macro(&self, id: DefIndex) -> &ProcMacro { // DefIndex's in root.proc_macro_data have a one-to-one correspondence <del> // with items in 'raw_proc_macros' </del> <ins> // with items in 'raw_proc_macros'. // NOTE: If you update the order of macros in 'proc_macro_data' for any reason, // you must also update src/libsyntax_ext/proc_macro_harness.rs // Failing to do so will result in incorrect data being associated // with proc macros when deserialized. </ins> let pos = self.root.proc_macro_data.unwrap().decode(self).position(|i| i == id).unwrap(); &self.raw_proc_macros.unwrap()[pos] }


| LL |         Enum::Foo(a, b) => {} |         ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant <ins> | help: the struct variant's fields are being ignored | LL |         Enum::Foo { a: _, b: _ } => {} |                   ~~~~~~~~~~~~~~ </ins> error[E0769]: tuple variant `Enum::Bar` written as struct variant --> $DIR/recover-from-bad-variant.rs:12:9


font-size: 19px; } <ins> ul.item-list > li > .out-of-band { font-size: 19px; } </ins> h4 > code, h3 > code, .invisible > code { position: inherit; }


// We replace self[index] with the last element. Note that if the // bounds check above succeeds there must be a last element (which // can be self[index] itself). <del> let last = ptr::read(self.as_ptr().add(len - 1)); let hole = self.as_mut_ptr().add(index); </del> <ins> let value = ptr::read(self.as_ptr().add(index)); let base_ptr = self.as_mut_ptr(); ptr::copy(base_ptr.add(len - 1), base_ptr.add(index), 1); </ins> self.set_len(len - 1); <del> ptr::replace(hole, last) </del> <ins> value </ins> } }


/// Swaps the values of two `Cell`s. /// Difference with `std::mem::swap` is that this function doesn't require `&mut` reference. /// <ins> /// # Panics /// /// This function will panic if `self` and `other` are different `Cell`s that partially overlap. /// (Using just standard library methods, it is impossible to create such partially overlapping `Cell`s. /// However, unsafe code is allowed to e.g. create two `&Cell<[i32; 2]>` that partially overlap.) /// </ins> /// # Examples /// /// ```


<ins> // force-host // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; struct Zeroable; #[proc_macro_derive(Zeroable)] pub fn derive_zeroable(_: proc_macro::TokenStream) -> proc_macro::TokenStream { proc_macro::TokenStream::default() } </ins>


t!(std::fs::write(stamp_file, version)) } <del> /// Returns the files modified between the `merge-base` of HEAD and </del> <ins> /// Returns the Rust files modified between the `merge-base` of HEAD and </ins> /// rust-lang/master and what is now on the disk. /// /// Returns `None` if all files should be formatted. <del> fn get_modified_files(build: &Builder<'_>) -> Option<Vec<String>> { </del> <ins> fn get_modified_rs_files(build: &Builder<'_>) -> Option<Vec<String>> { </ins> let Ok(remote) = get_rust_lang_rust_remote() else {return None;}; if !verify_rustfmt_version(build) { return None;


ImportKind::Single { target_bindings, .. } => target_bindings[TypeNS].get(), _ => None, }; <del> let prev_ambiguity_errors_len = self.ambiguity_errors.len(); </del> <ins> let ambiguity_errors_len = |errors: &Vec<AmbiguityError<'_>>| errors.iter().filter(|error| !error.warning).count(); let prev_ambiguity_errors_len = ambiguity_errors_len(&self.ambiguity_errors); </ins> let finalize = Finalize::with_root_span(import.root_id, import.span, import.root_span); // We'll provide more context to the privacy errors later, up to `len`.


// // If the issuing region outlives such a region, its loan escapes the function and // cannot go out of scope. We can early return. <del> if self.regioncx.scc_is_live_at_all_points(scc) { </del> <ins> if self.regioncx.is_region_live_at_all_points(successor) { </ins> return; } }


panic!("try to catch me"); } } <del> let s = Command::new(env::args_os().next().unwrap()).arg("foo").status(); </del> <ins> let mut cmd = Command::new(env::args_os().next().unwrap()); cmd.arg("foo"); // ARMv6 hanges while printing the backtrace, see #41004 if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") { cmd.env("RUST_BACKTRACE", "0"); } let s = cmd.status(); </ins> assert!(s.unwrap().code() != Some(0)); }


<ins> //@ edition: 2021 #![feature(async_closure)] // Ensure that building a by-ref async closure body doesn't ICE when the parent // body is tainted. fn main() { missing; //~^ ERROR cannot find value `missing` in this scope // We don't do numerical inference fallback when the body is tainted. // This leads to writeback folding the type of the coroutine-closure // into an error type, since its signature contains that numerical // infer var. let c = async |_| {}; c(1); } </ins>


self.tcx.sess.opts.debugging_opts.inline_mir_threshold }; <ins> if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NAKED) { debug!("#[naked] present - not inlining"); return false; } </ins> if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) { debug!("#[cold] present - not inlining"); return false;


Ok((fields, etc)) } <ins> #[deny(rustc::untranslatable_diagnostic)] fn report_misplaced_at_in_struct_pat(&self, prev_field: Ident) -> Diag<'a> { debug_assert_eq!(self.token, token::At); let span = prev_field.span.to(self.token.span); if let Some(dot_dot_span) = self.look_ahead(1, |t| if t == &token::DotDot { Some(t.span) } else { None }) { self.dcx().create_err(AtDotDotInStructPattern { span: span.to(dot_dot_span), remove: span.until(dot_dot_span), ident: prev_field, }) } else { self.dcx().create_err(AtInStructPattern { span: span }) } } </ins> /// If the user writes `S { ref field: name }` instead of `S { field: ref name }`, we suggest /// the correct code. fn recover_misplaced_pattern_modifiers(&self, fields: &ThinVec<PatField>, err: &mut Diag<'a>) {


<ins> // Regression test for #63033. // check-pass // edition: 2018 async fn test1(_: &'static u8, _: &'_ u8, _: &'_ u8) {} async fn test2<'s>(_: &'s u8, _: &'_ &'s u8, _: &'_ &'s u8) {} fn main() {} </ins>


<ins> error: only functions may be used as tests --> $DIR/issue-28134.rs:13:1 | LL | #![test] //~ ERROR only functions may be used as tests | ^^^^^^^^ error: aborting due to previous error </ins>


without modifying the original"] #[inline] #[track_caller] <del> #[rustc_inherit_overflow_checks] #[allow(arithmetic_overflow)] </del> pub const fn ilog2(self) -> u32 { <del> match self.checked_ilog2() { Some(n) => n, None => { // In debug builds, trigger a panic on None. // This should optimize completely out in release builds. let _ = Self::MAX + 1; 0 }, } </del> <ins> self.checked_ilog2().expect("argument of integer logarithm must be positive") </ins> } /// Returns the base 10 logarithm of the number, rounded down. /// /// # Panics /// <del> /// When the number is negative or zero it panics in debug mode and the return value /// is 0 in release mode. </del> <ins> /// This function will panic if `self` is less than or equal to zero. </ins> /// /// # Example ///


std::env::var("TARGET").is_ok_and(|v| v.contains("i586")) } <ins> #[cfg(target_arch = "x86_64")] fn f16(){ const_assert!((1f16).to_bits(), 0x3c00); const_assert!(u16::from_be_bytes(1f16.to_be_bytes()), 0x3c00); const_assert!((12.5f16).to_bits(), 0x4a40); const_assert!(u16::from_le_bytes(12.5f16.to_le_bytes()), 0x4a40); const_assert!((1337f16).to_bits(), 0x6539); const_assert!(u16::from_ne_bytes(1337f16.to_ne_bytes()), 0x6539); const_assert!((-14.25f16).to_bits(), 0xcb20); const_assert!(f16::from_bits(0x3c00), 1.0); const_assert!(f16::from_be_bytes(0x3c00u16.to_be_bytes()), 1.0); const_assert!(f16::from_bits(0x4a40), 12.5); const_assert!(f16::from_le_bytes(0x4a40u16.to_le_bytes()), 12.5); const_assert!(f16::from_bits(0x5be0), 252.0); const_assert!(f16::from_ne_bytes(0x5be0u16.to_ne_bytes()), 252.0); const_assert!(f16::from_bits(0xcb20), -14.25); // Check that NaNs roundtrip their bits regardless of signalingness // 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits // NOTE: These names assume `f{BITS}::NAN` is a quiet NAN and IEEE754-2008's NaN rules apply! const QUIET_NAN: u16 = f16::NAN.to_bits() ^ 0x0155; const SIGNALING_NAN: u16 = f16::NAN.to_bits() ^ 0x02AA; const_assert!(f16::from_bits(QUIET_NAN).is_nan()); const_assert!(f16::from_bits(SIGNALING_NAN).is_nan()); const_assert!(f16::from_bits(QUIET_NAN).to_bits(), QUIET_NAN); if !has_broken_floats() { const_assert!(f16::from_bits(SIGNALING_NAN).to_bits(), SIGNALING_NAN); } } </ins> fn f32() { const_assert!((1f32).to_bits(), 0x3f800000); const_assert!(u32::from_be_bytes(1f32.to_be_bytes()), 0x3f800000);


suffix: &'pat [Pat<'tcx>], ) { let tcx = self.tcx; <del> let (min_length, exact_size) = match place .clone() .into_place(tcx, self.typeck_results) .ty(&self.local_decls, tcx) .ty .kind() </del> <ins> let (min_length, exact_size) = if let Ok(place_resolved) = place.clone().try_upvars_resolved(tcx, self.typeck_results) </ins> { <del> ty::Array(_, length) => (length.eval_usize(tcx, self.param_env), true), _ => ((prefix.len() + suffix.len()).try_into().unwrap(), false), </del> <ins> match place_resolved .into_place(tcx, self.typeck_results) .ty(&self.local_decls, tcx) .ty .kind() { ty::Array(_, length) => (length.eval_usize(tcx, self.param_env), true), _ => ((prefix.len() + suffix.len()).try_into().unwrap(), false), } } else { ((prefix.len() + suffix.len()).try_into().unwrap(), false) </ins> }; match_pairs.extend(prefix.iter().enumerate().map(|(idx, subpattern)| {


<ins> error[E0596]: cannot borrow data in a `&` reference as mutable --> $DIR/issue-52240.rs:9:27 | LL |     if let (Some(Foo::Bar(ref mut val)), _) = (&arr.get(0), 0) { |                           ^^^^^^^^^^^ cannot borrow as mutable error: aborting due to previous error For more information about this error, try `rustc --explain E0596`. </ins>


rscope: &RegionScope, span: Span, principal_trait_ref: ty::PolyTraitRef<'tcx>, <del> mut projection_bounds: Vec<ty::PolyProjectionPredicate<'tcx>>, // Empty for boxed closures </del> <ins> projection_bounds: Vec<ty::PolyProjectionPredicate<'tcx>>, // Empty for boxed closures </ins> partitioned_bounds: PartitionedBounds) -> ty::ExistentialBounds<'tcx> {


/// A free importable items suggested in case of resolution failure. struct ImportSuggestion { <ins> did: Option<DefId>, </ins> path: Path, }


"cargo_metadata 0.9.1", "clippy-mini-macro-test", "clippy_lints", <del> "compiletest_rs", </del> <ins> "compiletest_rs 0.5.0", </ins> "derive-new", "lazy_static 1.4.0", "regex",


<ins> error: pretty-print failed to write `/tmp/` due to $ERROR_MESSAGE error: aborting due to previous error </ins>


<ins> // Copyright 2016 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-cross-compile #![crate_name = "foo"] pub trait SomeTrait {} pub struct SomeStruct; // @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#19' impl SomeTrait for usize {} // @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#22-24' impl SomeTrait for SomeStruct { // deliberately multi-line impl } </ins>


let gcx = self.infcx.tcx.global_tcx(); let mut orig_values = OriginalQueryValues::default(); <del> let c_data = self.infcx.canonicalize_query( </del> <ins> // HACK(matthewjasper) `'static` is special-cased in selection, // so we cannot canonicalize it. let c_data = self.infcx.canonicalize_hr_query_hack( </ins> &self.param_env.and(*data), &mut orig_values); debug!("QueryNormalizer: c_data = {:#?}", c_data); debug!("QueryNormalizer: orig_values = {:#?}", orig_values);


opt local-rust 0 "use an installed rustc rather than downloading a snapshot" opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)" opt inject-std-version 1 "inject the current compiler version of libstd into programs" <ins> opt rpath 1 "build rpaths into rustc itself" </ins> valopt prefix "/usr/local" "set installation prefix" valopt local-rust-root "/usr/local" "set prefix for local rust binary" valopt llvm-root "" "set LLVM root"


# Make `RefCell` store additional debugging information, which is printed out when # a borrow error occurs debug_refcell = [] <ins> [lints.rust.unexpected_cfgs] level = "warn" # x.py uses beta cargo, so `check-cfg` entries do not yet take effect # for rust-lang/rust. But for users of `-Zbuild-std` it does. # The unused warning is waiting for rust-lang/cargo#13925 to reach beta. check-cfg = [ 'cfg(bootstrap)', 'cfg(no_fp_fmt_parse)', 'cfg(stdarch_intel_sde)', # This matches `EXTRA_CHECK_CFGS` in `src/bootstrap/src/lib.rs`. 'cfg(feature, values(any()))', ] </ins>


/// Metadata encoding version. /// NB: increment this if you change the format of metadata such that <del> /// the rustc version can't be found to compare with `RUSTC_VERSION`. pub const METADATA_VERSION: u8 = 3; </del> <ins> /// the rustc version can't be found to compare with `rustc_version()`. pub const METADATA_VERSION: u8 = 4; </ins> /// Metadata header which includes `METADATA_VERSION`. /// To get older versions of rustc to ignore this metadata, /// there are 4 zero bytes at the start, which are treated /// as a length of 0 by old compilers. /// <del> /// This header is followed by the position of the `CrateRoot`. </del> <ins> /// This header is followed by the position of the `CrateRoot`, /// which is encoded as a 32-bit big-endian unsigned integer, /// and further followed by the rustc version string. </ins> pub const METADATA_HEADER: &'static [u8; 12] = &[0, 0, 0, 0, b'r', b'u', b's', b't', 0, 0, 0, METADATA_VERSION];


pub struct BufWriter<W: Write> { inner: Option<W>, buf: Vec<u8>, <ins> // #30888: If the inner writer panics in a call to write, we don't want to // write the buffered data a second time in BufWriter's destructor. This // flag tells the Drop impl if it should skip the flush. panicked: bool, </ins> } /// An error returned by `into_inner` which combines an error that


unmapped_path, src, Pos::from_usize(start_pos), <del> )); </del> <ins> )?); </ins> let mut files = self.files.borrow_mut();


use std::env; <del> use bootstrap::{Build, Config, Subcommand}; </del> <ins> use bootstrap::{Build, Config, Subcommand, VERSION}; </ins> fn main() { let args = env::args().skip(1).collect::<Vec<_>>(); let config = Config::parse(&args); <del> let changelog_suggestion = check_version(&config); </del> <ins> // check_version warnings are not printed during setup let changelog_suggestion = if matches!(config.cmd, Subcommand::Setup {..}) { None } else { check_version(&config) }; </ins> // NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the // changelog warning, not the `x.py setup` message.


let path_data = match path_data { Some(pd) => pd, None => { <del> span_bug!(path.span, "Unexpected def kind while looking up path in `{}`", self.span.snippet(path.span)) </del> <ins> return; </ins> } };


<ins> error[E0310]: the parameter type `T` may not live long enough --> $DIR/implied-bounds-unnorm-associated-type-3.rs:19:5 | LL |     fn zero_copy_from<'b>(cart: &'b [T]) -> &'b [T] { |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider adding an explicit lifetime bound `T: 'static`... = note: ...so that the type `[T]` will meet its required lifetime bounds error: aborting due to previous error For more information about this error, try `rustc --explain E0310`. </ins>


<del> struct Bug([u8; panic!(1)]); //~ ERROR panicking in constants is unstable </del> <ins> // Note: non-`&str` panic arguments gained a separate error in PR #80734 // which is why this doesn't match the issue struct Bug([u8; panic!("panic")]); //~ ERROR panicking in constants is unstable </ins> fn main() {}


asm_args: cvs!["-mthumb-interwork", "-march=armv4t", "-mlittle-endian",], // minimum extra features, these cannot be disabled via -C <del> features: "+soft-float,+strict-align".into(), </del> <ins> // Also force-enable 32-bit atomics, which allows the use of atomic load/store only. // The resulting atomics are ABI incompatible with atomics backed by libatomic. features: "+soft-float,+strict-align,+atomics-32".into(), </ins> panic_strategy: PanicStrategy::Abort, relocation_model: RelocModel::Static,


<ins> error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-89064.rs:17:16 | LL |     let _ = A::foo::<S>(); |                ^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-89064.rs:4:8 | LL |     fn foo() {} |        ^^^ help: consider moving this generic argument to the `A` trait, which takes up to 1 argument | LL -     let _ = A::foo::<S>(); LL +     let _ = A::<S>::foo(); | help: remove these generics | LL -     let _ = A::foo::<S>(); LL +     let _ = A::foo(); | error[E0107]: this associated function takes 0 generic arguments but 2 generic arguments were supplied --> $DIR/issue-89064.rs:22:16 | LL |     let _ = B::bar::<S, S>(); |                ^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-89064.rs:8:8 | LL |     fn bar() {} |        ^^^ help: consider moving these generic arguments to the `B` trait, which takes up to 2 arguments | LL -     let _ = B::bar::<S, S>(); LL +     let _ = B::<S, S>::bar(); | help: remove these generics | LL -     let _ = B::bar::<S, S>(); LL +     let _ = B::bar(); | error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-89064.rs:27:21 | LL |     let _ = A::<S>::foo::<S>(); |                     ^^^----- help: remove these generics |                     | |                     expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-89064.rs:4:8 | LL |     fn foo() {} |        ^^^ error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-89064.rs:31:16 | LL |     let _ = 42.into::<Option<_>>(); |                ^^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $SRC_DIR/core/src/convert/mod.rs:LL:COL | LL |     fn into(self) -> T; |        ^^^^ help: consider moving this generic argument to the `Into` trait, which takes up to 1 argument | LL |     let _ = Into::<Option<_>>::into(42); |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~ help: remove these generics | LL -     let _ = 42.into::<Option<_>>(); LL +     let _ = 42.into(); | error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0107`. </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. trait Trait { type A; type B; } fn foo<T: Trait<A = T::B>>() { } //~^ ERROR: unsupported cyclic reference between types/traits detected fn main() { } </ins>


ConditionalPass::always(CHECK_CUSTOM_CODE_CLASSES), ConditionalPass::always(COLLECT_TRAIT_IMPLS), ConditionalPass::always(CHECK_DOC_TEST_VISIBILITY), <ins> ConditionalPass::always(STRIP_ALIASED_NON_LOCAL), </ins> ConditionalPass::new(STRIP_HIDDEN, WhenNotDocumentHidden), ConditionalPass::new(STRIP_PRIVATE, WhenNotDocumentPrivate), ConditionalPass::new(STRIP_PRIV_IMPORTS, WhenDocumentPrivate),


| (ProjectionElem::Index(..), ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::Index(..), ProjectionElem::Subslice { .. }) | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Index(..)) <del> | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Subslice { .. }) | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..)) | (ProjectionElem::Subslice { .. }, ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => { </del> <ins> | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..)) => { </ins> // Array indexes (`a[0]` vs. `a[i]`). These can either be disjoint // (if the indexes differ) or equal (if they are the same), so this // is the recursive case that gives "equal *or* disjoint" its meaning. <del> // // Note that by construction, MIR at borrowck can't subdivide // `Subslice` accesses (e.g. `a[2..3][i]` will never be present) - they // are only present in slice patterns, and we "merge together" nested // slice patterns. That means we don't have to think about these. It's // probably a good idea to assert this somewhere, but I'm too lazy. // // FIXME(#8636) we might want to return Disjoint if // both projections are constant and disjoint. debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY"); </del> <ins> debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-INDEX"); </ins> Overlap::EqualOrDisjoint } <ins> (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: false }, ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: false }) | (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: true }, ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: true }) => { if o1 == o2 { debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset: offset_from_begin, min_length: min_length1, from_end: false }, ProjectionElem::ConstantIndex { offset: offset_from_end, min_length: min_length2, from_end: true }) | (ProjectionElem::ConstantIndex { offset: offset_from_end, min_length: min_length1, from_end: true }, ProjectionElem::ConstantIndex { offset: offset_from_begin, min_length: min_length2, from_end: false }) => { // both patterns matched so it must be at least the greater of the two let min_length = max(min_length1, min_length2); // `offset_from_end` can be in range `[1..min_length]`, 1 indicates the last // element (like -1 in Python) and `min_length` the first. // Therefore, `min_length - offset_from_end` gives the minimal possible // offset from the beginning if *offset_from_begin >= min_length - offset_from_end { debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-FE"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false }, ProjectionElem::Subslice {from, .. }) | (ProjectionElem::Subslice {from, .. }, ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false }) => { if offset >= from { debug!( "place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true }, ProjectionElem::Subslice {from: _, to }) | (ProjectionElem::Subslice {from: _, to }, ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true }) => { if offset > to { debug!("place_element_conflict:  DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE-FE"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE-FE"); Overlap::Disjoint } } (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => { debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES"); Overlap::EqualOrDisjoint } </ins> (ProjectionElem::Deref, _) | (ProjectionElem::Field(..), _) | (ProjectionElem::Index(..), _)


<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. // Regression test for issue #25436: check that things which can be // followed by any token also permit X* to come afterwards. macro_rules! foo { ( $a:expr $($b:tt)* ) => { }; //~ ERROR not allowed for `expr` fragments ( $a:ty $($b:tt)* ) => { };   //~ ERROR not allowed for `ty` fragments } fn main() { } </ins>


<ins> error: prefix `f` is unknown --> $DIR/dont-ice-on-invalid-lifetime-in-macro-definition.rs:5:17 | LL |             e::<f'g> |                 ^ unknown prefix | = note: prefixed identifiers and literals are reserved since Rust 2021 help: consider inserting whitespace here | LL |             e::<f 'g> |                  + error: aborting due to 1 previous error </ins>


<ins> error: `_x @` is not allowed in a tuple --> $DIR/issue-72574-1.rs:4:14 | LL |         (_a, _x @ ..) => {} |              ^^^^^^^ this is only allowed in slice patterns | = help: remove this and bind each tuple field independently help: if you don't need to use the contents of _x, discard the tuple's remaining fields | LL |         (_a, ..) => {} |              ^^ error: aborting due to previous error </ins>


<ins> #![feature(half_open_range_patterns)] macro_rules! funny { ($a:expr, $b:ident) => { match [1, 2] { [$a, $b] => {} } }; } fn main() { funny!(a, a); //~^ ERROR cannot find value `a` in this scope //~| ERROR arbitrary expressions aren't allowed in patterns } </ins>


<ins> //@ edition: 2021 //@ check-pass //@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver #![feature(async_closure)] use std::future::Future; use std::any::Any; struct Struct; impl Struct { fn method(&self) {} } fn fake_async_closure<F, Fut>(_: F) where F: Fn(Struct) -> Fut, Fut: Future<Output = ()>, {} fn main() { fake_async_closure(async |s| { s.method(); }) } </ins>


let gen_sig = substs.as_generator().poly_sig(); <del> // (1) Feels icky to skip the binder here, but OTOH we know // that the self-type is an generator type and hence is </del> <ins> // NOTE: The self-type is a generator type and hence is </ins> // in fact unparameterized (or at least does not reference any <del> // regions bound in the obligation). Still probably some // refactoring could make this nicer. </del> <ins> // regions bound in the obligation). let self_ty = obligation .predicate .self_ty() .no_bound_vars() .expect("unboxed closure type should not capture bound vars from the predicate"); </ins> let trait_ref = super::util::generator_trait_ref_and_outputs( self.tcx(), obligation.predicate.def_id(), <del> obligation.predicate.skip_binder().self_ty(), // (1) </del> <ins> self_ty, </ins> gen_sig, ) .map_bound(|(trait_ref, ..)| trait_ref);


LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {} |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe` <del> error[E0277]: the type `&mut (dyn Any + 'static)` may not be safely transferred across an unwind boundary --> $DIR/async-is-unwindsafe.rs:12:5 | LL |        is_unwindsafe(async { |   _____^_____________- |  |_____| | || LL | || LL | || LL | ||         use std::ptr::null; ...  || LL | ||         drop(cx_ref); LL | ||     }); | ||_____-^ `&mut (dyn Any + 'static)` may not be safely transferred across an unwind boundary |  |_____| |        within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}` | = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Any + 'static)`, which is required by `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}: UnwindSafe` note: future does not implement `UnwindSafe` as this value is used across an await --> $DIR/async-is-unwindsafe.rs:26:18 | LL |         let mut cx = Context::from_waker(&waker); |             ------ has type `Context<'_>` which does not implement `UnwindSafe` ... LL |         async {}.await; // this needs an inner await point |                  ^^^^^ await occurs here, with `mut cx` maybe used later note: required by a bound in `is_unwindsafe` --> $DIR/async-is-unwindsafe.rs:3:26 | LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {} |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe` error: aborting due to 2 previous errors </del> <ins> error: aborting due to 1 previous error </ins> For more information about this error, try `rustc --explain E0277`.


<del> Subproject commit d30da544a8afc5d78391dee270bdf40e74a215d3 </del> <ins> Subproject commit c8a8767c56ad3d3f4eb45c87b95026936fb9aa35 </ins>


.map(|res| (res, extra_fragment.clone())), type_ns: match self.resolve( path_str, <ins> disambiguator, </ins> TypeNS, &current_item, base_node,


assert_eq!(find_best_match_for_name(&input, Symbol::intern("1111111111"), None), None); <del> let input = vec![Symbol::intern("aAAA")]; </del> <ins> let input = vec![Symbol::intern("AAAA")]; </ins> assert_eq!( <del> find_best_match_for_name(&input, Symbol::intern("AAAA"), None), Some(Symbol::intern("aAAA")) </del> <ins> find_best_match_for_name(&input, Symbol::intern("aaaa"), None), Some(Symbol::intern("AAAA")) </ins> ); let input = vec![Symbol::intern("AAAA")]; <del> // Returns None because `lev_distance > max_dist / 3` assert_eq!(find_best_match_for_name(&input, Symbol::intern("aaaa"), None), None); let input = vec![Symbol::intern("AAAA")]; </del> assert_eq!( find_best_match_for_name(&input, Symbol::intern("aaaa"), Some(4)), Some(Symbol::intern("AAAA"))


let mut _4: &mut [T];                // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6 scope 1 { debug self => _4;                // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL <ins> let mut _5: &mut [T];            // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 </ins> } bb0: {


let prog = time(sess.time_passes(), "running linker", || cmd.output()); match prog { Ok(prog) => { <ins> fn escape_string(s: &[u8]) -> String { str::from_utf8(s).map(|s| s.to_owned()) .unwrap_or_else(|_| { let mut x = "Non-UTF-8 output: ".to_string(); x.extend(s.iter() .flat_map(|&b| ascii::escape_default(b)) .map(|b| char::from_u32(b as u32).unwrap())); x }) } </ins> if !prog.status.success() { sess.err(&format!("linking with `{}` failed: {}", pname,


<del> Subproject commit 097d8908339e20435078233a55a1a3335fe7c2eb </del> <ins> Subproject commit 9ed6f96f2ff85753c5a6ac290ee88ecb2831ab2e </ins>


|                    +++ error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters <del> --> $DIR/generics.rs:17:43 </del> <ins> --> $DIR/generics.rs:18:43 </ins> | LL |     f2: extern "C-cmse-nonsecure-call" fn(impl Copy, u32, u32, u32) -> u64, |                                           ^^^^^^^^^


fn f<F>(f: F) where F: Fn(isize) { f(10) } <del> fn main() { f(|i| { assert_eq!(i , 10) }) } </del> <ins> fn main() { f(|i| { assert_eq!(i, 10) }) } </ins>


/// Allows the user of associated type bounds. (active, associated_type_bounds, "1.34.0", Some(52662), None), <del> /// Allows calling constructor functions in `const fn`. (active, const_constructor, "1.37.0", Some(61456), None), </del> /// Allows `if/while p && let q = r && ...` chains. (active, let_chains, "1.37.0", Some(53667), None),


source_file } <del> } </del> <ins> }; Ok(lrc_sf) </ins> } /// Allocates a new SourceFile representing a source file from an external


// aux-build:lint_stability.rs // aux-build:inherited_stability.rs <del> #![feature(globs)] </del> <ins> #![feature(globs, phase)] </ins> #![deny(unstable)] #![deny(deprecated)] #![deny(experimental)] #![allow(dead_code)] mod cross_crate { <ins> #[phase(plugin, link)] </ins> extern crate lint_stability; use self::lint_stability::*;


<ins> // aux-build: similar-unstable-method.rs extern crate similar_unstable_method; fn main() { // FIXME: this function should not suggest the `foo` function. similar_unstable_method::foo1(); //~^ ERROR cannot find function `foo1` in crate `similar_unstable_method` [E0425] let foo = similar_unstable_method::Foo; foo.foo1(); //~^ ERROR no method named `foo1` found for struct `Foo` in the current scope [E0599] } </ins>


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { *return; //~ ERROR type `!` cannot be dereferenced } </ins>


<del> Subproject commit 50ab09fb43f038e4f824eea6cb278f560d3e8621 </del> <ins> Subproject commit 859fb269364623b17e092efaba3f94e70ce97c5e </ins>


use rustc::mir::{Mir, Place}; use rustc::mir::{Projection, ProjectionElem}; use rustc::ty::{self, TyCtxt}; <ins> use std::cmp::max; </ins> pub(super) fn places_conflict<'gcx, 'tcx>( tcx: TyCtxt<'_, 'gcx, 'tcx>,


rustup toolchain install --profile minimal nightly-${TOOLCHAIN} # Sanity check to see if the nightly exists echo nightly-${TOOLCHAIN} > rust-toolchain <del> echo "=> Uninstalling all old nighlies" </del> <ins> echo "=> Uninstalling all old nightlies" </ins> for nightly in $(rustup toolchain list | grep nightly | grep -v $TOOLCHAIN | grep -v nightly-x86_64); do rustup toolchain uninstall $nightly done


<ins> warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:28:5 | LL |     Generic::from_iter(1); |     ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic<_, _> as MyFromIter>::from_iter` | note: the lint level is defined here --> $DIR/future-prelude-collision-generic.rs:5:9 | LL | #![warn(rust_2021_prelude_collisions)] |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684> warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:31:5 | LL |     Generic::<i32, i32>::from_iter(1); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<i32, i32> as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684> warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:34:5 | LL |     Generic::<_, _>::from_iter(1); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<_, _> as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684> warning: 3 warnings emitted </ins>


rustdocflags.arg("-Dwarnings"); } <del> // FIXME(#58633) hide "unused attribute" errors in incremental // builds of the standard library, as the underlying checks are // not yet properly integrated with incremental recompilation. if mode == Mode::Std && compiler.stage == 0 && self.config.incremental { lint_flags.push("-Aunused-attributes"); } </del> // This does not use RUSTFLAGS due to caching issues with Cargo. // Clippy is treated as an "in tree" tool, but shares the same // cache as other "submodule" tools. With these options set in


<ins> // Copyright 2018 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. // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::*; #[proc_macro_derive(A, attributes(b))] pub fn foo(_x: TokenStream) -> TokenStream { TokenStream::new() } </ins>


#[cfg(any(target_os = "horizon", target_os = "hurd"))] pub fn accessed(&self) -> io::Result<SystemTime> { <del> Ok(SystemTime::from(self.stat.st_atim)) </del> <ins> SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64) </ins> } #[cfg(any(


use DefModifiers; use Module; <ins> use ModuleKind; </ins> use Namespace::{self, TypeNS, ValueNS}; use NameBindings; use NamespaceResult::{BoundResult, UnboundResult, UnknownResult};


<ins> error[E0308]: mismatched types --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:3:5 | LL | fn wat<T>(t: &T) -> T { |        -            - expected `T` because of return type |        | |        this type parameter LL |     t.clone() |     ^^^^^^^^^ expected type parameter `T`, found `&T` | = note: expected type parameter `T` found reference `&T` note: `T` does not implement `Clone`, so `&T` was cloned instead --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:3:5 | LL |     t.clone() |     ^ help: consider restricting type parameter `T` | LL | fn wat<T: Clone>(t: &T) -> T { |         +++++++ error[E0308]: mismatched types --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5 | LL | fn wut(t: &Foo) -> Foo { |                    --- expected `Foo` because of return type LL |     t.clone() |     ^^^^^^^^^ expected struct `Foo`, found `&Foo` | note: `Foo` does not implement `Clone`, so `&Foo` was cloned instead --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5 | LL |     t.clone() |     ^ help: consider annotating `Foo` with `#[derive(Clone)]` | LL | #[derive(Clone)] | error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. </ins>


<ins> // Regression test for #72051, hang when resolving regions. // check-pass // edition:2018 pub async fn query<'a>(_: &(), _: &(), _: (&(dyn std::any::Any + 'a),) ) {} fn main() {} </ins>


``` ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType` ``` <ins> Note that this does not move `v` (unlike `transmute`), and may need a call to `mem::forget(v)` in case you want to avoid destructors being called. </ins> "##, E0152: r##"


} } <del> fn type_bound( &self, ty: Ty<'tcx>, visited: &mut SsoHashSet<GenericArg<'tcx>>, ) -> VerifyBound<'tcx> { match *ty.kind() { ty::Param(p) => self.param_bound(p), ty::Projection(data) => self.projection_bound(data, visited), ty::FnDef(_, substs) => { // HACK(eddyb) ignore lifetimes found shallowly in `substs`. // This is inconsistent with `ty::Adt` (including all substs), // but consistent with previous (accidental) behavior. // See https://github.com/rust-lang/rust/issues/70917 // for further background and discussion. let mut bounds = substs .iter() .filter_map(|child| match child.unpack() { GenericArgKind::Type(ty) => Some(self.type_bound(ty, visited)), GenericArgKind::Lifetime(_) => None, GenericArgKind::Const(_) => Some(self.recursive_bound(child, visited)), }) .filter(|bound| { // Remove bounds that must hold, since they are not interesting. !bound.must_hold() }); match (bounds.next(), bounds.next()) { (Some(first), None) => first, (first, second) => VerifyBound::AllBounds( first.into_iter().chain(second).chain(bounds).collect(), ), } } _ => self.recursive_bound(ty.into(), visited), } } </del> fn param_bound(&self, param_ty: ty::ParamTy) -> VerifyBound<'tcx> { debug!("param_bound(param_ty={:?})", param_ty);


<ins> // ignore-emscripten no asm! support #![feature(asm)] fn main() { unsafe { asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)} //~^ ERROR: invalid value for constraint in inline assembly } } </ins>


let span = self.mark_span_with_reason(DesugaringKind::Await, dot_await_span, None); let gen_future_span = self.mark_span_with_reason( DesugaringKind::Await, <del> await_span, </del> <ins> full_span, </ins> self.allow_gen_future.clone(), ); let expr = self.lower_expr_mut(expr);


pub fn output(cmd: &mut Command) -> String { let output = match cmd.stderr(Stdio::inherit()).output() { Ok(status) => status, <del> Err(e) => fail(&format!("failed to execute command: {}", e)), </del> <ins> Err(e) => fail(&format!("failed to execute command: {:?}nerror: {}", cmd, e)), </ins> }; if !output.status.success() { panic!("command did not execute successfully: {:?}n


return; }; <del> let doc = item.doc_value(); if doc.is_empty() { return; } if let Some(item_id) = item.def_id() { check_redundant_explicit_link_for_did(cx, item, item_id, hir_id, &doc); } if let Some(item_id) = item.inline_stmt_id { check_redundant_explicit_link_for_did(cx, item, item_id, hir_id, &doc); </del> <ins> let hunks = prepare_to_doc_link_resolution(&item.attrs.doc_strings); for (item_id, doc) in hunks { if let Some(item_id) = item_id.or(item.def_id()) && !doc.is_empty() { check_redundant_explicit_link_for_did(cx, item, item_id, hir_id, &doc); } </ins> } }


<ins> // check-pass trait Factory { type Product; } impl Factory for () { type Product = (); } trait ProductConsumer<P> { fn consume(self, product: P); } impl<P> ProductConsumer<P> for () { fn consume(self, _: P) {} } fn make_product_consumer<F: Factory>(_: F) -> impl ProductConsumer<F::Product> { () } fn main() { let consumer = make_product_consumer(()); consumer.consume(()); } </ins>


check_expr_with_expectation_and_lvalue_pref( fcx, &**oprnd, expected_inner, lvalue_pref); let mut oprnd_t = fcx.expr_ty(&**oprnd); <del> if !ty::type_is_error(oprnd_t) && !ty::type_is_bot(oprnd_t) { </del> <ins> if !ty::type_is_error(oprnd_t) { </ins> match unop { ast::UnBox => { <del> oprnd_t = ty::mk_box(tcx, oprnd_t) </del> <ins> if !ty::type_is_bot(oprnd_t) { oprnd_t = ty::mk_box(tcx, oprnd_t) } </ins> } ast::UnUniq => { <del> oprnd_t = ty::mk_uniq(tcx, oprnd_t); </del> <ins> if !ty::type_is_bot(oprnd_t) { oprnd_t = ty::mk_uniq(tcx, oprnd_t); } </ins> } ast::UnDeref => { oprnd_t = structurally_resolved_type(fcx, expr.span, oprnd_t);


#![allow(rustc::untranslatable_diagnostic)] use either::Either; <del> use hir::ClosureKind; </del> <ins> use hir::{ClosureKind, Path}; </ins> use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxIndexSet; use rustc_errors::{codes::*, struct_span_code_err, Applicability, Diag, MultiSpan};


<del> error[E0658]: `#[thread_local]` is an experimental feature, and does not currently handle destructors. There is no corresponding `#[task_local]` mapping to the task model (see issue #29594) </del> <ins> error[E0658]: `#[thread_local]` is an experimental feature, and does not currently handle destructors. (see issue #29594) </ins> --> $DIR/feature-gate-thread_local.rs:18:1 | 18 | #[thread_local] //~ ERROR `#[thread_local]` is an experimental feature


/// let num_trailing = unsafe { cttz_nonzero(x) }; /// assert_eq!(num_trailing, 3); /// ``` <del> #[rustc_const_unstable(feature = "const_cttz", issue = "none")] </del> <ins> #[rustc_const_stable(feature = "const_cttz", since = "1.53.0")] </ins> pub fn cttz_nonzero<T: Copy>(x: T) -> T; /// Reverses the bytes in an integer type `T`.


<ins> error[E0668]: malformed inline assembly --> $DIR/issue-62046.rs:8:9 | LL |         asm!("nop" : "+r"("r15")); |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error For more information about this error, try `rustc --explain E0668`. </ins>


- [wasm32-wasip1](platform-support/wasm32-wasip1.md) - [wasm32-wasip1-threads](platform-support/wasm32-wasip1-threads.md) - [wasm32-wasip2](platform-support/wasm32-wasip2.md) <ins> - [wasm32-unknown-unknown](platform-support/wasm32-unknown-unknown.md) </ins> - [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md) - [*-win7-windows-msvc](platform-support/win7-windows-msvc.md) - [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md)


<ins> // check-fail // See issue #91899. If we treat unnormalized args as WF, `Self` can also be a // source of unsoundness. pub trait Yokeable<'a>: 'static { type Output: 'a; } impl<'a, T: 'static + ?Sized> Yokeable<'a> for &'static T { type Output = &'a T; } pub trait ZeroCopyFrom<C: ?Sized>: for<'a> Yokeable<'a> { /// Clone the cart `C` into a [`Yokeable`] struct, which may retain references into `C`. fn zero_copy_from<'b>(cart: &'b C) -> <Self as Yokeable<'b>>::Output; } impl<T> ZeroCopyFrom<[T]> for &'static [T] { fn zero_copy_from<'b>(cart: &'b [T]) -> &'b [T] { //~^ the parameter cart } } fn main() {} </ins>


// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> #![feature(associated_consts)] </ins> use Trait::foo; //~^ ERROR `foo` is not directly importable <ins> use Trait::Assoc; //~^ ERROR `Assoc` is not directly importable use Trait::C; //~^ ERROR `C` is not directly importable </ins> use Foo::new; //~^ ERROR unresolved import `Foo::new`. Not a module `Foo` <ins> use Foo::C2; //~^ ERROR unresolved import `Foo::C2`. Not a module `Foo` </ins> pub trait Trait { fn foo(); <ins> type Assoc; const C: u32; </ins> } struct Foo; impl Foo { fn new() {} <ins> const C2: u32 = 0; </ins> } fn main() {}


<ins> error[E0425]: cannot find value `a_variable_longer_name` in this scope --> $DIR/issue-66968-suggest-sorted-words.rs:3:20 | LL |     println!("{}", a_variable_longer_name); |                    ^^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `a_longer_variable_name` error: aborting due to previous error For more information about this error, try `rustc --explain E0425`. </ins>


let archive = ArchiveRO::open(&path).expect("wanted an rlib"); debug!("reading {}", name); <del> let bc = time(sess.time_passes(), format!("read {}.bc", name), (), |_| archive.read(format!("{}.bc", name))); let bc = bc.expect("missing bytecode in archive!"); </del> <ins> let bc = time(sess.time_passes(), format!("read {}.bc.deflate", name), (), |_| archive.read(format!("{}.bc.deflate", name))); let bc = bc.expect("missing compressed bytecode in archive!"); </ins> let bc = time(sess.time_passes(), format!("inflate {}.bc", name), (), |_| flate::inflate_bytes(bc)); let ptr = bc.as_slice().as_ptr();


} fn main() { <del> unsafe { printf(); } //~ ERROR E0060 </del> <ins> unsafe { printf(); } //~^ ERROR E0060 //~| NOTE expected at least 1 parameter //~| NOTE the following parameter type was expected </ins> }


tcx: TyCtxt<'tcx>, fn_sig: ty::PolyFnSig<'tcx>, ) -> Result<bool, &'tcx LayoutError<'tcx>> { <del> let mut ret_ty = fn_sig.output().skip_binder(); </del> <ins> // this type is only used for layout computation, which does not rely on regions let fn_sig = tcx.instantiate_bound_regions_with_erased(fn_sig); let mut ret_ty = fn_sig.output(); </ins> let layout = tcx.layout_of(ParamEnv::reveal_all().and(ret_ty))?; let size = layout.layout.size().bytes();


<ins> // Regression test for #61315 // // `dyn T:` is lowered to `dyn T: ReEmpty` - check that we don't ICE in NLL for // the unexpected region. // compile-pass trait T {} fn f() where dyn T: {} fn main() {} </ins>


} else if attr.check_name(sym::thread_local) { codegen_fn_attrs.flags |= CodegenFnAttrFlags::THREAD_LOCAL; } else if attr.check_name(sym::track_caller) { <del> if tcx.fn_sig(id).abi() != abi::Abi::Rust { </del> <ins> if tcx.is_closure(id) || tcx.fn_sig(id).abi() != abi::Abi::Rust { </ins> struct_span_err!(tcx.sess, attr.span, E0737, "`#[track_caller]` requires Rust ABI") .emit(); }


pub fn create( ) -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000
   No newline at end of file
pub fn create() -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000
   No newline at end of file


<ins> // check-pass trait MyCmp { fn cmp(&self) {} } impl MyCmp for f32 {} fn main() { // Ensure that `impl<F: FnPtr> Ord for F` is never considered for int and float infer vars. 0.0.cmp(); } </ins>


"URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation-1" }, ENDS_WITH) assert: "section:target" <ins> // Checks that, if a type has two methods with the same name, // and if it has multiple inherent impl blocks, that the numeric // impl block's disambiguator is also acted upon. go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->bool" wait-for: "#search-tabs" assert-count: ("a.result-method", 1) assert-attribute: ("a.result-method", { "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockStruct/method.second_fn" }) click: "a.result-method" wait-for: "details:has(summary > #impl-MultiImplBlockStruct-1) > div section[id='method.second_fn']:target" go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->u32" wait-for: "#search-tabs" assert-count: ("a.result-method", 1) assert-attribute: ("a.result-method", { "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockTrait-for-MultiImplBlockStruct/method.second_fn" }) click: "a.result-method" wait-for: "details:has(summary > #impl-MultiImplBlockTrait-for-MultiImplBlockStruct) > div section[id='method.second_fn-1']:target" </ins>


- checkout: self fetchDepth: 2 <ins> # Spawn a background process to collect CPU usage statistics which we'll upload # at the end of the build. See the comments in the script here for more # information. - bash: python src/ci/cpu-usage-over-time.py &> cpu-usage.csv & displayName: "Collect CPU-usage statistics in the background" </ins> - bash: printenv | sort displayName: Show environment variables


modified: Option<SystemTime>, } <del> #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] </del> <ins> #[derive(Copy, Clone, Eq, Debug)] </ins> pub struct FileType { mode: mode_t, } <ins> impl PartialEq for FileType { fn eq(&self, other: &Self) -> bool { self.masked() == other.masked() } } impl core::hash::Hash for FileType { fn hash<H: core::hash::Hasher>(&self, state: &mut H) { self.masked().hash(state); } } </ins> #[derive(Debug)] pub struct DirBuilder { mode: mode_t,


#[no_mangle] fn __rustc_plugin_registrar(reg: &mut Registry) { reg.lint_store.register_lints(&[&TEST_LINT]); <del> reg.lint_store.register_early_pass(|| box Pass); </del> <ins> reg.lint_store.register_early_pass(|| Box::new(Pass)); </ins> } ```


can_unwind: fn_can_unwind(cx.tcx().sess.panic_strategy(), codegen_fn_attr_flags, conv), }; fn_abi.adjust_for_abi(cx, sig.abi); <ins> debug!("FnAbi::new_internal = {:?}", fn_abi); </ins> fn_abi }


LinkerFlavor::Gcc, vec!["-m64".to_string(), "-arch".to_string(), "x86_64".to_string()], ); <del> base.link_env.extend(super::apple_base::macos_link_env("x86_64")); </del> base.link_env_remove.extend(super::apple_base::macos_link_env_remove()); // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved base.stack_probes = StackProbeType::Call;


ty::ReErased => { flags = flags | TypeFlags::HAS_RE_ERASED; } <del> ty::ReError(_) => {} </del> <ins> ty::ReError(_) => { flags = flags | TypeFlags::HAS_FREE_REGIONS; } </ins> } debug!("type_flags({:?}) = {:?}", self, flags);


#[rustc_main] fn main() -> std::process::ExitCode {{ const TESTS: [test::TestDescAndFn; {nb_tests}] = [{ids}]; <del> let bin_marker = std::ffi::OsStr::new(__doctest_mod::BIN_OPTION); </del> let test_marker = std::ffi::OsStr::new(__doctest_mod::RUN_OPTION); let test_args = &[{test_args}]; <ins> const ENV_BIN: &'static str = "RUSTDOC_DOCTEST_BIN_PATH"; </ins> <del> let mut args = std::env::args_os().skip(1); while let Some(arg) = args.next() {{ if arg == bin_marker {{ let Some(binary) = args.next() else {{ panic!("missing argument after `{{}}`", __doctest_mod::BIN_OPTION); }}; if crate::__doctest_mod::BINARY_PATH.set(binary.into()).is_err() {{ panic!("`{{}}` option was used more than once", bin_marker.to_string_lossy()); }} return std::process::Termination::report(test::test_main(test_args, Vec::from(TESTS), None)); }} else if arg == test_marker {{ let Some(nb_test) = args.next() else {{ panic!("missing argument after `{{}}`", __doctest_mod::RUN_OPTION); }}; if let Some(nb_test) = nb_test.to_str().and_then(|nb| nb.parse::<usize>().ok()) {{ if let Some(test) = TESTS.get(nb_test) {{ if let test::StaticTestFn(f) = test.testfn {{ return std::process::Termination::report(f()); }} </del> <ins> if let Ok(binary) = std::env::var(ENV_BIN) {{ let _ = crate::__doctest_mod::BINARY_PATH.set(binary.into()); unsafe {{ std::env::remove_var(ENV_BIN); }} return std::process::Termination::report(test::test_main(test_args, Vec::from(TESTS), None)); }} else if let Ok(nb_test) = std::env::var(__doctest_mod::RUN_OPTION) {{ if let Ok(nb_test) = nb_test.parse::<usize>() {{ if let Some(test) = TESTS.get(nb_test) {{ if let test::StaticTestFn(f) = test.testfn {{ return std::process::Termination::report(f()); </ins> }} }} <del> panic!("Unexpected value after `{{}}`", __doctest_mod::RUN_OPTION); </del> }} <ins> panic!("Unexpected value for `{{}}`", __doctest_mod::RUN_OPTION); </ins> }} <del> eprintln!("WARNING: No argument provided so doctests will be run in the same process"); </del> <ins> eprintln!("WARNING: No rustdoc doctest environment variable provided so doctests will be run in  the same process"); </ins> std::process::Termination::report(test::test_main(test_args, Vec::from(TESTS), None)) }}", nb_tests = self.nb_tests,


ItemsInTraitsAreNotImportable, }; use crate::Determinacy::{self, *}; <del> use crate::Namespace::*; </del> use crate::{module_to_string, names_to_string, ImportSuggestion}; <ins> use crate::{AmbiguityError, Namespace::*}; </ins> use crate::{AmbiguityKind, BindingKey, ResolutionError, Resolver, Segment}; use crate::{Finalize, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet}; use crate::{NameBinding, NameBindingData, NameBindingKind, PathResult, Used};


<ins> // Copyright 2017 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. // To work around #46855 // compile-flags: -Z mir-opt-level=0 // Regression test for the inhabitedness of unions with uninhabited variants, issue #46845 use std::mem; #[derive(Copy, Clone)] enum Never { } // A single uninhabited variant shouldn't make the whole union uninhabited. union Foo { a: u64, _b: Never } // If all the variants are uninhabited, however, the union should be uninhabited. union Bar { _a: (Never, u64), _b: (u64, Never) } fn main() { assert_eq!(mem::size_of::<Foo>(), 8); assert_eq!(mem::size_of::<Bar>(), 0); let f = [Foo { a: 42 }, Foo { a: 10 }]; println!("{}", unsafe { f[0].a }); assert_eq!(unsafe { f[1].a }, 10); } </ins>


<ins> #![feature(specialization)] #![allow(incomplete_features)] pub trait ReflectDrop { const REFLECT_DROP: bool = false; } impl<T> ReflectDrop for T where T: Clone {} pub trait PinDropInternal { fn is_valid() where Self: ReflectDrop; } struct Bears<T>(T); default impl<T> ReflectDrop for Bears<T> {} impl<T: Sized> PinDropInternal for Bears<T> { fn is_valid() where Self: ReflectDrop, { let _ = [(); 0 - !!(<Bears<T> as ReflectDrop>::REFLECT_DROP) as usize]; //~ ERROR constant expression depends on a generic parameter } } fn main() {} </ins>


<ins> // aux-build:issue-119463-extern.rs extern crate issue_119463_extern; struct S; impl issue_119463_extern::PrivateTrait for S { //~^ ERROR: trait `PrivateTrait` is private const FOO: usize = 1; fn nonexistent() {} //~^ ERROR: method `nonexistent` is not a member of trait } fn main() {} </ins>


cmd.env("MIRI_BE_RUSTC", "target"); // we better remember to *unset* this in the other phases! // Set rustdoc to us as well, so we can run doctests. <ins> if let Some(orig_rustdoc) = env::var_os("RUSTDOC") { cmd.env("MIRI_ORIG_RUSTDOC", orig_rustdoc); } </ins> cmd.env("RUSTDOC", &cargo_miri_path); cmd.env("MIRI_LOCAL_CRATES", local_crates(&metadata));


parse_async_move_order_incorrect = the order of `move` and `async` is incorrect .suggestion = try switching the order <ins> parse_at_dot_dot_in_struct_pattern = `@ ..` is not supported in struct patterns .suggestion = bind to each field separately or, if you don't need them, just remove `{$ident} @` parse_at_in_struct_pattern = Unexpected `@` in struct pattern .note = struct patterns use `field: pattern` syntax to bind to fields .help = consider replacing `new_name @ field_name` with `field_name: new_name` if that is what you intended </ins> parse_attr_after_generic = trailing attribute after generic parameter .label = attributes must go before parameters


use crate::generated_code; <del> use rustc_ast::token::{self, TokenKind}; use rustc_parse::lexer::{self, StringReader}; </del> <ins> use rustc_data_structures::sync::Lrc; use rustc_lexer::{tokenize, TokenKind}; </ins> use rustc_session::Session; use rustc_span::*;


if let Some(positional_arg_to_replace) = position_sp_to_replace { let name = if is_formatting_arg { named_arg_name + "$" } else { named_arg_name }; <ins> let span_to_replace = if let Ok(positional_arg_content) = self.sess().source_map().span_to_snippet(positional_arg_to_replace) && positional_arg_content.starts_with(":") { positional_arg_to_replace.shrink_to_lo() } else { positional_arg_to_replace }; </ins> db.span_suggestion_verbose( <del> positional_arg_to_replace, </del> <ins> span_to_replace, </ins> "use the named argument by name to avoid ambiguity", name, Applicability::MaybeIncorrect,


pub item_name: Ident, pub action_or_ty: String, } <ins> #[derive(Diagnostic)] #[diag(hir_typeck_ctor_is_private, code = "E0603")] pub struct CtorIsPrivate { #[primary_span] pub span: Span, pub def: String, } </ins>


<ins> error: expected `fn`, found `PUT_ANYTHING_YOU_WANT_HERE` --> $DIR/issue-68062-const-extern-fns-dont-need-fn-specifier.rs:5:25 | LL |     const extern "Rust" PUT_ANYTHING_YOU_WANT_HERE bug() -> usize { 1 } |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `fn` error[E0658]: `const extern fn` definitions are unstable --> $DIR/issue-68062-const-extern-fns-dont-need-fn-specifier.rs:5:5 | LL |     const extern "Rust" PUT_ANYTHING_YOU_WANT_HERE bug() -> usize { 1 } |     ^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/64926 = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. </ins>


trace!("Running RemoveUnneededDrops on {:?}", body.source); let did = body.source.def_id(); <del> let param_env = tcx.param_env(did); </del> <ins> let param_env = tcx.param_env_reveal_all_normalized(did); </ins> let mut should_simplify = false; let (basic_blocks, local_decls) = body.basic_blocks_and_local_decls_mut();


<ins> // Copyright 2012-2014 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. // Regression test for #27042. Test that a loop's label is included in its span. fn main() { let _: i32 = 'a: //~ ERROR mismatched types loop { break }; let _: i32 = 'b: //~ ERROR mismatched types while true { break }; let _: i32 = 'c: //~ ERROR mismatched types for _ in None { break }; let _: i32 = 'd: //~ ERROR mismatched types while let Some(_) = None { break }; } </ins>


<ins> warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/double-opaque-parent-predicates.rs:3:12 | LL | #![feature(generic_const_exprs)] |            ^^^^^^^^^^^^^^^^^^^ | = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted </ins>


LL |     #[expect(clippy::overly_complex_bool_expr)] |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <del> error: aborting due to 6 previous errors </del> <ins> error: aborting due to 7 previous errors </ins>


cx: &mut DocContext<'_>, cfg: Option<Arc<Cfg>>, ) -> Item { <del> trace!("name={:?}, def_id={:?}", name, def_id); </del> <ins> trace!("name={:?}, def_id={:?} cfg={:?}", name, def_id, cfg); </ins> // Primitives and Keywords are written in the source code as private modules. // The modules need to be private so that nobody actually uses them, but the


} fn check_expr(&mut self, cx: &Context, e: &ast::Expr) { <ins> // if the expression was produced by a macro expansion, if e.span.expn_info.is_some() { return } </ins> let id = match e.node { ast::ExprPath(..) | ast::ExprStruct(..) => { match cx.tcx.def_map.borrow().find(&e.id) {


<del> // check-pass // edition:2021 // compile-flags: -Zunstable-options fn main() { let _: u16 = 123i32.try_into().unwrap(); } </del>


let byte_pos = self.to_span_index(end); let start = InnerOffset(byte_pos.0 + 1); let field = self.argument(start); <del> // We can only parse `foo.bar` field access, any deeper nesting, // or another type of expression, like method calls, are not supported </del> <ins> // We can only parse simple `foo.bar` field access or `foo.0` tuple index access, any // deeper nesting, or another type of expression, like method calls, are not supported </ins> if !self.consume('}') { return; } if let ArgumentNamed(_) = arg.position { <del> if let ArgumentNamed(_) = field.position { self.errors.insert( 0, ParseError { description: "field access isn't supported".to_string(), note: None, label: "not supported".to_string(), span: InnerSpan::new(arg.position_span.start, field.position_span.end), secondary_label: None, suggestion: Suggestion::UsePositional, }, ); } </del> <ins> match field.position { ArgumentNamed(_) => { self.errors.insert( 0, ParseError { description: "field access isn't supported".to_string(), note: None, label: "not supported".to_string(), span: InnerSpan::new( arg.position_span.start, field.position_span.end, ), secondary_label: None, suggestion: Suggestion::UsePositional, }, ); } ArgumentIs(_) => { self.errors.insert( 0, ParseError { description: "tuple index access isn't supported".to_string(), note: None, label: "not supported".to_string(), span: InnerSpan::new( arg.position_span.start, field.position_span.end, ), secondary_label: None, suggestion: Suggestion::UsePositional, }, ); } _ => {} }; </ins> } } }


// Error codes that don't yet have a UI test. This list will eventually be removed. const IGNORE_UI_TEST_CHECK: &[&str] = &[ <del> "E0313", "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789", </del> <ins> "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789", </ins> ]; macro_rules! verbose_print {


// Most of these settings are copied from the arm_unknown_linux_gnueabihf // target. <del> base.features = "+strict-align,+v6,+vfp2".to_string(); </del> <ins> base.features = "+strict-align,+v6,+vfp2,-d32".to_string(); </ins> base.max_atomic_width = Some(64); Ok(Target { // It's important we use "gnueabihf" and not "musleabihf" here. LLVM


<ins> // test for https://github.com/rust-lang/rust/issues/86940 // run-rustfix // edition:2018 // check-pass #![warn(rust_2021_prelude_collisions)] #![allow(dead_code)] #![allow(unused_imports)] struct Generic<T, U>(T, U); trait MyFromIter { fn from_iter(_: i32) -> Self; } impl MyFromIter for Generic<i32, i32> { fn from_iter(x: i32) -> Self { Self(x, x) } } impl std::iter::FromIterator<i32> for Generic<i32, i32> { fn from_iter<T: IntoIterator<Item = i32>>(_: T) -> Self { todo!() } } fn main() { <Generic<_, _> as MyFromIter>::from_iter(1); //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021 //~| this is accepted in the current edition (Rust 2018) <Generic::<i32, i32> as MyFromIter>::from_iter(1); //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021 //~| this is accepted in the current edition (Rust 2018) <Generic::<_, _> as MyFromIter>::from_iter(1); //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021 //~| this is accepted in the current edition (Rust 2018) } </ins>


matching,' which `match` is an implementation of. So what's the big advantage here? Well, there are a few. First of all, `match` <del> does 'exhaustiveness checking.' Do you see that last arm, the one with the </del> <ins> enforces 'exhaustiveness checking.' Do you see that last arm, the one with the </ins> underscore (`_`)? If we remove that arm, Rust will give us an error: ```{ignore,notrust}


<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. fn foo(_: Self) { //~^ ERROR use of `Self` outside of an impl or trait } fn main() {} </ins>


printer.s.eof() } <ins> // This makes comma-separated lists look slightly nicer, // and also addresses a specific regression described in issue #63896. fn tt_prepend_space(tt: &TokenTree) -> bool { match tt { TokenTree::Token(token) => match token.kind { token::Comma => false, _ => true, } _ => true, } } </ins> fn binop_to_string(op: BinOpToken) -> &'static str { match op { token::Plus     => "+",