0, ); if stackp == MAP_FAILED { <del> panic!("failed to allocate an alternative stack"); </del> <ins> panic!("failed to allocate an alternative stack: {}", io::Error::last_os_error()); </ins> } let guard_result = libc::mprotect(stackp, page_size(), PROT_NONE); if guard_result != 0 { <del> panic!("failed to set up alternative stack guard page"); </del> <ins> panic!("failed to set up alternative stack guard page: {}", io::Error::last_os_error()); </ins> } stackp.add(page_size()) }


<ins> // error-pattern: `#[panic_handler]` function required, but not found // Regression test for #54505 - range borrowing suggestion had // incorrect syntax (missing parentheses). // This test doesn't use std // (so all Ranges resolve to core::ops::Range...) #![no_std] #![feature(lang_items)] use core::ops::RangeBounds; #[cfg(not(target_arch = "wasm32"))] #[lang = "eh_personality"] extern fn eh_personality() {} #[cfg(target_os = "windows")] #[lang = "eh_unwind_resume"] extern fn eh_unwind_resume() {} // take a reference to any built-in range fn take_range(_r: &impl RangeBounds<i8>) {} fn main() { take_range(0..1); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..1) take_range(1..); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(1..) take_range(..); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..) take_range(0..=1); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..=1) take_range(..5); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..5) take_range(..=42); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..=42) } </ins>


use rustc_ast::{self as ast, NodeId, CRATE_NODE_ID}; use rustc_ast::{AngleBracketedArg, Crate, Expr, ExprKind, GenericArg, GenericArgs, LitKind, Path}; use rustc_ast_lowering::{LifetimeRes, ResolverAstLowering}; <del> use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; </del> <ins> use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; </ins> use rustc_data_structures::intern::Interned; use rustc_data_structures::sync::Lrc; use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed};


<ins> error[E0308]: mismatched types --> $DIR/issue-30906.rs:15:5 | LL |     test(Compose(f, |_| {})); |     ^^^^ one type is more general than the other | = note: expected type `std::ops::FnOnce<(&'x str,)>` found type `std::ops::FnOnce<(&str,)>` error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>


} types::ItemEnum::Method(_) <ins> | types::ItemEnum::Module(_) </ins> | types::ItemEnum::AssocConst { .. } | types::ItemEnum::AssocType { .. } | types::ItemEnum::PrimitiveType(_) => true, <del> types::ItemEnum::Module(_) | types::ItemEnum::ExternCrate { .. } </del> <ins> types::ItemEnum::ExternCrate { .. } </ins> | types::ItemEnum::Import(_) | types::ItemEnum::StructField(_) | types::ItemEnum::Variant(_)


create_default_session_globals_then(|| { let comment = "n let a: *i32;n *a = 5;n"; let stripped = beautify_doc_string(Symbol::intern(comment), CommentKind::Block); <del> assert_eq!(stripped.as_str(), " let a: *i32;n *a = 5;"); </del> <ins> assert_eq!(stripped.as_str(), "let a: *i32;n*a = 5;"); </ins> }) }


LL |         for _ in &self.h { |                  + <del> error: aborting due to 2 previous errors </del> <ins> error[E0507]: cannot move out of a shared reference --> $DIR/for-i-in-vec.rs:21:19 | LL |     for loader in *LOADERS { |                   ^^^^^^^^ move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait | help: consider iterating over a slice of the `Vec<&u8>`'s content | LL |     for loader in &*LOADERS { |                   + error: aborting due to 3 previous errors </ins> For more information about this error, try `rustc --explain E0507`.


<del> Subproject commit 61605ebde25f920b18cc2f7e1b92838cd7b6fa67 </del> <ins> Subproject commit 05fdec916a3a9755c6ea603bab79cdb2f7c062bf </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. // Test that we cannot create objects from unsized types. trait Foo for Sized? {} impl Foo for str {} fn test<Sized? T: Foo>(t: &T) { let u: &Foo = t; //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` let v: &Foo = t as &Foo; //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` } fn main() { let _: &[&Foo] = &["hi"]; //~^ ERROR `core::kinds::Sized` is not implemented for the type `str` let _: &Foo = "hi" as &Foo; //~^ ERROR `core::kinds::Sized` is not implemented for the type `str` } </ins>


// was not actually bumped past it. When the `LazyAttrTokenStream` gets converted // into an `AttrTokenStream`, we will create the proper token. if self.token_cursor.break_last_token { <del> assert_eq!( trailing, TrailingToken::None, "Cannot set `break_last_token` and have trailing token" ); </del> <ins> assert!(!captured_trailing, "Cannot set break_last_token and have trailing token"); </ins> end_pos += 1; }


<ins> // check-pass // compile-flags: -Zsave-analysis trait Trait { type Assoc; } trait GenericTrait<T> {} struct Wrapper<B> { b: B } fn func() { // Processing associated path in impl block definition inside a function // body does not ICE impl<B: Trait> GenericTrait<B::Assoc> for Wrapper<B> {} } fn main() {} </ins>


<ins> error[E0261]: use of undeclared lifetime name `'a` --> $DIR/ice-unexpected-inference-var-122549.rs:5:70 | LL |     fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; |                                                                      ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     fn const_chunks_exact<'a, const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; |                           +++ help: consider introducing lifetime `'a` here | LL | trait ConstChunksExactTrait<'a, T> { |                             +++ error[E0261]: use of undeclared lifetime name `'a` --> $DIR/ice-unexpected-inference-var-122549.rs:11:34 | LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} |                         -        ^^ undeclared lifetime |                         | |                         help: consider introducing lifetime `'a` here: `'a,` error[E0046]: not all trait items implemented, missing: `const_chunks_exact` --> $DIR/ice-unexpected-inference-var-122549.rs:9:1 | LL |     fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; |     ------------------------------------------------------------------------------- `const_chunks_exact` from trait ... LL | impl<T> ConstChunksExactTrait<T> for [T] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `const_chunks_exact` in implementation error[E0392]: lifetime parameter `'rem` is never used --> $DIR/ice-unexpected-inference-var-122549.rs:11:25 | LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} |                         ^^^^ unused lifetime parameter | = help: consider removing `'rem`, referring to it in a field, or using a marker such as `PhantomData` error[E0392]: type parameter `T` is never used --> $DIR/ice-unexpected-inference-var-122549.rs:11:31 | LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} |                               ^ unused type parameter | = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/ice-unexpected-inference-var-122549.rs:15:13 | LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { |             ^^^^^^^^^^^^^^ unconstrained const parameter | = note: expressions using a const parameter must map each value to a distinct output value = note: proving the result of expressions other than the parameter are unique is not supported error[E0308]: mismatched types --> $DIR/ice-unexpected-inference-var-122549.rs:15:66 | LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { |                                                                  ^^ expected `usize`, found `()` error: aborting due to 7 previous errors Some errors have detailed explanations: E0046, E0207, E0261, E0308, E0392. For more information about an error, try `rustc --explain E0046`. </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. pub struct Foo; macro_rules! reexport { () => { use Foo as Bar; } } reexport!(); fn main() { use Bar; fn f(_: Bar) {} } </ins>


#[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item fn f6() { } <ins> #[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string fn f7() { } #[deprecated("test")] //~ ERROR item in `deprecated` must be a key/value pair fn f8() { } </ins> } #[deprecated(since = "a", note = "b")]


let a_kind = &a.kind; let b_kind = &b.kind; <del> let compare_layouts = |a, b| -> bool { let a_layout = &cx.layout_of(a).unwrap().layout.abi; let b_layout = &cx.layout_of(b).unwrap().layout.abi; debug!("{:?} == {:?} = {}", a_layout, b_layout, a_layout == b_layout); a_layout == b_layout </del> <ins> let compare_layouts = |a, b| -> Result<bool, LayoutError<'tcx>> { debug!("compare_layouts({:?}, {:?})", a, b); let a_layout = &cx.layout_of(a)?.layout.abi; let b_layout = &cx.layout_of(b)?.layout.abi; debug!( "comparing layouts: {:?} == {:?} = {}", a_layout, b_layout, a_layout == b_layout ); Ok(a_layout == b_layout) </ins> }; #[allow(rustc::usage_of_ty_tykind)]


/// Copied from String::push /// This does **not** include the WTF-8 concatenation check. fn push_code_point_unchecked(&mut self, code_point: CodePoint) { <del> let c = unsafe { char::from_u32_unchecked(code_point.value) }; </del> let mut bytes = [0; 4]; <del> let bytes = c.encode_utf8(&mut bytes).as_bytes(); </del> <ins> let bytes = char::encode_utf8_raw(code_point.value, &mut bytes); </ins> self.bytes.extend_from_slice(bytes) }


#![feature(iter_is_partitioned)] #![feature(iter_order_by)] #![feature(cmp_min_max_by)] <del> #![feature(slice_from_raw_parts)] </del> #![feature(const_slice_from_raw_parts)] #![feature(const_raw_ptr_deref)]


_ => unreachable!(), }; <del> color | (bits & 0x8) // copy the hi-intensity bit </del> <ins> color | (u32::from(bits) & 0x8) // copy the hi-intensity bit </ins> } impl<T: Write + Send + 'static> WinConsole<T> {


--> $DIR/auxiliary/dummy_lib.rs:2:1 | 2   + #[derive(Debug)] <del> 3   | #[path = "auxiliary/dummy_lib.rs"] </del> <ins> 3   | pub struct Dummy; </ins> | error: aborting due to previous error


fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc>> { // BTreeMap instead of HashMap to get a sorted output let mut map: BTreeMap<_, Vec<_>> = BTreeMap::new(); <ins> let mut inserted: FxHashMap<ItemType, FxHashSet<Symbol>> = FxHashMap::default(); </ins> for item in &m.items { if item.is_stripped() { continue;


self.diverge_cleanup(); let scope = self.scopes.pop().unwrap(); assert_eq!(scope.extent, extent); <del> build_scope_drops(block, &scope, &self.scopes[..], &mut self.cfg) </del> <ins> build_scope_drops(&mut self.cfg, &scope, &self.scopes[..], block) </ins> }


COPY host-x86_64/dist-various-2/build-fuchsia-toolchain.sh /tmp/ RUN /tmp/build-fuchsia-toolchain.sh COPY host-x86_64/dist-various-2/build-solaris-toolchain.sh /tmp/ <del> RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386 RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc </del> <ins> RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386  pc # Build deprecated target 'x86_64-sun-solaris2.10' until removed RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386  sun RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc sun </ins> COPY host-x86_64/dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/ RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh


} } <del> fn frame_address(f: &fn(++x: *u8)) { </del> <ins> fn frame_address(f: &fn(x: *u8)) { </ins> unsafe { rusti::frame_address(f) }


fn check_bounds_on_type_parameters(cx: &mut Context, e: &Expr) { let method_map = cx.tcx.method_map.borrow(); <del> let method = method_map.find(&typeck::MethodCall::expr(e.id)); </del> <ins> let method_call = typeck::MethodCall::expr(e.id); let method = method_map.find(&method_call); </ins> // Find the values that were provided (if any) let item_substs = cx.tcx.item_substs.borrow();


assert!(first.maybe_empty); first.add_all(subfirst); <del> if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore { </del> <ins> if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore || seq_rep.op == quoted::KleeneOp::ZeroOrOne { </ins> // continue scanning for more first // tokens, but also make sure we // restore empty-tracking state


} } <del> macro_rules! range_impl { </del> <ins> macro_rules! range_exact_iter_impl { </ins> ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] <del> impl Iterator for ::ops::Range<$t> { type Item = $t; </del> <ins> impl ExactSizeIterator for ::ops::Range<$t> { </ins> #[inline] <del> fn next(&mut self) -> Option<$t> { if self.start < self.end { let result = self.start; self.start += 1; return Some(result); } return None; } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { </del> <ins> fn len(&self) -> usize { </ins> debug_assert!(self.end >= self.start); <del> let hint = (self.end - self.start) as usize; (hint, Some(hint)) </del> <ins> (self.end - self.start) as usize </ins> } } <del> #[stable(feature = "rust1", since = "1.0.0")] impl ExactSizeIterator for ::ops::Range<$t> {} </del> )*) } <del> macro_rules! range_impl_no_hint { ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] impl Iterator for ::ops::Range<$t> { type Item = $t; #[inline] fn next(&mut self) -> Option<$t> { if self.start < self.end { let result = self.start; self.start += 1; return Some(result); } </del> <ins> #[stable(feature = "rust1", since = "1.0.0")] impl<A: Int> Iterator for ::ops::Range<A> { type Item = A; </ins> <del> return None; } </del> <ins> #[inline] fn next(&mut self) -> Option<A> { if self.start < self.end { let result = self.start; self.start = self.start + Int::one(); Some(result) } else { None </ins> } <del> )*) } macro_rules! range_other_impls { ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] impl DoubleEndedIterator for ::ops::Range<$t> { #[inline] fn next_back(&mut self) -> Option<$t> { if self.start < self.end { self.end -= 1; return Some(self.end); } </del> <ins> } </ins> <del> return None; } } </del> <ins> #[inline] fn size_hint(&self) -> (usize, Option<usize>) { debug_assert!(self.end >= self.start); let hint = (self.end - self.start).to_uint(); (hint.unwrap_or(0), hint) } } </ins> <del> #[stable(feature = "rust1", since = "1.0.0")] impl Iterator for ::ops::RangeFrom<$t> { type Item = $t; </del> <ins> range_exact_iter_impl!(usize u8 u16 u32 isize i8 i16 i32); #[cfg(target_pointer_width = "64")] range_exact_iter_impl!(u64 i64); </ins> <del> #[inline] fn next(&mut self) -> Option<$t> { let result = self.start; self.start += 1; debug_assert!(result < self.start); return Some(result); } </del> <ins> #[stable(feature = "rust1", since = "1.0.0")] impl<A: Int> DoubleEndedIterator for ::ops::Range<A> { #[inline] fn next_back(&mut self) -> Option<A> { if self.start < self.end { self.end = self.end - Int::one(); Some(self.end) } else { None </ins> } <del> )*) </del> <ins> } </ins> } <del> range_impl!(usize u8 u16 u32 isize i8 i16 i32); #[cfg(target_pointer_width = "64")] range_impl!(u64 i64); #[cfg(target_pointer_width = "32")] range_impl_no_hint!(u64 i64); </del> <ins> #[stable(feature = "rust1", since = "1.0.0")] impl<A: Int> Iterator for ::ops::RangeFrom<A> { type Item = A; </ins> <del> range_other_impls!(usize u8 u16 u32 u64 isize i8 i16 i32 i64); </del> <ins> #[inline] fn next(&mut self) -> Option<A> { let result = self.start; self.start = self.start + Int::one(); debug_assert!(result < self.start); Some(result) } } </ins> /// An iterator that repeats an element endlessly #[derive(Clone)]


<ins> pub trait Bar<S> {} pub trait Qux<T> {} pub trait Foo<T, S> { fn bar() where T: Bar<S>, { } } pub struct Concrete; impl<S> Foo<(), S> for Concrete {} impl<T, S> Bar<S> for T where S: Qux<T> {} impl<T, S> Qux<T> for S where T: Bar<S> {} </ins>


<ins> // revisions: current next //[next] compile-flags: -Znext-solver // check-pass #![feature(non_lifetime_binders)] //~^ WARN the feature `non_lifetime_binders` is incomplete trait Id { type Output: ?Sized; } impl<T: ?Sized> Id for T { type Output = T; } trait Everyone {} impl<T: ?Sized> Everyone for T {} fn hello() where for<T> <T as Id>::Output: Everyone {} fn main() { hello(); } </ins>


let associated_trait = tcx.impl_trait_ref(did).map(ty::EarlyBinder::skip_binder); <ins> // Do not inline compiler-internal items unless we're a compiler-internal crate. let is_compiler_internal = |did| { tcx.lookup_stability(did) .is_some_and(|stab| stab.is_unstable() && stab.feature == sym::rustc_private) }; let document_compiler_internal = is_compiler_internal(LOCAL_CRATE.as_def_id()); let is_directly_public = |cx: &mut DocContext<'_>, did| { cx.cache.effective_visibilities.is_directly_public(tcx, did) && (document_compiler_internal || !is_compiler_internal(did)) }; </ins> // Only inline impl if the implemented trait is // reachable in rustdoc generated documentation if !did.is_local() && let Some(traitref) = associated_trait <ins> && !is_directly_public(cx, traitref.def_id) </ins> { <del> let did = traitref.def_id; if !cx.cache.effective_visibilities.is_directly_public(tcx, did) { return; } if !tcx.features().rustc_private && !cx.render_options.force_unstable_if_unmarked { if let Some(stab) = tcx.lookup_stability(did) && stab.is_unstable() && stab.feature == sym::rustc_private { return; } } </del> <ins> return; </ins> } let impl_item = match did.as_local() {


<ins> // Regression test for issue #110856, where a borrowck error for a MIR tainted // all promoteds within. This in turn generated a spurious "erroneous constant // used" note when trying to evaluate a promoted. pub fn f() -> u32 { let a = 0; a = &0 * &1 * &2 * &3; //~^ ERROR: cannot assign twice to immutable variable a } fn main() {} </ins>


<ins> // build-pass // // (this is deliberately *not* check-pass; I have confirmed that the bug in // question does not replicate when one uses `cargo check` alone.) pub enum Void {} enum UninhabitedUnivariant { _Variant(Void), } enum UninhabitedMultivariant2 { _Variant(Void), _Warriont(Void), } enum UninhabitedMultivariant3 { _Variant(Void), _Warriont(Void), _Worrynot(Void), } #[repr(C)] enum UninhabitedUnivariantC { _Variant(Void), } #[repr(i32)] enum UninhabitedUnivariant32 { _Variant(Void), } fn main() { let _seed: UninhabitedUnivariant = None.unwrap(); match _seed { UninhabitedUnivariant::_Variant(_x) => {} } let _seed: UninhabitedMultivariant2 = None.unwrap(); match _seed { UninhabitedMultivariant2::_Variant(_x) => {} UninhabitedMultivariant2::_Warriont(_x) => {} } let _seed: UninhabitedMultivariant2 = None.unwrap(); match _seed { UninhabitedMultivariant2::_Variant(_x) => {} _ => {} } let _seed: UninhabitedMultivariant2 = None.unwrap(); match _seed { UninhabitedMultivariant2::_Warriont(_x) => {} _ => {} } let _seed: UninhabitedMultivariant3 = None.unwrap(); match _seed { UninhabitedMultivariant3::_Variant(_x) => {} UninhabitedMultivariant3::_Warriont(_x) => {} UninhabitedMultivariant3::_Worrynot(_x) => {} } let _seed: UninhabitedMultivariant3 = None.unwrap(); match _seed { UninhabitedMultivariant3::_Variant(_x) => {} _ => {} } let _seed: UninhabitedMultivariant3 = None.unwrap(); match _seed { UninhabitedMultivariant3::_Warriont(_x) => {} _ => {} } let _seed: UninhabitedMultivariant3 = None.unwrap(); match _seed { UninhabitedMultivariant3::_Worrynot(_x) => {} _ => {} } let _seed: UninhabitedUnivariantC = None.unwrap(); match _seed { UninhabitedUnivariantC::_Variant(_x) => {} } let _seed: UninhabitedUnivariant32 = None.unwrap(); match _seed { UninhabitedUnivariant32::_Variant(_x) => {} } } </ins>


[[package]] name = "rustfmt-nightly" <del> version = "0.1.9" </del> <ins> version = "0.2.1" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",


all(target_vendor = "fortanix", target_env = "sgx"), feature(slice_index_methods, coerce_unsized, sgx_platform) )] <ins> #![cfg_attr(windows, feature(round_char_boundary))] </ins> // // Language features: #![feature(alloc_error_handler)]


<ins> #[no_mangle] pub extern "C" fn hello() { println!("Hello world!"); } #[no_mangle] pub extern "C" fn number() -> u32 { 42 } </ins>


// ignore-tidy-linelength // ignore-lldb <del> // ignore-android: FIXME(#10381) </del> <ins> // ignore-android: FIXME(#24958) </ins> // compile-flags:-g


"codegen-units"); suite("check-incremental", "src/test/incremental", "incremental", "incremental"); <del> suite("check-ui", "src/test/ui", "ui", "ui"); </del> } if build.config.build.contains("msvc") {


candidates.vec.push(FnPointerCandidate); } } <ins> // Provide an impl for suitable functions, rejecting `#[target_feature]` functions (RFC 2396). ty::FnDef(def_id, _) => { if let ty::FnSig { unsafety: hir::Unsafety::Normal, abi: Abi::Rust, c_variadic: false, .. } = self_ty.fn_sig(self.tcx()).skip_binder() { if self.tcx().codegen_fn_attrs(def_id).target_features.is_empty() { candidates.vec.push(FnPointerCandidate); } } } </ins> _ => {} }


// highlighted text will always be `&<expr>` and // thus can transform to `&mut` by slicing off // first ASCII character and prepending "&mut ". <del> let borrowed_expr = src[1..].to_string(); return (assignment_rhs_span, format!("&mut {}", borrowed_expr)); </del> <ins> if src.starts_with('&') { let borrowed_expr = src[1..].to_string(); return (assignment_rhs_span, format!("&mut {}", borrowed_expr)); } </ins> } }


<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn iterate<T, F>(initial: T, f: F) -> Iterate<T, F> { Iterate { state: initial, f: f, } } pub struct Iterate<T, F> { state: T, f: F } impl<T: Clone, F> Iterator for Iterate<T, F> where F: Fn(&T) -> T { type Item = T; #[inline] fn next(&mut self) -> Option<Self::Item> { self.state = (self.f)(&self.state); Some(self.state.clone()) } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { (std::usize::MAX, None) } } fn main() { let a = iterate(0, |x| x+1); println!("{:?}", a.iter().take(10).collect::<Vec<usize>>()); //~^ ERROR no method named `iter` found for type `Iterate<{integer} } </ins>


<ins> error[E0308]: mismatched types --> $DIR/default-body-type-err-2.rs:8:9 | LL |         42 |         ^^- help: try using a conversion method: `.to_string()` |         | |         expected struct `String`, found integer error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>


<ins> // check-pass // This is a valid macro. Commit 4 in #95159 broke things such that it failed // with a "missing tokens in macro arguments" error, as reported in #95267. macro_rules! f { ( /// ab ) => {}; } fn main() { f!(); } </ins>


make_test!(split_space_str, s, s.split(" ").count()); make_test!(split_ad_str, s, s.split("ad").count()); <ins> make_test!(to_lowercase, s, s.to_lowercase()); </ins>


should_continue = suggest(err, false, span, message, sugg); } } <del> LifetimeRibKind::Item => break, </del> <ins> LifetimeRibKind::Item | LifetimeRibKind::ConstParamTy => break, </ins> _ => {} } if !should_continue {


// Render unstable items. But don't render "rustc_private" crates (internal compiler crates). // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere. <del> if let Some((StabilityLevel::Unstable { reason, issue, .. }, feature)) = item </del> <ins> if let Some((StabilityLevel::Unstable { reason: _, issue, .. }, feature)) = item </ins> .stability(cx.tcx()) .as_ref() .filter(|stab| stab.feature != sym::rustc_private)


use tokenstream; use std::{cmp, fmt}; <ins> use std::mem; </ins> use rustc_data_structures::sync::{Lrc, Lock}; #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]


} let (mut min, mut max) = (i128::max_value(), i128::min_value()); <ins> let discr_type = def.repr.discr_type(); let bits = Integer::from_attr(tcx, discr_type).size().bits(); </ins> for (i, discr) in def.discriminants(tcx).enumerate() { if variants[i].iter().any(|f| f.abi == Abi::Uninhabited) { continue; } <del> let x = discr.val as i128; </del> <ins> let mut x = discr.val as i128; if discr_type.is_signed() { // sign extend the raw representation to be an i128 x = (x << (128 - bits)) >> (128 - bits); } </ins> if x < min { min = x; } if x > max { max = x; } }


/// ``` #[stable(feature = "rust1", since = "1.0.0")] pub trait ExactSizeIterator: Iterator { <del> /// Returns the exact number of times the iterator will iterate. </del> <ins> /// Returns the exact length of the iterator. </ins> /// <ins> /// The implementation ensures that the iterator will return exactly `len()` /// more times a `Some(T)` value, before returning `None`. </ins> /// This method has a default implementation, so you usually should not /// implement it directly. However, if you can provide a more efficient /// implementation, you can do so. See the [trait-level] docs for an


use rustc_infer::infer::{self, InferOk}; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::subst::{InternalSubsts, SubstsRef}; <del> use rustc_middle::ty::GenericParamDefKind; </del> use rustc_middle::ty::{self, ToPredicate, Ty, TypeVisitable}; <ins> use rustc_middle::ty::{DefIdTree, GenericParamDefKind}; </ins> use rustc_span::symbol::Ident; use rustc_span::Span; use rustc_trait_selection::traits;


) .span_suggestion( span_with_quotes, <del> "if you meant to write a `str` literal, use double quotes", </del> <ins> msg, </ins> format!(""{}"", lit), Applicability::MachineApplicable, ).emit()


<del> //@ known-bug: #123710 #[repr(packed)] #[repr(u32)] enum E { A, B, C, } fn main() { union InvalidTag { int: u32, e: E, } let _invalid_tag = InvalidTag { int: 4 }; } </del>


<ins> error: expected one of `.`, `;`, `?`, `else`, or an operator, found `}` --> $DIR/issue-60075.rs:6:10 | LL |         }); |          ^ expected one of `.`, `;`, `?`, `else`, or an operator here error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;` --> $DIR/issue-60075.rs:6:11 | LL |     fn qux() -> Option<usize> { |                               - unclosed delimiter LL |         let _ = if true { LL |         }); |           ^ |           | |           help: `}` may belong here error: expected identifier, found `;` --> $DIR/issue-60075.rs:6:11 | LL |         }); |           ^ expected identifier error: missing `fn`, `type`, or `const` for trait-item declaration --> $DIR/issue-60075.rs:6:12 | LL |           }); |  ____________^ LL | | LL | | LL | | LL | | LL | |         Some(4) | |________^ missing `fn`, `type`, or `const` error: aborting due to 4 previous errors </ins>


_ => (), } } <del> FnKind::ItemFn(name, ..) => { </del> <ins> FnKind::ItemFn(name, _, _, _, abi, _, attrs) => { // Skip foreign-ABI #[no_mangle] functions (Issue #31924) if abi != Abi::Rust && attr::find_by_name(attrs, "no_mangle").is_some() { return; } </ins> self.check_snake_case(cx, "function", &name.as_str(), Some(span)) } FnKind::Closure(_) => (),


- [What is rustdoc?](what-is-rustdoc.md) - [Command-line arguments](command-line-arguments.md) - [How to read rustdoc output](how-to-read-rustdoc.md) <ins> - [In-doc settings](read-documentation/in-doc-settings.md) </ins> - [How to write documentation](how-to-write-documentation.md) - [What to include (and exclude)](write-documentation/what-to-include.md) - [The `#[doc]` attribute](write-documentation/the-doc-attribute.md)


// Each call to `fill_buf` sets `filled` to indicate how many bytes at the start of `buf` are // initialized with bytes from a read. filled: usize, <ins> // This is the max number of bytes returned across all `fill_buf` calls. We track this so that we // can accurately tell `read_buf` how many bytes of buf are initialized, to bypass as much of its // defensive initialization as possible. Note that while this often the same as `filled`, it // doesn't need to be. Calls to `fill_buf` are not required to actually fill the buffer, and // omitting this is a huge perf regression for `Read` impls that do not. initialized: usize, </ins> } impl Buffer { #[inline] pub fn with_capacity(capacity: usize) -> Self { let buf = Box::new_uninit_slice(capacity); <del> Self { buf, pos: 0, filled: 0 } </del> <ins> Self { buf, pos: 0, filled: 0, initialized: 0 } </ins> } #[inline]


item.id, span, item.name, <del> item.node.descriptive_variant() </del> <ins> item.node.descriptive_variant(), "used", </ins> ); } else { // Only continue if we didn't warn


.expect("failed to read src/version"); let version = version.trim(); <del> let bootstrap_out = std::env::current_exe() </del> <ins> let mut bootstrap_out = std::env::current_exe() </ins> .expect("could not determine path to running process") .parent() .unwrap() .to_path_buf(); <ins> // Since bootstrap is hardlink to deps/bootstrap-*, Solaris can sometimes give // path with deps/ which is bad and needs to be avoided. if bootstrap_out.ends_with("deps") { bootstrap_out.pop(); } </ins> if !bootstrap_out.join(exe("rustc", config.build)).exists() && !cfg!(test) { // this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented panic!(


} else { "items from traits can only be used if the trait is implemented and in scope" }); <del> let mut msg = format!( </del> <ins> let message = |action| format!( </ins> "the following {traits_define} an item `{name}`, perhaps you need to {action}  {one_of_them}:", traits_define = if candidates.len() == 1 {


<ins> #![crate_type="lib"] fn x<'a>(x: &mut 'a i32){} //~ ERROR lifetime must precede `mut` macro_rules! mac { ($lt:lifetime) => { fn w<$lt>(w: &mut $lt i32) {} //~^ ERROR lifetime must precede `mut` } } mac!('a); // avoid false positives fn y<'a>(y: &mut 'a + Send) { //~^ ERROR expected a path on the left-hand side of `+`, not `&mut 'a` //~| WARNING trait objects without an explicit `dyn` are deprecated //~| ERROR at least one trait is required for an object type let z = y as &mut 'a + Send; //~^ ERROR expected value, found trait `Send` //~| WARNING trait objects without an explicit `dyn` are deprecated } </ins>


// Do not ask for a passphrase while manually testing let mut passphrase = String::new(); if should_sign { <del> // `x.py` passes the passphrase via stdin. </del> t!(io::stdin().read_to_string(&mut passphrase)); }


<ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-ty.rs:2:17 | LL |     type A: S<C<i32 = u32> = ()>; |                 ^^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. </ins>


) - visited elif item["kind"] == "variant": if item["inner"]["variant_kind"] == "tuple": <del> for ty in item["inner"]["variant_inner"]: check_type(ty) </del> <ins> for field_id in filter(None, item["inner"]["variant_inner"]): work_list.add(field_id) </ins> elif item["inner"]["variant_kind"] == "struct": <del> work_list |= set(item["inner"]["variant_inner"]) - visited </del> <ins> work_list |= set(item["inner"]["variant_inner"]["fields"]) - visited </ins> elif item["kind"] in ("function", "method"): check_generics(item["inner"]["generics"]) check_decl(item["inner"]["decl"])


// If this is due to a block, then maybe we forgot a `return`/`break`. if due_to_block && let Some(expr) = expression <del> && let Some((parent_fn_decl, parent_id)) = fcx .tcx .hir() .parent_iter(block_or_return_id) .find_map(|(_, node)| Some((node.fn_decl()?, node.associated_body()?.0))) </del> <ins> && let Some(parent_fn_decl) = fcx.tcx.hir().fn_decl_by_hir_id(fcx.tcx.local_def_id_to_hir_id(fcx.body_id)) </ins> { fcx.suggest_missing_break_or_return_expr( &mut err,


tcx.sess.span_err(span, "`..` cannot be used in union patterns"); } } else if !etc { <del> let unmentioned_fields = variant.fields .iter() .map(|field| field.ident.modern()) .filter(|ident| !used_fields.contains_key(&ident)) .collect::<Vec<_>>(); </del> if unmentioned_fields.len() > 0 { let field_names = if unmentioned_fields.len() == 1 { format!("field `{}`", unmentioned_fields[0])


runtest(&args[0]); } } <del> // See issue 28218 #[cfg(all(windows, target_arch = "x86"))] fn main() {} </del>


struct $crate {} //~ ERROR expected identifier, found reserved identifier `$crate` } <del> use $crate; // OK //~^ WARN `$crate` may not be imported </del> <ins> use $crate; //~ ERROR `$crate` may not be imported </ins> use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate` <del> //~^ WARN `$crate` may not be imported </del> <ins> //~^ ERROR `$crate` may not be imported </ins> } }


if let Some(ty) = crate::types::repr_nullable_ptr(cx, adt, ckind) { ty == primitive } else { <del> compare_layouts(a, b) </del> <ins> compare_layouts(a, b).unwrap_or(false) </ins> } } // Otherwise, just compare the layouts. This may fail to lint for some // incompatible types, but at the very least, will stop reads into // uninitialised memory. <del> _ => compare_layouts(a, b), </del> <ins> _ => compare_layouts(a, b).unwrap_or(false), </ins> } }) }


} pub enum timezone {} <ins> pub type sighandler_t = size_t; </ins> } pub mod bsd44 { use libc::types::os::arch::c95::{c_char, c_int, c_uint};


UniqueBorrow, /// AddressOf for *const pointer. AddressOf, <ins> /// PlaceMention statement. /// /// This statement is executed as a check that the `Place` is live without reading from it, /// so it must be considered as a non-mutating use. PlaceMention, </ins> /// Used as base for another place, e.g., `x` in `x.y`. Will not mutate the place. /// For example, the projection `x.y` is not marked as a mutation in these cases: /// ```ignore (illustrative)


# Explicitly disabling ICE dump export RUSTC_ICE=0 $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-disabled.log 2>&1 <del> should_be_empty_tmp=$(ls -l $TMPDIR/rustc-ice-*.txt | wc -l) should_be_empty_dot=$(ls -l ./rustc-ice-*.txt | wc -l) </del> <ins> should_be_empty_tmp=$(ls -l $TMPDIR/rustc-ice-*.txt 2>/dev/null | wc -l) should_be_empty_dot=$(ls -l ./rustc-ice-*.txt 2>/dev/null | wc -l) </ins> echo "#### ICE Dump content:" echo $content


/// If you need a [`&str`] instead of a `String`, consider /// [`str::from_utf8`]. /// <del> /// The inverse of this method is [`as_bytes`]. </del> <ins> /// The inverse of this method is [`into_bytes`]. </ins> /// /// # Errors ///


<ins> //@ run-rustfix #![allow(unused_mut)] use std::borrow::{Borrow, BorrowMut}; use std::convert::{AsMut, AsRef}; struct Bar; impl AsRef<Bar> for Bar { fn as_ref(&self) -> &Bar { self } } impl AsMut<Bar> for Bar { fn as_mut(&mut self) -> &mut Bar { self } } fn foo<T: AsRef<Bar>>(_: T) {} fn qux<T: AsMut<Bar>>(_: T) {} fn bat<T: Borrow<T>>(_: T) {} fn baz<T: BorrowMut<T>>(_: T) {} pub fn main() { let bar = Bar; foo(&bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; qux(&mut bar); let _baa = bar; //~ ERROR use of moved value let bar = Bar; bat(&bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; baz(&mut bar); let _baa = bar; //~ ERROR use of moved value } </ins>


use foo::bar; foo::bar(); //~ ERROR: unnecessary qualification bar(); <ins> let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 macro_rules! m { () => { $crate::foo::bar(); } } m!(); // issue #37357 </ins> }


TyKind::Path(ref qself, ref path) => { self.diagnostic_metadata.current_type_path = Some(ty); self.smart_resolve_path(ty.id, qself.as_ref(), path, PathSource::Type); <ins> // Check whether we should interpret this as a bare trait object. if qself.is_none() && let Some(partial_res) = self.r.partial_res_map.get(&ty.id) && partial_res.unresolved_segments() == 0 && let Res::Def(DefKind::Trait | DefKind::TraitAlias, _) = partial_res.base_res() { // This path is actually a bare trait object.  In case of a bare `Fn`-trait // object with anonymous lifetimes, we need this rib to correctly place the // synthetic lifetimes. let span = ty.span.shrink_to_lo().to(path.span.shrink_to_lo()); self.with_generic_param_rib( &[], NormalRibKind, LifetimeRibKind::Generics { binder: ty.id, kind: LifetimeBinderKind::PolyTrait, span, }, |this| this.visit_path(&path, ty.id), ); self.diagnostic_metadata.current_type_path = prev_ty; return; } </ins> } TyKind::ImplicitSelf => { let self_ty = Ident::with_dummy_span(kw::SelfUpper);


<ins> error[E0382]: use of moved value: `t` --> $DIR/issue-67123.rs:2:13 | LL | fn foo<T>(t: T) { |        - help: consider restricting this bound: `T: Copy` LL |     || { t; t; }; |          -  ^ value used here after move |          | |          value moved here | = note: move occurs because `t` has type `T`, which does not implement the `Copy` trait error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. </ins>


// There was a previous subslice pattern; make sure we don't allow more. let rest_span = match pat.kind { PatKind::Rest => Some(pat.span), <del> PatKind::Ident(.., Some(ref sub)) if sub.is_rest() => { // The `HirValidator` is merciless; add a `_` pattern to avoid ICEs. after.push(self.pat_wild_with_node_id_of(pat)); </del> <ins> PatKind::Ident(ref bm, ident, Some(ref sub)) if sub.is_rest() => { // #69103: Lower into `binding @ _` as above to avoid ICEs. after.push(lower_rest_sub(self, pat, bm, ident, sub)); </ins> Some(sub.span) } _ => None,


// in `SpecialCasing.txt`, // so hard-code it rather than have a generic "condition" mechanism. // See https://github.com/rust-lang/rust/issues/26035 <del> let out_len = self.len() - rest.len(); let sigma_lowercase = map_uppercase_sigma(&self, i + out_len); </del> <ins> let sigma_lowercase = map_uppercase_sigma(self, prefix_len + i); </ins> s.push(sigma_lowercase); } else { match conversions::to_lower(c) {


install_fatal_error_handler(FatalErrorHandler); } <ins> extern "C" void LLVMRustDisableSystemDialogsOnCrash() { sys::DisableSystemDialogsOnCrash(); } </ins> extern "C" char *LLVMRustGetLastError(void) { char *Ret = LastError; LastError = nullptr;


// We special case `#[derive(_)]n` and other attribute suggestions, because those // are the ones where context is most useful. let file_lines = sm <del> .span_to_lines(span.primary_span().unwrap().shrink_to_hi()) </del> <ins> .span_to_lines(parts[0].span.shrink_to_hi()) </ins> .expect("span_to_lines failed when emitting suggestion"); let line_num = sm.lookup_char_pos(parts[0].span.lo()).line; if let Some(line) = file_lines.file.get_line(line_num - 1) {


<ins> error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71382.rs:15:23 | LL |     fn test<const FN: fn()>(&self) { |                       ^^^^ error: aborting due to previous error </ins>


<ins> error[E0689]: can't call method `rev` on type `usize` --> $DIR/issue-90315.rs:4:28 | LL |     for _i in 0..arr.len().rev() { |                            ^^^ can't call method `rev` on type `usize` | help: you must surround the range in parentheses to call its `rev` function | LL |     for _i in (0..arr.len()).rev() { |               +            + error[E0689]: can't call method `rev` on type `{integer}` --> $DIR/issue-90315.rs:12:20 | LL |     for i in 1..11.rev() { |                    ^^^ can't call method `rev` on type `{integer}` | help: you must surround the range in parentheses to call its `rev` function | LL |     for i in (1..11).rev() { |              +     + error[E0689]: can't call method `rev` on type `usize` --> $DIR/issue-90315.rs:18:21 | LL |     for i in 1..end.rev() { |                     ^^^ can't call method `rev` on type `usize` | help: you must surround the range in parentheses to call its `rev` function | LL |     for i in (1..end).rev() { |              +      + error[E0689]: can't call method `rev` on type `usize` --> $DIR/issue-90315.rs:23:27 | LL |     for i in 1..(end + 1).rev() { |                           ^^^ can't call method `rev` on type `usize` | help: you must surround the range in parentheses to call its `rev` function | LL |     for i in (1..(end + 1)).rev() { |              +            + error[E0689]: can't call method `is_empty` on type `usize` --> $DIR/issue-90315.rs:28:21 | LL |     if 1..(end + 1).is_empty() { |                     ^^^^^^^^ can't call method `is_empty` on type `usize` | help: you must surround the range in parentheses to call its `is_empty` function | LL |     if (1..(end + 1)).is_empty() { |        +            + error[E0308]: mismatched types --> $DIR/issue-90315.rs:28:8 | LL |     if 1..(end + 1).is_empty() { |        ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` error[E0689]: can't call method `is_sorted` on type `usize` --> $DIR/issue-90315.rs:34:21 | LL |     if 1..(end + 1).is_sorted() { |                     ^^^^^^^^^ can't call method `is_sorted` on type `usize` | help: you must surround the range in parentheses to call its `is_sorted` function | LL |     if (1..(end + 1)).is_sorted() { |        +            + error[E0308]: mismatched types --> $DIR/issue-90315.rs:34:8 | LL |     if 1..(end + 1).is_sorted() { |        ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` error[E0689]: can't call method `take` on type `{integer}` --> $DIR/issue-90315.rs:40:26 | LL |     let _res: i32 = 3..6.take(2).sum(); |                          ^^^^ can't call method `take` on type `{integer}` | help: you must surround the range in parentheses to call its `take` function | LL |     let _res: i32 = (3..6).take(2).sum(); |                     +    + error[E0308]: mismatched types --> $DIR/issue-90315.rs:40:21 | LL |     let _res: i32 = 3..6.take(2).sum(); |               ---   ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `std::ops::Range` |               | |               expected due to this | = note: expected type `i32` found struct `std::ops::Range<{integer}>` error[E0689]: can't call method `sum` on type `{integer}` --> $DIR/issue-90315.rs:45:26 | LL |     let _sum: i32 = 3..6.sum(); |                          ^^^ can't call method `sum` on type `{integer}` | help: you must surround the range in parentheses to call its `sum` function | LL |     let _sum: i32 = (3..6).sum(); |                     +    + error[E0308]: mismatched types --> $DIR/issue-90315.rs:45:21 | LL |     let _sum: i32 = 3..6.sum(); |               ---   ^^^^^^^^^^ expected `i32`, found struct `std::ops::Range` |               | |               expected due to this | = note: expected type `i32` found struct `std::ops::Range<{integer}>` error[E0689]: can't call method `rev` on type `usize` --> $DIR/issue-90315.rs:53:21 | LL |     for _a in a..=b.rev() { |                     ^^^ can't call method `rev` on type `usize` | help: you must surround the range in parentheses to call its `rev` function | LL |     for _a in (a..=b).rev() { |               +     + error[E0689]: can't call method `contains` on type `{integer}` --> $DIR/issue-90315.rs:58:21 | LL |     let _res = ..10.contains(3); |                     ^^^^^^^^ can't call method `contains` on type `{integer}` | help: you must surround the range in parentheses to call its `contains` function | LL |     let _res = (..10).contains(3); |                +    + error[E0599]: no method named `error_method` found for type `usize` in the current scope --> $DIR/issue-90315.rs:62:15 | LL |     if 1..end.error_method() { |               ^^^^^^^^^^^^ method not found in `usize` error[E0308]: mismatched types --> $DIR/issue-90315.rs:62:8 | LL |     if 1..end.error_method() { |        ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` </ins> error[E0599]: `usize` is not an iterator <del> --> $DIR/issue-90315.rs:3:26 </del> <ins> --> $DIR/issue-90315.rs:68:18 </ins> | <del> LL |   for _i in 0..arr.len().rev() { |                          ^^^ `usize` is not an iterator </del> <ins> LL |     let _res = b.take(1)..a; |                  ^^^^ `usize` is not an iterator </ins> | = note: the following trait bounds were not satisfied: `usize: Iterator` which is required by `&mut usize: Iterator` <del> error: aborting due to previous error </del> <ins> error[E0689]: can't call method `take` on ambiguous numeric type `{integer}` --> $DIR/issue-90315.rs:71:25 | LL |     let _res: i32 = ..6.take(2).sum(); |                         ^^^^ | help: you must specify a concrete type for this numeric value, like `i32` | LL |     let _res: i32 = ..6_i32.take(2).sum(); |                       ~~~~~ error[E0308]: mismatched types --> $DIR/issue-90315.rs:71:21 | LL |     let _res: i32 = ..6.take(2).sum(); |               ---   ^^^^^^^^^^^^^^^^^ expected `i32`, found struct `RangeTo` |               | |               expected due to this | = note: expected type `i32` found struct `RangeTo<_>` error: aborting due to 19 previous errors </ins> <del> For more information about this error, try `rustc --explain E0599`. </del> <ins> Some errors have detailed explanations: E0308, E0599, E0689. For more information about an error, try `rustc --explain E0308`. </ins>


[[package]] name = "compiler_builtins" <del> version = "0.1.47" </del> <ins> version = "0.1.49" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "fd4ed89e0a5c3e50b15c0045fbe1ff8567b703bc07544faf935ddff0aaa7b65f" </del> <ins> checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2" </ins> dependencies = [ "cc", "rustc-std-workspace-core",


/// Composite function which sets LLVM attributes for function depending on its AST (#[attribute]) /// attributes. <del> pub fn from_fn_attrs(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value, id: DefId) { let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(id); </del> <ins> pub fn from_fn_attrs( cx: &CodegenCx<'ll, '_>, llfn: &'ll Value, id: Option<DefId>, ) { let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id)) .unwrap_or(CodegenFnAttrs::new()); </ins> inline(llfn, codegen_fn_attrs.inline); <ins> // The `uwtable` attribute according to LLVM is: // //     This attribute indicates that the ABI being targeted requires that an //     unwind table entry be produced for this function even if we can show //     that no exceptions passes by it. This is normally the case for the //     ELF x86-64 abi, but it can be disabled for some compilation units. // // Typically when we're compiling with `-C panic=abort` (which implies this // `no_landing_pads` check) we don't need `uwtable` because we can't // generate any exceptions! On Windows, however, exceptions include other // events such as illegal instructions, segfaults, etc. This means that on // Windows we end up still needing the `uwtable` attribute even if the `-C // panic=abort` flag is passed. // // You can also find more info on why Windows is whitelisted here in: //      https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 if !cx.sess().no_landing_pads() || cx.sess().target.target.options.requires_uwtable { attributes::emit_uwtable(llfn, true); } </ins> set_frame_pointer_elimination(cx, llfn); set_probestack(cx, llfn);


<ins> error[E0785]: cannot define inherent `impl` for a dyn auto trait --> $DIR/issue-85026.rs:5:6 | LL | impl dyn AutoTrait {} |      ^^^^^^^^^^^^^ impl requires at least one non-auto trait | = note: define and implement a new trait or type instead error[E0785]: cannot define inherent `impl` for a dyn auto trait --> $DIR/issue-85026.rs:8:6 | LL | impl dyn Unpin {} |      ^^^^^^^^^ impl requires at least one non-auto trait | = note: define and implement a new trait or type instead error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0785`. </ins>


<del> error[E0277]: the trait bound `&'static mut (): Clone` is not satisfied --> $DIR/issue-93008.rs:5:5 | LL |     &'static mut (): Clone, |     ^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `&'static mut ()` | = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </del>


Some(f) => f, None => return DummyResult::any(sp) }; <del> let file = cx.resolve_path(file, sp); </del> <ins> let file = match cx.resolve_path(file, sp) { Ok(f) => f, Err(mut err) => { err.emit(); return DummyResult::any(sp); }, }; </ins> match cx.source_map().load_binary_file(&file) { Ok(bytes) => { base::MacEager::expr(cx.expr_lit(sp, ast::LitKind::ByteStr(Lrc::new(bytes))))


return Success(PrefixFound(containing_module, i)); } <ins> fn resolve_crate_var(&mut self, mut crate_var_ctxt: SyntaxContext) -> Module<'a> { while crate_var_ctxt.source().0 != SyntaxContext::empty() { crate_var_ctxt = crate_var_ctxt.source().0; } let module = self.invocations[&crate_var_ctxt.source().1].module.get(); if module.is_local() { self.graph_root } else { module } } </ins> // AST resolution // // We maintain a list of value ribs and type ribs.


<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; //~^ ERROR failed to resolve. Could not find `imp` in `sys` [E0433] //~^^ ERROR module `sys` is private [E0603] } </ins>


Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. <del> Last change is for: https://github.com/rust-lang/rust/pull/109373 </del> <ins> Last change is for: https://github.com/rust-lang/rust/pull/96971 </ins>


document(w, cx, it)?; if !e.variants.is_empty() {  write!(w, "
Variants
n")?;   write!(w, "
 Variants
n")?;  for variant in &e.variants { let id = derive_id(format!("{}.{}", ItemType::Variant,


} } <ins> fn replace_tabs(str: &str) -> String { str.replace('t', "    ") } </ins> fn draw_col_separator(buffer: &mut StyledBuffer, line: usize, col: usize) { buffer.puts(line, col, "| ", Style::LineNumber); }


if w > 2 { val = utf8_acc_cont_byte!(val, s[i + 2]); } if w > 3 { val = utf8_acc_cont_byte!(val, s[i + 3]); } <del> return CharRange {ch: unsafe { transmute(val as u32) }, next: i + w}; </del> <ins> return CharRange {ch: unsafe { transmute(val) }, next: i + w}; </ins> } return multibyte_char_range_at(*self, i);


} } <del> visible_parent_map </del> <ins> drop(visible_parent_map); self.visible_parent_map.borrow() </ins> } }


/* Code ========================================================================== */ pre, code { <del> font-family: Menlo, Monaco, Consolas, "Courier New", monospace; </del> <ins> font-family: Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace; </ins> border-radius: 4px; } pre { <del> background-color: #F5F5F5; </del> <ins> background-color: #FDFDFD; </ins> border: 1px solid #CCC; border-radius: 0.5em; white-space: pre-wrap;


<del> //! Ensure that we call Windows TLS callbacks in the local crate. //@only-target-windows // Calling eprintln in the callback seems to (re-)initialize some thread-local storage // and then leak the memory allocated for that. Let's just ignore these leaks, // that's not what this test is about. //@compile-flags: -Zmiri-ignore-leaks #[link_section = ".CRT$XLB"] #[used] // Miri only considers explicitly `#[used]` statics for `lookup_link_section` pub static CALLBACK: unsafe extern "system" fn(*const (), u32, *const ()) = tls_callback; unsafe extern "system" fn tls_callback(_h: *const (), _dw_reason: u32, _pv: *const ()) { eprintln!("in tls_callback"); } fn main() {} </del>


// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> #![feature(lang_items)] </ins> #![no_std] <ins> #[lang="sized"] pub trait Sized for Sized? {} </ins> // error-pattern:requires `start` lang_item fn main() {}


<ins> error[E0728]: `await` is only allowed inside `async` functions and blocks --> $DIR/async-outside-of-await-issue-121096.rs:7:7 | LL | fn main() { |    ---- this is not `async` ... LL |     }.await |       ^^^^^ only allowed inside `async` functions and blocks error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0728`. </ins>


<ins> error: `#[doc(alias = "...")]` isn't allowed on associated constant in trait implementation block --> $DIR/doc-alias-assoc-const.rs:11:11 | LL |     #[doc(alias = "CONST_BAZ")] |           ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error </ins>


<ins> // run-rustfix // Regression test for #54505 - range borrowing suggestion had // incorrect syntax (missing parentheses). use std::ops::RangeBounds; // take a reference to any built-in range fn take_range(_r: &impl RangeBounds<i8>) {} fn main() { take_range(&(0..1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..1) take_range(&(1..)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(1..) take_range(&(..)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..) take_range(&(0..=1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..=1) take_range(&(..5)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..5) take_range(&(..=42)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..=42) } </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. struct X(int); enum Enum { Variant1, Variant2 } impl Drop for X { fn drop(&mut self) {} } impl Drop for Enum { fn drop(&mut self) {} } fn main() { let foo = X(1i); drop(foo); match foo { //~ ERROR use of moved value X(1i) => (), _ => unreachable!() } let e = Variant2; drop(e); match e { //~ ERROR use of moved value Variant1 => unreachable!(), Variant2 => () } } </ins>


} } <ins> /// Check if node is an impl block. pub fn is_impl_block(&self) -> bool { matches!(self, OwnerNode::Item(Item { kind: ItemKind::Impl(_), .. })) } </ins> expect_methods_self! { expect_item,         &'hir Item<'hir>,        OwnerNode::Item(n),        n; expect_foreign_item, &'hir ForeignItem<'hir>, OwnerNode::ForeignItem(n), n;


<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. pub fn main() { struct Fun<F>(F); let f = Fun(|x| 3*x); let Fun(g) = f; println!("{:?}",g(4)); } </ins>


sources::render(&mut cx, &krate)?; } <del> // Build our search index let index = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx); </del> <ins> if !no_emit_shared { // Build our search index let index = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx); // Write shared runs within a flock; disable thread dispatching of IO temporarily. Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true); write_shared(&cx, &krate, index, &md_opts)?; Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(false); } </ins> <del> // Write shared runs within a flock; disable thread dispatching of IO temporarily. Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true); write_shared(&cx, &krate, index, &md_opts)?; Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(false); </del> Ok((cx, krate)) }


<del> warning: `$crate` may not be imported --> $DIR/import-crate-var.rs:7:5 </del> <ins> error: `$crate` may not be imported --> $DIR/import-crate-var.rs:6:5 </ins> | LL |     m!(); |     ^^^^^ | <del> = note: `use $crate;` was erroneously allowed and will become a hard error in a future release = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) </del> <ins> = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error </ins>


//@ aux-build:issue-76736-1.rs //@ aux-build:issue-76736-2.rs <ins> // https://github.com/rust-lang/rust/issues/124635 </ins> #![crate_name = "foo"] #![feature(rustc_private)]


use crate::cgu_reuse_tracker::CguReuseTracker; use crate::code_stats::CodeStats; pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo}; <del> use crate::config::{self, CrateType, OutputType, PrintRequest, SwitchWithOptPath}; </del> <ins> use crate::config::{self, CrateType, OutputType, SwitchWithOptPath}; </ins> use crate::filesearch; use crate::lint::{self, LintId}; use crate::parse::ParseSess;


ty::Alias(kind @ (ty::Projection | ty::Opaque), alias_ty) => (kind, alias_ty), ty::Alias(ty::Inherent | ty::Weak, _) => { <del> unreachable!("Weak and Inherent aliases should have been normalized away already") </del> <ins> self.tcx().sess.dcx().span_delayed_bug( DUMMY_SP, format!("could not normalize {self_ty}, it is not WF"), ); return; </ins> } };


enum priv_enum { foo2, bar2 } //~ ERROR: enum is never used enum used_enum { foo3, <del> bar3 //~ ERROR variant is never used </del> <ins> bar3 //~ ERROR variant is never constructed </ins> } fn f<T>() {}


<ins> error[E0412]: cannot find type `Bar` in this scope --> $DIR/issue-36836.rs:13:17 | LL | impl<T> Foo for Bar<T> {} |                 ^^^ not found in this scope error: aborting due to previous error For more information about this error, try `rustc --explain E0412`. </ins>


//! A copy of the `Qualif` trait in `qualify_consts.rs` that is suitable for the new validator. <del> use rustc::hir::def_id::DefId; </del> use rustc::mir::*; use rustc::ty::{self, Ty}; use syntax_pos::DUMMY_SP;


assert!(plan.iter().all(|s| s.host == "A")); assert!(plan.iter().all(|s| s.target == "C")); <del> assert!(plan.iter().any(|s| s.name.contains("-ui"))); assert!(plan.iter().any(|s| s.name.contains("cfail"))); </del> <ins> assert!(!plan.iter().any(|s| s.name.contains("-ui"))); </ins> assert!(plan.iter().any(|s| s.name.contains("cfail"))); assert!(!plan.iter().any(|s| s.name.contains("cfail-full"))); assert!(plan.iter().any(|s| s.name.contains("codegen-units")));


fn default() -> BinaryHeap<T> { BinaryHeap::new() } } <ins> #[stable(feature = "binaryheap_debug", since = "1.4.0")] impl<T: fmt::Debug + Ord> fmt::Debug for BinaryHeap<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } } </ins> impl<T: Ord> BinaryHeap<T> { /// Creates an empty `BinaryHeap` as a max-heap. ///


TyUint(uty) => (Integer::from_attr(tcx, UnsignedInt(uty)), false), _ => bug!("non integer discriminant"), }; <ins> let bit_size = int.size().bits(); let amt = 128 - bit_size; </ins> if signed { <del> let (min, max) = match int { Integer::I8 => (i8::min_value() as i128, i8::max_value() as i128), Integer::I16 => (i16::min_value() as i128, i16::max_value() as i128), Integer::I32 => (i32::min_value() as i128, i32::max_value() as i128), Integer::I64 => (i64::min_value() as i128, i64::max_value() as i128), Integer::I128 => (i128::min_value(), i128::max_value()), </del> <ins> let sext = |u| { let i = u as i128; (i << amt) >> amt </ins> }; <del> let val = self.val as i128; </del> <ins> let min = sext(1_u128 << (bit_size - 1)); let max = i128::max_value() >> amt; let val = sext(self.val); assert!(n < (i128::max_value() as u128)); </ins> let n = n as i128; let oflo = val > max - n; let val = if oflo {


<ins> #![feature(non_lifetime_binders)] //~^ WARN the feature `non_lifetime_binders` is incomplete trait Trait<Input> { type Assoc; } fn uwu(_: impl for<T> Trait<(), Assoc = impl Trait<T>>) {} //~^ ERROR `impl Trait` can only mention type parameters from an fn or impl fn main() {} </ins>


fn read_port(&mut self) -> Option<u16> { self.read_atomically(|p| { p.read_given_char(':')?; <del> p.read_number(10, None) </del> <ins> p.read_number(10, None, true) </ins> }) }


build.verbose = args.verbose build.clean = args.clean <del> # Read from `RUST_BOOTSTRAP_CONFIG`, then `--config`, then fallback to `config.toml` (if it </del> <ins> # Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then fallback to `config.toml` (if it </ins> # exists). <del> toml_path = os.getenv('RUST_BOOTSTRAP_CONFIG') or args.config </del> <ins> toml_path = args.config or os.getenv('RUST_BOOTSTRAP_CONFIG') </ins> if not toml_path and os.path.exists('config.toml'): toml_path = 'config.toml'


// Version of LLDB pub lldb_version: Option<String>, <ins> // Version of LLVM pub llvm_version: Option<String>, </ins> // Path to the android tools pub android_cross_path: PathBuf,


match ocx.eq(&misc_cause, param_env, opaque_ty, hidden_ty) { Ok(()) => {} Err(ty_err) => { <ins> // Some types may be left "stranded" if they can't be reached // from an astconv'd bound but they're mentioned in the HIR. This // will happen, e.g., when a nested opaque is inside of a non- // existent associated type, like `impl Trait<Missing = impl Trait>`. // See <tests/ui/impl-trait/stranded-opaque.rs>. </ins> let ty_err = ty_err.to_string(tcx); <del> tcx.dcx().span_bug( </del> <ins> let guar = tcx.dcx().span_delayed_bug( </ins> span, format!("could not unify `{hidden_ty}` with revealed type:n{ty_err}"), ); <ins> return Err(guar); </ins> } }


#![no_std] #![feature(lang_items)] <ins> #[lang="sized"] pub trait Sized for Sized? {} </ins> #[lang="fail"] fn fail(_: &(&'static str, &'static str, uint)) -> ! { loop {} }


.chain(features.declared_lib_features.iter().map(|(name, span)| (name, span))) .filter(|(&name, _)| features.incomplete(name) || features.internal(name)) .for_each(|(&name, &span)| { <del> let note = rustc_feature::find_feature_issue(name, GateIssue::Language) .map(|n| BuiltinFeatureIssueNote { n }); </del> if features.incomplete(name) { <ins> let note = rustc_feature::find_feature_issue(name, GateIssue::Language) .map(|n| BuiltinFeatureIssueNote { n }); </ins> let help = HAS_MIN_FEATURES.contains(&name).then_some(BuiltinIncompleteFeaturesHelp); cx.emit_spanned_lint( INCOMPLETE_FEATURES, span, BuiltinIncompleteFeatures { name, note, help }, ); } else { <del> cx.emit_spanned_lint( INTERNAL_FEATURES, span, BuiltinInternalFeatures { name, note }, ); </del> <ins> cx.emit_spanned_lint(INTERNAL_FEATURES, span, BuiltinInternalFeatures { name }); </ins> } }); }


<ins> error: expected pattern, found `$` --> $DIR/issue-116781.rs:4:16 | LL |     field: fn(($),), |                ^ expected pattern error: expected pattern, found `$` --> $DIR/issue-116781.rs:4:16 | LL |     field: fn(($),), |                ^ expected pattern | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 2 previous errors </ins>


mod a { mod b { <del> use self as A; //~ ERROR `self` imports are only allowed within a { } list //~^ ERROR unresolved import `self` [E0432] //~| no `self` in the root </del> <ins> use self as A; //~^ ERROR `self` imports are only allowed within a { } list </ins> use super as B; //~^ ERROR unresolved import `super` [E0432] //~| no `super` in the root


source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", <del> "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",


ss_size: SIGSTKSZ, }; sigaltstack(&stack, ptr::null_mut()); <del> munmap(handler._data, SIGSTKSZ); </del> <ins> // We know from `get_stackp` that the alternate stack we installed is part of a mapping // that started one page earlier, so walk back a page and unmap from there. munmap(handler._data.sub(page_size()), SIGSTKSZ + page_size()); </ins> } } }


<ins> // run-rustfix pub enum Range { //~^ ERROR `enum` and `struct` are mutually exclusive Valid { begin: u32, len: u32, }, Out, } fn main() { } </ins>


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


last_import_segment: false, unusable_binding: None, <ins> pat_span_map: Default::default(), </ins> partial_res_map: Default::default(), import_res_map: Default::default(), label_res_map: Default::default(),


<ins> // Regression test for ICE #129503 // Tests that we come up with decent error spans // when the template fed to `asm!()` is itself a // macro call like `concat!()` and should not ICE use std::arch::asm; fn main() { // Should not ICE asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "r} {}")); //~^ ERROR invalid asm template string: unmatched `}` found // Macro call template: should point to // everything within `asm!()` as error span asm!(concat!("abc", "r} {}")); //~^ ERROR invalid asm template string: unmatched `}` found // Literal template: should point precisely to // just the `}` as error span asm!("abc", "r} {}"); //~^ ERROR invalid asm template string: unmatched `}` found } </ins>


#![allow(unused_macros)] <ins> // Tests that repetition matchers cannot match the empty token tree (since that would be // ambiguous). // edition:2018 </ins> macro_rules! foo { ( $()* ) => {}; //~^ ERROR repetition matches empty token tree ( $()+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $()? ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( $(),* ) => {}; // PASS ( $(),+ ) => {}; // PASS <ins> // `?` cannot have a separator... </ins> ( [$()*] ) => {}; //~^ ERROR repetition matches empty token tree ( [$()+] ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( [$()?] ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( [$(),*] ) => {}; // PASS ( [$(),+] ) => {}; // PASS <ins> // `?` cannot have a separator... </ins> ( $($()* $(),* $(a)* $(a),* )* ) => {}; //~^ ERROR repetition matches empty token tree ( $($()* $(),* $(a)* $(a),* )+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $($()* $(),* $(a)* $(a),* )? ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )* ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )+ ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )? ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( $(a     $(),* $(a)* $(a),* )* ) => {}; // PASS ( $($(a)+ $(),* $(a)* $(a),* )+ ) => {}; // PASS <ins> ( $($(a)+ $(),* $(a)* $(a),* )? ) => {}; // PASS ( $(a     $(),* $(a)? $(a),* )* ) => {}; // PASS ( $($(a)+ $(),* $(a)? $(a),* )+ ) => {}; // PASS ( $($(a)+ $(),* $(a)? $(a),* )? ) => {}; // PASS </ins> ( $(a $()+)* ) => {}; //~^ ERROR repetition matches empty token tree ( $(a $()*)+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $(a $()+)? ) => {}; //~^ ERROR repetition matches empty token tree ( $(a $()?)+ ) => {}; //~^ ERROR repetition matches empty token tree </ins> } // --- Original Issue --- // macro_rules! make_vec {


[95818]: https://github.com/rust-lang/rust/pull/95818/ [95897]: https://github.com/rust-lang/rust/pull/95897/ [95953]: https://github.com/rust-lang/rust/pull/95953/ <ins> [96051]: https://github.com/rust-lang/rust/pull/96051/ </ins> [96296]: https://github.com/rust-lang/rust/pull/96296/ [96455]: https://github.com/rust-lang/rust/pull/96455/ [96737]: https://github.com/rust-lang/rust/pull/96737/


config.download_beta_toolchain(); config.out.join(config.build.triple).join("stage0/bin/rustc") }); config.initial_cargo = build .cargo .map(|cargo| {


#[rustc_doc_primitive = "f32"] #[doc(alias = "single")] <del> /// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008). </del> <ins> /// A 32-bit floating-point type (specifically, the "binary32" type defined in IEEE 754-2008). </ins> /// /// This type can represent a wide range of decimal numbers, like `3.5`, `27`, /// `-113.75`, `0.0078125`, `34359738368`, `0`, `-1`. So unlike integer types <del> /// (such as `i32`), floating point types can represent non-integer numbers, </del> <ins> /// (such as `i32`), floating-point types can represent non-integer numbers, </ins> /// too. /// /// However, being able to represent this wide range of numbers comes at the


if i != 0 || j != lines.len() { Some((i, j)) } else { None } } <del> fn get_horizontal_trim(lines: &[&str], kind: CommentKind) -> Option<usize> { </del> <ins> fn get_horizontal_trim<'a>(lines: &'a [&str], kind: CommentKind) -> Option<String> { </ins> let mut i = usize::MAX; let mut first = true;


return ret; } <ins> fn verify_rustc_version(&self, name: &str, span: Span, metadata: &MetadataBlob) { let crate_rustc_version = decoder::crate_rustc_version(metadata.as_slice()); if crate_rustc_version != Some(rustc_version()) { span_err!(self.sess, span, E0514, "the crate `{}` has been compiled with {}, which is  incompatible with this version of rustc", name, crate_rustc_version .as_ref().map(|s|&**s) .unwrap_or("an old version of rustc") ); self.sess.abort_if_errors(); } } </ins> fn register_crate(&mut self, root: &Option<CratePaths>, ident: &str,


<ins> error[E0404]: expected trait, found type alias `Strings` --> $DIR/suggest-trait-alias-instead-of-type.rs:10:18 | LL | struct Struct<S: Strings>(S); |                  ^^^^^^^ type aliases cannot be used as traits | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | LL | trait Strings = Iterator<Item=String>; | error: aborting due to previous error For more information about this error, try `rustc --explain E0404`. </ins>


extra_args.push("--disable-minification"); } <del> doc_std(builder, self.format, stage, target, &out, &extra_args, &self.crates); </del> <ins> doc_std(builder, self.format, stage, target, &out, &extra_args, &crates); </ins> // Don't open if the format is json if let DocumentationFormat::Json = self.format {


<ins> trait T { type A: S<C<i32 = u32> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C: Q; } fn main() {} </ins>


// present. However, we first need to strip the empty lines so they don't get in the middle // when we try to compute the "horizontal trim". let lines = if kind == CommentKind::Block { <del> let mut i = 0; </del> <ins> // Whatever happens, we skip the first line. let mut i = if lines[0].trim_start().starts_with('*') { 0 } else { 1 }; </ins> let mut j = lines.len(); while i < j && lines[i].trim().is_empty() {


/// [`NotConnected`]: ../../std/io/enum.ErrorKind.html#variant.NotConnected /// /// ```no_run <del> /// #![feature(udp_peer_addr)] </del> /// use std::net::UdpSocket; /// /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address"); /// assert_eq!(socket.peer_addr().unwrap_err().kind(), ///            ::std::io::ErrorKind::NotConnected); /// ``` <del> #[unstable(feature = "udp_peer_addr", issue = "59127")] </del> <ins> #[stable(feature = "udp_peer_addr", since = "1.40.0")] </ins> pub fn peer_addr(&self) -> io::Result<SocketAddr> { self.0.peer_addr() }


// This is something like impl Trait1 for Trait2. Illegal // if Trait1 is a supertrait of Trait2 or Trait2 is not object safe. <del> if let Some(principal_def_id) = data.principal_def_id() { if !tcx.is_object_safe(principal_def_id) { </del> <ins> let component_def_ids = data.iter().flat_map(|predicate| { match predicate.skip_binder() { ty::ExistentialPredicate::Trait(tr) => Some(tr.def_id), ty::ExistentialPredicate::AutoTrait(def_id) => Some(*def_id), // An associated type projection necessarily comes with // an additional `Trait` requirement. ty::ExistentialPredicate::Projection(..) => None, } }); for component_def_id in component_def_ids { if !tcx.is_object_safe(component_def_id) { </ins> // This is an error, but it will be reported by wfcheck.  Ignore it here. // This is tested by `coherence-impl-trait-for-trait-object-safe.rs`. } else { let mut supertrait_def_ids = <del> traits::supertrait_def_ids(tcx, principal_def_id); </del> <ins> traits::supertrait_def_ids(tcx, component_def_id); </ins> if supertrait_def_ids.any(|d| d == trait_def_id) { let sp = tcx.sess.source_map().def_span(tcx.span_of_impl(impl_def_id).unwrap()); struct_span_err!(tcx.sess,


#[stable(feature = "ip_u32", since = "1.1.0")] impl From<u32> for Ipv4Addr { <ins> /// It performs the conversion in network order (big-endian). </ins> fn from(ip: u32) -> Ipv4Addr { Ipv4Addr::new((ip >> 24) as u8, (ip >> 16) as u8, (ip >> 8) as u8, ip as u8) }


#![feature(doc_spotlight)] #![cfg_attr(test, feature(update_panic_count))] #![cfg_attr(windows, feature(const_atomic_ptr_new))] <ins> #![cfg_attr(windows, feature(used))] </ins> #![default_lib_allocator]


StyledBuffer { text: vec![], styles: vec![] } } <del> fn replace_tabs(&mut self) { for (line_pos, line) in self.text.iter_mut().enumerate() { let mut tab_pos = vec![]; for (pos, c) in line.iter().enumerate() { if *c == 't' { tab_pos.push(pos); } } // start with the tabs at the end of the line to replace them with 4 space chars for pos in tab_pos.iter().rev() { assert_eq!(line.remove(*pos), 't'); // fix the position of the style to match up after replacing the tabs let s = self.styles[line_pos].remove(*pos); for _ in 0..4 { line.insert(*pos, ' '); self.styles[line_pos].insert(*pos, s); } } } } </del> <ins> pub fn render(&self) -> Vec<Vec<StyledString>> { // Tabs are assumed to have been replaced by spaces in calling code. assert!(self.text.iter().all(|r| !r.contains(&'t'))); </ins> <del> pub fn render(&mut self) -> Vec<Vec<StyledString>> { </del> let mut output: Vec<Vec<StyledString>> = vec![]; let mut styled_vec: Vec<StyledString> = vec![]; <del> // before we render, replace tabs with spaces self.replace_tabs(); </del> for (row, row_style) in self.text.iter().zip(&self.styles) { let mut current_style = Style::NoStyle; let mut current_text = String::new();


<ins> // check-pass fn main() { println!("{:?}", { type T = (); pub fn cloneit(it: &'_ mut T) -> (&'_ mut T, &'_ mut T) where for<'any> &'any mut T: Clone, { (it.clone(), it) } }); } </ins>


("stable", Whitelisted, template!(List: r#"feature = "name", since = "version""#), Ungated), ("unstable", Whitelisted, template!(List: r#"feature = "name", reason = "...", issue = "N""#), Ungated), <del> ("deprecated", Normal, template!(Word, List: r#"/*opt*/ since = "version", /*opt*/ note = "reason"#, NameValueStr: "reason"), Ungated), </del> <ins> ("deprecated", Normal, template!( Word, List: r#"/*opt*/ since = "version", /*opt*/ note = "reason"#, NameValueStr: "reason" ), Ungated ), </ins> ("rustc_paren_sugar", Normal, template!(Word), Gated(Stability::Unstable, "unboxed_closures",


// We don't emit documentation for default items if they appear in the // Implementations on Foreign Types or Implementors sections. if rendering_params.show_default_items { <del> if let Some(t) = trait_ { </del> <ins> if let Some(t) = trait_ && !impl_.is_negative_trait_impl() { </ins> render_default_items( &mut default_impl_items, &mut impl_items, cx, t, <del> i.inner_impl(), </del> <ins> impl_, </ins> &i.impl_item, render_mode, rendering_params,


param_mode: ParamMode, itctx: ImplTraitContext, ) -> hir::Ty<'hir> { <ins> // Check whether we should interpret this as a bare trait object. // This check mirrors the one in late resolution.  We only introduce this special case in // the rare occurence we need to lower `Fresh` anonymous lifetimes. // The other cases when a qpath should be opportunistically made a trait object are handled // by `ty_path`. if qself.is_none() && let Some(partial_res) = self.resolver.get_partial_res(t.id) && partial_res.unresolved_segments() == 0 && let Res::Def(DefKind::Trait | DefKind::TraitAlias, _) = partial_res.base_res() { let (bounds, lifetime_bound) = self.with_dyn_type_scope(true, |this| { let bound = this.lower_poly_trait_ref( &PolyTraitRef { bound_generic_params: vec![], trait_ref: TraitRef { path: path.clone(), ref_id: t.id }, span: t.span }, itctx, ); let bounds = this.arena.alloc_from_iter([bound]); let lifetime_bound = this.elided_dyn_bound(t.span); (bounds, lifetime_bound) }); let kind = hir::TyKind::TraitObject(bounds, lifetime_bound, TraitObjectSyntax::None); return hir::Ty { kind, span: self.lower_span(t.span), hir_id: self.next_id() }; } </ins> let id = self.lower_node_id(t.id); let qpath = self.lower_qpath(t.id, qself, path, param_mode, itctx); self.ty_path(id, t.span, qpath)


match MyOption::MySome(42) { MyOption::MySome { x: 42 } => (), //~^ ERROR variant `MyOption::MySome` does not have a field named `x` <del> //~| ERROR pattern does not mention field `0` </del> _ => (), } }


/// /// Run a future to completion on the current thread. /// fn block_on<T>(fut: impl Future<Output = T>) -> T { ///     // Pin the future so it can be polled. <del> ///     let mut fut = Box::pin(fut); </del> <ins> ///     let mut fut = pin!(fut); </ins> /// ///     // Create a new context to be passed to the future. ///     let t = thread::current();


// since we may be in the process of computing this MIR in the // first place. let layout = if def_id == self.caller_body.source.def_id() { <del> // FIXME: This is not right for async closures. </del> <ins> self.caller_body.coroutine_layout_raw() } else if let Some(hir::CoroutineKind::Desugared( _, hir::CoroutineSource::Closure, )) = self.tcx.coroutine_kind(def_id) && let ty::ClosureKind::FnOnce = args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap() && self.caller_body.source.def_id() == self.tcx.coroutine_by_move_body_def_id(def_id) { // Same if this is the by-move body of a coroutine-closure. </ins> self.caller_body.coroutine_layout_raw() } else { self.tcx.coroutine_layout(def_id, args.as_coroutine().kind_ty())


"bad output4: {}", s); } <del> #[cfg(not(all(windows, target_arch = "x86")))] </del> fn main() { <ins> if cfg!(windows) && cfg!(target_arch = "x86") && cfg!(target_env = "gnu") { return } </ins> let args: Vec<String> = env::args().collect(); if args.len() >= 2 && args[1] == "fail" { foo();


} let definition_ty = instantiated_ty <del> .remap_generic_params_to_declaration_params(opaque_type_key, self.tcx, false, origin) </del> <ins> .remap_generic_params_to_declaration_params(opaque_type_key, self.tcx, false) </ins> .ty; if !check_opaque_type_parameter_valid(


| ----- in this macro invocation error: expected identifier, found reserved identifier `$crate` <del> --> $DIR/dollar-crate-is-keyword.rs:11:23 </del> <ins> --> $DIR/dollar-crate-is-keyword.rs:10:23 </ins> | LL |         use $crate as $crate; |                       ^^^^^^ expected identifier, found reserved identifier


= help: add `#![feature(never_type)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date <del> error: aborting due to 5 previous errors </del> <ins> error[E0658]: the `!` type is experimental --> $DIR/feature-gate-never_type.rs:16:43 | LL | fn look_ma_no_feature_gate<F: FnOnce() -> !>() {} |                                           ^ | = note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information = help: add `#![feature(never_type)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: the `!` type is experimental --> $DIR/feature-gate-never_type.rs:17:26 | LL | fn tadam(f: &dyn Fn() -> !) {} |                          ^ | = note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information = help: add `#![feature(never_type)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: the `!` type is experimental --> $DIR/feature-gate-never_type.rs:21:30 | LL | fn toudoum() -> impl Fn() -> ! { |                              ^ | = note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information = help: add `#![feature(never_type)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 8 previous errors </ins> For more information about this error, try `rustc --explain E0658`.


// The correct solution would be to add symbolic computations to miri, // so we wouldn't have to compute and store the actual value <del> let hir::ExprKind::Path(ref qpath) = source.kind else { return ExprKind::Cast { source: self.mirror_expr(source) }; }; let res = self.typeck_results().qpath_res(qpath, source.hir_id); let ty = self.typeck_results().node_type(source.hir_id); let ty::Adt(adt_def, args) = ty.kind() else { return ExprKind::Cast { source: self.mirror_expr(source) }; }; let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), variant_ctor_id) = res else { return ExprKind::Cast { source: self.mirror_expr(source) }; }; </del> let idx = adt_def.variant_index_with_ctor_id(variant_ctor_id); let (discr_did, discr_offset) = adt_def.discriminant_def_for_variant(idx);


adt_def, variant_index: adt_def.variant_index_with_ctor_id(def_id), substs, <del> user_ty: user_provided_type, </del> <ins> user_ty, </ins> fields: vec![], base: None, }, <ins> _ if ty.references_error() => { // Handle degenerate input without ICE (#67377). ExprKind::Literal { literal: ty::Const::zero_sized(cx.tcx, cx.tcx.types.err), user_ty: None, } } </ins> _ => bug!("unexpected ty: {:?}", ty), } }


.map(|lazy| lazy.decode((cdata, tcx))) .process_decoded(tcx, || panic!("{def_id:?} does not have trait_impl_trait_tys"))) } <del> implied_predicates_of => { cdata .root .tables .implied_predicates_of .get(cdata, def_id.index) .map(|lazy| lazy.decode((cdata, tcx))) .unwrap_or_else(|| { debug_assert_eq!(tcx.def_kind(def_id), DefKind::Trait); tcx.super_predicates_of(def_id) }) } </del> associated_types_for_impl_traits_in_associated_fn => { table_defaulted_array }


panic::panic_any(InjectedFailure) ); }); <del> assert_eq!(get(), vec![14, 19, 20, 17, 15, 11, 18, 16, 12, 13]); </del> <ins> assert_eq!(get(), vec![20, 17, 15, 11, 19, 18, 16, 12, 14, 13]); </ins> }


<ins> error[E0308]: mismatched types --> $DIR/issue-54505.rs:14:16 | LL |     take_range(0..1); |                ^^^^ |                | |                expected reference, found struct `std::ops::Range` |                help: consider borrowing here: `&(0..1)` | = note: expected type `&_` found type `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:19:16 | LL |     take_range(1..); |                ^^^ |                | |                expected reference, found struct `std::ops::RangeFrom` |                help: consider borrowing here: `&(1..)` | = note: expected type `&_` found type `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:24:16 | LL |     take_range(..); |                ^^ |                | |                expected reference, found struct `std::ops::RangeFull` |                help: consider borrowing here: `&(..)` | = note: expected type `&_` found type `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505.rs:29:16 | LL |     take_range(0..=1); |                ^^^^^ |                | |                expected reference, found struct `std::ops::RangeInclusive` |                help: consider borrowing here: `&(0..=1)` | = note: expected type `&_` found type `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:34:16 | LL |     take_range(..5); |                ^^^ |                | |                expected reference, found struct `std::ops::RangeTo` |                help: consider borrowing here: `&(..5)` | = note: expected type `&_` found type `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:39:16 | LL |     take_range(..=42); |                ^^^^^ |                | |                expected reference, found struct `std::ops::RangeToInclusive` |                help: consider borrowing here: `&(..=42)` | = note: expected type `&_` found type `std::ops::RangeToInclusive<{integer}>` error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0308`. </ins>


pub type ExternType; } <ins> pub trait T { fn test(&self) {} } pub trait G<N> { fn g(&self, n: N) {} } </ins> impl ExternType { <del> pub fn f(&self) { </del> <ins> pub fn f(&self) {} } </ins> <del> } </del> <ins> impl T for ExternType { fn test(&self) {} } impl G<usize> for ExternType { fn g(&self, n: usize) {} </ins> } // @has 'extern_type/foreigntype.ExternType.html' // @has 'extern_type/fn.links_to_extern_type.html'  // 'href="foreigntype.ExternType.html#method.f"' <ins> // @has 'extern_type/fn.links_to_extern_type.html'  // 'href="foreigntype.ExternType.html#method.test"' // @has 'extern_type/fn.links_to_extern_type.html'  // 'href="foreigntype.ExternType.html#method.g"' </ins> /// See also [ExternType::f] <ins> /// See also [ExternType::test] /// See also [ExternType::g] </ins> pub fn links_to_extern_type() {}


} #[test] <ins> fn test_str_from_utf8_lossy() { let xs = bytes!("hello"); assert_eq!(from_utf8_lossy(xs), ~"hello"); let xs = bytes!("ศไทย中华Việt Nam"); assert_eq!(from_utf8_lossy(xs), ~"ศไทย中华Việt Nam"); let xs = bytes!("Hello", 0xC2, " There", 0xFF, " Goodbye"); assert_eq!(from_utf8_lossy(xs), ~"HellouFFFD ThereuFFFD Goodbye"); let xs = bytes!("Hello", 0xC0, 0x80, " There", 0xE6, 0x83, " Goodbye"); assert_eq!(from_utf8_lossy(xs), ~"HellouFFFDuFFFD ThereuFFFD Goodbye"); let xs = bytes!(0xF5, "foo", 0xF5, 0x80, "bar"); assert_eq!(from_utf8_lossy(xs), ~"uFFFDfoouFFFDuFFFDbar"); let xs = bytes!(0xF1, "foo", 0xF1, 0x80, "bar", 0xF1, 0x80, 0x80, "baz"); assert_eq!(from_utf8_lossy(xs), ~"uFFFDfoouFFFDbaruFFFDbaz"); let xs = bytes!(0xF4, "foo", 0xF4, 0x80, "bar", 0xF4, 0xBF, "baz"); assert_eq!(from_utf8_lossy(xs), ~"uFFFDfoouFFFDbaruFFFDuFFFDbaz"); let xs = bytes!(0xF0, 0x80, 0x80, 0x80, "foo", 0xF0, 0x90, 0x80, 0x80, "bar"); assert_eq!(from_utf8_lossy(xs), ~"uFFFDuFFFDuFFFDuFFFDfooU00010000bar"); // surrogates let xs = bytes!(0xED, 0xA0, 0x80, "foo", 0xED, 0xBF, 0xBF, "bar"); assert_eq!(from_utf8_lossy(xs), ~"uFFFDuFFFDuFFFDfoouFFFDuFFFDuFFFDbar"); } #[test] </ins> fn test_to_send_str() { assert_eq!("abcde".to_send_str(), SendStrStatic("abcde")); assert_eq!("abcde".to_send_str(), SendStrOwned(~"abcde"));


<ins> error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closure --> $DIR/option-content-move2.rs:9:9 | LL |     let mut var = None; |         ------- captured outer variable ... LL |         move || { |         ^^^^^^^ move out of `var` occurs here LL | LL |             var = Some(NotCopyable); |             --- |             | |             move occurs because `var` has type `std::option::Option<NotCopyable>`, which does not implement the `Copy` trait |             move occurs due to use in closure error: aborting due to previous error For more information about this error, try `rustc --explain E0507`. </ins>


<del> Subproject commit 130721d6f4e6cba3b910ccdf5e0aa62b9dffc95f </del> <ins> Subproject commit 027e428197f3702599cfbb632883768175f49173 </ins>


<ins> error: unknown start of token: u{2a75} --> $DIR/unicode-double-equals-recovery.rs:1:16 | LL | const A: usize ⩵ 2; |                ^ | help: Unicode character '⩵' (Two Consecutive Equals Signs) looks like '==' (Double Equals Sign), but it is not | LL | const A: usize == 2; |                ~~ error: unexpected `==` --> $DIR/unicode-double-equals-recovery.rs:1:16 | LL | const A: usize ⩵ 2; |                ^ | help: try using `=` instead | LL | const A: usize = 2; |                ~ error: aborting due to 2 previous errors </ins>


<ins> // check-pass // compile-flags:--test // This test ensures that no code block is detected in the doc comments. pub mod Wormhole { /** # Returns * */ pub fn foofoo() {} /** * # Returns * */ pub fn barbar() {} } </ins>


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


self.hir.span_bug(span, &format!("extent {:?} does not enclose", extent)) }); <ins> let tmp = self.get_unit_temp(); </ins> for (idx, ref scope) in self.scopes.iter().enumerate().rev().take(scope_count) { <del> unpack!(block = build_scope_drops(block, scope, &self.scopes[..idx], &mut self.cfg)); </del> <ins> unpack!(block = build_scope_drops(&mut self.cfg, scope, &self.scopes[..idx], block)); if let Some(ref free_data) = scope.free { let next = self.cfg.start_new_block(); let free = build_free(self.hir.tcx(), tmp.clone(), free_data, next); self.cfg.terminate(block, free); block = next; } </ins> } self.cfg.terminate(block, Terminator::Goto { target: target }); }


use crate::io; use crate::mem; <del> use crate::sync; </del> <ins> use crate::ptr; </ins> use crate::sys::c; <del> /// The kinds of HashMap RNG that may be available #[derive(Clone, Copy, Debug, PartialEq)] enum HashMapRng { Preferred, Fallback, } </del> pub fn hashmap_random_keys() -> (u64, u64) { <del> match get_hashmap_rng() { HashMapRng::Preferred => { preferred_rng().expect("couldn't generate random bytes with preferred RNG") } HashMapRng::Fallback => { fallback_rng().expect("couldn't generate random bytes with fallback RNG") } } } /// Returns the HashMap RNG that should be used /// /// Panics if they are both broken fn get_hashmap_rng() -> HashMapRng { // Assume that if the preferred RNG is broken the first time we use it, it likely means // that: the DLL has failed to load, there is no point to calling it over-and-over again, // and we should cache the result static VALUE: sync::OnceLock<HashMapRng> = sync::OnceLock::new(); *VALUE.get_or_init(choose_hashmap_rng) } /// Test whether we should use the preferred or fallback RNG /// /// If the preferred RNG is successful, we choose it. Otherwise, if the fallback RNG is successful, /// we choose that /// /// Panics if both the preferred and the fallback RNG are both non-functional fn choose_hashmap_rng() -> HashMapRng { let preferred_error = match preferred_rng() { Ok(_) => return HashMapRng::Preferred, Err(e) => e, }; match fallback_rng() { Ok(_) => return HashMapRng::Fallback, Err(fallback_error) => panic!( "preferred RNG broken: `{}`, fallback RNG broken: `{}`", preferred_error, fallback_error ), } } /// Generate random numbers using the preferred RNG function (BCryptGenRandom) fn preferred_rng() -> Result<(u64, u64), io::Error> { use crate::ptr; </del> let mut v = (0, 0); let ret = unsafe { c::BCryptGenRandom(


<ins> #![allow(unreachable_code)] use std::marker::PhantomData; use std::ops::Deref; use std::sync::Arc; pub struct Guard<T> { _phantom: PhantomData<T>, } impl<T> Deref for Guard<T> { type Target = T; fn deref(&self) -> &T { unimplemented!() } } pub struct DirectDeref<T>(T); impl<T> Deref for DirectDeref<Arc<T>> { type Target = T; fn deref(&self) -> &T { unimplemented!() } } pub trait Access<T> { type Guard: Deref<Target = T>; fn load(&self) -> Self::Guard { unimplemented!() } } impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P { //~^ NOTE: required for `Arc<ArcSwapAny<Arc<usize>>>` to implement `Access<_>` type Guard = A::Guard; } impl<T> Access<T> for ArcSwapAny<T> { //~^ NOTE: multiple `impl`s satisfying `ArcSwapAny<Arc<usize>>: Access<_>` found type Guard = Guard<T>; } impl<T> Access<T> for ArcSwapAny<Arc<T>> { type Guard = DirectDeref<Arc<T>>; } pub struct ArcSwapAny<T> { _phantom_arc: PhantomData<T>, } pub fn foo() { let s: Arc<ArcSwapAny<Arc<usize>>> = unimplemented!(); let guard: Guard<Arc<usize>> = s.load(); //~^ ERROR: type annotations needed //~| HELP: try using a fully qualified path to specify the expected types } fn main() {} </ins>


let mut slice = None; let mut prev_rest_span = None; <ins> // Lowers `$bm $ident @ ..` to `$bm $ident @ _`. let lower_rest_sub = |this: &mut Self, pat, bm, ident, sub| { let lower_sub = |this: &mut Self| Some(this.pat_wild_with_node_id_of(sub)); let node = this.lower_pat_ident(pat, bm, ident, lower_sub); this.pat_with_node_id_of(pat, node) }; </ins> let mut iter = pats.iter(); // Lower all the patterns until the first occurrence of a sub-slice pattern. for pat in iter.by_ref() {


fn get_rendered_const(&self, id: DefIndex) -> String { match self.kind(id) { <del> EntryKind::Const(_, data) | EntryKind::AssocConst(_, _, data) => data.decode(self).0, </del> <ins> EntryKind::AnonConst(_, data) | EntryKind::Const(_, data) | EntryKind::AssocConst(_, _, data) => data.decode(self).0, </ins> _ => bug!(), } }


"checksum rls-vfs 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd34691a510938bb67fe0444fb363103c73ffb31c121d1e16bc92d8945ea8ff" "checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" <del> "checksum rustfmt-nightly 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6693f90ac7d0a2291aa309f5214f5f3ac1bd79961c11116fcf6d5545749bf2e7" </del> <ins> "checksum rustfmt-nightly 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa1ffc66e1e1786355f22e8a958a57bd67fbf9564f522f87f31de9586715f8f6" </ins> "checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" "checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d" "checksum scopeguard 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "59a076157c1e2dc561d8de585151ee6965d910dd4dcb5dabb7ae3e83981a6c57"


let b = b.subst(cx.tcx, b_substs); debug!("Comparing {:?} and {:?}", a, b); <ins> // We can immediately rule out these types as structurally same if // their layouts differ. match compare_layouts(a, b) { Ok(false) => return false, _ => (), // otherwise, continue onto the full, fields comparison } </ins> // Grab a flattened representation of all fields. let a_fields = a_def.variants.iter().flat_map(|v| v.fields.iter()); let b_fields = b_def.variants.iter().flat_map(|v| v.fields.iter()); <del> compare_layouts(a, b) && a_fields.eq_by( </del> <ins> // Perform a structural comparison for each field. a_fields.eq_by( </ins> b_fields, |&ty::FieldDef { did: a_did, .. }, &ty::FieldDef { did: b_did, .. }| {


<ins> #![feature(const_fn_trait_bound)] // Regression test related to issue 88434 const _CONST: &() = &f(&|_| {}); const fn f<F>(_: &F) where F: FnMut(&u8), { panic!() //~ ERROR evaluation of constant value failed } fn main() { } </ins>


<ins> fn main() { format!("x7Ba}"); //~^ ERROR cannot find value `a` in this scope format!("x7Bax7D"); //~^ ERROR cannot find value `a` in this scope let a = 0; format!("x7Ba} {b}"); //~^ ERROR cannot find value `b` in this scope format!("x7Bax7D {b}"); //~^ ERROR cannot find value `b` in this scope format!("x7Ba} x7Bb}"); //~^ ERROR cannot find value `b` in this scope format!("x7Bax7D x7Bb}"); //~^ ERROR cannot find value `b` in this scope format!("x7Bax7D x7Bbx7D"); //~^ ERROR cannot find value `b` in this scope } </ins>


if !consts.is_empty() { write!(w, "
Associated Constants

 Associated Constants

 ")?; for t in &consts {


/// /// * `to_drop` must be [valid] for reads. /// <del> /// * `to_drop` must be properly aligned. See the example below for how to drop ///   an unaligned pointer. </del> <ins> /// * `to_drop` must be properly aligned. </ins> /// /// Additionally, if `T` is not [`Copy`], using the pointed-to value after /// calling `drop_in_place` can cause undefined behavior. Note that `*to_drop =


resolver: &mut Resolver<'_>, krate: &ast::Crate, externs: Externs, <ins> document_private_items: bool, </ins> ) -> ResolverCaches { let mut loader = IntraLinkCrateLoader { resolver,