let attrs = self.tcx.hir().attrs(hir_id); for attr in attrs { match attr.path().as_slice() { <del> [sym::diagnostic, sym::do_not_recommend] => { </del> <ins> [sym::diagnostic, sym::do_not_recommend, ..] => { </ins> self.check_do_not_recommend(attr.span, hir_id, target) } <del> [sym::diagnostic, sym::on_unimplemented] => { </del> <ins> [sym::diagnostic, sym::on_unimplemented, ..] => { </ins> self.check_diagnostic_on_unimplemented(attr.span, hir_id, target) } <del> [sym::inline] => self.check_inline(hir_id, attr, span, target), [sym::coverage] => self.check_coverage(attr, span, target), [sym::optimize] => self.check_optimize(hir_id, attr, target), [sym::non_exhaustive] => self.check_non_exhaustive(hir_id, attr, span, target), [sym::marker] => self.check_marker(hir_id, attr, span, target), [sym::target_feature] => { </del> <ins> [sym::inline, ..] => self.check_inline(hir_id, attr, span, target), [sym::coverage, ..] => self.check_coverage(attr, span, target), [sym::optimize, ..] => self.check_optimize(hir_id, attr, target), [sym::non_exhaustive, ..] => self.check_non_exhaustive(hir_id, attr, span, target), [sym::marker, ..] => self.check_marker(hir_id, attr, span, target), [sym::target_feature, ..] => { </ins> self.check_target_feature(hir_id, attr, span, target, attrs) } <del> [sym::thread_local] => self.check_thread_local(attr, span, target), [sym::track_caller] => { </del> <ins> [sym::thread_local, ..] => self.check_thread_local(attr, span, target), [sym::track_caller, ..] => { </ins> self.check_track_caller(hir_id, attr.span, attrs, span, target) } <del> [sym::doc] => self.check_doc_attrs( </del> <ins> [sym::doc, ..] => self.check_doc_attrs( </ins> attr, hir_id, target, &mut specified_inline, &mut doc_aliases, ), <del> [sym::no_link] => self.check_no_link(hir_id, attr, span, target), [sym::export_name] => self.check_export_name(hir_id, attr, span, target), [sym::rustc_layout_scalar_valid_range_start] | [sym::rustc_layout_scalar_valid_range_end] => { </del> <ins> [sym::no_link, ..] => self.check_no_link(hir_id, attr, span, target), [sym::export_name, ..] => self.check_export_name(hir_id, attr, span, target), [sym::rustc_layout_scalar_valid_range_start, ..] | [sym::rustc_layout_scalar_valid_range_end, ..] => { </ins> self.check_rustc_layout_scalar_valid_range(attr, span, target) } <del> [sym::allow_internal_unstable] => { </del> <ins> [sym::allow_internal_unstable, ..] => { </ins> self.check_allow_internal_unstable(hir_id, attr, span, target, attrs) } <del> [sym::debugger_visualizer] => self.check_debugger_visualizer(attr, target), [sym::rustc_allow_const_fn_unstable] => { </del> <ins> [sym::debugger_visualizer, ..] => self.check_debugger_visualizer(attr, target), [sym::rustc_allow_const_fn_unstable, ..] => { </ins> self.check_rustc_allow_const_fn_unstable(hir_id, attr, span, target) } <del> [sym::rustc_std_internal_symbol] => { </del> <ins> [sym::rustc_std_internal_symbol, ..] => { </ins> self.check_rustc_std_internal_symbol(attr, span, target) } <del> [sym::naked] => self.check_naked(hir_id, attr, span, target, attrs), [sym::rustc_never_returns_null_ptr] => { </del> <ins> [sym::naked, ..] => self.check_naked(hir_id, attr, span, target, attrs), [sym::rustc_never_returns_null_ptr, ..] => { </ins> self.check_applied_to_fn_or_method(hir_id, attr, span, target) } <del> [sym::rustc_legacy_const_generics] => { </del> <ins> [sym::rustc_legacy_const_generics, ..] => { </ins> self.check_rustc_legacy_const_generics(hir_id, attr, span, target, item) } <del> [sym::rustc_lint_query_instability] => { </del> <ins> [sym::rustc_lint_query_instability, ..] => { </ins> self.check_rustc_lint_query_instability(hir_id, attr, span, target) } <del> [sym::rustc_lint_diagnostics] => { </del> <ins> [sym::rustc_lint_diagnostics, ..] => { </ins> self.check_rustc_lint_diagnostics(hir_id, attr, span, target) } <del> [sym::rustc_lint_opt_ty] => self.check_rustc_lint_opt_ty(attr, span, target), [sym::rustc_lint_opt_deny_field_access] => { </del> <ins> [sym::rustc_lint_opt_ty, ..] => self.check_rustc_lint_opt_ty(attr, span, target), [sym::rustc_lint_opt_deny_field_access, ..] => { </ins> self.check_rustc_lint_opt_deny_field_access(attr, span, target) } <del> [sym::rustc_clean] | [sym::rustc_dirty] | [sym::rustc_if_this_changed] | [sym::rustc_then_this_would_need] => self.check_rustc_dirty_clean(attr), [sym::rustc_coinductive] | [sym::rustc_must_implement_one_of] | [sym::rustc_deny_explicit_impl] | [sym::const_trait] => self.check_must_be_applied_to_trait(attr, span, target), [sym::cmse_nonsecure_entry] => { </del> <ins> [sym::rustc_clean, ..] | [sym::rustc_dirty, ..] | [sym::rustc_if_this_changed, ..] | [sym::rustc_then_this_would_need, ..] => self.check_rustc_dirty_clean(attr), [sym::rustc_coinductive, ..] | [sym::rustc_must_implement_one_of, ..] | [sym::rustc_deny_explicit_impl, ..] | [sym::const_trait, ..] => self.check_must_be_applied_to_trait(attr, span, target), [sym::cmse_nonsecure_entry, ..] => { </ins> self.check_cmse_nonsecure_entry(hir_id, attr, span, target) } <del> [sym::collapse_debuginfo] => self.check_collapse_debuginfo(attr, span, target), [sym::must_not_suspend] => self.check_must_not_suspend(attr, span, target), [sym::must_use] => self.check_must_use(hir_id, attr, target), [sym::rustc_pass_by_value] => self.check_pass_by_value(attr, span, target), [sym::rustc_allow_incoherent_impl] => { </del> <ins> [sym::collapse_debuginfo, ..] => self.check_collapse_debuginfo(attr, span, target), [sym::must_not_suspend, ..] => self.check_must_not_suspend(attr, span, target), [sym::must_use, ..] => self.check_must_use(hir_id, attr, target), [sym::rustc_pass_by_value, ..] => self.check_pass_by_value(attr, span, target), [sym::rustc_allow_incoherent_impl, ..] => { </ins> self.check_allow_incoherent_impl(attr, span, target) } <del> [sym::rustc_has_incoherent_inherent_impls] => { </del> <ins> [sym::rustc_has_incoherent_inherent_impls, ..] => { </ins> self.check_has_incoherent_inherent_impls(attr, span, target) } <del> [sym::ffi_pure] => self.check_ffi_pure(attr.span, attrs, target), [sym::ffi_const] => self.check_ffi_const(attr.span, target), [sym::rustc_const_unstable] | [sym::rustc_const_stable] | [sym::unstable] | [sym::stable] | [sym::rustc_allowed_through_unstable_modules] | [sym::rustc_promotable] => self.check_stability_promotable(attr, target), [sym::link_ordinal] => self.check_link_ordinal(attr, span, target), [sym::rustc_confusables] => self.check_confusables(attr, target), [sym::rustc_safe_intrinsic] => { </del> <ins> [sym::ffi_pure, ..] => self.check_ffi_pure(attr.span, attrs, target), [sym::ffi_const, ..] => self.check_ffi_const(attr.span, target), [sym::rustc_const_unstable, ..] | [sym::rustc_const_stable, ..] | [sym::unstable, ..] | [sym::stable, ..] | [sym::rustc_allowed_through_unstable_modules, ..] | [sym::rustc_promotable, ..] => self.check_stability_promotable(attr, target), [sym::link_ordinal, ..] => self.check_link_ordinal(attr, span, target), [sym::rustc_confusables, ..] => self.check_confusables(attr, target), [sym::rustc_safe_intrinsic, ..] => { </ins> self.check_rustc_safe_intrinsic(hir_id, attr, span, target) } <del> [sym::cold] => self.check_cold(hir_id, attr, span, target), [sym::link] => self.check_link(hir_id, attr, span, target), [sym::link_name] => self.check_link_name(hir_id, attr, span, target), [sym::link_section] => self.check_link_section(hir_id, attr, span, target), [sym::no_mangle] => self.check_no_mangle(hir_id, attr, span, target), [sym::deprecated] => self.check_deprecated(hir_id, attr, span, target), [sym::macro_use] | [sym::macro_escape] => { </del> <ins> [sym::cold, ..] => self.check_cold(hir_id, attr, span, target), [sym::link, ..] => self.check_link(hir_id, attr, span, target), [sym::link_name, ..] => self.check_link_name(hir_id, attr, span, target), [sym::link_section, ..] => self.check_link_section(hir_id, attr, span, target), [sym::no_mangle, ..] => self.check_no_mangle(hir_id, attr, span, target), [sym::deprecated, ..] => self.check_deprecated(hir_id, attr, span, target), [sym::macro_use, ..] | [sym::macro_escape, ..] => { </ins> self.check_macro_use(hir_id, attr, target) } <del> [sym::path] => self.check_generic_attr(hir_id, attr, target, Target::Mod), [sym::macro_export] => self.check_macro_export(hir_id, attr, target), [sym::ignore] | [sym::should_panic] => { </del> <ins> [sym::path, ..] => self.check_generic_attr(hir_id, attr, target, Target::Mod), [sym::macro_export, ..] => self.check_macro_export(hir_id, attr, target), [sym::ignore, ..] | [sym::should_panic, ..] => { </ins> self.check_generic_attr(hir_id, attr, target, Target::Fn) } <del> [sym::automatically_derived] => { </del> <ins> [sym::automatically_derived, ..] => { </ins> self.check_generic_attr(hir_id, attr, target, Target::Impl) } <del> [sym::no_implicit_prelude] => { </del> <ins> [sym::no_implicit_prelude, ..] => { </ins> self.check_generic_attr(hir_id, attr, target, Target::Mod) } <del> [sym::rustc_object_lifetime_default] => self.check_object_lifetime_default(hir_id), [sym::proc_macro] => { </del> <ins> [sym::rustc_object_lifetime_default, ..] => self.check_object_lifetime_default(hir_id), [sym::proc_macro, ..] => { </ins> self.check_proc_macro(hir_id, target, ProcMacroKind::FunctionLike) } <del> [sym::proc_macro_attribute] => { </del> <ins> [sym::proc_macro_attribute, ..] => { </ins> self.check_proc_macro(hir_id, target, ProcMacroKind::Attribute); } <del> [sym::proc_macro_derive] => { </del> <ins> [sym::proc_macro_derive, ..] => { </ins> self.check_generic_attr(hir_id, attr, target, Target::Fn); self.check_proc_macro(hir_id, target, ProcMacroKind::Derive) } <del> [sym::coroutine] => { </del> <ins> [sym::coroutine, ..] => { </ins> self.check_coroutine(attr, target); } [


[[package]] name = "libgit2-sys" <del> version = "0.10.0" </del> <ins> version = "0.11.0+0.99.0" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "d9ec6bca50549d34a392611dde775123086acbd994e3fff64954777ce2dc2e51" </del> <ins> checksum = "4d5d1459353d397a029fb18862166338de938e6be976606bd056cf8f1a912ecf" </ins> dependencies = [ "cc", "libc",


/// /// # Safety /// <del> /// The resulting pointer does not need to be in bounds, but it is /// potentially hazardous to dereference (which requires `unsafe`). </del> <ins> /// This operation itself is always safe, but using the resulting pointer is not. </ins> /// <del> /// In particular, the resulting pointer remains attached to the same allocated /// object that `self` points to. It may *not* be used to access a /// different allocated object. Note that in Rust, /// every (stack-allocated) variable is considered a separate allocated object. </del> <ins> /// The resulting pointer remains attached to the same allocated object that `self` points to. /// It may *not* be used to access a different allocated object. Note that in Rust, every /// (stack-allocated) variable is considered a separate allocated object. </ins> /// <del> /// In other words, `x.wrapping_offset((y as usize).wrapping_sub(x as usize) / size_of::<T>())` /// is *not* the same as `y`, and dereferencing it is undefined behavior /// unless `x` and `y` point into the same allocated object. </del> <ins> /// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z` /// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still /// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless /// `x` and `y` point into the same allocated object. </ins> /// <del> /// Compared to [`offset`], this method basically delays the requirement of staying /// within the same allocated object: [`offset`] is immediate Undefined Behavior when /// crossing object boundaries; `wrapping_offset` produces a pointer but still leads /// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized /// better and is thus preferable in performance-sensitive code. </del> <ins> /// Compared to [`offset`], this method basically delays the requirement of staying within the /// same allocated object: [`offset`] is immediate Undefined Behavior when crossing object /// boundaries; `wrapping_offset` produces a pointer but still leads to Undefined Behavior if a /// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`] /// can be optimized better and is thus preferable in performance-sensitive code. /// /// The delayed check only considers the value of the pointer that was dereferenced, not the /// intermediate values used during the computation of the final result. For example, /// `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other /// words, leaving the allocated object and then re-entering it later is permitted. </ins> /// /// If you need to cross object boundaries, cast the pointer to an integer and /// do the arithmetic there.


let _: &dyn BuildHasher<Hasher = DefaultHasher> = &RandomState::new(); } <ins> // just tests by whether or not this compiles fn _build_hasher_default_impl_all_auto_traits<T>() { use std::panic::{RefUnwindSafe, UnwindSafe}; fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {} all_auto_traits::<std::hash::BuildHasherDefault<T>>(); } </ins>


} // handled in the `strip-priv-imports` pass <del> clean::ExternCrateItem { .. } | clean::ImportItem(..) => {} </del> <ins> clean::ExternCrateItem { .. } => {} clean::ImportItem(ref imp) => { // Because json doesn't inline imports from private modules, we need to mark // the imported item as retained so it's impls won't be stripped.i // // FIXME: Is it necessary to check for json output here: See // https://github.com/rust-lang/rust/pull/100325#discussion_r941495215 if let Some(did) = imp.source.did && self.is_json_output { self.retained.insert(did.into()); } } </ins> clean::ImplItem(..) => {}


--> $DIR/issue-17800.rs:18:28 | LL |         MyOption::MySome { x: 42 } => (), <del> |                            ^^^^^ variant `MyOption::MySome` does not have this field </del> <ins> |                            ^^^^^ |                            | |                            variant `MyOption::MySome` does not have this field |                            help: did you mean: `0` </ins> <del> error[E0027]: pattern does not mention field `0` --> $DIR/issue-17800.rs:18:9 | LL |         MyOption::MySome { x: 42 } => (), |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `0` | = note: trying to match a tuple variant with a struct variant pattern error: aborting due to 2 previous errors </del> <ins> error: aborting due to previous error </ins> <del> Some errors occurred: E0026, E0027. For more information about an error, try `rustc --explain E0026`. </del> <ins> For more information about this error, try `rustc --explain E0026`. </ins>


``` "##, <del> //NB: not currently reachable E0247: r##" This error indicates an attempt to use a module name where a type is expected. For example: ``` mod MyMod { mod MySubMod { } } fn do_something(x: MyMod::MySubMod) { } ``` In this example, we're attempting to take a parameter of type `MyMod::MySubMod` in the do_something function. This is not legal: `MyMod::MySubMod` is a module name, not a type. "##, </del> E0248: r##" This error indicates an attempt to use a value where a type is expected. For example:


return; } <ins> let self_contained_linker = sess.opts.cg.link_self_contained.linker(); // FIXME: some targets default to using `lld`, but users can only override the linker on the CLI // and cannot yet select the precise linker flavor to opt out of that. See for example issue // #113597 for the `thumbv6m-none-eabi` target: a driver is used, and its default linker // conflicts with the target's flavor, causing unexpected arguments being passed. // // Until the new `LinkerFlavor`-like CLI options are stabilized, we only adopt MCP510's behavior // if its dedicated unstable CLI flags are used, to keep the current sub-optimal stable // behavior. let using_mcp510 = self_contained_linker || sess.opts.cg.linker_flavor.is_some_and(|f| f.is_unstable()); if !using_mcp510 && !unstable_use_lld { return; } </ins> // 1. Implement the "self-contained" part of this feature by adding rustc distribution //    directories to the tool's search path. <del> let self_contained_linker = sess.opts.cg.link_self_contained.linker() || unstable_use_lld; if self_contained_linker { </del> <ins> if self_contained_linker || unstable_use_lld { </ins> for path in sess.get_tools_search_paths(false) { cmd.arg({ let mut arg = OsString::from("-B");


.next() .map_or(false, |c| c.is_ascii_uppercase()) { <del> (format!("use of undeclared type `{}`", ident), None) </del> <ins> // Check whether the name refers to an item in the value namespace. let suggestion = if ribs.is_some() { let match_span = match self.resolve_ident_in_lexical_scope( ident, ValueNS, parent_scope, None, path_span, &ribs.unwrap()[ValueNS], ) { // Name matches a local variable. For example: // ``` // fn f() { //     let Foo: &str = ""; //     println!("{}", Foo::Bar); // Name refers to local //                               // variable `Foo`. // } // ``` Some(LexicalScopeBinding::Res(Res::Local(id))) => { Some(*self.pat_span_map.get(&id).unwrap()) } // Name matches item from a local name binding // created by `use` declaration. For example: // ``` // pub Foo: &str = ""; // // mod submod { //     use super::Foo; //     println!("{}", Foo::Bar); // Name refers to local //                               // binding `Foo`. // } // ``` Some(LexicalScopeBinding::Item(name_binding)) => { Some(name_binding.span) } _ => None, }; if let Some(span) = match_span { Some(( vec![(span, String::from(""))], format!("`{}` is defined here, but is not a type", ident), Applicability::MaybeIncorrect, )) } else { None } } else { None }; (format!("use of undeclared type `{}`", ident), suggestion) </ins> } else { (format!("use of undeclared crate or module `{}`", ident), None) }


<ins> #![feature(inherent_associated_types)] #![allow(incomplete_features)] // Check that we don't crash when printing inherent projections in diagnostics. pub struct Carrier<'a>(&'a ()); pub type User = for<'b> fn(Carrier<'b>::Focus<i32>); impl<'a> Carrier<'a> { pub type Focus<T> = &'a mut User; //~ ERROR overflow evaluating associated type } fn main() {} </ins>


<ins> warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/alias-bounds-when-not-wf.rs:3:12 | LL | #![feature(lazy_type_alias)] |            ^^^^^^^^^^^^^^^ | = note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information = note: `#[warn(incomplete_features)]` on by default error: the type `W<A<usize>>` is not well-formed --> $DIR/alias-bounds-when-not-wf.rs:16:13 | LL | fn hello(_: W<A<usize>>) {} |             ^^^^^^^^^^^ error: aborting due to 1 previous error; 1 warning emitted </ins>


use std::path::{Path, PathBuf}; use std::process::Command; <del> use build_helper::ci::CiEnv; </del> use tracing::*; use crate::common::{Config, Debugger, FailMode, Mode, PassMode};


<ins> pub struct Option; impl Option { pub fn unwrap(self) {} } mod macros { use crate::Option; /// [`Option::unwrap`] #[macro_export] macro_rules! print { () => () } } mod structs { use crate::Option; /// [`Option::unwrap`] pub struct Print; } pub use structs::Print; </ins>


<ins> // check-pass // edition:2021 use std::rc::Rc; // Test that we restrict precision when moving not-`Copy` types, if any of the parent paths // implement `Drop`. This is to ensure that we don't move out of a type that implements Drop. pub fn test1() { struct Foo(Rc<i32>); impl Drop for Foo { fn drop(self: &mut Foo) {} } let f = Foo(Rc::new(1)); let x = move || { println!("{:?}", f.0); }; x(); } // Test that we don't restrict precision when moving `Copy` types(i.e. when copying), // even if any of the parent paths implement `Drop`. pub fn test2() { struct Character { hp: u32, name: String, } impl Drop for Character { fn drop(&mut self) {} } let character = Character { hp: 100, name: format!("A") }; let c = move || { println!("{}", character.hp) }; c(); println!("{}", character.name); } fn main() {} </ins>


<ins> error[E0428]: the name `f` is defined multiple times --> $DIR/test-compile-fail1.rs:8:1 | 6 | pub fn f() {} | ---------- previous definition of the value `f` here 7 | 8 | pub fn f() {} | ^^^^^^^^^^ `f` redefined here | = note: `f` must be defined only once in the value namespace of this module error: aborting due to previous error For more information about this error, try `rustc --explain E0428`. </ins>


target_val!(data_layout); target_option_val!(is_builtin); <del> target_option_val!(endian, "target_endian"); target_option_val!(c_int_width, "target_c_int_width"); </del> <ins> target_option_val!(endian, "target-endian"); target_option_val!(c_int_width, "target-c-int-width"); </ins> target_option_val!(os); target_option_val!(env); target_option_val!(vendor);


infer::IfExpression(_) => { format!("if and else have compatible types") } <ins> infer::IfExpressionWithNoElse(_) => { format!("if may be missing an else clause") } </ins> }; match self.values_str(&trace.values) {


-include ../tools.mk <del> # This test makes sure that indirect call promotion is performed. The test # programs calls the same function a thousand times through a function pointer. # Only PGO data provides the information that it actually always is the same # function. We verify that the indirect call promotion pass inserts a check # whether it can make a direct call instead of the indirect call. # LLVM doesn't support instrumenting binaries that use SEH: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMMON_FLAGS=-Cpanic=abort endif </del> all: # We don't compile `opaque` with either optimizations or instrumentation. # We don't compile `opaque` with either optimizations or instrumentation.


_marker: PhantomData<&'f mut &'f c_void>, } <ins> /// s390x ABI implementation of a `va_list`. #[cfg(target_arch = "s390x")] #[repr(C)] #[derive(Debug)] #[unstable( feature = "c_variadic", reason = "the `c_variadic` feature has not been properly tested on  all supported platforms", issue = "44930" )] #[lang = "va_list"] pub struct VaListImpl<'f> { gpr: i64, fpr: i64, overflow_arg_area: *mut c_void, reg_save_area: *mut c_void, _marker: PhantomData<&'f mut &'f c_void>, } </ins> /// x86_64 ABI implementation of a `va_list`. #[cfg(all(target_arch = "x86_64", not(target_os = "uefi"), not(windows)))] #[repr(C)]


// memmove back untouched tail, update to new length let start = source_vec.len(); let tail = self.tail_start; <del> let src = source_vec.as_ptr().offset(tail as isize); let dst = source_vec.as_mut_ptr().offset(start as isize); ptr::copy(src, dst, self.tail_len); </del> <ins> if tail != start { let src = source_vec.as_ptr().offset(tail as isize); let dst = source_vec.as_mut_ptr().offset(start as isize); ptr::copy(src, dst, self.tail_len); } </ins> source_vec.set_len(start + self.tail_len); } }


// if a test does not crash, consider it an error if proc_res.status.success() || matches!(proc_res.status.code(), Some(1 | 0)) { self.fatal(&format!( <del> "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name,  add a doc-comment to the start of the test explaining why it exists and  move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description  ensures that the corresponding ticket is auto-closed upon merge." </del> <ins> "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful  name, add a doc-comment to the start of the test explaining why it exists and  move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR  description ensures that the corresponding ticket is auto-closed upon merge.  If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`." </ins> )); } }


// not covered via the Shared impl above b/c the inner contents use // Cell/AtomicUsize, but the usage here is recover safe so we can lift the // impl up one level to Arc/Rc itself <del> impl<T: NoUnsafeCell + ?Sized> RecoverSafe for Rc<T> {} impl<T: NoUnsafeCell + ?Sized> RecoverSafe for Arc<T> {} </del> <ins> impl<T: RefRecoverSafe + ?Sized> RecoverSafe for Rc<T> {} impl<T: RefRecoverSafe + ?Sized> RecoverSafe for Arc<T> {} </ins> <del> // Pretty simple implementations for the `NoUnsafeCell` marker trait, basically // just saying that this is a marker trait and `UnsafeCell` is the only thing // which doesn't implement it (which then transitively applies to everything // else. impl NoUnsafeCell for .. {} impl<T: ?Sized> !NoUnsafeCell for UnsafeCell<T> {} </del> <ins> // Pretty simple implementations for the `RefRecoverSafe` marker trait, // basically just saying that this is a marker trait and `UnsafeCell` is the // only thing which doesn't implement it (which then transitively applies to // everything else. impl RefRecoverSafe for .. {} impl<T: ?Sized> !RefRecoverSafe for UnsafeCell<T> {} impl<T> RefRecoverSafe for AssertRecoverSafe<T> {} </ins> impl<T> AssertRecoverSafe<T> { /// Creates a new `AssertRecoverSafe` wrapper around the provided type.


builder.install(&exe, &dst_bindir, 0o755); } <ins> // Copy libLLVM.so to the target lib dir as well, so the RPATH like // `$ORIGIN/../lib` can find it. It may also be used as a dependency // of `rustc-dev` to support the inherited `-lLLVM` when using the // compiler libraries. maybe_install_llvm_target(builder, target, &image); </ins> // Prepare the overlay let overlay = tmp.join("llvm-tools-overlay"); drop(fs::remove_dir_all(&overlay));


COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)" <del> # LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMPILE_FLAGS+= -Cpanic=abort endif </del> all: $(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs # We expect symbols starting with "__llvm_profile_".


} }; <del> bfs_queue.push_back(DefId { krate: cnum, index: CRATE_DEF_INDEX }); </del> while let Some(def) = bfs_queue.pop_front() { for child in tcx.item_children(def).iter() { add_child(bfs_queue, child, def);


<ins> // This is a non-regression test for issue #127052 where unreferenced `#[used]` statics couldn't be // removed by the MSVC linker, causing linking errors. //@ build-pass: needs linking //@ only-msvc #[used] static FOO: u32 = 0; fn main() {} </ins>


<ins> warning: function cannot return without recursing --> $DIR/issue-87450.rs:5:1 | LL | fn foo() -> impl Fn() { | ^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing ... LL |     wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo()))))))) |                                        ----- recursive call site | = note: `#[warn(unconditional_recursion)]` on by default = help: a `loop` may express intention better if this is on purpose error[E0720]: cannot resolve opaque type --> $DIR/issue-87450.rs:5:13 | LL | fn foo() -> impl Fn() { |             ^^^^^^^^^ recursive opaque type ... LL |     wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo()))))))) |     ----------------------------------------------- returning here with type `impl Fn<()>` ... LL | fn wrap(f: impl Fn()) -> impl Fn() { |                          --------- returning this opaque type `impl Fn<()>` error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0720`. </ins>


<ins> use std::{ptr::NonNull, task::Poll}; struct TaskRef; struct Header { vtable: &'static Vtable, } struct Vtable { poll: unsafe fn(TaskRef) -> Poll<()>, deallocate: unsafe fn(NonNull<Header>), } // in the "Header" type, which is a private type in maitake impl Header { pub(crate) const fn new_stub() -> Self { unsafe fn nop(_ptr: TaskRef) -> Poll<()> { Poll::Pending } unsafe fn nop_deallocate(ptr: NonNull<Header>) { unreachable!("stub task ({ptr:p}) should never be deallocated!"); } Self { vtable: &Vtable { poll: nop, deallocate: nop_deallocate } } } } // This is a public type in `maitake` #[repr(transparent)] #[cfg_attr(loom, allow(dead_code))] pub struct TaskStub { hdr: Header, } impl TaskStub { /// Create a new unique stub [`Task`]. pub const fn new() -> Self { Self { hdr: Header::new_stub() } } } </ins>


<ins> // revisions: rpass cfail enum A { //[cfail]~^ ERROR 3:1: 3:7: recursive type `A` has infinite size [E0072] B(C), } #[cfg(rpass)] struct C(Box<A>); #[cfg(cfail)] struct C(A); //[cfail]~^ ERROR 12:1: 12:13: recursive type `C` has infinite size [E0072] fn main() {} </ins>


pub fn check_for_errors_in<T, F>(f: F) -> Result<T, String> where F: FnOnce() -> T, { <del> use std::sync::{Mutex, Once, ONCE_INIT}; static INIT: Once = ONCE_INIT; </del> <ins> use std::sync::{Mutex, Once}; static INIT: Once = Once::new(); </ins> static mut LOCK: *mut Mutex<()> = 0 as *mut _; unsafe { INIT.call_once(|| {


}; for (local, val) in cpv.can_const_prop.iter_enumerated_mut() { let ty = body.local_decls[local].ty; <del> match tcx.layout_of(param_env.and(ty)) { Ok(layout) if layout.size < Size::from_bytes(MAX_ALLOC_LIMIT) => {} // Either the layout fails to compute, then we can't use this local anyway // or the local is too large, then we don't want to. _ => { *val = ConstPropMode::NoPropagation; continue; </del> <ins> if ty.is_union() { // Do not const prop unions as they can // ICE during layout calc *val = ConstPropMode::NoPropagation; } else { match tcx.layout_of(param_env.and(ty)) { Ok(layout) if layout.size < Size::from_bytes(MAX_ALLOC_LIMIT) => {} // Either the layout fails to compute, then we can't use this local anyway // or the local is too large, then we don't want to. _ => { *val = ConstPropMode::NoPropagation; continue; } </ins> } } }


<ins> warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/unifying-placeholders-in-query-response.rs:5:12 | LL | #![feature(non_lifetime_binders)] |            ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted </ins>


// Free the allocation without dropping its contents let (bptr, alloc) = Box::into_raw_with_allocator(src); <del> let src = Box::from_raw(bptr as *mut mem::ManuallyDrop<T>); </del> <ins> let src = Box::from_raw_in(bptr as *mut mem::ManuallyDrop<T>, alloc.by_ref()); </ins> drop(src); Self::from_ptr_in(ptr, alloc)


- [Extend `ptr::null` and `null_mut` to all thin (including extern) types.][94954] - [`impl Read and Write for VecDeque<u8>`.][95632] - [STD support for the Nintendo 3DS.][95897] <ins> - [Use rounding in float to Duration conversion methods.][96051] </ins> - [Make write/print macros eagerly drop temporaries.][96455] - [Implement internal traits that enable `[OsStr]::join`.][96881] - [Implement `Hash` for `core::alloc::Layout`.][97034]


<del> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn foo(_s: i16) { } fn bar(_s: u32) { } fn main() { foo(1*(1 as int)); //~^ ERROR: mismatched types: expected `i16`, found `int` (expected `i16`, found `int`) bar(1*(1 as uint)); //~^ ERROR: mismatched types: expected `u32`, found `uint` (expected `u32`, found `uint`) } </del>


kind: TypeVariableOriginKind::MiscVariable, span: full_call_span, }); <del> self.point_at_expr_source_of_inferred_type(&mut err, rcvr, expected, callee_ty); </del> <ins> self.point_at_expr_source_of_inferred_type( &mut err, rcvr, expected, callee_ty, provided_arg_span, ); </ins> } // Call out where the function is defined self.label_fn_like(


/// Float types, respectively). When comparing two ADTs, these rules apply recursively. pub fn same_type_modulo_infer(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> bool { let (a, b) = self.resolve_vars_if_possible((a, b)); <del> match (a.kind(), b.kind()) { (&ty::Adt(def_a, substs_a), &ty::Adt(def_b, substs_b)) => { if def_a != def_b { return false; } </del> <ins> SameTypeModuloInfer(self).relate(a, b).is_ok() } } </ins> <del> substs_a .types() .zip(substs_b.types()) .all(|(a, b)| self.same_type_modulo_infer(a, b)) } (&ty::FnDef(did_a, substs_a), &ty::FnDef(did_b, substs_b)) => { if did_a != did_b { return false; } </del> <ins> struct SameTypeModuloInfer<'a, 'tcx>(&'a InferCtxt<'a, 'tcx>); </ins> <del> substs_a .types() .zip(substs_b.types()) .all(|(a, b)| self.same_type_modulo_infer(a, b)) } (&ty::Int(_) | &ty::Uint(_), &ty::Infer(ty::InferTy::IntVar(_))) </del> <ins> impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> { fn tcx(&self) -> TyCtxt<'tcx> { self.0.tcx } fn param_env(&self) -> ty::ParamEnv<'tcx> { // Unused, only for consts which we treat as always equal ty::ParamEnv::empty() } fn tag(&self) -> &'static str { "SameTypeModuloInfer" } fn a_is_expected(&self) -> bool { true } fn relate_with_variance<T: relate::Relate<'tcx>>( &mut self, _variance: ty::Variance, _info: ty::VarianceDiagInfo<'tcx>, a: T, b: T, ) -> relate::RelateResult<'tcx, T> { self.relate(a, b) } fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> { match (a.kind(), b.kind()) { (ty::Int(_) | ty::Uint(_), ty::Infer(ty::InferTy::IntVar(_))) </ins> | ( <del> &ty::Infer(ty::InferTy::IntVar(_)), &ty::Int(_) | &ty::Uint(_) | &ty::Infer(ty::InferTy::IntVar(_)), </del> <ins> ty::Infer(ty::InferTy::IntVar(_)), ty::Int(_) | ty::Uint(_) | ty::Infer(ty::InferTy::IntVar(_)), </ins> ) <del> | (&ty::Float(_), &ty::Infer(ty::InferTy::FloatVar(_))) </del> <ins> | (ty::Float(_), ty::Infer(ty::InferTy::FloatVar(_))) </ins> | ( <del> &ty::Infer(ty::InferTy::FloatVar(_)), &ty::Float(_) | &ty::Infer(ty::InferTy::FloatVar(_)), </del> <ins> ty::Infer(ty::InferTy::FloatVar(_)), ty::Float(_) | ty::Infer(ty::InferTy::FloatVar(_)), </ins> ) <del> | (&ty::Infer(ty::InferTy::TyVar(_)), _) | (_, &ty::Infer(ty::InferTy::TyVar(_))) => true, (&ty::Ref(_, ty_a, mut_a), &ty::Ref(_, ty_b, mut_b)) => { mut_a == mut_b && self.same_type_modulo_infer(ty_a, ty_b) } (&ty::RawPtr(a), &ty::RawPtr(b)) => { a.mutbl == b.mutbl && self.same_type_modulo_infer(a.ty, b.ty) } (&ty::Slice(a), &ty::Slice(b)) => self.same_type_modulo_infer(a, b), (&ty::Array(a_ty, a_ct), &ty::Array(b_ty, b_ct)) => { self.same_type_modulo_infer(a_ty, b_ty) && a_ct == b_ct } (&ty::Tuple(a), &ty::Tuple(b)) => { if a.len() != b.len() { return false; } std::iter::zip(a.iter(), b.iter()).all(|(a, b)| self.same_type_modulo_infer(a, b)) } (&ty::FnPtr(a), &ty::FnPtr(b)) => { let a = a.skip_binder().inputs_and_output; let b = b.skip_binder().inputs_and_output; if a.len() != b.len() { return false; } std::iter::zip(a.iter(), b.iter()).all(|(a, b)| self.same_type_modulo_infer(a, b)) } // FIXME(compiler-errors): This needs to be generalized more _ => a == b, </del> <ins> | (ty::Infer(ty::InferTy::TyVar(_)), _) | (_, ty::Infer(ty::InferTy::TyVar(_))) => Ok(a), (ty::Infer(_), _) | (_, ty::Infer(_)) => Err(TypeError::Mismatch), _ => relate::super_relate_tys(self, a, b), </ins> } } <ins> fn regions( &mut self, a: ty::Region<'tcx>, b: ty::Region<'tcx>, ) -> RelateResult<'tcx, ty::Region<'tcx>> { if (a.is_var() && b.is_free_or_static()) || (b.is_var() && a.is_free_or_static()) || a == b { Ok(a) } else { Err(TypeError::Mismatch) } } fn binders<T>( &mut self, a: ty::Binder<'tcx, T>, b: ty::Binder<'tcx, T>, ) -> relate::RelateResult<'tcx, ty::Binder<'tcx, T>> where T: relate::Relate<'tcx>, { Ok(ty::Binder::dummy(self.relate(a.skip_binder(), b.skip_binder())?)) } fn consts( &mut self, a: ty::Const<'tcx>, _b: ty::Const<'tcx>, ) -> relate::RelateResult<'tcx, ty::Const<'tcx>> { // FIXME(compiler-errors): This could at least do some first-order // relation Ok(a) } </ins> } impl<'a, 'tcx> InferCtxt<'a, 'tcx> {


FileType(self.0.file_type()) } <del> /// Returns whether this metadata is for a directory. </del> <ins> /// Returns whether this metadata is for a directory. The /// result is mutually exclusive to the result of /// [`is_file`], and will be false for symlink metadata /// obtained from [`symlink_metadata`]. /// /// [`is_file`]: struct.Metadata.html#method.is_file /// [`symlink_metadata`]: fn.symlink_metadata.html </ins> /// /// # Examples ///


pub mod rusti { #[abi = "rust-intrinsic"] pub extern { <del> pub fn frame_address(f: &once fn(++x: *u8)); </del> <ins> pub fn frame_address(f: &once fn(x: *u8)); </ins> } }


let short = item.type_(); let myname = match item.name { None => continue, <del> Some(ref s) => s.to_string(), </del> <ins> Some(s) => s, </ins> }; <del> let short = short.to_string(); map.entry(short).or_default().push(( myname, Some(item.doc_value().map_or_else(String::new, |s| plain_text_summary(&s))), )); </del> <ins> if inserted.entry(short).or_default().insert(myname) { let short = short.to_string(); let myname = myname.to_string(); map.entry(short).or_default().push(( myname, Some(item.doc_value().map_or_else(String::new, |s| plain_text_summary(&s))), )); } </ins> } if self.shared.sort_modules_alphabetically {


<ins> // Regression test for #57597. // // Make sure that nested matchers work correctly rather than causing an infinite loop or crash. // edition:2018 macro_rules! foo1 { ($($($i:ident)?)+) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo2 { ($($($i:ident)?)*) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo3 { ($($($i:ident)?)?) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo4 { ($($($($i:ident)?)?)?) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo5 { ($($($($i:ident)*)?)?) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo6 { ($($($($i:ident)?)*)?) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo7 { ($($($($i:ident)?)?)*) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo8 { ($($($($i:ident)*)*)?) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo9 { ($($($($i:ident)?)*)*) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo10 { ($($($($i:ident)?)*)+) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo11 { ($($($($i:ident)+)?)*) => {}; //~^ ERROR repetition matches empty token tree } macro_rules! foo12 { ($($($($i:ident)+)*)?) => {}; //~^ ERROR repetition matches empty token tree } fn main() { foo1!(); foo2!(); foo3!(); foo4!(); foo5!(); foo6!(); foo7!(); foo8!(); foo9!(); foo10!(); foo11!(); foo12!(); } </ins>


}; let ExpansionData { depth, id: expn_id, .. } = invoc.expansion_data; <ins> let depth = depth - orig_expansion_data.depth; </ins> self.cx.current_expansion = invoc.expansion_data.clone(); self.cx.force_mode = force;


pat: &'tcx Pat<'tcx>, expected: Ty<'tcx>, span: Option<Span>, <del> origin_expr: bool, </del> <ins> origin_expr: Option<&'tcx hir::Expr<'tcx>>, </ins> ) { let info = TopInfo { expected, origin_expr, span }; self.check_pat(pat, expected, INITIAL_BM, info);


// Use `||` to give these suggestions a precedence let suggested = self.suggest_missing_parentheses(err, expr) <ins> || self.suggest_missing_unwrap_expect(err, expr, expected, expr_ty) </ins> || self.suggest_remove_last_method_call(err, expr, expected) || self.suggest_associated_const(err, expr, expected) || self.suggest_deref_ref_or_into(err, expr, expected, expr_ty, expected_ty_expr)


<ins> type Range = std::ops::Range<usize>; fn demo(r: &Range) { println!("{:?}", r); } fn tell(x: usize) -> usize { x } fn main() { demo(tell(1)..tell(10)); //~^ ERROR mismatched types demo(1..10); //~^ ERROR mismatched types } </ins>


<ins> error[E0425]: cannot find function `used_fn` in this scope --> $DIR/tainted-body.rs:9:9 | LL |         used_fn(); |         ^^^^^^^ not found in this scope error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. </ins>


base.has_elf_tls = true; base.features = "+neon,+fp-armv8".to_string(); <del> // FIXME: this shouldn't be panic=abort, it should be panic=unwind base.panic_strategy = PanicStrategy::Abort; </del> Ok(Target { llvm_target: "aarch64-pc-windows-msvc".to_string(), target_endian: "little".to_string(),


<ins> // only-x86_64 #![feature(target_feature_11)] #[target_feature(enable = "avx")] fn foo() {} #[target_feature(enable = "avx")] unsafe fn foo_unsafe() {} fn call(f: impl Fn()) { f() } fn call_mut(f: impl FnMut()) { f() } fn call_once(f: impl FnOnce()) { f() } fn main() { call(foo); //~ ERROR expected a `std::ops::Fn<()>` closure, found `fn() {foo}` call_mut(foo); //~ ERROR expected a `std::ops::FnMut<()>` closure, found `fn() {foo}` call_once(foo); //~ ERROR expected a `std::ops::FnOnce<()>` closure, found `fn() {foo}` call(foo_unsafe); //~^ ERROR expected a `std::ops::Fn<()>` closure, found `unsafe fn() {foo_unsafe}` call_mut(foo_unsafe); //~^ ERROR expected a `std::ops::FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` call_once(foo_unsafe); //~^ ERROR expected a `std::ops::FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` } </ins>


} fn check_fn_decl(&self, fn_decl: &FnDecl, self_semantic: SelfSemantic) { <ins> self.check_decl_num_args(fn_decl); </ins> self.check_decl_cvaradic_pos(fn_decl); self.check_decl_attrs(fn_decl); self.check_decl_self_param(fn_decl, self_semantic); } <ins> /// Emits fatal error if function declaration has more than `u16::MAX` arguments /// Error is fatal to prevent errors during typechecking fn check_decl_num_args(&self, fn_decl: &FnDecl) { let max_num_args: usize = u16::MAX.into(); if fn_decl.inputs.len() > max_num_args { let Param { span, .. } = fn_decl.inputs[0]; self.err_handler().span_fatal( span, &format!("function can not have more than {} arguments", max_num_args), ); } } </ins> fn check_decl_cvaradic_pos(&self, fn_decl: &FnDecl) { match &*fn_decl.inputs { [Param { ty, span, .. }] => {


- [`#[link]` attributes are now checked more strictly,][96885] which may introduce errors for invalid attribute arguments that were previously ignored. <ins> - [Rounding is now used when converting a float to a `Duration`.][96051] The converted duration can differ slightly from what it was. </ins> Internal Changes ----------------


the string entered with a fuzzy matching algorithm that is tolerant of minor typos. <del> By default, the search results give are "In Names", </del> <ins> By default, the search results given are "In Names", </ins> meaning that the fuzzy match is made against the names of items. Matching names are shown on the left, and the first few words of their descriptions are given on the right.


<ins> // Generalizes the suggestion introduced in #100838 trait Foo<T> { fn bar(&self, _: T); } impl Foo<i32> for i32 { fn bar(&self, x: i32) { println!("{}", self + x); } } fn main() { 1.bar::<i32>(0); //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied //~| HELP consider moving this generic argument to the `Foo` trait, which takes up to 1 argument //~| HELP remove these generics } </ins>


|              not allowed in type signatures |              help: replace `_` with the correct type: `i32` <del> error: aborting due to 66 previous errors </del> <ins> error: aborting due to 67 previous errors </ins> Some errors have detailed explanations: E0121, E0282, E0403. For more information about an error, try `rustc --explain E0121`.


/// * if `path` has a root but no prefix (e.g., `windows`), it ///   replaces everything except for the prefix (if any) of `self`. /// * if `path` has a prefix but no root, it replaces `self`. <ins> /// * if `self` has a verbatim prefix (e.g. `?C:windows`) ///   and `path` is not empty, the new path is normalized: all references ///   to `.` and `..` are removed. </ins> /// /// # Examples ///


<ins> // check-pass // compile-flags: --edition 2018 #![feature(try_blocks)] #![warn(unused_parens, unused_braces)] fn consume<T>(_: Result<T, T>) -> T { todo!() } fn main() { consume((try {})); //~^ WARN unnecessary parentheses consume({ try {} }); //~^ WARN unnecessary braces match (try {}) { //~^ WARN unnecessary parentheses Ok(()) | Err(()) => (), } if let Err(()) = (try {}) {} //~^ WARN unnecessary parentheses match (try {}) { //~^ WARN unnecessary parentheses Ok(()) | Err(()) => (), } } </ins>


&& this.token.kind == token::Semi { TrailingToken::Semi <ins> } else if this.token.kind == token::Gt { TrailingToken::Gt </ins> } else { // FIXME - pass this through from the place where we know // we need a comma, rather than assuming that `#[attr] expr,`


<ins> error: overflow evaluating associated type `Carrier<'b>::Focus<i32>` --> $DIR/issue-111879-0.rs:11:25 | LL |     pub type Focus<T> = &'a mut User; |                         ^^^^^^^^^^^^ error: aborting due to previous error </ins>


extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t, nread: libc::ssize_t, <del> ++buf: uv::ll::uv_buf_t) { </del> <ins> buf: uv::ll::uv_buf_t) { </ins> unsafe { debug!("entering on_tcp_read_cb stream: %? nread: %?", stream, nread);


pub const tag_impl_coerce_unsized_kind: usize = 0xa5; pub const tag_items_data_item_constness: usize = 0xa6; <ins> pub const tag_rustc_version: usize = 0x10f; pub fn rustc_version() -> String { format!( "rustc {}", option_env!("CFG_VERSION").unwrap_or("unknown version") ) } </ins>


<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn foo(x: i32) { |y| x + y //~^ ERROR: mismatched types: //~| expected `()`, //~|     found closure //~| (expected (), //~|     found closure) [E0308] } fn main() { let x = foo(5)(2); //~^ ERROR: expected function, found `()` } </ins>


<ins> //@ check-pass //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] #[macro_use] extern crate another_proc_macro; use another_proc_macro::{pointee, AnotherMacro}; #[derive(core::marker::SmartPointer)] #[repr(transparent)] pub struct Ptr<'a, #[pointee] T: ?Sized> { data: &'a mut T, } #[pointee] fn f() {} #[derive(AnotherMacro)] #[pointee] struct MyStruct; fn main() {} </ins>


/// The default panic handler. fn default_hook(info: &PanicInfo<'_>) { <del> panic_hook_with_disk_dump(info, None) } #[unstable(feature = "ice_to_disk", issue = "none")] /// The implementation of the default panic handler. /// /// It can also write the backtrace to a given `path`. This functionality is used only by `rustc`. pub fn panic_hook_with_disk_dump(info: &PanicInfo<'_>, path: Option<&crate::path::Path>) { </del> // If this is a double panic, make sure that we print a backtrace // for this panic. Otherwise only print it if logging is enabled. let backtrace = if info.force_no_backtrace() {


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


assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Enums") assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Traits") assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Functions") <del> assert: (".sidebar-elems > .items > ul > li:nth-child(6)", "Keywords") </del> <ins> assert: (".sidebar-elems > .items > ul > li:nth-child(6)", "Type Definitions") assert: (".sidebar-elems > .items > ul > li:nth-child(7)", "Keywords") </ins> assert: ("#structs + table td > a", "Foo") click: "#structs + table td > a"


/// Writes to a fixed-size byte slice <ins> /// /// If a write will not fit in the buffer, it raises the `io_error` /// condition and does not write any data. </ins> pub struct BufWriter<'self> { priv buf: &'self mut [u8], priv pos: uint


<del> Subproject commit ae964207bb17911cf96d9744d9469fa2734093a8 </del> <ins> Subproject commit 12dac5c0f7acd106401aa14fec758f0ff552f678 </ins>


AtomicOrderingFence, AtomicOrderingLoad, AtomicOrderingStore, ImproperCTypes, InvalidAtomicOrderingDiag, OnlyCastu8ToChar, OverflowingBinHex, OverflowingBinHexSign, OverflowingBinHexSub, OverflowingInt, OverflowingIntHelp, OverflowingLiteral, <del> OverflowingUInt, RangeEndpointOutOfRange, UnusedComparisons, VariantSizeDifferencesDiag, </del> <ins> OverflowingUInt, RangeEndpointOutOfRange, UnusedComparisons, UseInclusiveRange, VariantSizeDifferencesDiag, </ins> }, }; use crate::{LateContext, LateLintPass, LintContext};


<ins> `async fn`s are not yet supported in traits in Rust. Erroneous code example: ```compile_fail,edition2018 trait T { // Neither case is currently supported. async fn foo() {} async fn bar(&self) {} } ``` `async fn`s return an `impl Future`, making the following two examples equivalent: ```edition2018,ignore (example-of-desugaring-equivalence) async fn foo() -> User { unimplemented!() } // The async fn above gets desugared as follows: fn foo(&self) -> impl Future<Output = User> + '_ { unimplemented!() } ``` But when it comes to supporting this in traits, there are [a few implementation issues][async-is-hard]. One of them is returning `impl Trait` in traits is not supported, as it would require [Generic Associated Types] to be supported: ```edition2018,ignore (example-of-desugaring-equivalence) impl MyDatabase { async fn get_user(&self) -> User { unimplemented!() } } impl MyDatabase { fn get_user(&self) -> impl Future<Output = User> + '_ { unimplemented!() } } ``` Until these issues are resolved, you can use the [`async-trait` crate], allowing you to use `async fn` in traits by desugaring to "boxed futures" (`Pin<Box<dyn Future + Send + 'async>>`). Note that using these trait methods will result in a heap allocation per-function-call. This is not a significant cost for the vast majority of applications, but should be considered when deciding whether to use this functionality in the public API of a low-level function that is expected to be called millions of times a second. You might be interested in visiting the [async book] for further information. [`async-trait` crate]: https://crates.io/crates/async-trait [async-is-hard]: https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/ [Generic Associated Types]: https://github.com/rust-lang/rust/issues/44265 [async book]: https://rust-lang.github.io/async-book/07_workarounds/06_async_in_traits.html </ins>


<ins> error: invalid const generic expression --> $DIR/issue-103143.rs:2:13 | LL |     x::<#[a]y::<z>> |             ^^^^^^ | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     x::<#[a]{ y::<z> }> |             +        + error[E0425]: cannot find value `x` in this scope --> $DIR/issue-103143.rs:2:5 | LL |     x::<#[a]y::<z>> |     ^ not found in this scope error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>


} } <del> // Maybe add libLLVM.so to the lib-dir. It will only have been built if // LLVM tools are linked dynamically. // // We add this to both the libdir of the rustc binary itself (for it to load at // runtime) and also to the target directory so it can find it at link-time. // // Note: This function does no yet support Windows but we also don't support //       linking LLVM tools dynamically on Windows yet. pub fn maybe_install_llvm_dylib(builder: &Builder<'_>, target: Interned<String>, sysroot: &Path) { </del> <ins> /// Maybe add libLLVM.so to the given destination lib-dir. It will only have /// been built if LLVM tools are linked dynamically. /// /// Note: This function does not yet support Windows, but we also don't support ///       linking LLVM tools dynamically on Windows yet. fn maybe_install_llvm(builder: &Builder<'_>, target: Interned<String>, dst_libdir: &Path) { </ins> let src_libdir = builder.llvm_out(target).join("lib"); <del> let dst_libdir1 = sysroot.join("lib/rustlib").join(&*target).join("lib"); let dst_libdir2 = sysroot.join(builder.sysroot_libdir_relative(Compiler { stage: 1, host: target })); t!(fs::create_dir_all(&dst_libdir1)); t!(fs::create_dir_all(&dst_libdir2)); </del> if target.contains("apple-darwin") { let llvm_dylib_path = src_libdir.join("libLLVM.dylib"); if llvm_dylib_path.exists() { <del> builder.install(&llvm_dylib_path, &dst_libdir1, 0o644); builder.install(&llvm_dylib_path, &dst_libdir2, 0o644); </del> <ins> builder.install(&llvm_dylib_path, dst_libdir, 0o644); </ins> } return; }


} impl<'self> Writer for BufWriter<'self> { <del> fn write(&mut self, _buf: &[u8]) { fail!() } </del> <ins> fn write(&mut self, buf: &[u8]) { // raises a condition if the entire write does not fit in the buffer let max_size = self.buf.len(); if self.pos >= max_size || (self.pos + buf.len()) > max_size { io_error::cond.raise(IoError { kind: OtherIoError, desc: "Trying to write past end of buffer", detail: None }); return; } </ins> <del> fn flush(&mut self) { fail!() } </del> <ins> vec::bytes::copy_memory(self.buf.mut_slice_from(self.pos), buf, buf.len()); self.pos += buf.len(); } </ins> } <ins> // FIXME(#10432) </ins> impl<'self> Seek for BufWriter<'self> { <del> fn tell(&self) -> u64 { fail!() } </del> <ins> fn tell(&self) -> u64 { self.pos as u64 } </ins> <del> fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() } </del> <ins> fn seek(&mut self, pos: i64, style: SeekStyle) { // compute offset as signed and clamp to prevent overflow let offset = match style { SeekSet => { 0 } SeekEnd => { self.buf.len() } SeekCur => { self.pos } } as i64; self.pos = max(0, offset+pos) as uint; } </ins> }


assert_eq!(copy(&mut r as &mut dyn Read, &mut w as &mut dyn Write).unwrap(), 1 << 17); } <ins> struct ShortReader { cap: usize, read_size: usize, observed_buffer: usize, } impl Read for ShortReader { fn read(&mut self, buf: &mut [u8]) -> Result<usize> { let bytes = min(self.cap, self.read_size); self.cap -= bytes; self.observed_buffer = max(self.observed_buffer, buf.len()); Ok(bytes) } } struct WriteObserver { observed_buffer: usize, } impl Write for WriteObserver { fn write(&mut self, buf: &[u8]) -> Result<usize> { self.observed_buffer = max(self.observed_buffer, buf.len()); Ok(buf.len()) } fn flush(&mut self) -> Result<()> { Ok(()) } } #[test] fn copy_specializes_bufwriter() { let cap = 117 * 1024; let buf_sz = 16 * 1024; let mut r = ShortReader { cap, observed_buffer: 0, read_size: 1337 }; let mut w = BufWriter::with_capacity(buf_sz, WriteObserver { observed_buffer: 0 }); assert_eq!( copy(&mut r, &mut w).unwrap(), cap as u64, "expected the whole capacity to be copied" ); assert_eq!(r.observed_buffer, buf_sz, "expected a large buffer to be provided to the reader"); assert!(w.get_mut().observed_buffer > DEFAULT_BUF_SIZE, "expected coalesced writes"); } </ins> #[test] fn sink_sinks() { let mut s = sink();


<ins> #[macro_export] macro_rules! a{ () => {}} #[macro_export] macro_rules! b{ () => {}} </ins>


<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn f<F, R>(_: F) where F: Fn() -> R { } fn main() { f(|| -> ! { () }); //~^ ERROR: computation may converge in a function marked as diverging [E0270] } </ins>


id: ast::NodeId, span: syntax_pos::Span, name: ast::Name, <del> node_type: &str) { </del> <ins> node_type: &str, participle: &str) { </ins> if !name.as_str().starts_with("_") { self.tcx .lint_node(lint::builtin::DEAD_CODE, id, span, <del> &format!("{} is never used: `{}`", node_type, name)); </del> <ins> &format!("{} is never {}: `{}`", node_type, participle, name)); </ins> } } }


[submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git <del> branch = rustc/17.0-2023-07-29 </del> <ins> branch = rustc/17.0-2023-09-19 </ins> shallow = true [submodule "src/doc/embedded-book"] path = src/doc/embedded-book


#![allow(non_upper_case_globals)] <ins> use attributes; </ins> use intrinsics::{self, Intrinsic}; use llvm::{self, TypeKind}; use abi::{Abi, FnType, LlvmType, PassMode};


// option. This file may not be copied, modified, or distributed // except according to those terms. <del> #![feature(globs)] </del> <ins> #![feature(globs, lang_items)] </ins> #![no_std] // makes debugging this test *a lot* easier (during resolve) <ins> #[lang = "sized"] pub trait Sized for Sized? {} </ins> // Test to make sure that private items imported through globs remain private // when  they're used.


<ins> error: unterminated double quote string --> $DIR/test-compile-fail3.rs:3:1 | 3 | "fail | ^^^^^^ error: aborting due to previous error </ins>


panic_unwind = { path = "../panic_unwind", optional = true } panic_abort = { path = "../panic_abort" } core = { path = "../core", public = true } <del> compiler_builtins = { version = "0.1.114" } </del> <ins> compiler_builtins = { version = "0.1.117" } </ins> profiler_builtins = { path = "../profiler_builtins", optional = true } unwind = { path = "../unwind" } hashbrown = { version = "0.14", default-features = false, features = [


<ins> #![feature(auto_traits)] auto trait AutoTrait {} // You cannot impl your own `dyn AutoTrait`. impl dyn AutoTrait {} //~ERROR E0785 // You cannot impl someone else's `dyn AutoTrait` impl dyn Unpin {} //~ERROR E0785 fn main() {} </ins>


.push(PathSegment { name: last_segment.name, args: new_params }); bounds.insert(GenericBound::TraitBound( <del> PolyTrait { trait_: new_path, generic_params: poly_trait.generic_params }, </del> <ins> PolyTrait { trait_: new_path, generic_params: poly_trait.generic_params.clone(), }, </ins> hir::TraitBoundModifier::None, )); }


.map(|i| from_item_id_with_name(i.item_id, tcx, i.name)) .collect() } <ins> fn ids_keeping_stripped( items: impl IntoIterator<Item = clean::Item>, tcx: TyCtxt<'_>, ) -> Vec<Option<Id>> { items .into_iter() .map(|i| { if !i.is_stripped() && !i.is_keyword() { Some(from_item_id_with_name(i.item_id, tcx, i.name)) } else { None } }) .collect() } </ins>


#[derive(SmartPointer)] //~ ERROR use of unstable library feature 'derive_smart_pointer' #[repr(transparent)] struct MyPointer<'a, #[pointee] T: ?Sized> { <del> //~^ ERROR the `#[pointee]` attribute is an experimental feature </del> ptr: &'a T, }


... LL |     arg.wait(); |         ^^^^ <del> | help: another candidate was found in the following trait, perhaps add a `use` for it: | LL | use private::Future; | </del> error: aborting due to previous error


<ins> // check-pass // aux-build:test-macros.rs // compile-flags: -Z span-debug #![no_std] // Don't load unnecessary hygiene information from std extern crate std; extern crate test_macros; #[test_macros::print_attr] fn foo<T>() where T: Copy + { } fn main() {} </ins>


} alloc0 (static: FOO, size: 4, align: 4) { <del> ╾─alloc3──╼                                     │ ╾──╼ </del> <ins> ╾─alloc9──╼                                     │ ╾──╼ </ins> } <del> alloc3 (size: 168, align: 1) { </del> <ins> alloc9 (size: 168, align: 1) { </ins> 0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................ 0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾─alloc4──╼ │ ............╾──╼ 0x20 │ 01 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 │ ................


for _ in 0..sz_a - self.len { self.a.next_back(); } <ins> self.a_len = self.len; </ins> } let sz_b = self.b.size(); if B::MAY_HAVE_SIDE_EFFECT && sz_b > self.len {


/// /// This is required because we may still want to run MIR passes on an item /// with type errors, but normal MIR construction can't handle that in general. <del> fn construct_error(tcx: TyCtxt<'_>, def: LocalDefId, err: ErrorGuaranteed) -> Body<'_> { let span = tcx.def_span(def); let hir_id = tcx.hir().local_def_id_to_hir_id(def); let coroutine_kind = tcx.coroutine_kind(def); let body_owner_kind = tcx.hir().body_owner_kind(def); let ty = Ty::new_error(tcx, err); let num_params = match body_owner_kind { hir::BodyOwnerKind::Fn => tcx.fn_sig(def).skip_binder().inputs().skip_binder().len(), hir::BodyOwnerKind::Closure => { let ty = tcx.type_of(def).instantiate_identity(); match ty.kind() { ty::Closure(_, args) => 1 + args.as_closure().sig().inputs().skip_binder().len(), ty::Coroutine(..) => 2, _ => bug!("expected closure or coroutine, found {ty:?}"), } </del> <ins> fn construct_error(tcx: TyCtxt<'_>, def_id: LocalDefId, guar: ErrorGuaranteed) -> Body<'_> { let span = tcx.def_span(def_id); let hir_id = tcx.hir().local_def_id_to_hir_id(def_id); let coroutine_kind = tcx.coroutine_kind(def_id); let (inputs, output, yield_ty) = match tcx.def_kind(def_id) { DefKind::Const | DefKind::AssocConst | DefKind::AnonConst | DefKind::InlineConst | DefKind::Static(_) => (vec![], tcx.type_of(def_id).instantiate_identity(), None), DefKind::Ctor(..) | DefKind::Fn | DefKind::AssocFn => { let sig = tcx.liberate_late_bound_regions( def_id.to_def_id(), tcx.fn_sig(def_id).instantiate_identity(), ); (sig.inputs().to_vec(), sig.output(), None) } DefKind::Closure => { let closure_ty = tcx.type_of(def_id).instantiate_identity(); let ty::Closure(_, args) = closure_ty.kind() else { bug!() }; let args = args.as_closure(); let sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), args.sig()); let self_ty = match args.kind() { ty::ClosureKind::Fn => Ty::new_imm_ref(tcx, tcx.lifetimes.re_erased, closure_ty), ty::ClosureKind::FnMut => Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, closure_ty), ty::ClosureKind::FnOnce => closure_ty, }; ([self_ty].into_iter().chain(sig.inputs().to_vec()).collect(), sig.output(), None) } DefKind::Coroutine => { let coroutine_ty = tcx.type_of(def_id).instantiate_identity(); let ty::Coroutine(_, args, _) = coroutine_ty.kind() else { bug!() }; let args = args.as_coroutine(); let yield_ty = args.yield_ty(); let return_ty = args.return_ty(); let self_ty = Ty::new_adt( tcx, tcx.adt_def(tcx.lang_items().pin_type().unwrap()), tcx.mk_args(&[Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, coroutine_ty).into()]), ); let coroutine_state = Ty::new_adt( tcx, tcx.adt_def(tcx.lang_items().coroutine_state().unwrap()), tcx.mk_args(&[yield_ty.into(), return_ty.into()]), ); (vec![self_ty, args.resume_ty()], coroutine_state, Some(yield_ty)) </ins> } <del> hir::BodyOwnerKind::Const { .. } => 0, hir::BodyOwnerKind::Static(_) => 0, </del> <ins> dk => bug!("{:?} is not a body: {:?}", def_id, dk), </ins> }; <ins> let source_info = SourceInfo { span, scope: OUTERMOST_SOURCE_SCOPE }; let local_decls = IndexVec::from_iter( [output].iter().chain(&inputs).map(|ty| LocalDecl::with_source_info(*ty, source_info)), ); </ins> let mut cfg = CFG { basic_blocks: IndexVec::new() }; let mut source_scopes = IndexVec::new(); <del> let mut local_decls = IndexVec::from_elem_n(LocalDecl::new(ty, span), 1); </del> cfg.start_new_block(); source_scopes.push(SourceScopeData {


if !fail { return None; } <del> bug!("unexpected const parent path def {:?}", x); </del> <ins> tcx.sess.delay_span_bug( DUMMY_SP, &format!( "unexpected const parent path def {:?}", x ), ); tcx.types.err </ins> } } }


&mut self, radix: u32, max_digits: Option<usize>, <ins> allow_zero_prefix: bool, </ins> ) -> Option<T> { self.read_atomically(move |p| { let mut result = T::ZERO; let mut digit_count = 0; <ins> let has_leading_zero = p.peek_char() == Some('0'); </ins> while let Some(digit) = p.read_atomically(|p| p.read_char()?.to_digit(radix)) { result = result.checked_mul(radix)?;


<ins> // build-pass // force-host // no-prefer-dynamic // aux-build:exports_no_mangle.rs #![crate_type = "proc-macro"] // Issue #111888: this proc-macro crate imports another crate that itself // exports a no_mangle function. // // That combination was broken for a period of time, because: // // In PR #99944 we *stopped* exporting no_mangle symbols from // proc-macro crates. The constructed linker version script still referred // to them, but resolving that discrepancy was left as a FIXME in the code. // // In PR #108017 we started telling the linker to check (via the // `--no-undefined-version` linker invocation flag) that every symbol referenced // in the "linker version script" is actually present in the linker input. So // the unresolved discrepancy from #99944 started surfacing as a compile-time // error. extern crate exports_no_mangle; </ins>


"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf" <del> "checksum backtrace 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)" = "1c50b4cb6d852a8567d98bb11c03f91ccec4dfbd88778bc1b92789c624081283" </del> <ins> "checksum backtrace 0.3.29 (registry+https://github.com/rust-lang/crates.io-index)" = "2d631cd7af21b7ff796293f1990104e3cdb606852863bac32f000c193aa35dfb" </ins> "checksum backtrace-sys 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "6ea90dd7b012b3d1a2cb6bec16670a0db2c95d4e931e84f4047e0460c1b34c8d" "checksum bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f1efcc46c18245a69c38fcc5cc650f16d3a59d034f3106e9ed63748f695730a" "checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf"


debug!(?cache_projection, ?obligation_projection); match infcx.at(cause, param_env).eq( <del> DefineOpaqueTypes::No, </del> <ins> DefineOpaqueTypes::Yes, </ins> cache_projection, obligation_projection, ) {


use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::ty::{fast_reject, TypeFoldable}; use rustc_middle::ty::{ToPredicate, TypeVisitableExt}; <del> use rustc_span::ErrorGuaranteed; </del> <ins> use rustc_span::{ErrorGuaranteed, DUMMY_SP}; </ins> use std::fmt::Debug; pub(super) mod structural_traits;


<ins> #![feature(associated_const_equality)] trait T { type A: S<C<X = 0i32> = 34>; //~^ ERROR associated type bindings are not allowed here } trait S { const C: i32; } fn main() {} </ins>


<del> Subproject commit 648e5b90b49af483d07caa8e413473a4517853d6 </del> <ins> Subproject commit 5cb983338e924ec85898880d60e65f2a1291b7be </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. trait Foo { } impl<T:Copy> Foo for T { } fn take_param<T:Foo>(foo: &T) { } fn main() { let x = box 3i; take_param(&x); //~^ ERROR instantiating a type parameter with an incompatible type } </ins>


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


} #[cfg(not(target_vendor = "win7"))] <del> #[link(name = "synchronization")] </del> <ins> // Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library. #[cfg_attr( target_arch = "x86", link( name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib", import_name_type = "undecorated" ) )] #[cfg_attr( not(target_arch = "x86"), link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib") )] </ins> extern "system" { pub fn WaitOnAddress( address: *const c_void,


) -> FfiResult<'tcx> { use FfiResult::*; <del> let transparent_safety = def.repr().transparent().then(|| { // Can assume that at most one field is not a ZST, so only check // that field's type for FFI-safety. </del> <ins> let transparent_with_all_zst_fields = if def.repr().transparent() { </ins> if let Some(field) = transparent_newtype_field(self.cx.tcx, variant) { <del> return self.check_field_type_for_ffi(cache, field, args); </del> <ins> // Transparent newtypes have at most one non-ZST field which needs to be checked.. match self.check_field_type_for_ffi(cache, field, args) { FfiUnsafe { ty, .. } if ty.is_unit() => (), r => return r, } false </ins> } else { <del> // All fields are ZSTs; this means that the type should behave // like (), which is FFI-unsafe... except if all fields are PhantomData, // which is tested for below FfiUnsafe { ty, reason: fluent::lint_improper_ctypes_struct_zst, help: None } </del> <ins> // ..or have only ZST fields, which is FFI-unsafe (unless those fields are all // `PhantomData`). true </ins> } <del> }); // We can't completely trust repr(C) markings; make sure the fields are // actually safe. </del> <ins> } else { false }; // We can't completely trust `repr(C)` markings, so make sure the fields are actually safe. </ins> let mut all_phantom = !variant.fields.is_empty(); for field in &variant.fields { <del> match self.check_field_type_for_ffi(cache, &field, args) { FfiSafe => { all_phantom = false; } FfiPhantom(..) if !def.repr().transparent() && def.is_enum() => { return FfiUnsafe { ty, reason: fluent::lint_improper_ctypes_enum_phantomdata, help: None, }; } FfiPhantom(..) => {} r => return transparent_safety.unwrap_or(r), </del> <ins> all_phantom &= match self.check_field_type_for_ffi(cache, &field, args) { FfiSafe => false, // `()` fields are FFI-safe! FfiUnsafe { ty, .. } if ty.is_unit() => false, FfiPhantom(..) => true, r @ FfiUnsafe { .. } => return r, </ins> } } <del> if all_phantom { FfiPhantom(ty) } else { transparent_safety.unwrap_or(FfiSafe) } </del> <ins> if all_phantom { FfiPhantom(ty) } else if transparent_with_all_zst_fields { FfiUnsafe { ty, reason: fluent::lint_improper_ctypes_struct_zst, help: None } } else { FfiSafe } </ins> } /// Checks if the given type is "ffi-safe" (has a stable, well-defined


self.pos } <ins> // This is only used by a test which asserts that the initialization-tracking is correct. #[cfg(test)] pub fn initialized(&self) -> usize { self.initialized } </ins> #[inline] pub fn discard_buffer(&mut self) { self.pos = 0;


struct Bar; impl Foo for Bar {} // error: `Foo` is not a trait <ins> fn baz<T: Foo>(t: T) {} // error: `Foo` is not a trait </ins> ``` Another erroneous code example: ```compile_fail,E0404 <del> struct Foo; </del> <ins> type Foo = Iterator<Item=String>; </ins> <del> fn bar<T: Foo>(t: T) {} // error: `Foo` is not a trait </del> <ins> fn bar<T: Foo>(t: T) {} // error: `Foo` is a type alias </ins> ``` Please verify that the trait's name was not misspelled or that the right


<ins> #![feature(allow_internal_unstable)] // Macro to help ensure CONST_ERR lint errors // are not silenced in external macros. // https://github.com/rust-lang/rust/issues/65300 #[macro_export] #[allow_internal_unstable(type_ascription)] macro_rules! static_assert { ($test:expr) => { #[allow(dead_code)] const _: () = [()][!($test: bool) as usize]; } } </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. static FOO: &'static [u8] = bytes!("hello, world"); pub fn main() { let b = match true { true => bytes!("test"), false => unreachable!() }; assert_eq!(b, "test".as_bytes()); assert_eq!(FOO, "hello, world".as_bytes()); } </ins>


<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #[macro_export] macro_rules! m { () => { use $crate; } } </ins>


<del> Subproject commit c388361cc2db82568d5e90fefea864f0af8d35e9 </del> <ins> Subproject commit a0ba079b6af0f8c07c33dd8af72a51c997e58967 </ins>


.map(|(id, title, items)| LinkBlock::new(Link::new(id, title), "", items)) .collect(); sidebar_assoc_items(cx, it, &mut blocks); <ins> if !t.is_object_safe(cx.tcx()) { blocks.push(LinkBlock::forced( Link::new("object-safety", "Object Safety"), "object-safety-note", )); } </ins> blocks.push(LinkBlock::forced(Link::new("implementors", "Implementors"), "impl")); if t.is_auto(cx.tcx()) { blocks.push(LinkBlock::forced(


let index = out.join("std").join("index.html"); builder.open_in_browser(index); } else { <del> for requested_crate in &*self.crates { </del> <ins> for requested_crate in crates { </ins> if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) { let index = out.join(requested_crate).join("index.html"); builder.open_in_browser(index);


impl<'a> Resolver<'a> { fn resolution(&self, module: Module<'a>, ident: Ident, ns: Namespace) -> &'a RefCell<NameResolution<'a>> { <ins> let ident = ident.unhygienize(); </ins> *module.resolutions.borrow_mut().entry((ident, ns)) .or_insert_with(|| self.arenas.alloc_name_resolution()) }


"rustc_hir", "rustc_middle", "rustc_span", <ins> "scoped-tls", </ins> "tracing", ]


/// information. #[macro_export] #[allow_internal_unstable] <del> #[cfg(not(no_elf_tls))] </del> macro_rules! scoped_thread_local { (static $name:ident: $t:ty) => ( <del> #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")), thread_local)] </del> static $name: ::std::thread::ScopedKey<$t> = <del> ::std::thread::ScopedKey::new(); </del> <ins> __scoped_thread_local_inner!($t); </ins> ); (pub static $name:ident: $t:ty) => ( <del> #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")), thread_local)] </del> pub static $name: ::std::thread::ScopedKey<$t> = <del> ::std::thread::ScopedKey::new(); </del> <ins> __scoped_thread_local_inner!($t); </ins> ); } <ins> #[doc(hidden)] #[unstable(feature = "thread_local_internals", reason = "should not be necessary")] </ins> #[macro_export] #[allow_internal_unstable] #[cfg(no_elf_tls)] <del> macro_rules! scoped_thread_local { (static $name:ident: $t:ty) => ( static $name: ::std::thread::ScopedKey<$t> = ::std::thread::ScopedKey::new(); ); (pub static $name:ident: $t:ty) => ( pub static $name: ::std::thread::ScopedKey<$t> = ::std::thread::ScopedKey::new(); ); </del> <ins> macro_rules! __scoped_thread_local_inner { ($t:ty) => {{ static _KEY: ::std::thread::__ScopedKeyInner<$t> = ::std::thread::__ScopedKeyInner::new(); fn _getit() -> &'static ::std::thread::__ScopedKeyInner<$t> { &_KEY } ::std::thread::ScopedKey::new(_getit) }} } #[doc(hidden)] #[unstable(feature = "thread_local_internals", reason = "should not be necessary")] #[macro_export] #[allow_internal_unstable] #[cfg(not(no_elf_tls))] macro_rules! __scoped_thread_local_inner { ($t:ty) => {{ #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")), thread_local)] static _KEY: ::std::thread::__ScopedKeyInner<$t> = ::std::thread::__ScopedKeyInner::new(); fn _getit() -> &'static ::std::thread::__ScopedKeyInner<$t> { &_KEY } ::std::thread::ScopedKey::new(_getit) }} </ins> } #[unstable(feature = "scoped_tls",


let unqualified_def = resolve_identifier_with_fallback(self, None); let qualified_binding = self.resolve_module_relative_path(span, segments, namespace); match (qualified_binding, unqualified_def) { <del> (Ok(binding), Some(ref ud)) if binding.def() == ud.def => { </del> <ins> (Ok(binding), Some(ref ud)) if binding.def() == ud.def && segments[0].identifier.name.as_str() != "$crate" => { </ins> self.session .add_lint(lint::builtin::UNUSED_QUALIFICATIONS, id,


Future incompatibility report: Future breakage diagnostic: error: missing fragment specifier <del> --> $DIR/macro-match-nonterminal.rs:2:8 </del> <ins> --> $DIR/macro-match-nonterminal.rs:2:6 </ins> | LL |     ($a, $b) => { <del> |        ^ </del> <ins> |      ^^ </ins> | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>


let msg = "you might have meant to use `#![feature(trait_alias)]` instead of a  `type` alias"; if let Some(span) = self.def_span(def_id) { <del> err.span_help(span, msg); </del> <ins> if let Ok(snip) = self.r.session.source_map().span_to_snippet(span) { // The span contains a type alias so we should be able to // replace `type` with `trait`. let snip = snip.replacen("type", "trait", 1); err.span_suggestion(span, msg, snip, Applicability::MaybeIncorrect); } else { err.span_help(span, msg); } </ins> } else { err.help(msg); }


// mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) } <del> _13 = (_4.0: &i32);              // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = (_4.1: &i32);              // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_5);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_6);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> StorageLive(_5);                 // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _5 = (_4.0: &i32);               // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _6 = (_4.1: &i32);               // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> StorageLive(_7);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL <del> _7 = (*_13);                     // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _6 = Eq(move _7, const 1_i32);   // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_7);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _5 = Not(move _6);               // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_6);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL switchInt(_5) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> StorageLive(_8);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_9);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = (*_5);                      // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _8 = Eq(move _9, const 1_i32);   // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_9);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _7 = Not(move _8);               // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_8);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL switchInt(_7) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> } bb1: { <del> StorageDead(_5);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> StorageDead(_7);                 // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_5);                 // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> _0 = const ();                   // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 return;                          // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } bb2: { <del> (_9.0: &[&str]) = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> StorageLive(_11);                // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _25 = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> // ty::Const // + ty: &[&str; 3] // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } <del> StorageLive(_11);                // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL (_12.0: &&i32) = &_13;           // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_14);                // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _14 = &_15;                      // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_12.1: &&i32) = move _14;       // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageDead(_14);                // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _20 = (_12.0: &&i32);            // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = (_12.1: &&i32);            // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _19 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> StorageLive(_13);                // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_15);                // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = _5;                        // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_14.0: &&i32) = &_15;           // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_16);                // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _16 = &_6;                       // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_14.1: &&i32) = move _16;       // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageDead(_16);                // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _21 = (_14.0: &&i32);            // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _24 = (_14.1: &&i32);            // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _20 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } <del> StorageLive(_18);                // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _18 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _19) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </del> <ins> StorageLive(_19);                // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _19 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _20) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb3: { <del> (_16.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _20) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </del> <ins> (_17.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _21) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb4: { <del> (_16.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _18; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_18);                // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _22 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> (_17.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _19; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_19);                // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _23 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } <del> StorageLive(_21);                // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _21 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _22) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </del> <ins> StorageLive(_22);                // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _22 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _23) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb5: { <del> (_17.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </del> <ins> (_18.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb6: { <del> (_17.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _21; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_21);                // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _11 = [move _16, move _17];      // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL </del> <ins> (_18.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _22; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_22);                // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _13 = [move _17, move _18];      // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL _12 = &_13;                      // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _27 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_26);                // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL discriminant(_26) = 0;           // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_11.0: &[&str]) = move _25;     // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_11.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _26; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_11.2: &[std::fmt::ArgumentV1]) = move _27; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_26);                // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL </ins> _10 = &_11;                      // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL <del> _25 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_24);                // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL discriminant(_24) = 0;           // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_9.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _24; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_9.2: &[std::fmt::ArgumentV1]) = move _25; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_24);                // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _8 = &_9;                        // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic_fmt(move _8);        // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL </del> <ins> begin_panic_fmt(move _10);       // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL </ins> // mir::Constant // + span: $SRC_DIR/std/src/macros.rs:LL:COL // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }


<ins> // run-pass #![allow(dead_code)] #![allow(improper_ctypes)] // ignore-wasm32-bare no libc to test ffi with #[derive(Copy, Clone)] pub struct QuadFloats { a: f32, b: f32, c: f32, d: f32 } mod rustrt { use super::QuadFloats; #[link(name = "rust_test_helpers", kind = "static")] extern { pub fn get_c_exhaust_sysv64_ints( _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), h: QuadFloats, ) -> f32; } } fn test() { unsafe { let null = std::ptr::null(); let q = QuadFloats { a: 10.2, b: 20.3, c: 30.4, d: 40.5 }; assert_eq!( rustrt::get_c_exhaust_sysv64_ints(null, null, null, null, null, null, null, q), q.c, ); } } pub fn main() { test(); } </ins>


<ins> error: inconsistent resolution for an import --> $DIR/issue-62767.rs:24:5 | LL | use bar::bar; |     ^^^^^^^^ error[E0432]: unresolved import `Same` --> $DIR/issue-62767.rs:12:5 | LL | use Same::Same; |     ^^^^ `Same` is a variant, not a module error[E0432]: unresolved import `bar::bar` --> $DIR/issue-62767.rs:24:5 | LL | use bar::bar; |     ^^^^^^^^ no `bar` in `foo::bar::bar` error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0432`. </ins>


hashbrown = { version = "0.4.0", features = ['rustc-dep-of-std'] } [dependencies.backtrace] <del> version = "0.3.25" </del> <ins> version = "0.3.29" </ins> default-features = false # don't use coresymbolication on OSX features = [ "rustc-dep-of-std", # enable build support for integrating into libstd


<ins> error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71611.rs:4:21 | LL | fn func<A, const F: fn(inner: A)>(outer: A) { |                     ^^^^^^^^^^^^ error: aborting due to previous error </ins>


[true] `{$param_name}` *[false] `fn` parameter } has {$has_lifetime -> <del> [named] lifetime `{$lifetime}` *[anon] an anonymous lifetime `'_` </del> <ins> [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` </ins> } but calling `{$ident}` introduces an implicit `'static` lifetime requirement infer_ril_introduced_here = `'static` requirement introduced here


GenericArg::Const(self.parse_const_arg()?) } else if self.check_type() { // Parse type argument. <del> let is_const_fn = self.look_ahead(1, |t| t.kind == token::OpenDelim(Delimiter::Parenthesis)); let mut snapshot = self.create_snapshot_for_diagnostic(); </del> <ins> // Proactively create a parser snapshot enabling us to rewind and try to reparse the // input as a const expression in case we fail to parse a type. If we successfully // do so, we will report an error that it needs to be wrapped in braces. let mut snapshot = None; if self.may_recover() && self.token.can_begin_expr() { snapshot = Some(self.create_snapshot_for_diagnostic()); } </ins> match self.parse_ty() { <del> Ok(ty) => GenericArg::Type(ty), </del> <ins> Ok(ty) => { // Since the type parser recovers from some malformed slice and array types and // successfully returns a type, we need to look for `TyKind::Err`s in the // type to determine if error recovery has occurred and if the input is not a // syntactically valid type after all. if let ast::TyKind::Slice(inner_ty) | ast::TyKind::Array(inner_ty, _) = &ty.kind && let ast::TyKind::Err = inner_ty.kind && let Some(snapshot) = snapshot && let Some(expr) = self.recover_unbraced_const_arg_that_can_begin_ty(snapshot) { return Ok(Some(self.dummy_const_arg_needs_braces( self.struct_span_err(expr.span, "invalid const generic expression"), expr.span, ))); } GenericArg::Type(ty) } </ins> Err(err) => { <del> if is_const_fn { match (*snapshot).parse_expr_res(Restrictions::CONST_EXPR, None) { Ok(expr) => { self.restore_snapshot(snapshot); return Ok(Some(self.dummy_const_arg_needs_braces(err, expr.span))); } Err(err) => { err.cancel(); } } </del> <ins> if let Some(snapshot) = snapshot && let Some(expr) = self.recover_unbraced_const_arg_that_can_begin_ty(snapshot) { return Ok(Some(self.dummy_const_arg_needs_braces( err, expr.span, ))); </ins> } // Try to recover from possible `const` arg without braces. return self.recover_const_arg(start, err).map(Some);


<ins> // force-host // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::{Group, TokenStream, TokenTree}; // This macro exists as part of a reproduction of #61963 but without using quote/syn/proc_macro2. #[proc_macro_derive(DomObject)] pub fn expand_token_stream(input: TokenStream) -> TokenStream { // Construct a dummy span - `#0 bytes(0..0)` - which is present in the input because // of the specially crafted generated tokens in the `attribute-crate` proc-macro. let dummy_span = input.clone().into_iter().nth(0).unwrap().span(); // Define what the macro would output if constructed properly from the source using syn/quote. let output: TokenStream = "impl Bar for ((), Qux<Qux<Baz> >) { } impl Bar for ((), Box<Bar>) { }".parse().unwrap(); let mut tokens: Vec<_> = output.into_iter().collect(); // Adjust token spans to match the original crate (which would use `quote`). Some of the // generated tokens point to the dummy span. for token in tokens.iter_mut() { if let TokenTree::Group(group) = token { let mut tokens: Vec<_> = group.stream().into_iter().collect(); for token in tokens.iter_mut().skip(2) { token.set_span(dummy_span); } let mut stream = TokenStream::new(); stream.extend(tokens); *group = Group::new(group.delimiter(), stream); } } let mut output = TokenStream::new(); output.extend(tokens); output } </ins>


ty_op: |ty| match *ty.kind() { // We can't normalize associated types from `rustc_infer`, // but we can eagerly register inference variables for them. <del> ty::Projection(projection_ty) if !projection_ty.has_escaping_bound_vars() => { </del> <ins> // FIXME(RPITIT): Don't replace RPITITs with inference vars. ty::Projection(projection_ty) if !projection_ty.has_escaping_bound_vars() && tcx.def_kind(projection_ty.item_def_id) != DefKind::ImplTraitPlaceholder => { </ins> self.infer_projection( param_env, projection_ty,


<ins> error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | const _CONST: &[u8] = &f(&[], |_| {}); |                        -------------- inside `_CONST` at $DIR/issue-88434-removal-index-should-be-less.rs:4:24 ... LL |     panic!() |     ^^^^^^^^ |     | |     the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:10:5 |     inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:4:31: 4:37]>` at $SRC_DIR/std/src/panic.rs:LL:COL | = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. </ins>


<ins> // build-pass trait X<const N: i32> {} fn hello<T: X<{ fn hello() -> ! { loop {} } 1 }>>() {} fn main() {} </ins>


<ins> /// Some doc comment. struct X; // ignore-license // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // pp-exact // Test that rust can properly pretty print a doc comment if it's the first line in a file.  some fn main() { let x = X; } </ins>


io.into_raw_handle(); ret }, <del> Err(..) => unsafe { Ok(Handle::from_raw_handle(c::INVALID_HANDLE_VALUE)) }, </del> <ins> // If no stdio handle is available, then propagate the null value. Err(..) => unsafe { Ok(Handle::from_raw_handle(ptr::null_mut())) }, </ins> }, Stdio::MakePipe => {