<ins> error: expected one of `,` or `:`, found `(` --> $DIR/issue-66357-unexpected-unreachable.rs:12:13 | LL | fn f() { |[](* } |             ^ expected one of `,` or `:` error: expected one of `)`, `-`, `_`, `box`, `mut`, `ref`, `|`, identifier, or path, found `*` --> $DIR/issue-66357-unexpected-unreachable.rs:12:14 | LL | fn f() { |[](* } |             -^ help: `)` may belong here |             | |             unclosed delimiter error: aborting due to 2 previous errors </ins>


} /* For the last child of a div, the margin will be taken care of by the margin-top of the next item. */ <del> p:last-child { </del> <ins> p:last-child, .docblock > .warning:last-child { </ins> margin: 0; }


find_best_match_for_name(input.iter(), "aaaa", Some(4)), Some(Symbol::intern("AAAA")) ); <ins> let input = vec![Symbol::intern("a_longer_variable_name")]; assert_eq!( find_best_match_for_name(input.iter(), "a_variable_longer_name", None), Some(Symbol::intern("a_longer_variable_name")) ); </ins> }) }


name_key(lhs).cmp(&name_key(rhs)) } <del> indices.sort_by(|&i1, &i2| cmp(&items[i1], &items[i2], i1, i2)); </del> <ins> if cx.shared.sort_modules_alphabetically { indices.sort_by(|&i1, &i2| cmp(&items[i1], &items[i2], i1, i2)); } </ins> // This call is to remove reexport duplicates in cases such as: // // ```


<del> Subproject commit 2adc17a5442614dbe34626fdd9b32de7c07b8086 </del> <ins> Subproject commit 1d5d0e8b0e3134dc781adb98057e38ffdf200df2 </ins>


None => continue, }; <del> // Filter away "empty import canaries" and ambiguous imports. </del> <ins> // Filter away ambiguous and gensymed imports. Gensymed imports // (e.g. implicitly injected `std`) cannot be properly encoded in metadata, // so they can cause name conflict errors downstream. </ins> let is_good_import = binding.is_import() && !binding.is_ambiguity() && <del> binding.vis != ty::Visibility::Invisible; </del> <ins> !(ident.name.is_gensymed() && ident.name != "_"); </ins> if is_good_import || binding.is_macro_def() { let def = binding.def(); if def != Def::Err {


})), }; <del> f(RefMutL(put_back_on_drop.value.as_mut().unwrap())) </del> <ins> f(put_back_on_drop.value.as_mut().unwrap()) </ins> } /// Sets the value in `self` to `value` while running `f`.


<ins> // When build the suggesttion take in consideration the `:?` // https://github.com/rust-lang/rust/issues/100648 #![deny(warnings)] fn main () { println!("hello {:?}", world = "world"); //~^ ERROR named argument `world` is not used by name //~| HELP use the named argument by name to avoid ambiguity //~| SUGGESTION world } </ins>


///     Ok(()) /// } /// ``` <del> #[unstable(feature = "rw_exact_all_at", issue = "51984")] </del> <ins> #[stable(feature = "rw_exact_all_at", since = "1.33.0")] </ins> fn read_exact_at(&self, mut buf: &mut [u8], mut offset: u64) -> io::Result<()> { while !buf.is_empty() { match self.read_at(buf, offset) {


//! call `next()` on your iterator, until it reaches `None`. Let's go over that //! next. //! <ins> //! Also note that `Iterator` provides a default implementation of methods such as `nth` and `fold` //! which call `next` internally. However, it is also possible to write a custom implementation of //! methods like `nth` and `fold` if an iterator can compute them more efficiently without calling //! `next`. //! </ins> //! # for Loops and IntoIterator //! //! Rust's `for` loop syntax is actually sugar for iterators. Here's a basic


let prefix = default_path(&builder.config.prefix, "/usr/local"); let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc")); <ins> // Sanity check for the user write access on prefix and sysconfdir assert!( is_dir_writable_for_user(&prefix), "User doesn't have write access on `install.prefix` path in the `config.toml`.", ); assert!( is_dir_writable_for_user(&sysconfdir), "User doesn't have write access on `install.sysconfdir` path in `config.toml`." ); </ins> let datadir = prefix.join(default_path(&builder.config.datadir, "share")); let docdir = prefix.join(default_path(&builder.config.docdir, "share/doc/rust")); let mandir = prefix.join(default_path(&builder.config.mandir, "share/man"));


#[unstable(feature = "context_ext", issue = "123392")] #[rustc_const_unstable(feature = "const_waker", issue = "102012")] pub const fn ext(&mut self) -> &mut dyn Any { <del> match &mut self.ext { </del> <ins> // FIXME: this field makes Context extra-weird about unwind safety // can we justify AssertUnwindSafe if we stabilize this? do we care? match &mut *self.ext { </ins> ExtData::Some(data) => *data, ExtData::None(unit) => unit, }


<del> // ---------------------------------------------------------------------------- // // Inno Setup Ver:	5.4.2 // Script Version:	1.4.1 // Author:			Jared Breland <jbreland@legroom.net> // Homepage:		http://www.legroom.net/software // License:			GNU Lesser General Public License (LGPL), version 3 //						http://www.gnu.org/licenses/lgpl.html // // Script Function: //	Allow modification of environmental path directly from Inno Setup installers // // Instructions: //	Copy modpath.iss to the same directory as your setup script // //	Add this statement to your [Setup] section //		ChangesEnvironment=true // //	Add this statement to your [Tasks] section //	You can change the Description or Flags //	You can change the Name, but it must match the ModPathName setting below //		Name: modifypath; Description: &Add application directory to your environmental path; Flags: unchecked // //	Add the following to the end of your [Code] section //	ModPathName defines the name of the task defined above //	ModPathType defines whether the 'user' or 'system' path will be modified; //		this will default to user if anything other than system is set //	setArrayLength must specify the total number of dirs to be added //	Result[0] contains first directory, Result[1] contains second, etc. //		const //			ModPathName = 'modifypath'; //			ModPathType = 'user'; // //		function ModPathDir(): TArrayOfString; //		begin //			setArrayLength(Result, 1); //			Result[0] := ExpandConstant('{app}'); //		end; //		#include "modpath.iss" // ---------------------------------------------------------------------------- procedure ModPath(); var oldpath:	String; newpath:	String; updatepath:	Boolean; pathArr:	TArrayOfString; aExecFile:	String; aExecArr:	TArrayOfString; i, d:		Integer; pathdir:	TArrayOfString; regroot:	Integer; regpath:	String; begin // Get constants from main script and adjust behavior accordingly // ModPathType MUST be 'system' or 'user'; force 'user' if invalid if ModPathType = 'system' then begin regroot := HKEY_LOCAL_MACHINE; regpath := 'SYSTEMCurrentControlSetControlSession ManagerEnvironment'; end else begin regroot := HKEY_CURRENT_USER; regpath := 'Environment'; end; // Get array of new directories and act on each individually pathdir := ModPathDir(); for d := 0 to GetArrayLength(pathdir)-1 do begin updatepath := true; // Modify WinNT path if UsingWinNT() = true then begin // Get current path, split into an array RegQueryStringValue(regroot, regpath, 'Path', oldpath); oldpath := oldpath + ';'; i := 0; while (Pos(';', oldpath) > 0) do begin SetArrayLength(pathArr, i+1); pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1); oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath)); i := i + 1; // Check if current directory matches app dir if pathdir[d] = pathArr[i-1] then begin // if uninstalling, remove dir from path if IsUninstaller() = true then begin continue; // if installing, flag that dir already exists in path end else begin updatepath := false; end; end; // Add current directory to new path if i = 1 then begin newpath := pathArr[i-1]; end else begin newpath := newpath + ';' + pathArr[i-1]; end; end; // Append app dir to path if not already included if (IsUninstaller() = false) AND (updatepath = true) then newpath := newpath + ';' + pathdir[d]; // Write new path RegWriteStringValue(regroot, regpath, 'Path', newpath); // Modify Win9x path end else begin // Convert to shortened dirname pathdir[d] := GetShortName(pathdir[d]); // If autoexec.bat exists, check if app dir already exists in path aExecFile := 'C:AUTOEXEC.BAT'; if FileExists(aExecFile) then begin LoadStringsFromFile(aExecFile, aExecArr); for i := 0 to GetArrayLength(aExecArr)-1 do begin if IsUninstaller() = false then begin // If app dir already exists while installing, skip add if (Pos(pathdir[d], aExecArr[i]) > 0) then updatepath := false; break; end else begin // If app dir exists and = what we originally set, then delete at uninstall if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then aExecArr[i] := ''; end; end; end; // If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path if (IsUninstaller() = false) AND (updatepath = true) then begin SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True); // If uninstalling, write the full autoexec out end else begin SaveStringsToFile(aExecFile, aExecArr, False); end; end; end; end; // Split a string into an array using passed delimiter procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String); var i: Integer; begin i := 0; repeat SetArrayLength(Dest, i+1); if Pos(Separator,Text) > 0 then	begin Dest[i] := Copy(Text, 1, Pos(Separator, Text)-1); Text := Copy(Text, Pos(Separator,Text) + Length(Separator), Length(Text)); i := i + 1; end else begin Dest[i] := Text; Text := ''; end; until Length(Text)=0; end; procedure ModPathCurStepChanged(CurStep: TSetupStep); var taskname:	String; begin taskname := ModPathName; if CurStep = ssPostInstall then if IsTaskSelected(taskname) then ModPath(); end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); var aSelectedTasks:	TArrayOfString; i:				Integer; taskname:		String; regpath:		String; regstring:		String; appid:			String; begin // only run during actual uninstall if CurUninstallStep = usUninstall then begin // get list of selected tasks saved in registry at install time appid := '{#emit SetupSetting("AppId")}'; if appid = '' then appid := '{#emit SetupSetting("AppName")}'; regpath := ExpandConstant('SoftwareMicrosoftWindowsCurrentVersionUninstall'+appid+'_is1'); RegQueryStringValue(HKLM, regpath, 'Inno Setup: Selected Tasks', regstring); if regstring = '' then RegQueryStringValue(HKCU, regpath, 'Inno Setup: Selected Tasks', regstring); // check each task; if matches modpath taskname, trigger patch removal if regstring <> '' then begin taskname := ModPathName; Explode(aSelectedTasks, regstring, ','); if GetArrayLength(aSelectedTasks) > 0 then begin for i := 0 to GetArrayLength(aSelectedTasks)-1 do begin if comparetext(aSelectedTasks[i], taskname) = 0 then ModPath(); end; end; end; end; end; function NeedRestart(): Boolean; var taskname:	String; begin taskname := ModPathName; if IsTaskSelected(taskname) and not UsingWinNT() then begin Result := True; end else begin Result := False; end; end; </del>


config.out = absolute(&config.out).expect("can't make empty path absolute"); } <ins> if cargo_clippy.is_some() && rustc.is_none() { println!( "WARNING: Using `build.cargo-clippy` without `build.rustc` usually fails due to toolchain conflict." ); } config.initial_cargo_clippy = cargo_clippy; </ins> config.initial_rustc = if let Some(rustc) = rustc { if !flags.skip_stage0_validation { config.check_stage0_version(&rustc, "rustc");


[platform-support]: https://forge.rust-lang.org/platform-support.html <del> ## Installing on Linux or Mac </del> <ins> ## Installing Rust </ins> <del> If we're on Linux or a Mac, all we need to do is open a terminal and type this: </del> <ins> All you need to do on Unix systems like Linux and macOS is open a terminal and type this: </ins> ```bash <del> $ curl -sSf https://static.rust-lang.org/rustup.sh | sh </del> <ins> $ curl https://sh.rustup.rs -sSf | sh </ins> ``` <del> This will download a script, and start the installation. If it all goes well, you’ll see this appear: </del> <ins> It will download a script, and start the installation. If everything goes well, you’ll see this appear: </ins> ```text <del> Rust is ready to roll. </del> <ins> Rust is installed now. Great! </ins> ``` <del> From here, press `y` for ‘yes’, and then follow the rest of the prompts. </del> <ins> Installing on Windows is nearly as easy: download and run [rustup-init.exe]. It will start the installation in a console and present the above message on success. </ins> <del> ## Installing on Windows </del> <ins> For other installation options and information, visit the [install] page of the Rust website. </ins> <del> If you're on Windows, please download the appropriate [installer][install-page]. [install-page]: https://www.rust-lang.org/install.html </del> <ins> [rustup-init.exe]: https://win.rustup.rs [install]: https://www.rust-lang.org/install.html </ins> ## Uninstalling <del> Uninstalling Rust is as easy as installing it. On Linux or Mac, run the uninstall script: </del> <ins> Uninstalling Rust is as easy as installing it: </ins> ```bash <del> $ sudo /usr/local/lib/rustlib/uninstall.sh </del> <ins> $ rustup self uninstall </ins> ``` <del> If we used the Windows installer, we can re-run the `.msi` and it will give us an uninstall option. </del> ## Troubleshooting If we've got Rust installed, we can open up a shell, and type this:


} } <ins> #[cfg(target_arch = "x86_64")] fn f128() { const_assert!((1f128).to_bits(), 0x3fff0000000000000000000000000000); const_assert!(u128::from_be_bytes(1f128.to_be_bytes()), 0x3fff0000000000000000000000000000); const_assert!((12.5f128).to_bits(), 0x40029000000000000000000000000000); const_assert!(u128::from_le_bytes(12.5f128.to_le_bytes()), 0x40029000000000000000000000000000); const_assert!((1337f128).to_bits(), 0x40094e40000000000000000000000000); const_assert!(u128::from_ne_bytes(1337f128.to_ne_bytes()), 0x40094e40000000000000000000000000); const_assert!((-14.25f128).to_bits(), 0xc002c800000000000000000000000000); const_assert!(f128::from_bits(0x3fff0000000000000000000000000000), 1.0); const_assert!(f128::from_be_bytes(0x3fff0000000000000000000000000000u128.to_be_bytes()), 1.0); const_assert!(f128::from_bits(0x40029000000000000000000000000000), 12.5); const_assert!(f128::from_le_bytes(0x40029000000000000000000000000000u128.to_le_bytes()), 12.5); const_assert!(f128::from_bits(0x40094e40000000000000000000000000), 1337.0); assert_eq!(f128::from_ne_bytes(0x40094e40000000000000000000000000u128.to_ne_bytes()), 1337.0); const_assert!(f128::from_bits(0xc002c800000000000000000000000000), -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: u128 = f128::NAN.to_bits() | 0x0000_AAAA_AAAA_AAAA_AAAA_AAAA_AAAA_AAAA; const SIGNALING_NAN: u128 = f128::NAN.to_bits() ^ 0x0000_5555_5555_5555_5555_5555_5555_5555; const_assert!(f128::from_bits(QUIET_NAN).is_nan()); const_assert!(f128::from_bits(SIGNALING_NAN).is_nan()); const_assert!(f128::from_bits(QUIET_NAN).to_bits(), QUIET_NAN); if !has_broken_floats() { const_assert!(f128::from_bits(SIGNALING_NAN).to_bits(), SIGNALING_NAN); } } </ins> fn main() { <ins> #[cfg(target_arch = "x86_64")] { f16(); f128(); } </ins> f32(); f64(); }


return Some(*c); } <del> let mut dist = dist.unwrap_or_else(|| cmp::max(lookup.len(), 3) / 3); </del> <ins> // `fn edit_distance()` use `chars()` to calculate edit distance, so we must // also use `chars()` (and not `str::len()`) to calculate length here. let lookup_len = lookup.chars().count(); let mut dist = dist.unwrap_or_else(|| cmp::max(lookup_len, 3) / 3); </ins> let mut best = None; // store the candidates with the same distance, only for `use_substring_score` current. let mut next_candidates = vec![];


fn f(a: u16, b: &str) {} fn main() { <del> f(0); //~ ERROR E0061 </del> <ins> f(0); //~^ ERROR E0061 //~| NOTE expected 2 parameters //~| NOTE the following parameter types were expected </ins> }


run: src/ci/scripts/install-wix.sh <<: *step <del> - name: install InnoSetup run: src/ci/scripts/install-innosetup.sh <<: *step </del> - name: ensure the build happens on a partition with enough space run: src/ci/scripts/symlink-build-dir.sh <<: *step


<ins> // Checks that naked functions are never inlined. // compile-flags: -O -Zmir-opt-level=2 // ignore-wasm32 #![crate_type = "lib"] #![feature(asm)] #![feature(naked_functions)] #[inline(always)] #[naked] #[no_mangle] pub unsafe extern "C" fn f() { // Check that f has naked and noinline attributes. // // CHECK:       define void @f() unnamed_addr [[ATTR:#[0-9]+]] // CHECK-NEXT:  start: // CHECK-NEXT:    call void asm asm!("", options(noreturn)); } #[no_mangle] pub unsafe fn g() { // Check that call to f is not inlined. // // CHECK-LABEL: define void @g() // CHECK-NEXT:  start: // CHECK-NEXT:    call void @f() f(); } // CHECK: attributes [[ATTR]] = { naked noinline{{.*}} } </ins>


// through and constrain Pi. let mut subcomponents = smallvec![]; let mut subvisited = SsoHashSet::new(); <del> compute_components_recursive(tcx, ty.into(), &mut subcomponents, &mut subvisited); </del> <ins> compute_alias_components_recursive(tcx, ty, &mut subcomponents, &mut subvisited); </ins> out.push(Component::EscapingAlias(subcomponents.into_iter().collect())); } }


pub fn report_error_if_loans_conflict(&self, old_loan: &Loan<'tcx>, <del> new_loan: &Loan<'tcx>) { </del> <ins> new_loan: &Loan<'tcx>) -> bool { </ins> //! Checks whether `old_loan` and `new_loan` can safely be issued //! simultaneously.


fn method(&self) -> impl Trait<Type = impl Sized + '_>; } <ins> trait Trait2 { type Type; fn method(&self) -> impl Trait2<Type = impl Trait2<Type = impl Sized + '_> + '_>; } </ins> fn main() {}


<ins> // Traits in scope are collected for doc links in field attributes. // check-pass // aux-build: assoc-field-dep.rs extern crate assoc_field_dep; pub use assoc_field_dep::*; #[derive(Clone)] pub struct Struct; pub mod mod1 { pub struct Fields { /// [crate::Struct::clone] pub field: u8, } } pub mod mod2 { pub enum Fields { V { /// [crate::Struct::clone] field: u8, }, } } </ins>


} } <ins> /// A call to a `panic()` lang item where the first argument is _not_ a `&str`. #[derive(Debug)] pub struct PanicNonStr; impl NonConstOp for PanicNonStr { fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> { ccx.tcx.sess.struct_span_err( span, "argument to `panic!()` in a const context must have type `&str`", ) } } </ins> #[derive(Debug)] pub struct RawPtrComparison; impl NonConstOp for RawPtrComparison {


/// /// In other words, it zips two iterators together, into a single one. /// <del> /// When either iterator returns [`None`], all further calls to [`next`] /// will return [`None`]. </del> <ins> /// If either iterator returns [`None`], [`next`] will return [`None`]. </ins> /// /// # Examples ///


<ins> trait T<'x> { type V; } impl<'g> T<'g> for u32 { type V = u16; } fn main() { (&|_|()) as &dyn for<'x> Fn(<u32 as T<'x>>::V); //~^ ERROR: type mismatch in closure arguments //~| ERROR: type mismatch resolving } </ins>


ObligationCauseCode::VariableType(hir_id) => { let parent_node = self.tcx.hir().get_parent_node(hir_id); match self.tcx.hir().find(parent_node) { <ins> Some(Node::Local(hir::Local { ty: Some(ty), .. })) => { err.span_suggestion_verbose( ty.span.shrink_to_lo(), "consider borrowing here", "&", Applicability::MachineApplicable, ); err.note("all local variables must have a statically known size"); } </ins> Some(Node::Local(hir::Local { init: Some(hir::Expr { kind: hir::ExprKind::Index(_, _), span, .. }), ..


<ins> error[E0425]: cannot find value `读文` in this scope --> $DIR/non_ascii_ident.rs:3:13 | LL |     let _ = 读文; |             ^^^^ not found in this scope error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. </ins>


plugin_registrar, plugins, pointer, <ins> pointer_trait, pointer_trait_fmt, </ins> poll, position, post_dash_lto: "post-lto",


<del> // compile-flags: --error-format pretty-json -Zunstable-options // build-pass (FIXME(62277): could be check-pass?) </del> <ins> // compile-flags: --error-format json -Zunstable-options </ins> // run-rustfix // The output for humans should just highlight the whole span without showing


|| abi == SpecAbi::RustIntrinsic || abi == SpecAbi::PlatformIntrinsic { <del> let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| { </del> <ins> let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| { </ins> if arg.is_ignore() { return; }


<ins> error[E0080]: it is undefined behavior to use this value --> $DIR/issue-51559.rs:4:1 | LL | pub const FOO: usize = unsafe { BAR as usize }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. </ins>


ast_passes_bound_in_context = bounds on `type`s in {$ctx} have no effect <del> ast_passes_const_and_async = functions cannot be both `const` and `async` .const = `const` because of this .async = `async` because of this .label = {""} </del> ast_passes_const_and_c_variadic = functions cannot be both `const` and C-variadic .const = `const` because of this .variadic = C-variadic because of this <ins> ast_passes_const_and_coroutine = functions cannot be both `const` and `{$coroutine_kind}` .const = `const` because of this .coroutine = `{$coroutine_kind}` because of this .label = {""} </ins> ast_passes_const_bound_trait_object = const trait bounds are not allowed in trait object types ast_passes_const_without_body =


<ins> error[E0425]: cannot find function `foo` in module `to_reuse` --> $DIR/ice-issue-124342.rs:7:21 | LL |     reuse to_reuse::foo { foo } |                     ^^^ not found in `to_reuse` error[E0425]: cannot find value `foo` in this scope --> $DIR/ice-issue-124342.rs:7:27 | LL |     reuse to_reuse::foo { foo } |                           ^^^ | help: you might have meant to refer to the associated function | LL |     reuse to_reuse::foo { Self::foo } |                           ++++++ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>


} let tcx = self.tcx(); let mut pred = cache_fresh_trait_pred.skip_binder(); <del> param_env = param_env.with_constness(pred.constness.and(param_env.constness())); </del> <ins> pred.remap_constness(tcx, &mut param_env); </ins> if self.can_use_global_caches(param_env) { if let Some(res) = tcx.selection_cache.get(&param_env.and(pred), tcx) {


} } <del> pub fn is_async(self) -> bool { matches!(self, CoroutineKind::Async { .. }) } pub fn is_gen(self) -> bool { matches!(self, CoroutineKind::Gen { .. }) </del> <ins> pub fn as_str(self) -> &'static str { match self { CoroutineKind::Async { .. } => "async", CoroutineKind::Gen { .. } => "gen", CoroutineKind::AsyncGen { .. } => "async gen", } </ins> } pub fn closure_id(self) -> NodeId {


use rustc_middle::ty; <ins> // Please change the public `use` directives cautiously, as they might be used by external tools. // See issue #120130. </ins> pub use self::drop_flag_effects::{ drop_flag_effects_for_function_entry, drop_flag_effects_for_location, move_path_children_matching, on_all_children_bits, on_lookup_result_bits, }; pub use self::framework::{ <del> fmt, lattice, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor, </del> <ins> fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine, Forward, GenKill, GenKillAnalysis, JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects, </ins> }; <del> use self::framework::{Backward, SwitchIntEdgeEffects}; </del> use self::move_paths::MoveData; pub mod debuginfo;


let _ = &packed2.y; // ok, has align 2 in packed(2) struct let _ = &packed2.z; // ok, has align 1 } <ins> unsafe { struct U16(u16); impl Drop for U16 { fn drop(&mut self) { println!("{:p}", self); } } struct HasDrop; impl Drop for HasDrop { fn drop(&mut self) {} } #[allow(unused)] struct Wrapper { a: U16, b: HasDrop, } #[allow(unused)] #[repr(packed(2))] struct Wrapper2 { a: U16, b: HasDrop, } // An outer struct with more restrictive packing than the inner struct -- make sure we // notice that! #[repr(packed)] struct Misalign<T>(u8, T); let m1 = Misalign( 0, Wrapper { a: U16(10), b: HasDrop, }, ); let _ref = &m1.1.a; //~ ERROR reference to packed field //~^ previously accepted let m2 = Misalign( 0, Wrapper2 { a: U16(10), b: HasDrop, }, ); let _ref = &m2.1.a; //~ ERROR reference to packed field //~^ previously accepted } </ins> }


#[start] fn main(_argc: isize, _argv: *const *const u8) -> isize { <del> let _x = box 1; </del> <ins> let _x = Box::new(1); </ins> 0 } #[lang = "eh_personality"] extern fn rust_eh_personality() {} <del> #[lang = "panic_impl"] extern fn rust_begin_panic(info: &PanicInfo) -> ! { unsafe { intrinsics::abort() } } </del> <ins> #[lang = "panic_impl"] extern fn rust_begin_panic(_info: &PanicInfo) -> ! { intrinsics::abort() } </ins> #[no_mangle] pub extern fn rust_eh_register_frames () {} #[no_mangle] pub extern fn rust_eh_unregister_frames () {} ```


use _Unwind_VRS_DataRepresentation::*; pub const UNWIND_POINTER_REG: c_int = 12; <ins> pub const UNWIND_SP_REG: c_int = 13; </ins> pub const UNWIND_IP_REG: c_int = 15; #[cfg_attr(all(feature = "llvm-libunwind",


TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, }; use rustc_session::config::TraitSolver; <del> use rustc_span::def_id::{DefId, CRATE_DEF_ID}; </del> <ins> use rustc_span::{ def_id::{DefId, CRATE_DEF_ID}, DUMMY_SP, }; </ins> use rustc_trait_selection::traits; fn sized_constraint_for_ty<'tcx>(


<ins> - // MIR for `bitwise_not` before JumpThreading + // MIR for `bitwise_not` after JumpThreading fn bitwise_not() -> i32 { let mut _0: i32; let mut _1: i32; let mut _2: bool; let mut _3: i32; let mut _4: i32; scope 1 { debug a => _1; } bb0: { StorageLive(_1); _1 = const 0_i32; _1 = const 1_i32; StorageLive(_2); StorageLive(_3); StorageLive(_4); _4 = copy _1; _3 = Not(move _4); StorageDead(_4); _2 = Eq(move _3, const 0_i32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } bb1: { StorageDead(_3); _0 = const 1_i32; goto -> bb3; } bb2: { StorageDead(_3); _0 = const 0_i32; goto -> bb3; } bb3: { StorageDead(_2); StorageDead(_1); return; } } </ins>


} else { let args: Vec<_> = args .into_iter() <del> .map(|arg| unpack!(block = this.as_local_operand(block, arg))) </del> <ins> .map(|arg| unpack!(block = this.as_local_call_operand(block, arg))) </ins> .collect(); let success = this.cfg.start_new_block();


check_dispatch $1 beta nomicon src/doc/nomicon check_dispatch $1 beta reference src/doc/reference check_dispatch $1 beta rust-by-example src/doc/rust-by-example <del> # Temporarily disabled until # https://github.com/rust-lang/rust/issues/60459 is fixed. # check_dispatch $1 beta edition-guide src/doc/edition-guide </del> <ins> check_dispatch $1 beta edition-guide src/doc/edition-guide </ins> check_dispatch $1 beta rls src/tools/rls check_dispatch $1 beta rustfmt src/tools/rustfmt check_dispatch $1 beta clippy-driver src/tools/clippy


} #[derive(Subdiagnostic)] <del> #[multipart_suggestion(passes_change_fields_to_be_of_unit_type, applicability = "has-placeholders")] pub struct ChangeFieldsToBeOfUnitType { pub num: usize, #[suggestion_part(code = "()")] pub spans: Vec<Span>, </del> <ins> pub enum ChangeFields { #[multipart_suggestion( passes_change_fields_to_be_of_unit_type, applicability = "has-placeholders" )] ChangeToUnitTypeOrRemove { num: usize, #[suggestion_part(code = "()")] spans: Vec<Span>, }, #[help(passes_remove_fields)] Remove { num: usize }, </ins> } #[derive(Diagnostic)]


LL |         #[expect(invalid_nan_comparisons)] |                  ^^^^^^^^^^^^^^^^^^^^^^^ <del> warning: 2 warnings emitted </del> <ins> warning: this lint expectation is unfulfilled --> $DIR/expect_tool_lint_rfc_2383.rs:38:18 | LL |         #[expect(invalid_nan_comparisons)] |                  ^^^^^^^^^^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` warning: 3 warnings emitted </ins>


let projections_b = &place_b.projections; let same_initial_projections = <del> iter::zip(projections_a, projections_b).all(|(proj_a, proj_b)| proj_a == proj_b); </del> <ins> iter::zip(projections_a, projections_b).all(|(proj_a, proj_b)| proj_a.kind == proj_b.kind); </ins> if same_initial_projections { <ins> use std::cmp::Ordering; </ins> // First min(n, m) projections are the same // Select Ancestor/Descendant <del> if projections_b.len() >= projections_a.len() { PlaceAncestryRelation::Ancestor } else { PlaceAncestryRelation::Descendant </del> <ins> match projections_b.len().cmp(&projections_a.len()) { Ordering::Greater => PlaceAncestryRelation::Ancestor, Ordering::Equal => PlaceAncestryRelation::SamePlace, Ordering::Less => PlaceAncestryRelation::Descendant, </ins> } } else { PlaceAncestryRelation::Divergent


// types are fine though. ty::ConstKind::Value(_) => c.ty().is_primitive(), ty::ConstKind::Unevaluated(..) | ty::ConstKind::Expr(..) => false, <ins> // This can happen if evaluation of a constant failed. The result does not matter // much since compilation is doomed. ty::ConstKind::Error(..) => false, </ins> // Should not appear in runtime MIR. ty::ConstKind::Infer(..) | ty::ConstKind::Bound(..) <del> | ty::ConstKind::Placeholder(..) | ty::ConstKind::Error(..) => bug!(), </del> <ins> | ty::ConstKind::Placeholder(..) => bug!(), </ins> }, Const::Unevaluated(..) => false, // If the same slice appears twice in the MIR, we cannot guarantee that we will


span: Span,            // span of the field pattern, e.g., `x: 0` def: &'tcx ty::AdtDef, // definition of the struct or enum field: &'tcx ty::FieldDef, <ins> in_update_syntax: bool, </ins> ) { // definition of the field let ident = Ident::new(kw::Invalid, use_ctxt); let current_hir = self.current_item; let def_id = self.tcx.adjust_ident_and_get_scope(ident, def.did, current_hir).1; if !def.is_enum() && !field.vis.is_accessible_from(def_id, self.tcx) { <ins> let label = if in_update_syntax { format!("field `{}` is private", field.ident) } else { "private field".to_string() }; </ins> struct_span_err!( self.tcx.sess, span,


#[cfg(test)] mod bench { <del> use test::Bencher; </del> use super::VecMap; <del> use bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n}; #[bench] pub fn insert_rand_100(b: &mut Bencher) { let mut m = VecMap::new(); insert_rand_n(100, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.remove(&i); }); } #[bench] pub fn insert_rand_10_000(b: &mut Bencher) { let mut m = VecMap::new(); insert_rand_n(10_000, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.remove(&i); }); } // Insert seq #[bench] pub fn insert_seq_100(b: &mut Bencher) { let mut m = VecMap::new(); insert_seq_n(100, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.remove(&i); }); } #[bench] pub fn insert_seq_10_000(b: &mut Bencher) { let mut m = VecMap::new(); insert_seq_n(10_000, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.remove(&i); }); } </del> <ins> map_insert_rand_bench!{insert_rand_100,    100,    VecMap} map_insert_rand_bench!{insert_rand_10_000, 10_000, VecMap} </ins> <del> // Find rand #[bench] pub fn find_rand_100(b: &mut Bencher) { let mut m = VecMap::new(); find_rand_n(100, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.get(&i); }); } #[bench] pub fn find_rand_10_000(b: &mut Bencher) { let mut m = VecMap::new(); find_rand_n(10_000, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.get(&i); }); } </del> <ins> map_insert_seq_bench!{insert_seq_100,    100,    VecMap} map_insert_seq_bench!{insert_seq_10_000, 10_000, VecMap} </ins> <del> // Find seq #[bench] pub fn find_seq_100(b: &mut Bencher) { let mut m = VecMap::new(); find_seq_n(100, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.get(&i); }); } </del> <ins> map_find_rand_bench!{find_rand_100,    100,    VecMap} map_find_rand_bench!{find_rand_10_000, 10_000, VecMap} </ins> <del> #[bench] pub fn find_seq_10_000(b: &mut Bencher) { let mut m = VecMap::new(); find_seq_n(10_000, &mut m, b, |m, i| { m.insert(i, 1); }, |m, i| { m.get(&i); }); } </del> <ins> map_find_seq_bench!{find_seq_100,    100,    VecMap} map_find_seq_bench!{find_seq_10_000, 10_000, VecMap} </ins> }


<ins> # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "aligned" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "as-slice 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "as-slice" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bare-metal" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cortex-m" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aligned 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cortex-m-rt" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cortex-m-rt-macros 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cortex-m-rt-macros" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cortex-m-semihosting" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "example" version = "0.1.0" dependencies = [ "cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "cortex-m-rt 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "cortex-m-semihosting 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "panic-halt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "generic-array" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "generic-array" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "panic-halt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "r0" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "typenum" version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vcell" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "volatile-register" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] "checksum aligned 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eb1ce8b3382016136ab1d31a1b5ce807144f8b7eb2d5f16b2108f0f07edceb94" "checksum as-slice 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "be6b7e95ac49d753f19cab5a825dea99a1149a04e4e3230b33ae16e120954c04" "checksum bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" "checksum cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2954942fbbdd49996704e6f048ce57567c3e1a4e2dc59b41ae9fde06a01fc763" "checksum cortex-m-rt 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "33a716cd7d8627fae3892c2eede9249e50d2d79aedfb43ca28dad9a2b23876d9" "checksum cortex-m-rt-macros 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "72b1073338d1e691b3b7aaf6bd61993e589ececce9242a02dfa5453e1b98918d" "checksum cortex-m-semihosting 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "113ef0ecffee2b62b58f9380f4469099b30e9f9cbee2804771b4203ba1762cfa" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum generic-array 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd" "checksum panic-halt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" "checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5" "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c" "checksum volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286" </ins>


<ins> error[E0716]: temporary value dropped while borrowed --> $DIR/promote-no-mut.rs:3:50 | LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]); |                                        ----------^^^^^^^^^- |                                        |         |        | |                                        |         |        temporary value is freed at the end of this statement |                                        |         creates a temporary which is freed while still in use |                                        using this value as a static requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed --> $DIR/promote-no-mut.rs:6:18 | LL |     let x = &mut [1,2,3]; |                  ^^^^^^^ creates a temporary which is freed while still in use LL |     x |     - using this value as a static requires that borrow lasts for `'static` LL | }; | - temporary value is freed at the end of this statement error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0716`. </ins>


( &ty::Dynamic(ref data_a, _, src_dyn_kind), &ty::Dynamic(ref data_b, _, target_dyn_kind), <del> ) => { assert_eq!(src_dyn_kind, target_dyn_kind); </del> <ins> ) if src_dyn_kind == target_dyn_kind => { </ins> let old_info = old_info.expect("unsized_info: missing old info for trait upcasting coercion"); if data_a.principal_def_id() == data_b.principal_def_id() {


<ins> // compile-pass // edition:2018 // aux-build:gensymed.rs extern crate gensymed; fn main() {} </ins>


self.per_ns(|this, ns| { let key = BindingKey::new(target, ns); let _ = this.try_define(import.parent_scope.module, key, dummy_binding, false); <ins> this.update_resolution(import.parent_scope.module, key, false, |_, resolution| { resolution.single_imports.remove(&import); }) </ins> }); self.record_use(target, dummy_binding, false); } else if import.imported_module.get().is_none() {


<ins> error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:2:5 | LL |     x = x = x; |     ^ | help: you might have meant to introduce a new binding | LL |     let x = x = x; |     +++ error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:2:9 | LL |     x = x = x; |         ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:2:13 | LL |     x = x = x; |             ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:7:5 | LL |     x = y = y = y; |     ^ | help: you might have meant to introduce a new binding | LL |     let x = y = y = y; |     +++ error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:7:9 | LL |     x = y = y = y; |         ^ not found in this scope error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:7:13 | LL |     x = y = y = y; |             ^ not found in this scope error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:7:17 | LL |     x = y = y = y; |                 ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:13:5 | LL |     x = y = y; |     ^ | help: you might have meant to introduce a new binding | LL |     let x = y = y; |     +++ error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:13:9 | LL |     x = y = y; |         ^ not found in this scope error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:13:13 | LL |     x = y = y; |             ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:18:5 | LL |     x = x = y; |     ^ | help: you might have meant to introduce a new binding | LL |     let x = x = y; |     +++ error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:18:9 | LL |     x = x = y; |         ^ not found in this scope error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:18:13 | LL |     x = x = y; |             ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:23:5 | LL |     x = x; // will suggest add `let` |     ^ | help: you might have meant to introduce a new binding | LL |     let x = x; // will suggest add `let` |     +++ error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:23:9 | LL |     x = x; // will suggest add `let` |         ^ not found in this scope error[E0425]: cannot find value `x` in this scope --> $DIR/issue-104086-suggest-let.rs:27:5 | LL |     x = y // will suggest add `let` |     ^ | help: you might have meant to introduce a new binding | LL |     let x = y // will suggest add `let` |     +++ error[E0425]: cannot find value `y` in this scope --> $DIR/issue-104086-suggest-let.rs:27:9 | LL |     x = y // will suggest add `let` |         ^ not found in this scope error: aborting due to 17 previous errors For more information about this error, try `rustc --explain E0425`. </ins>


<ins> error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:14:1 | LL | extern crate alloc; | ^^^^^^^^^^^^^^^^^^^ help: remove it | note: lint level defined here --> $DIR/unnecessary-extern-crate.rs:11:9 | LL | #![deny(unnecessary_extern_crate)] |         ^^^^^^^^^^^^^^^^^^^^^^^^ error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:17:1 | LL | extern crate alloc as x; | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `use`: `use alloc as x` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:23:1 | LL | pub extern crate test as y; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `pub use`: `pub use test as y` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:26:1 | LL | pub extern crate libc; | ^^^^^^^^^^^^^^^^^^^^^^ help: use `pub use`: `pub use libc` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:32:5 | LL |     extern crate alloc; |     ^^^^^^^^^^^^^^^^^^^ help: use `use`: `use alloc` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:35:5 | LL |     extern crate alloc as x; |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `use`: `use alloc as x` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:38:5 | LL |     pub extern crate test; |     ^^^^^^^^^^^^^^^^^^^^^^ help: use `pub use`: `pub use test` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:41:5 | LL |     pub extern crate test as y; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `pub use`: `pub use test as y` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:45:9 | LL |         extern crate alloc; |         ^^^^^^^^^^^^^^^^^^^ help: use `use`: `use alloc` error: `extern crate` is unnecessary in the new edition --> $DIR/unnecessary-extern-crate.rs:48:9 | LL |         extern crate alloc as x; |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `use`: `use alloc as x` error: aborting due to 10 previous errors </ins>


#[stable(feature = "move_cell", since = "1.17.0")] pub fn swap(&self, other: &Self) { if ptr::eq(self, other) { <ins> // Swapping wouldn't change anything. </ins> return; } <ins> if !is_nonoverlapping(self, other, 1) { // See <https://github.com/rust-lang/rust/issues/80778> for why we need to stop here. panic!("`Cell::swap` on overlapping non-identical `Cell`s"); } </ins> // SAFETY: This can be risky if called from separate threads, but `Cell` // is `!Sync` so this won't happen. This also won't invalidate any // pointers since `Cell` makes sure nothing else will be pointing into <del> // either of these `Cell`s. </del> <ins> // either of these `Cell`s. We also excluded shenanigans like partially overlapping `Cell`s, // so `swap` will just properly copy two full values of type `T` back and forth. </ins> unsafe { <del> ptr::swap(self.value.get(), other.value.get()); </del> <ins> mem::swap(&mut *self.value.get(), &mut *other.value.get()); </ins> } }


<ins> // issue-54966: ICE returning an unknown type with impl FnMut fn generate_duration() -> Oper<impl FnMut()> {} //~^ ERROR cannot find type `Oper` in this scope fn main() {} </ins>


<ins> error: `#[target_feature(..)]` can only be applied to `unsafe` functions --> $DIR/issue-68060.rs:8:13 | LL |             #[target_feature(enable = "")] |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only be applied to `unsafe` functions ... LL |             |_| (), |             ------ not an `unsafe` function error: the feature named `` is not valid for this target --> $DIR/issue-68060.rs:8:30 | LL |             #[target_feature(enable = "")] |                              ^^^^^^^^^^^ `` is not valid for this target error[E0737]: `#[track_caller]` requires Rust ABI --> $DIR/issue-68060.rs:11:13 | LL |             #[track_caller] |             ^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0737`. </ins>


pub projection_bounds: Vec<PolyProjectionPredicate<'tcx>>, } <ins> impl<'tcx> ExistentialBounds<'tcx> { pub fn new(region_bound: ty::Region, builtin_bounds: BuiltinBounds, projection_bounds: Vec<PolyProjectionPredicate<'tcx>>) -> Self { let mut projection_bounds = projection_bounds; ty::sort_bounds_list(&mut projection_bounds); ExistentialBounds { region_bound: region_bound, builtin_bounds: builtin_bounds, projection_bounds: projection_bounds } } } </ins> #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] pub struct BuiltinBounds(EnumSet<BuiltinBound>);


}); let existential_projections = bounds.projection_bounds.iter().map(|(bound, _)| { <del> bound.map_bound(|b| { if b.projection_ty.self_ty() != dummy_self { tcx.sess.delay_span_bug( DUMMY_SP, &format!("trait_ref_to_existential called on {:?} with non-dummy Self", b), ); </del> <ins> bound.map_bound(|mut b| { assert_eq!(b.projection_ty.self_ty(), dummy_self); // Like for trait refs, verify that `dummy_self` did not leak inside default type // parameters. let references_self = b.projection_ty.substs.iter().skip(1).any(|arg| { if arg.walk().any(|arg| arg == dummy_self.into()) { return true; } false }); if references_self { tcx.sess .delay_span_bug(span, "trait object projection bounds reference `Self`"); let substs: Vec<_> = b .projection_ty .substs .iter() .map(|arg| { if arg.walk().any(|arg| arg == dummy_self.into()) { return tcx.ty_error().into(); } arg }) .collect(); b.projection_ty.substs = tcx.intern_substs(&substs[..]); </ins> } ty::ExistentialProjection::erase_self_ty(tcx, b) }) });


<ins> // only-x86_64 // compile-flags: -Ccode-model=large --crate-type lib // build-pass // // Regression test for issue #37508 #![no_main] #![no_std] #![feature(thread_local, lang_items)] #[lang = "eh_personality"] extern "C" fn eh_personality() {} use core::panic::PanicInfo; #[panic_handler] fn panic(_panic: &PanicInfo<'_>) -> ! { loop {} } pub struct BB; #[thread_local] static mut KEY: Key = Key { inner: BB, dtor_running: false }; pub unsafe fn set() -> Option<&'static BB> { if KEY.dtor_running { return None; } Some(&KEY.inner) } pub struct Key { inner: BB, dtor_running: bool, } </ins>


<ins> // check-pass #![feature(type_alias_impl_trait)] struct MyTy<'a>(Vec<u8>, &'a ()); impl MyTy<'_> { fn one(&mut self) -> &mut impl Sized { &mut self.0 } fn two(&mut self) -> &mut (impl Sized + 'static) { self.one() } } type Opaque<'a> = impl Sized; fn define<'a>() -> Opaque<'a> {} fn test<'a>() { None::<&'static Opaque<'a>>; } fn one<'a, 'b: 'b>() -> &'a impl Sized { &() } fn two<'a, 'b>() { one::<'a, 'b>(); } fn main() {} </ins>


<ins> // check-pass // From https://github.com/rust-lang/rust/issues/72476 // and https://github.com/rust-lang/rust/issues/89393 trait Trait { type Projection; } struct A; impl Trait for A { type Projection = bool; } struct B; impl Trait for B { type Projection = (u32, u32); } struct Next<T: Trait>(T::Projection); fn foo1(item: Next<A>) { match item { Next(true) => {} Next(false) => {} } } fn foo2(x: <A as Trait>::Projection) { match x { true => {} false => {} } } fn foo3(x: Next<B>) { let Next((_, _)) = x; match x { Next((_, _)) => {} } } fn foo4(x: <B as Trait>::Projection) { let (_, _) = x; match x { (_, _) => {} } } fn foo5<T: Trait>(x: <T as Trait>::Projection) { match x { _ => {} } } fn main() {} </ins>


#![feature(core_intrinsics)] #![feature(lang_items)] #![feature(link_llvm_intrinsics)] <del> #![feature(panic_info_message)] </del> extern crate alloc;


<del> //@ known-bug: #101962 #![feature(core_intrinsics)] pub fn wrapping<T: Copy>(a: T, b: T) { let _z = core::intrinsics::wrapping_mul(a, b); } fn main() { wrapping(1,2); } </del>


<del> Subproject commit 891e1a859b52486936e021235fdc36fbdd9b4100 </del> <ins> Subproject commit b7c802b5e33f5a402de3780bc5a8b05e7ebad409 </ins>


Some(ns @ ValueNS) => { match self.resolve( path_str, <ins> disambiguator, </ins> ns, &current_item, base_node,


relevant_pr_number, relevant_pr_user, labels, <ins> github_token, </ins> ): <del> # Open an issue about the toolstate failure. </del> <ins> # type: (str, str, typing.Iterable[str], str, str, typing.List[str], str) -> None '''Open an issue about the toolstate failure.''' </ins> if status == 'test-fail': status_description = 'has failing tests' else:


<ins> fn main() { let x: [u8] = vec!(1, 2, 3)[..]; //~ ERROR E0277 let x: &[u8] = vec!(1, 2, 3)[..]; //~ ERROR E0308 let x: [u8] = &vec!(1, 2, 3)[..]; //~ ERROR E0308 //~^ ERROR E0277 let x: &[u8] = &vec!(1, 2, 3)[..]; } </ins>


// aux-build:struct_variant_privacy.rs extern crate struct_variant_privacy; <del> fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private </del> <ins> fn f(b: struct_variant_privacy::Bar) { //~^ ERROR enum `Bar` is private </ins> match b { struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private }


"type name" }; <del> let msg = format!("use of undeclared {} `{}`", kind, path_names_to_string(path, 0)); </del> <ins> let self_type_name = special_idents::type_self.name; let is_invalid_self_type_name = path.segments.len() > 0 && maybe_qself.is_none() && path.segments[0].identifier.name == self_type_name; let msg = if is_invalid_self_type_name { "use of `Self` outside of an impl or trait".to_string() } else { format!("use of undeclared {} `{}`", kind, path_names_to_string(path, 0)) }; </ins> self.resolve_error(ty.span, &msg[..]); } }


<ins> #![crate_type = "lib"] use super::A; //~ ERROR failed to resolve mod b { pub trait A {} pub trait B {} } /// [`A`] pub use b::*; </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. // ignore-pretty #![feature(unsafe_destructor)] use std::rc::Rc; use std::cell::Cell; struct Field { number: uint, state: Rc<Cell<uint>> } impl Field { fn new(number: uint, state: Rc<Cell<uint>>) -> Field { Field { number: number, state: state } } } #[unsafe_destructor] // because Field isn't Send impl Drop for Field { fn drop(&mut self) { println!("Dropping field {}", self.number); assert_eq!(self.state.get(), self.number); self.state.set(self.state.get()+1); } } struct NoDropImpl { _one: Field, _two: Field, _three: Field } struct HasDropImpl { _one: Field, _two: Field, _three: Field } #[unsafe_destructor] // because HasDropImpl isn't Send impl Drop for HasDropImpl { fn drop(&mut self) { println!("HasDropImpl.drop()"); assert_eq!(self._one.state.get(), 0); self._one.state.set(1); } } pub fn main() { let state = Rc::new(Cell::new(1)); let noImpl = NoDropImpl { _one: Field::new(1, state.clone()), _two: Field::new(2, state.clone()), _three: Field::new(3, state.clone()) }; drop(noImpl); assert_eq!(state.get(), 4); state.set(0); let hasImpl = HasDropImpl { _one: Field::new(1, state.clone()), _two: Field::new(2, state.clone()), _three: Field::new(3, state.clone()) }; drop(hasImpl); assert_eq!(state.get(), 4); } </ins>


/// # Example /// /// ```rust <ins> /// # #![allow(deprecated)] </ins> /// use url::decode; /// /// let url = decode("https://example.com/Rust%20(programming%20language)");


<del> [target.thumbv7m-none-eabi] # uncomment this to make `cargo run` execute programs on QEMU </del> <ins> [target.thumbv6m-none-eabi] # FIXME: Should be Cortex-M0, but Qemu used by CI is too old </ins> runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" <del> [target.thumbv6m-none-eabi] # uncomment this to make `cargo run` execute programs on QEMU # For now, we use cortex-m3 instead of cortex-m0 which are not supported by QEMU </del> <ins> [target.thumbv7m-none-eabi] </ins> runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" <ins> [target.thumbv7em-none-eabi] runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" [target.thumbv7em-none-eabihf] runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" [target.thumbv8m.base-none-eabi] # FIXME: Should be the Cortex-M23, bt Qemu does not currently support it runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" [target.thumbv8m.main-none-eabi] runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" [target.thumbv8m.main-none-eabihf] runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" </ins> [target.'cfg(all(target_arch = "arm", target_os = "none"))'] # uncomment ONE of these three option to make `cargo run` start a GDB session # which option to pick depends on your system


&& key.ns == MacroNS && nonglob_binding.expansion != LocalExpnId::ROOT { <del> resolution.binding = Some(self.ambiguity( </del> <ins> resolution.binding = Some(this.ambiguity( </ins> AmbiguityKind::GlobVsExpanded, nonglob_binding, glob_binding,


use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use rustc_infer::infer::DefineOpaqueTypes; use rustc_infer::infer::InferOk; <ins> use rustc_infer::traits::query::NoSolution; </ins> use rustc_infer::traits::ObligationCause; use rustc_middle::middle::stability; use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};


debug!("(building reduced graph for external  crate) building type {}", final_ident); <ins> let modifiers = match new_parent.kind.get() { NormalModuleKind => modifiers, _ => modifiers & !DefModifiers::IMPORTABLE }; </ins> child_name_bindings.define_type(def, DUMMY_SP, modifiers); } DefStruct(def_id) => {


Some(false) => { cvt(unsafe { unlinkat(fd, child.name_cstr().as_ptr(), 0) })?; } <del> None => match cvt(unsafe { unlinkat(fd, child.name_cstr().as_ptr(), 0) }) { // type unknown - try to unlink Err(err) if err.raw_os_error() == Some(libc::EISDIR) || err.raw_os_error() == Some(libc::EPERM) => { // if the file is a directory unlink fails with EISDIR on Linux and EPERM everyhwere else remove_dir_all_recursive(Some(fd), Path::new(&child.file_name()))?; } result => { result?; } }, </del> <ins> None => { // POSIX specifies that calling unlink()/unlinkat(..., 0) on a directory can succeed // if the process has the appropriate privileges. This however can causing orphaned // directories requiring an fsck e.g. on Solaris and Illumos. So we try recursing // into it first instead of trying to unlink() it. remove_dir_all_recursive(Some(fd), Path::new(&child.file_name()))?; } </ins> } }


<del> // check-pass // From https://github.com/rust-lang/rust/issues/72476 trait A { type Projection; } impl A for () { type Projection = bool; } struct Next<T: A>(T::Projection); fn f(item: Next<()>) { match item { Next(true) => {} Next(false) => {} } } fn main() {} </del>


| help: change the delimiters to curly braces | <del> LL | y!{ LL | Ϥ} | </del> <ins> LL | y! { /* items */ } |    ^^^^^^^^^^^^^^^ </ins> help: add a semicolon | LL | Ϥ,;


error!("This is an error log") warn!("This is a warn log") info!("this is an info log") <del> debug!("This is a dubug log") </del> <ins> debug!("This is a debug log") </ins> } ```


// rustc internal (active, staged_api, "1.0.0", None), <del> // Allows using items which are missing stability attributes // rustc internal (active, unmarked_api, "1.0.0", None), </del> // Allows using #![no_core] (active, no_core, "1.3.0", Some(29639)),


AssocTypeItem(t, b) => ItemEnum::AssocType { generics: t.generics.into_tcx(tcx), bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(), <del> default: t.item_type.map(|ty| ty.into_tcx(tcx)), </del> <ins> default: Some(t.item_type.unwrap_or(t.type_).into_tcx(tcx)), </ins> }, // `convert_item` early returns `None` for striped items and keywords. StrippedItem(_) | KeywordItem(_) => unreachable!(),


<ins> use rustc_errors::Applicability; use rustc_hir::def_id::DefId; use rustc_middle::mir::visit::Visitor; use rustc_middle::mir::*; use rustc_middle::ty::{ self, subst::{GenericArgKind, Subst, SubstsRef}, PredicateAtom, Ty, TyCtxt, TyS, }; use rustc_session::lint::builtin::FUNCTION_ITEM_REFERENCES; use rustc_span::{symbol::sym, Span}; use rustc_target::spec::abi::Abi; use crate::transform::MirPass; pub struct FunctionItemReferences; impl<'tcx> MirPass<'tcx> for FunctionItemReferences { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { let mut checker = FunctionItemRefChecker { tcx, body }; checker.visit_body(&body); } } struct FunctionItemRefChecker<'a, 'tcx> { tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, } impl<'a, 'tcx> Visitor<'tcx> for FunctionItemRefChecker<'a, 'tcx> { /// Emits a lint for function reference arguments bound by `fmt::Pointer` or passed to /// `transmute`. This only handles arguments in calls outside macro expansions to avoid double /// counting function references formatted as pointers by macros. fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) { if let TerminatorKind::Call { func, args, destination: _, cleanup: _, from_hir_call: _, fn_span: _, } = &terminator.kind { let source_info = *self.body.source_info(location); // Only handle function calls outside macros if !source_info.span.from_expansion() { let func_ty = func.ty(self.body, self.tcx); if let ty::FnDef(def_id, substs_ref) = *func_ty.kind() { // Handle calls to `transmute` if self.tcx.is_diagnostic_item(sym::transmute, def_id) { let arg_ty = args[0].ty(self.body, self.tcx); for generic_inner_ty in arg_ty.walk() { if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() { if let Some(fn_id) = FunctionItemRefChecker::is_fn_ref(inner_ty) { let ident = self.tcx.item_name(fn_id).to_ident_string(); let span = self.nth_arg_span(&args, 0); self.emit_lint(ident, fn_id, source_info, span); } } } } else { self.check_bound_args(def_id, substs_ref, &args, source_info); } } } } self.super_terminator(terminator, location); } /// Emits a lint for function references formatted with `fmt::Pointer::fmt` by macros. These /// cases are handled as operands instead of call terminators to avoid any dependence on /// unstable, internal formatting details like whether `fmt` is called directly or not. fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) { let source_info = *self.body.source_info(location); if source_info.span.from_expansion() { let op_ty = operand.ty(self.body, self.tcx); if let ty::FnDef(def_id, substs_ref) = *op_ty.kind() { if self.tcx.is_diagnostic_item(sym::pointer_trait_fmt, def_id) { let param_ty = substs_ref.type_at(0); if let Some(fn_id) = FunctionItemRefChecker::is_fn_ref(param_ty) { // The operand's ctxt wouldn't display the lint since it's inside a macro so // we have to use the callsite's ctxt. let callsite_ctxt = source_info.span.source_callsite().ctxt(); let span = source_info.span.with_ctxt(callsite_ctxt); let ident = self.tcx.item_name(fn_id).to_ident_string(); self.emit_lint(ident, fn_id, source_info, span); } } } } self.super_operand(operand, location); } } impl<'a, 'tcx> FunctionItemRefChecker<'a, 'tcx> { /// Emits a lint for function reference arguments bound by `fmt::Pointer` in calls to the /// function defined by `def_id` with the substitutions `substs_ref`. fn check_bound_args( &self, def_id: DefId, substs_ref: SubstsRef<'tcx>, args: &Vec<Operand<'tcx>>, source_info: SourceInfo, ) { let param_env = self.tcx.param_env(def_id); let bounds = param_env.caller_bounds(); for bound in bounds { if let Some(bound_ty) = self.is_pointer_trait(&bound.skip_binders()) { // Get the argument types as they appear in the function signature. let arg_defs = self.tcx.fn_sig(def_id).skip_binder().inputs(); for (arg_num, arg_def) in arg_defs.iter().enumerate() { // For all types reachable from the argument type in the fn sig for generic_inner_ty in arg_def.walk() { if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() { // If the inner type matches the type bound by `Pointer` if TyS::same_type(inner_ty, bound_ty) { // Do a substitution using the parameters from the callsite let subst_ty = inner_ty.subst(self.tcx, substs_ref); if let Some(fn_id) = FunctionItemRefChecker::is_fn_ref(subst_ty) { let ident = self.tcx.item_name(fn_id).to_ident_string(); let span = self.nth_arg_span(args, arg_num); self.emit_lint(ident, fn_id, source_info, span); } } } } } } } } /// If the given predicate is the trait `fmt::Pointer`, returns the bound parameter type. fn is_pointer_trait(&self, bound: &PredicateAtom<'tcx>) -> Option<Ty<'tcx>> { if let ty::PredicateAtom::Trait(predicate, _) = bound { if self.tcx.is_diagnostic_item(sym::pointer_trait, predicate.def_id()) { Some(predicate.trait_ref.self_ty()) } else { None } } else { None } } /// If a type is a reference or raw pointer to the anonymous type of a function definition, /// returns that function's `DefId`. fn is_fn_ref(ty: Ty<'tcx>) -> Option<DefId> { let referent_ty = match ty.kind() { ty::Ref(_, referent_ty, _) => Some(referent_ty), ty::RawPtr(ty_and_mut) => Some(&ty_and_mut.ty), _ => None, }; referent_ty .map( |ref_ty| { if let ty::FnDef(def_id, _) = *ref_ty.kind() { Some(def_id) } else { None } }, ) .unwrap_or(None) } fn nth_arg_span(&self, args: &Vec<Operand<'tcx>>, n: usize) -> Span { match &args[n] { Operand::Copy(place) | Operand::Move(place) => { self.body.local_decls[place.local].source_info.span } Operand::Constant(constant) => constant.span, } } fn emit_lint(&self, ident: String, fn_id: DefId, source_info: SourceInfo, span: Span) { let lint_root = self.body.source_scopes[source_info.scope] .local_data .as_ref() .assert_crate_local() .lint_root; let fn_sig = self.tcx.fn_sig(fn_id); let unsafety = fn_sig.unsafety().prefix_str(); let abi = match fn_sig.abi() { Abi::Rust => String::from(""), other_abi => { let mut s = String::from("extern ""); s.push_str(other_abi.name()); s.push_str("" "); s } }; let num_args = fn_sig.inputs().map_bound(|inputs| inputs.len()).skip_binder(); let variadic = if fn_sig.c_variadic() { ", ..." } else { "" }; let ret = if fn_sig.output().skip_binder().is_unit() { "" } else { " -> _" }; self.tcx.struct_span_lint_hir(FUNCTION_ITEM_REFERENCES, lint_root, span, |lint| { lint.build("taking a reference to a function item does not give a function pointer") .span_suggestion( span, &format!("cast `{}` to obtain a function pointer", ident), format!( "{} as {}{}fn({}{}){}", ident, unsafety, abi, vec!["_"; num_args].join(", "), variadic, ret, ), Applicability::Unspecified, ) .emit(); }); } } </ins>


- [Rustc now catches more cases of `pub_use_of_private_extern_crate`][80763] - [Changes in how proc macros handle whitespace may lead to panics when used with older `proc-macro-hack` versions. A `cargo update` should be sufficient to fix this in all cases.][84136] <ins> - [Turn `#[derive]` into a regular macro attribute][79078] </ins> [84136]: https://github.com/rust-lang/rust/issues/84136 [80763]: https://github.com/rust-lang/rust/pull/80763


<ins> // build-pass fn main() { let _ = &[(); usize::MAX]; } </ins>


}; if self.in_root && item.vis.node.is_pub() { <del> self.derives.push(ProcMacroDerive { </del> <ins> self.macros.push(ProcMacro::Derive(ProcMacroDerive { </ins> span: item.span, trait_name: trait_ident.name, function_name: item.ident, attrs: proc_attrs, <del> }); </del> <ins> })); </ins> } else { let msg = if !self.in_root { "functions tagged with `#[proc_macro_derive]` must


use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::Session; <ins> use rustc_span::hygiene::DesugaringKind; </ins> use rustc_span::Span; #[derive(Clone, Copy, Debug, PartialEq)]


<ins> fn g() where 'static: 'static, dyn 'static: 'static + Copy, //~ ERROR at least one trait is required for an object type { } fn main() {} </ins>


// except according to those terms. struct BuildData { <ins> foo: isize, //~ NOTE `foo` first declared here </ins> foo: isize, <del> foo: isize, //~ ERROR field `foo` is already declared </del> <ins> //~^ ERROR field `foo` is already declared [E0124] //~| NOTE field already declared </ins> } fn main() {


let ans = s(); //~^ ERROR this function takes 1 parameter but 0 parameters were supplied //~| NOTE the following parameter type was expected <ins> //~| NOTE expected 1 parameter </ins> let ans = s("burma", "shave"); //~^ ERROR this function takes 1 parameter but 2 parameters were supplied //~| NOTE the following parameter type was expected <ins> //~| NOTE expected 1 parameter </ins> }


// FIXME we need to revisit this for #67176 if rvalue.has_param() { <ins> trace!("skipping, has param"); </ins> return None; } if !rvalue


relevant_pr_url, relevant_pr_user, pr_reviewer, <del> current_datetime </del> <ins> current_datetime, github_token, </ins> ): <ins> # type: (str, str, str, str, str, str, str) -> str </ins> '''Updates `_data/latest.json` to match build result of the given commit. ''' with open('_data/latest.json', 'r+') as f:


impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> { type Output = (); fn call_once(self, _args: ()) { <del> //~^ ERROR `call_once` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn </del> <ins> //~^ ERROR `call_once` has an incompatible type for trait //~| expected "rust-call" fn, //~| found "Rust" fn </ins> println!("{:?}", self.x); } }


error[E0038]: the trait alias `SelfInput` cannot be made into an object <del> --> $DIR/self-in-generics.rs:5:19 </del> <ins> --> $DIR/self-in-generics.rs:12:19 </ins> | LL | pub fn f(_f: &dyn SelfInput) {} |                   ^^^^^^^^^


use crate::cmp::Ordering; use crate::fmt::{self, Debug, Display}; <ins> use crate::intrinsics::is_nonoverlapping; </ins> use crate::marker::{PhantomData, Unsize}; use crate::mem; use crate::ops::{CoerceUnsized, Deref, DerefMut, DispatchFromDyn};


<ins> error[E0038]: the trait alias `BB` cannot be made into an object --> $DIR/self-in-const-generics.rs:9:16 | LL | fn foo(x: &dyn BB) {} |                ^^ | = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause error: aborting due to previous error For more information about this error, try `rustc --explain E0038`. </ins>


// except according to those terms. /// Creates a `Vec` containing the arguments. <ins> /// /// `vec!` allows `Vec`s to be defined with the same syntax as array expressions. /// There are two forms of this macro: /// /// - Create a `Vec` containing a given list of elements: /// /// ``` /// let v = vec![1, 2, 3]; /// assert_eq!(v[0], 1); /// assert_eq!(v[1], 2); /// assert_eq!(v[2], 3); /// ``` /// /// - Create a `Vec` from a given element and size: /// /// ``` /// let v = vec![1; 3]; /// assert_eq!(v, vec![1, 1, 1]); /// ``` /// /// Note that unlike array expressions this syntax supports all elements /// which implement `Clone` and the number of elements doesn't have to be /// a constant. </ins> #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] macro_rules! vec { <del> ($x:expr; $y:expr) => ( <[_] as $crate::slice::SliceExt>::into_vec( $crate::boxed::Box::new([$x; $y])) </del> <ins> ($elem:expr; $n:expr) => ( $crate::vec::from_elem($elem, $n) </ins> ); ($($x:expr),*) => ( <[_] as $crate::slice::SliceExt>::into_vec(


<del> error[E0658]: :literal fragment specifier is experimental and subject to change (see issue #35625) --> $DIR/feature-gate-macro-literal-matcher.rs:14:19 | LL | macro_rules! m { ($lt:literal) => {} } |                   ^^^^^^^^^^^ | = help: add #![feature(macro_literal_matcher)] to the crate attributes to enable error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. </del>


} else { resolution.binding = Some(nonglob_binding); } <del> resolution.shadowed_glob = Some(glob_binding); </del> <ins> if let Some(old_binding) = resolution.shadowed_glob { assert!(old_binding.is_glob_import()); if glob_binding.res() != old_binding.res() { resolution.shadowed_glob = Some(this.ambiguity( AmbiguityKind::GlobVsGlob, old_binding, glob_binding, )); } else if !old_binding.vis.is_at_least(binding.vis, this.tcx) { resolution.shadowed_glob = Some(glob_binding); } } else { resolution.shadowed_glob = Some(glob_binding); } </ins> } (false, false) => { return Err(old_binding);


snapshot.recover_diff_marker(); } if self.token == token::Colon { <del> // if next token is following a colon, it's likely a path // and we can suggest a path separator self.bump(); if self.token.span.lo() == self.prev_token.span.hi() { </del> <ins> // if a previous and next token of the current one is // integer literal (e.g. `1:42`), it's likely a range // expression for Pythonistas and we can suggest so. if self.prev_token.is_integer_lit() && self.may_recover() && self.look_ahead(1, |token| token.is_integer_lit()) { // FIXME(hkmatsumoto): Might be better to trigger // this only when parsing an index expression. </ins> err.span_suggestion_verbose( <del> self.prev_token.span, "maybe write a path separator here", "::", </del> <ins> self.token.span, "you might have meant a range expression", "..", </ins> Applicability::MaybeIncorrect, ); <del> } if self.sess.unstable_features.is_nightly_build() { // FIXME(Nilstrieb): Remove this again after a few months. err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>"); </del> <ins> } else { // if next token is following a colon, it's likely a path // and we can suggest a path separator self.bump(); if self.token.span.lo() == self.prev_token.span.hi() { err.span_suggestion_verbose( self.prev_token.span, "maybe write a path separator here", "::", Applicability::MaybeIncorrect, ); } if self.sess.unstable_features.is_nightly_build() { // FIXME(Nilstrieb): Remove this again after a few months. err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>"); } </ins> } }


/// Creating a pointer `b` to contents of another reference Reborrow(Span), <del> /// Creating a pointer `b` to contents of an upvar ReborrowUpvar(Span, ty::UpvarId), </del> /// Data with type `Ty<'tcx>` was borrowed DataBorrowed(Ty<'tcx>, Span),


let ty = tcx.type_of(def_id).instantiate_identity(); if ty.references_error() { // If there is already another error, do not emit an error for not using a type parameter. <del> assert!(tcx.dcx().has_errors().is_some()); </del> <ins> // Without the `stashed_err_count` part this can fail (#120856). assert!(tcx.dcx().has_errors().is_some() || tcx.dcx().stashed_err_count() > 0); </ins> return; }


#[proc_macro_attribute] pub fn expect_print_stmt(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); <del> assert_eq!(item.to_string(), "println!("{}" , string);"); </del> <ins> assert_eq!(item.to_string(), "println!("{}", string);"); </ins> item }


parse_only: parse_only, no_trans: no_trans, no_analysis: no_analysis, <ins> no_rpath: no_rpath, </ins> debugging_opts: debugging_opts, android_cross_path: android_cross_path, write_dependency_info: write_dependency_info,


enum PlaceAncestryRelation { Ancestor, Descendant, <ins> SamePlace, </ins> Divergent, }


} } <ins> /// Suggests moving redundant argument(s) of an associate function to the /// trait it belongs to. /// /// ```compile_fail /// Into::into::<Option<_>>(42) // suggests considering `Into::<Option<_>>::into(42)` /// ``` fn suggest_moving_args_from_assoc_fn_to_trait(&self, err: &mut Diagnostic) { let trait_ = match self.tcx.trait_of_item(self.def_id) { Some(def_id) => def_id, None => return, }; // Skip suggestion when the associated function is itself generic, it is unclear // how to split the provided parameters between those to suggest to the trait and // those to remain on the associated type. let num_assoc_fn_expected_args = self.num_expected_type_or_const_args() + self.num_expected_lifetime_args(); if num_assoc_fn_expected_args > 0 { return; } let num_assoc_fn_excess_args = self.num_excess_type_or_const_args() + self.num_excess_lifetime_args(); let trait_generics = self.tcx.generics_of(trait_); let num_trait_generics_except_self = trait_generics.count() - if trait_generics.has_self { 1 } else { 0 }; let msg = format!( "consider moving {these} generic argument{s} to the `{name}` trait, which takes up to {num} argument{s}", these = pluralize!("this", num_assoc_fn_excess_args), s = pluralize!(num_assoc_fn_excess_args), name = self.tcx.item_name(trait_), num = num_trait_generics_except_self, ); if let Some(hir_id) = self.path_segment.hir_id && let Some(parent_node) = self.tcx.hir().find_parent_node(hir_id) && let Some(parent_node) = self.tcx.hir().find(parent_node) && let hir::Node::Expr(expr) = parent_node { match expr.kind { hir::ExprKind::Path(ref qpath) => { self.suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path( err, qpath, msg, num_assoc_fn_excess_args, num_trait_generics_except_self ) }, hir::ExprKind::MethodCall(..) => { self.suggest_moving_args_from_assoc_fn_to_trait_for_method_call( err, trait_, expr, msg, num_assoc_fn_excess_args, num_trait_generics_except_self ) }, _ => return, } } } fn suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path( &self, err: &mut Diagnostic, qpath: &'tcx hir::QPath<'tcx>, msg: String, num_assoc_fn_excess_args: usize, num_trait_generics_except_self: usize, ) { if let hir::QPath::Resolved(_, path) = qpath && let Some(trait_path_segment) = path.segments.get(0) { let num_generic_args_supplied_to_trait = trait_path_segment.args().num_generic_params(); if num_assoc_fn_excess_args == num_trait_generics_except_self - num_generic_args_supplied_to_trait { if let Some(span) = self.gen_args.span_ext() && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) { let sugg = vec![ (self.path_segment.ident.span, format!("{}::{}", snippet, self.path_segment.ident)), (span.with_lo(self.path_segment.ident.span.hi()), "".to_owned()) ]; err.multipart_suggestion( msg, sugg, Applicability::MaybeIncorrect ); } } } } fn suggest_moving_args_from_assoc_fn_to_trait_for_method_call( &self, err: &mut Diagnostic, trait_: DefId, expr: &'tcx hir::Expr<'tcx>, msg: String, num_assoc_fn_excess_args: usize, num_trait_generics_except_self: usize, ) { if let hir::ExprKind::MethodCall(_, args, _) = expr.kind { assert_eq!(args.len(), 1); if num_assoc_fn_excess_args == num_trait_generics_except_self { if let Some(gen_args) = self.gen_args.span_ext() && let Ok(gen_args) = self.tcx.sess.source_map().span_to_snippet(gen_args) && let Ok(args) = self.tcx.sess.source_map().span_to_snippet(args[0].span) { let sugg = format!("{}::{}::{}({})", self.tcx.item_name(trait_), gen_args, self.tcx.item_name(self.def_id), args); err.span_suggestion(expr.span, msg, sugg, Applicability::MaybeIncorrect); } } } } </ins> /// Suggests to remove redundant argument(s): /// /// ```text


<ins> error[E0700]: hidden type for `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures lifetime that does not appear in bounds --> $DIR/nested-impl-trait-fail.rs:17:5 | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> |                     -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here ... LL |     [a] |     ^^^ | help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's |                                                                                ++++ help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> |                                                                                ++++ error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds --> $DIR/nested-impl-trait-fail.rs:17:5 | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> |                     -- hidden type `&'s u8` captures the lifetime `'s` as defined here ... LL |     [a] |     ^^^ | help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's |                                                                                ++++ help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> |                                                                                ++++ error[E0700]: hidden type for `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures lifetime that does not appear in bounds --> $DIR/nested-impl-trait-fail.rs:28:5 | LL | fn fail_late_bound<'s, 'a, 'b>( |                    -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here ... LL |     [a] |     ^^^ | help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's { |                                                       ++++ help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> { |                                                      ++++ error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds --> $DIR/nested-impl-trait-fail.rs:28:5 | LL | fn fail_late_bound<'s, 'a, 'b>( |                    -- hidden type `&'s u8` captures the lifetime `'s` as defined here ... LL |     [a] |     ^^^ | help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's { |                                                       ++++ help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound | LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> { |                                                      ++++ error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0700`. </ins>


# source tarball for a stable release you'll likely see `1.x.0` for rustc and # `0.(x+1).0` for Cargo where they were released on `date`. <del> date: 2020-06-03 </del> <ins> date: 2020-06-16 </ins> rustc: beta cargo: beta


base: &'tcx hir::Expr<'tcx>, field: Ident, ) -> Ty<'tcx> { <ins> debug!("check_field(expr: {:?}, base: {:?}, field: {:?})", expr, base, field); </ins> let expr_t = self.check_expr(base); let expr_t = self.structurally_resolved_type(base.span, expr_t); let mut private_candidate = None; let mut autoderef = self.autoderef(expr.span, expr_t); while let Some((base_t, _)) = autoderef.next() { <ins> debug!("base_t: {:?}", base_t); </ins> match base_t.kind() { ty::Adt(base_def, substs) if !base_def.is_enum() => { debug!("struct named {:?}", base_t);


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


#![feature(core)] #![feature(core_intrinsics)] #![feature(core_prelude)] <ins> #![feature(core_slice_ext)] </ins> #![feature(custom_attribute)] #![feature(fundamental)] #![feature(lang_items)]


<ins> //@edition:2021 macro_rules! foo { () => { println!('hello world'); //~^ ERROR unterminated character literal //~| ERROR prefix `world` is unknown } } fn main() {} </ins>


#[stable(feature = "rust1", since = "1.0.0")] pub fn create_dir_all<P: AsPath + ?Sized>(path: &P) -> io::Result<()> { let path = path.as_path(); <del> if path.is_dir() { return Ok(()) } </del> <ins> if path == Path::new("") || path.is_dir() { return Ok(()) } </ins> if let Some(p) = path.parent() { try!(create_dir_all(p)) } create_dir(path) }


LL |     let ug = Graph::<i32, i32>::new_undirected(); |                                 ^^^^^^^^^^^^^^ function or associated item not found in `Graph<i32, i32>` | <ins> note: if you're trying to build a new `issue_30123_aux::Graph<i32, i32>`, consider using `issue_30123_aux::Graph::<N, E>::new` which returns `issue_30123_aux::Graph<_, _>` --> $DIR/auxiliary/issue-30123-aux.rs:14:5 | LL |     pub fn new() -> Self { |     ^^^^^^^^^^^^^^^^^^^^ </ins> = note: the function or associated item was found for - `issue_30123_aux::Graph<N, E, Undirected>`


# Find out where the pretty printer Python module is RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" <ins> # Get the commit hash for path remapping RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: (w*)/1/p')" </ins> # Run GDB with the additional arguments that load the pretty printers # Set the environment variable `RUST_GDB` to overwrite the call to a


let msg = "macro-expanded `extern crate` items cannot  shadow names passed with `--extern`"; self.r.tcx.sess.span_err(item.span, msg); <ins> // `return` is intended to discard this binding because it's an // unregistered ambiguity error which would result in a panic // caused by inconsistency `path_res` // more details: https://github.com/rust-lang/rust/pull/111761 return; </ins> } } let entry = self.r.extern_prelude.entry(ident.normalize_to_macros_2_0()).or_insert(


<del> //@ known-bug: #121574 #![feature(generic_const_exprs)] pub struct DimName<const N: usize> {} impl<const Z: usize> X<Z> { pub fn y<'a, U: 'a>(&'a self) -> impl Iterator<Item = impl Iterator<Item = [u8; Z]> + '_> { "0".as_bytes(move |_| (0..1).map(move |_| loop {})) } } </del>


// relying on projections in the impl-trait-ref. // // e.g., `impl<U: Tr, V: Iterator<Item=U>> Foo<<U as Tr>::T> for V` <del> substs.obligations.append(&mut impl_obligations); </del> <ins> impl_obligations.extend(substs.obligations); </ins> <del> ImplSourceUserDefinedData { impl_def_id, substs: substs.value, nested: substs.obligations } </del> <ins> ImplSourceUserDefinedData { impl_def_id, substs: substs.value, nested: impl_obligations } </ins> } fn confirm_object_candidate(


use core::prelude::*; use heap; <ins> use raw_vec::RawVec; </ins> use core::any::Any; use core::cmp::Ordering;


| LL |         E::Empty3() => () |         ^^^^^^^^^^^ not a tuple struct or tuple variant <ins> | help: use the struct variant pattern syntax | LL |         E::Empty3 {} => () |                   ~~ </ins> error[E0164]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3` --> $DIR/empty-struct-braces-pat-3.rs:21:9 | LL |         XE::XEmpty3() => () |         ^^^^^^^^^^^^^ not a tuple struct or tuple variant <ins> | help: use the struct variant pattern syntax | LL |         XE::XEmpty3 {} => () |                     ~~ </ins> error[E0164]: expected tuple struct or tuple variant, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-pat-3.rs:25:9 | LL |         E::Empty3(..) => () |         ^^^^^^^^^^^^^ not a tuple struct or tuple variant <ins> | help: use the struct variant pattern syntax | LL |         E::Empty3 {} => () |                   ~~ </ins> error[E0164]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3` --> $DIR/empty-struct-braces-pat-3.rs:29:9 | LL |         XE::XEmpty3(..) => () |         ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant <ins> | help: use the struct variant pattern syntax | LL |         XE::XEmpty3 {} => () |                     ~~ </ins> error: aborting due to 4 previous errors


//! symbol, but that caused Debian to detect an unnecessarily strict versioned //! dependency on libc6 (#23628). <ins> // There are a variety of `#[cfg]`s controlling which targets are involved in // each instance of `weak!` and `syscall!`. Rather than trying to unify all of // that, we'll just allow that some unix targets don't use this module at all. #![allow(dead_code, unused_macros)] </ins> use crate::ffi::CStr; use crate::marker; use crate::mem;


if level == Level::Forbid { continue } <del> let forbid_src = match self.sets.get_lint_id_level(*id, self.cur) { </del> <ins> let forbid_src = match self.sets.get_lint_id_level(*id, self.cur, None) { </ins> (Some(Level::Forbid), src) => src, _ => continue, };


panic_immediate_abort = ["core/panic_immediate_abort"] # Choose algorithms that are optimized for binary size instead of runtime performance optimize_for_size = ["core/optimize_for_size"] <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_global_oom_handling)', 'cfg(no_rc)', 'cfg(no_sync)', ] </ins>


pub use self::location::Location; #[stable(feature = "panic_hooks", since = "1.10.0")] pub use self::panic_info::PanicInfo; <del> #[unstable(feature = "panic_info_message", issue = "66745")] </del> <ins> #[stable(feature = "panic_info_message", since = "CURRENT_RUSTC_VERSION")] </ins> pub use self::panic_info::PanicMessage; #[stable(feature = "catch_unwind", since = "1.9.0")] pub use self::unwind_safe::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe};


CRATE_URL := https://github.com/rust-embedded/cortex-m CRATE_SHA1 := a448e9156e2cb1e556e5441fd65426952ef4b927 # 0.5.0 <del> export RUSTFLAGS := --cap-lints=allow </del> <ins> # Don't make lints fatal, but they need to at least warn or they break Cargo's target info parsing. export RUSTFLAGS := --cap-lints=warn </ins> all: env


<ins> error: the `wait` method cannot be invoked on a trait object --> $DIR/issue-35976.rs:20:9 | LL |         fn wait(&self) where Self: Sized; |                                    ----- this has a `Sized` requirement ... LL |     arg.wait(); |         ^^^^ | help: another candidate was found in the following trait, perhaps add a `use` for it: | LL | use private::Future; | error: aborting due to previous error </ins>


"rustc_data_structures", "rustc_hir", "rustc_hir_pretty", <ins> "rustc_lexer", </ins> "rustc_middle", <del> "rustc_parse", </del> "rustc_session", "rustc_span", "serde_json",


// Region folder impl<'tcx> TyCtxt<'tcx> { <del> /// Folds the escaping and free regions in `value` using `f`, and /// sets `skipped_regions` to true if any late-bound region was found /// and skipped. </del> <ins> /// Folds the escaping and free regions in `value` using `f`. </ins> pub fn fold_regions<T>( self, value: T,


<ins> #![feature(stmt_expr_attributes)] fn foo() -> String { #[cfg(feature = "validation")] [1, 2, 3].iter().map(|c| c.to_string()).collect::<String>() //~ ERROR expected `;`, found `#` #[cfg(not(feature = "validation"))] String::new() } fn bar() -> String { #[attr] [1, 2, 3].iter().map(|c| c.to_string()).collect::<String>() //~ ERROR expected `;`, found `#` #[attr] //~ ERROR cannot find attribute `attr` in this scope String::new() } fn main() { println!("{}", foo()); } </ins>


t!(fs::create_dir_all(&out_dir)); let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld")); <del> if let Some(ref linker) = builder.config.llvm_use_linker { cfg.define("LLVM_USE_LINKER", linker); } </del> configure_cmake(builder, target, &mut cfg, true); // This is an awful, awful hack. Discovered when we migrated to using


<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. #![feature(core)] use std::boxed::FnBox; struct Obj<F> where F: FnOnce() -> u32 { closure: F, not_closure: usize, } struct BoxedObj { boxed_closure: Box<FnBox() -> u32>, } struct Wrapper<F> where F: FnMut() -> u32 { wrap: Obj<F>, } fn func() -> u32 { 0 } fn check_expression() -> Obj<Box<FnBox() -> u32>> { Obj { closure: Box::new(|| 42_u32) as Box<FnBox() -> u32>, not_closure: 42 } } fn main() { // test variations of function let o_closure = Obj { closure: || 42, not_closure: 42 }; o_closure.closure(); //~ ERROR no method named `closure` found //~^ NOTE use `(o_closure.closure)(...)` if you meant to call the function stored o_closure.not_closure(); //~ ERROR no method named `not_closure` found //~^ NOTE did you mean to write `o_closure.not_closure`? let o_func = Obj { closure: func, not_closure: 5 }; o_func.closure(); //~ ERROR no method named `closure` found //~^ NOTE use `(o_func.closure)(...)` if you meant to call the function stored let boxed_fn = BoxedObj { boxed_closure: Box::new(func) }; boxed_fn.boxed_closure();//~ ERROR no method named `boxed_closure` found //~^ NOTE use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored let boxed_closure = BoxedObj { boxed_closure: Box::new(|| 42_u32) as Box<FnBox() -> u32> }; boxed_closure.boxed_closure();//~ ERROR no method named `boxed_closure` found //~^ NOTE use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored // test expression writing in the notes let w = Wrapper { wrap: o_func }; w.wrap.closure();//~ ERROR no method named `closure` found //~^ NOTE use `(w.wrap.closure)(...)` if you meant to call the function stored w.wrap.not_closure();//~ ERROR no method named `not_closure` found //~^ NOTE did you mean to write `w.wrap.not_closure`? check_expression().closure();//~ ERROR no method named `closure` found //~^ NOTE use `(check_expression().closure)(...)` if you meant to call the function stored } </ins>


match target { Some(ref target) if target.shadowable != Shadowable::Always => { let ns_word = match namespace { <del> TypeNS => "type", </del> <ins> TypeNS => { if let Some(ref ty_def) = *target.bindings.type_def.borrow() { match ty_def.module_def { Some(ref module) if module.kind.get() == ModuleKind::NormalModuleKind => "module", Some(ref module) if module.kind.get() == ModuleKind::TraitModuleKind => "trait", _ => "type", } } else { "type" } }, </ins> ValueNS => "value", }; span_err!(self.resolver.session, import_span, E0252,


LL | pub fn has_error() -> TypeError {} |                       ^^^^^^^^^ not found in this scope <del> error: aborting due to 1 previous error </del> <ins> error[E0412]: cannot find type `TypeError` in this scope --> $DIR/type-errors.rs:18:29 | LL | pub fn autoderef_source(e: &TypeError) { |                             ^^^^^^^^^ not found in this scope error[E0412]: cannot find type `TypeError` in this scope --> $DIR/type-errors.rs:23:29 | LL | pub fn autoderef_target(_: &TypeError) {} |                             ^^^^^^^^^ not found in this scope error: aborting due to 3 previous errors </ins> For more information about this error, try `rustc --explain E0412`.


.define("LLVM_TARGET_ARCH", target_native.split('-').next().unwrap()) .define("LLVM_DEFAULT_TARGET_TRIPLE", target_native); <del> if target != "aarch64-apple-darwin" { </del> <ins> if target != "aarch64-apple-darwin" && !target.contains("windows") { </ins> cfg.define("LLVM_ENABLE_ZLIB", "ON"); } else { cfg.define("LLVM_ENABLE_ZLIB", "OFF");


name = "stdbenches" path = "benches/lib.rs" test = true <ins> [lints.rust.unexpected_cfgs] level = "warn" check-cfg = [ 'cfg(bootstrap)', 'cfg(backtrace_in_libstd)', 'cfg(netbsd10)', 'cfg(target_arch, values("xtensa"))', 'cfg(feature, values("std", "as_crate"))', ] </ins>