<ins> // error-pattern: this file contains an unclosed delimiter // error-pattern: this file contains an unclosed delimiter // error-pattern: expected pattern, found `=` // error-pattern: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` // error-pattern: expected item, found `]` fn main() {} fn p([=(} </ins>


#[derive(Copy, Clone, Debug)] pub struct Discr<'tcx> { <ins> /// bit representation of the discriminant, so `-128i8` is `0xFF_u128` </ins> pub val: u128, pub ty: Ty<'tcx> } impl<'tcx> fmt::Display for Discr<'tcx> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { <del> if self.ty.is_signed() { write!(fmt, "{}", self.val as i128) } else { write!(fmt, "{}", self.val) </del> <ins> match self.ty.sty { ty::TyInt(ity) => { let bits = ty::tls::with(|tcx| { Integer::from_attr(tcx, SignedInt(ity)).size().bits() }); let x = self.val as i128; // sign extend the raw representation to be an i128 let x = (x << (128 - bits)) >> (128 - bits); write!(fmt, "{}", x) }, _ => write!(fmt, "{}", self.val), </ins> } } }


} enum XYZ { <del> X, //~ ERROR variant is never used Y { //~ ERROR variant is never used </del> <ins> X, //~ ERROR variant is never constructed Y { //~ ERROR variant is never constructed </ins> a: String, b: i32, c: i32,


<ins> #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(u32::MAX)] //~ ERROR pub struct A(u32); #[rustc_layout_scalar_valid_range_end(1, 2)] //~ ERROR pub struct B(u8); #[rustc_layout_scalar_valid_range_end(a = "a")] //~ ERROR pub struct C(i32); #[rustc_layout_scalar_valid_range_end(1)] //~ ERROR enum E { X = 1, Y = 14, } fn main() { let _ = A(0); let _ = B(0); let _ = C(0); let _ = E::X; } </ins>


<ins> error[E0277]: the trait bound `[T; _]: From<()>` is not satisfied --> $DIR/hash-tyvid-regression-1.rs:9:5 | LL |     <[T; N.get()]>::try_from(()) |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<()>` is not implemented for `[T; _]` | = note: required because of the requirements on the impl of `Into<[T; _]>` for `()` = note: required because of the requirements on the impl of `TryFrom<()>` for `[T; _]` note: required by `try_from` --> $SRC_DIR/core/src/convert/mod.rs:LL:COL | LL |     fn try_from(value: T) -> Result<Self, Self::Error>; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/hash-tyvid-regression-1.rs:9:5 | LL |     <[T; N.get()]>::try_from(()) |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Result` | = note: expected unit type `()` found enum `Result<[T; _], Infallible>` help: consider using a semicolon here | LL |     <[T; N.get()]>::try_from(()); |                                 + help: try adding a return type | LL | -> Result<[T; _], Infallible> where | +++++++++++++++++++++++++++++ error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. </ins>


But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`. <del> ### Changing displayed theme You can change the displayed theme by opening the settings menu (the gear icon in the upper right) and then pick a new one from there. </del> ### Shortcuts Pressing `S` while focused elsewhere on the page will move focus to the


nested: Vec<Ty<'tcx>>) -> VtableBuiltinData<PredicateObligation<'tcx>> { <del> let derived_cause = self.derived_cause(obligation, BuiltinDerivedObligation); let obligations = nested.iter().map(|&bound_ty| { // the obligation might be higher-ranked, e.g. for<'a> &'a // int : Copy. In that case, we will wind up with // late-bound regions in the `nested` vector. So for each // one we instantiate to a skolemized region, do our work // to produce something like `&'0 int : Copy`, and then // re-bind it. This is a bit of busy-work but preserves // the invariant that we only manipulate free regions, not // bound ones. self.infcx.try(|snapshot| { let (skol_ty, skol_map) = self.infcx().skolemize_late_bound_regions(&ty::Binder(bound_ty), snapshot); let skol_predicate = util::predicate_for_builtin_bound( self.tcx(), derived_cause.clone(), bound, obligation.recursion_depth + 1, skol_ty); match skol_predicate { Ok(skol_predicate) => Ok(self.infcx().plug_leaks(skol_map, snapshot, &skol_predicate)), Err(ErrorReported) => Err(ErrorReported) } }) }).collect::<Result<_, _>>(); let obligations = match obligations { Ok(o) => o, Err(ErrorReported) => Vec::new(), </del> <ins> let trait_def = match self.tcx().lang_items.from_builtin_kind(bound) { Ok(def_id) => def_id, Err(_) => { self.tcx().sess.bug("builtin trait definition not found"); } </ins> }; <ins> let obligations = self.collect_predicates_for_types(obligation, trait_def, nested); </ins> let obligations = VecPerParamSpace::new(obligations, Vec::new(), Vec::new()); debug!("vtable_builtin_data: obligations={}",


target_option_val!(exe_suffix); target_option_val!(staticlib_prefix); target_option_val!(staticlib_suffix); <del> target_option_val!(os_family, "target_family"); </del> <ins> target_option_val!(os_family, "target-family"); </ins> target_option_val!(abi_return_struct_as_int); target_option_val!(is_like_osx); target_option_val!(is_like_solaris);


<ins> warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/cannot-infer-type-for-const-param.rs:1:12 | LL | #![feature(const_generics)] |            ^^^^^^^^^^^^^^ error[E0282]: type annotations needed --> $DIR/cannot-infer-type-for-const-param.rs:10:19 | LL |     let _ = Foo::<3>([1, 2, 3]); |                   ^ cannot infer type for `{integer}` error: aborting due to previous error For more information about this error, try `rustc --explain E0282`. </ins>


/// # Examples /// /// ``` <del> /// # #![feature(duration_as_u128)] </del> /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_micros(), 5730023); /// ``` <del> #[unstable(feature = "duration_as_u128", issue = "50202")] </del> <ins> #[stable(feature = "duration_as_u128", since = "1.33.0")] </ins> #[inline] pub const fn as_micros(&self) -> u128 { self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128


use m::*; <del> // The variant `Same` introduced by this import is not considered when resolving the prefix // `Same::` during import validation (issue #62767). use Same::Same; </del> <ins> // The variant `Same` introduced by this import is also considered when resolving the prefix // `Same::` during import validation to avoid effects similar to time travel (#74556). use Same::Same; //~ ERROR unresolved import `Same` // Case from #74556. mod foo { pub mod bar { pub mod bar { pub fn foobar() {} } } } use foo::*; use bar::bar; //~ ERROR unresolved import `bar::bar` //~| ERROR inconsistent resolution for an import use bar::foobar; </ins> fn main() {}


use std::collections::{HashMap, HashSet}; use std::env; use std::fs::{self, File}; <del> use std::io; </del> use std::io::ErrorKind; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio};


-include ../tools.mk <del> # This test makes sure that instrumented binaries record the right counts for # functions being called and branches being taken. We run an instrumented binary # with an argument that causes a know path through the program and then check # that the expected counts get added to the use-phase LLVM IR. # LLVM doesn't support instrumenting binaries that use SEH: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMMON_FLAGS=-Cpanic=abort endif </del> # For some very small programs GNU ld seems to not properly handle # instrumentation sections correctly. Neither Gold nor LLD have that problem. ifeq ($(UNAME),Linux)


#[cfg(host)] use std::{ <del> any::Any, marker::PhantomData, mem::ManuallyDrop, num::NonZero, ptr::NonNull, rc::Rc, sync::Arc, </del> <ins> any::Any, marker::PhantomData, mem::ManuallyDrop, num::NonZero, ptr::NonNull, rc::Rc, sync::Arc, </ins> }; /// To work cross-target this test must be no_core.


:target { background: #FDFFD3; } <del> pre.rust .kw { color: #cc782f; } pre.rust .kw-2 { color: #3bbb33; } pre.rust .prelude-ty { color: #3bbb33; } pre.rust .number { color: #c13928; } pre.rust .self { color: #c13928; } pre.rust .boolval { color: #c13928; } pre.rust .prelude-val { color: #c13928; } pre.rust .op { color: #cc782f; } pre.rust .comment { color: #533add; } pre.rust .doccomment { color: #d343d0; } pre.rust .macro { color: #d343d0; } pre.rust .macro-nonterminal { color: #d343d0; } pre.rust .string { color: #c13928; } pre.rust .lifetime { color: #d343d0; } pre.rust .attribute { color: #d343d0 !important; } </del> <ins> pre.rust, pre.line-numbers { background-color: #FDFDFD; } /* Code Highlighting */ pre.rust .kw { color: #8959A8; } pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } pre.rust .number { color: #718C00; } pre.rust .self { color: #C13928; } pre.rust .boolval { color: #C13928; } pre.rust .prelude-val { color: #C13928; } pre.rust .comment { color: #8E908C; } pre.rust .doccomment { color: #4D4D4C; } pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999f; } pre.rust .string { color: #718C00; } pre.rust .lifetime { color: #C13928; } pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } </ins>


///     Ok(()) /// } /// ``` <del> #[unstable(feature = "bufreader_buffer", issue = "45323")] </del> <ins> #[stable(feature = "bufreader_buffer", since = "1.37.0")] </ins> pub fn buffer(&self) -> &[u8] { &self.buf[self.pos..self.cap] }


- Several unsupported `./configure` options have been removed: `optimize`, `parallel-compiler`. These can still be enabled with `--set`, although it isn't recommended. - `remote-test-server`'s `verbose` argument has been removed in favor of the `--verbose` flag - `remote-test-server`'s `remote` argument has been removed in favor of the `--bind` flag. Use `--bind 0.0.0.0:12345` to replicate the behavior of the `remote` argument. <ins> - `x.py fmt` now formats only files modified between the merge-base of HEAD and the last commit in the master branch of the rust-lang repository and the current working directory. To restore old behaviour, use `x.py fmt .`. The check mode is not affected by this change. [#105702](https://github.com/rust-lang/rust/pull/105702) </ins> ### Non-breaking changes


<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. // aux-build:macro_with_super_1.rs #[macro_use] extern crate macro_with_super_1; declare!(); fn main() { bbb::ccc(); } </ins>


/// # Examples /// /// ```rust <del> /// #![feature(slice_from_raw_parts)] </del> /// use std::ptr; /// /// // create a slice pointer when starting out with a pointer to the first element <del> /// let mut x = [5, 6, 7]; /// let ptr = &mut x[0] as *mut _; /// let slice = ptr::slice_from_raw_parts_mut(ptr, 3); </del> <ins> /// let x = [5, 6, 7]; /// let ptr = x.as_ptr(); /// let slice = ptr::slice_from_raw_parts(ptr, 3); </ins> /// assert_eq!(unsafe { &*slice }[2], 7); /// ``` #[inline] <del> #[unstable(feature = "slice_from_raw_parts", reason = "recently added", issue = "36925")] </del> <ins> #[stable(feature = "slice_from_raw_parts", since = "1.42.0")] </ins> #[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")] pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] { unsafe { Repr { raw: FatPtr { data, len } }.rust }


<ins> error[E0433]: failed to resolve: use of undeclared type `Baz` --> $DIR/issue-81508.rs:11:20 | LL |     let Baz: &str = ""; |         --- help: `Baz` is defined here, but is not a type LL | LL |     println!("{}", Baz::Bar); |                    ^^^ use of undeclared type `Baz` error[E0433]: failed to resolve: use of undeclared type `Foo` --> $DIR/issue-81508.rs:20:24 | LL |     use super::Foo; |         ---------- help: `Foo` is defined here, but is not a type LL |     fn function() { LL |         println!("{}", Foo::Bar); |                        ^^^ use of undeclared type `Foo` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0433`. </ins>


<ins> error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/move-generic-to-trait-in-method-with-params.rs:14:7 | LL |     1.bar::<i32>(0); |       ^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/move-generic-to-trait-in-method-with-params.rs:4:8 | LL |     fn bar(&self, _: T); |        ^^^ help: consider moving this generic argument to the `Foo` trait, which takes up to 1 argument | LL |     Foo::<i32>::bar(1, 0); |     ~~~~~~~~~~~~~~~~~~~~~ help: remove these generics | LL -     1.bar::<i32>(0); LL +     1.bar(0); | error: aborting due to previous error For more information about this error, try `rustc --explain E0107`. </ins>


// Remember return type so that regionck can access it later. let fn_sig_tys: Vec<ty::t> = <del> arg_tys.iter() .chain([ret_ty].iter()) .map(|&ty| ty) .collect(); </del> <ins> arg_tys.iter().chain([ret_ty].iter()).map(|&ty| ty).collect(); </ins> debug!("fn-sig-map: fn_id={} fn_sig_tys={}", fn_id, fn_sig_tys.repr(tcx)); <del> inherited.fn_sig_map .borrow_mut() .insert(fn_id, fn_sig_tys); </del> <ins> inherited.fn_sig_map.borrow_mut().insert(fn_id, fn_sig_tys); </ins> { let mut visit = GatherLocalsVisitor { fcx: &fcx, };


"arm", "avr", "bpf", <ins> "csky", </ins> "hexagon", "loongarch", "m68k",


// Additionally, the top bit of GLOBAL_PANIC_COUNT (GLOBAL_ALWAYS_ABORT_FLAG) // records whether panic::always_abort() has been called.  This can only be // set, never cleared. <ins> // panic::always_abort() is usually called to prevent memory allocations done by // the panic handling in the child created by `libc::fork`. // Memory allocations performed in  a child created with `libc::fork` are undefined // behavior in most operating systems. // Accessing LOCAL_PANIC_COUNT in a child created by `libc::fork` would lead to a memory // allocation. Only GLOBAL_PANIC_COUNT can be accessed in this situation. This is // sufficient because a child process will always have exactly one thread only. // See also #85261 for details. </ins> // // This could be viewed as a struct containing a single bit and an n-1-bit // value, but if we wrote it like that it would be more than a single word,


use char::CharExt; try!(write!(f, "'")); for c in self.escape_default() { <del> try!(write!(f, "{}", c)); </del> <ins> try!(f.write_char(c)) </ins> } write!(f, "'") }


//! conflicts between multiple such attributes attached to the same //! item. <del> use rustc_ast::tokenstream::DelimSpan; use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MacArgs, MetaItemKind, NestedMetaItem}; </del> <ins> use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem}; </ins> use rustc_data_structures::fx::FxHashMap; use rustc_errors::{pluralize, struct_span_err, Applicability, MultiSpan}; use rustc_expand::base::resolve_path;


5_000_000.times do count += 1 end <ins> count </ins> end end <del> threads.each { |t| t.join } </del> <ins> threads.each do |t| puts "Thread finished with count=#{t.value}" end </ins> puts "done!" ```


<del> Subproject commit 69268fb75fdb452296caa9bc4aaeff1674279de2 </del> <ins> Subproject commit e479ab26406ed8a473987e5f4a1f3be3e978e5d2 </ins>


<ins> //@ force-host //@ no-prefer-dynamic #![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; use proc_macro::{quote, TokenStream}; #[proc_macro_derive(AnotherMacro, attributes(pointee))] pub fn derive(_input: TokenStream) -> TokenStream { quote! { const _: () = { const ANOTHER_MACRO_DERIVED: () = (); }; } .into() } #[proc_macro_attribute] pub fn pointee( _attr: proc_macro::TokenStream, _item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { quote! { const _: () = { const POINTEE_MACRO_ATTR_DERIVED: () = (); }; } .into() } #[proc_macro_attribute] pub fn default( _attr: proc_macro::TokenStream, _item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { quote! { const _: () = { const DEFAULT_MACRO_ATTR_DERIVED: () = (); }; } .into() } </ins>


} Operand::Constant(ref constant) => { <del> if let Some(static_) = constant.check_static_ptr(cx.tcx) { Self::in_static(cx, static_) </del> <ins> if constant.check_static_ptr(cx.tcx).is_some() { // `mir_const_qualif` does return the qualifs in the final value of a `static`, // so we could use value-based qualification here, but we shouldn't do this // without a good reason. // // Note: this uses `constant.literal.ty` which is a reference or pointer to the // type of the actual `static` item. Self::in_any_value_of_ty(cx, constant.literal.ty) </ins> } else if let ty::ConstKind::Unevaluated(def_id, _) = constant.literal.val { // Don't peek inside trait associated constants. if cx.tcx.trait_of_item(def_id).is_some() {


<ins> fn thing() { let f = |_, _| (); f(f); //~ ERROR: closure/coroutine type that references itself //~^ ERROR: this function takes 2 arguments but 1 argument was supplied } fn main() {} </ins>


//! goes along from the output of the previous stage. use std::borrow::Cow; <ins> use std::collections::HashSet; </ins> use std::env; use std::fs; use std::io::prelude::*;


#![feature(const_heap)] #![feature(const_index_range_slice_index)] #![feature(const_likely)] <del> #![feature(const_make_ascii)] </del> #![feature(const_nonnull_new)] #![feature(const_num_midpoint)] #![feature(const_option_ext)]


<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(associated_consts)] impl A for i32 { type Foo = u32; } impl B for u32 { const BAR: i32 = 0; } trait A { type Foo: B; } trait B { const BAR: i32; } fn generic<T: A>() { // This panics if the universal function call syntax is used as well println!("{}", T::Foo::BAR); } fn main() {} </ins>


/// # Examples /// /// ```no_run <del> /// #![feature(udp_peer_addr)] </del> /// use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket}; /// /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");


] [[package]] <del> name = "rustc-serialize" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" [[package]] </del> name = "rustc-std-workspace-alloc" version = "1.99.0" dependencies = [


<del> // compile-flags: -Zmir-opt-level=4 </del> <ins> // build-pass // compile-flags: -Zmir-opt-level=3 --crate-type=lib </ins> <del> pub fn bar<T>(s: &'static mut ()) </del> <ins> #![feature(trivial_bounds)] #![allow(trivial_bounds)] trait Foo { fn test(self); } fn baz<T>() </ins> where <del> &'static mut (): Clone, //~ ERROR the trait bound </del> <ins> &'static str: Foo, </ins> { <del> <&'static mut () as Clone>::clone(&s); </del> <ins> "Foo".test() </ins> } <del> fn main() {} </del>


//! Runs rustfmt on the repository. use crate::builder::Builder; <del> use crate::util::{output, t}; </del> <ins> use crate::util::{output, program_out_of_date, t}; </ins> use ignore::WalkBuilder; use std::collections::VecDeque; use std::path::{Path, PathBuf};


Res::Def(DefKind::Ctor(_, CtorKind::Const), def_id) => { let user_provided_types = cx.tables.user_provided_types(); <del> let user_provided_type = user_provided_types.get(expr.hir_id).copied(); debug!("convert_path_expr: user_provided_type={:?}", user_provided_type); </del> <ins> let user_ty = user_provided_types.get(expr.hir_id).copied(); </ins> let ty = cx.tables().node_type(expr.hir_id); match ty.kind { // A unit struct/variant which is used as a value.


} } <del> let group = p.read_separator(':', i, |p| p.read_number(16, Some(4))); </del> <ins> let group = p.read_separator(':', i, |p| p.read_number(16, Some(4), true)); </ins> match group { Some(g) => *slot = g,


<ins> // check-fail // Ensure we don't error when emitting trait bound not satisfied when self type // has late bound var fn main() { test(&|| 0); //~ ERROR the trait bound } trait Trait {} fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {} </ins>


<ins> enum E { One(i32, i32), } fn main() { let var = E::One; if let E::One(var1, var2) = var { //~^ ERROR mismatched types //~| HELP use parentheses to construct this tuple variant println!("{var1} {var2}"); } let Some(x) = Some; //~^ ERROR mismatched types //~| HELP use parentheses to construct this tuple variant } </ins>


expanded_cache: FxHashMap::default(), primary_def_id: None, found_recursion: false, <ins> found_any_recursion: false, </ins> check_recursion: false, tcx, };


<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct Zst; fn main() { unsafe { ::std::ptr::write_volatile(1 as *mut Zst, Zst) } } </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. #![feature(struct_variant)] mod a { pub enum Enum { EnumStructVariant { x: u8, y: u8, z: u8 } } pub fn get_enum_struct_variant() -> () { EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types: expected `()`, found `a::Enum` (expected (), found enum a::Enum) } } mod b { mod test { use a; fn test_enum_struct_variant() { let enum_struct_variant = ::a::get_enum_struct_variant(); match enum_struct_variant { a::EnumStructVariant { x, y, z } => { //~^ ERROR error: mismatched types: expected `()`, found a structure pattern } } } } } fn main() {} </ins>


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


<ins> error[E0517]: attribute should be applied to a struct or union --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:6:8 | LL |   #[repr(packed)] |          ^^^^^^ ... LL | / enum E { LL | |     A, LL | |     B, LL | |     C, LL | | } | |_- not a struct or union error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:18:9 | LL |         e: E, |         ^^^^ | = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` help: wrap the field type in `ManuallyDrop<...>` | LL |         e: std::mem::ManuallyDrop<E>, |            +++++++++++++++++++++++ + error: aborting due to 2 previous errors Some errors have detailed explanations: E0517, E0740. For more information about an error, try `rustc --explain E0517`. </ins>


} fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) { <del> self.sess.buffer_lint_with_diagnostic( builtin::BARE_TRAIT_OBJECTS, id, span, "trait objects without an explicit `dyn` are deprecated", builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global), ) </del> <ins> // FIXME(davidtwco): This is a hack to detect macros which produce spans of the // call site which do not have a macro backtrace. See #61963. let is_macro_callsite = self.sess.source_map() .span_to_snippet(span) .map(|snippet| snippet.starts_with("#[")) .unwrap_or(true); if !is_macro_callsite { self.sess.buffer_lint_with_diagnostic( builtin::BARE_TRAIT_OBJECTS, id, span, "trait objects without an explicit `dyn` are deprecated", builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global), ) } </ins> } fn wrap_in_try_constructor(


} bb10: { <del> _4 = const ();                   // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 // ty::Const // + ty: () // + val: Value(Scalar(<ZST>)) // mir::Constant // + span: $DIR/issue-49232.rs:10:25: 10:30 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } </del> unreachable;                     // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 }


) -> io::Result<(Process, StdioPipes)> { let maybe_env = self.env.capture_if_changed(); <del> let mut si = zeroed_startupinfo(); si.cb = mem::size_of::<c::STARTUPINFO>() as c::DWORD; si.dwFlags = c::STARTF_USESTDHANDLES; </del> let child_paths = if let Some(env) = maybe_env.as_ref() { env.get(&EnvKey::new("PATH")).map(|s| s.as_os_str()) } else {


// from the CodeView line tables in the object files. self.cmd.arg("/DEBUG"); <ins> // Default to emitting only the file name of the PDB file into // the binary instead of the full path. Emitting the full path // may leak private information (such as user names). // See https://github.com/rust-lang/rust/issues/87825. // // This default behavior can be overridden by explicitly passing // `-Clink-arg=/PDBALTPATH:...` to rustc. self.cmd.arg("/PDBALTPATH:%_PDB%"); </ins> // This will cause the Microsoft linker to embed .natvis info into the PDB file let natvis_dir_path = self.sess.sysroot.join("librustlibetc"); if let Ok(natvis_dir) = fs::read_dir(&natvis_dir_path) {


//@ revisions: m68k //@[m68k] compile-flags: --target m68k-unknown-linux-gnu //@[m68k] needs-llvm-components: m68k <ins> //@ revisions: csky //@[csky] compile-flags: --target csky-unknown-linux-gnuabiv2 //@[csky] needs-llvm-components: csky </ins> // FIXME: disabled on nvptx64 since the target ABI fails the sanity check // see https://github.com/rust-lang/rust/issues/117480 /* revisions: nvptx64 [nvptx64] compile-flags: --target nvptx64-nvidia-cuda [nvptx64] needs-llvm-components: nvptx */ <del> // FIXME: disabled since it fails on CI saying the csky component is missing // see https://github.com/rust-lang/rust/issues/125697 /* revisions: csky [csky] compile-flags: --target csky-unknown-linux-gnuabiv2 [csky] needs-llvm-components: csky */ </del> #![feature(rustc_attrs, unsized_fn_params, transparent_unions)] #![cfg_attr(not(host), feature(no_core, lang_items), no_std, no_core)] #![allow(unused, improper_ctypes_definitions, internal_features)]


<ins> // This is a non-regression test for const-qualification of unstable items in libcore // as explained in issue #67053. // const-qualification could miss some `const fn`s if they were unstable and the feature // gate was not enabled in libcore. #![stable(feature = "core", since = "1.6.0")] #![feature(const_if_match)] #![feature(rustc_const_unstable)] #![feature(staged_api)] enum Opt<T> { Some(T), None, } impl<T> Opt<T> { #[rustc_const_unstable(feature = "foo")] #[stable(feature = "rust1", since = "1.0.0")] const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { //~^ ERROR destructors cannot be evaluated at compile-time //~| ERROR destructors cannot be evaluated at compile-time match self { Opt::Some(t) => t, Opt::None => f(), //~ ERROR E0015 } } } fn main() {} </ins>


<ins> error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper<F>(f: F) LL | | LL | | LL | | LL | | where LL | |     F:, LL | |     for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:10 | LL | async fn wrapper<F>(f: F) |          ^^^^^^^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:13:1 | LL | / { LL | | LL | |     let mut i = 41; LL | |     &mut i; LL | | } | |_^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper<F>(f: F) LL | | LL | | LL | | LL | | where LL | |     F:, LL | |     for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. </ins>


<ins> // Regression test for <https://github.com/rust-lang/rust/issues/111415>. // This test ensures that only impl blocks are documented in bodies. #![crate_name = "foo"] // @has 'foo/index.html' // Checking there are only three sections. // @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3 // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs' // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Functions' // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Traits' // Checking that there are only three items. // @count - '//*[@id="main-content"]//*[@class="item-name"]' 3 // @has - '//*[@id="main-content"]//a[@href="struct.Bar.html"]' 'Bar' // @has - '//*[@id="main-content"]//a[@href="fn.foo.html"]' 'foo' // @has - '//*[@id="main-content"]//a[@href="trait.Foo.html"]' 'Foo' // Now checking that the `foo` method is visible in `Bar` page. // @has 'foo/struct.Bar.html' // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub fn foo()' // @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar()' pub struct Bar; pub trait Foo { fn bar() {} } pub fn foo() { pub mod inaccessible {} pub fn inner() {} pub const BAR: u32 = 0; impl Bar { pub fn foo() {} } impl Foo for Bar {} } </ins>


let cache = cache(); write!(w, "
Implementors

 Implementors

 ")?; if let Some(implementors) = cache.implementors.get(&it.def_id) {


<ins> // check-pass fn foo<T>(t: T) -> usize where for<'a> &'a T: IntoIterator, for<'a> <&'a T as IntoIterator>::IntoIter: ExactSizeIterator, { t.into_iter().len() } fn main() { foo::<Vec<u32>>(vec![]); } </ins>


<ins> //! Email me at <hello@example.com>. //! Email me at <hello-world@example.com>. //! Email me at <hello@localhost> (this warns but will still become a link). // @has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com' // @has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com' // @has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost' </ins>


<ins> //@ check-pass // issue: rust-lang/rust#123824 // This test is a sanity check and does not enforce any stable API, so may be // removed at a future point. fn main() { let x = f32::from(3.14); let y = f64::from(3.14); } </ins>


<ins> error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time --> $DIR/issue-61525.rs:14:33 | LL |         1.query::<dyn ToString>("") |           -----                 ^^ doesn't have a size known at compile-time |           | |           required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `dyn ToString` note: required by a bound in `Example::query` --> $DIR/issue-61525.rs:2:14 | LL |     fn query<Q>(self, q: Q); |              ^ required by this bound in `Example::query` help: consider relaxing the implicit `Sized` restriction | LL |     fn query<Q: ?Sized>(self, q: Q); |               ++++++++ error[E0308]: mismatched types --> $DIR/issue-61525.rs:14:33 | LL |         1.query::<dyn ToString>("") |           --------------------- ^^ expected trait object `dyn ToString`, found `&str` |           | |           arguments to this function are incorrect | = note: expected trait object `dyn ToString` found reference `&'static str` note: associated function defined here --> $DIR/issue-61525.rs:2:8 | LL |     fn query<Q>(self, q: Q); |        ^^^^^ error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. </ins>


use serde::{Deserialize, Serialize}; /// rustdoc format-version. <del> pub const FORMAT_VERSION: u32 = 19; </del> <ins> pub const FORMAT_VERSION: u32 = 20; </ins> /// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information /// about the language items in the local crate, as well as info about external items to allow


opaque_type_key, self.fcx.infcx.tcx, true, <del> decl.origin, </del> ); self.typeck_results.concrete_opaque_types.insert(opaque_type_key.def_id, hidden_type);


<meta charset="utf-8" /> <title>{title}</title> <del> <link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400' </del> <ins> <link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400,700' </ins> rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="{root_path}{krate}/main.css">


<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Trait<'a> { type A; type B; } fn foo<'a, T: Trait<'a>>(value: T::A) { let new: T::B = unsafe { std::mem::transmute_copy(&value) }; } fn main() { } </ins>


Err(ManuallyDrop::into_inner(data.p)) }; <del> // Compatibility wrapper around the try intrinsic for bootstrap #[inline] </del> <ins> // Compatibility wrapper around the try intrinsic for bootstrap. // // We also need to mark it #[inline(never)] to work around a bug on MinGW // targets: the unwinding implementation was relying on UB, but this only // becomes a problem in practice if inlining is involved. #[cfg(not(bootstrap))] use intrinsics::r#try as do_try; #[cfg(bootstrap)] #[inline(never)] </ins> unsafe fn do_try(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32 { <del> #[cfg(not(bootstrap))] { intrinsics::r#try(try_fn, data, catch_fn) } #[cfg(bootstrap)] { use crate::mem::MaybeUninit; </del> <ins> use crate::mem::MaybeUninit; #[cfg(target_env = "msvc")] type TryPayload = [u64; 2]; #[cfg(not(target_env = "msvc"))] type TryPayload = *mut u8; let mut payload: MaybeUninit<TryPayload> = MaybeUninit::uninit(); let payload_ptr = payload.as_mut_ptr() as *mut u8; let r = intrinsics::r#try(try_fn, data, payload_ptr); if r != 0 { </ins> #[cfg(target_env = "msvc")] <del> type TryPayload = [u64; 2]; </del> <ins> { catch_fn(data, payload_ptr) } </ins> #[cfg(not(target_env = "msvc"))] <del> type TryPayload = *mut u8; let mut payload: MaybeUninit<TryPayload> = MaybeUninit::uninit(); let payload_ptr = payload.as_mut_ptr() as *mut u8; let r = intrinsics::r#try(try_fn, data, payload_ptr); if r != 0 { #[cfg(target_env = "msvc")] { catch_fn(data, payload_ptr) } #[cfg(not(target_env = "msvc"))] { catch_fn(data, payload.assume_init()) } </del> <ins> { catch_fn(data, payload.assume_init()) </ins> } <del> r </del> } <ins> r </ins> } // We consider unwinding to be rare, so mark this function as cold. However,


&exports, machine, !sess.target.is_like_msvc, <del> /*comdat=*/ false, </del> <ins> // Enable compatibility with MSVC's `/WHOLEARCHIVE` flag. // Without this flag a duplicate symbol error would be emitted // when linking a rust staticlib using `/WHOLEARCHIVE`. // See #129020 true, </ins> ) { sess.dcx() .emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() });


<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. // compile-flags: -C lto // no-prefer-dynamic // ignore-emscripten no threads support use std::thread; static mut HIT: usize = 0; thread_local!(static A: Foo = Foo); struct Foo; impl Drop for Foo { fn drop(&mut self) { unsafe { HIT += 1; } } } fn main() { unsafe { assert_eq!(HIT, 0); thread::spawn(|| { assert_eq!(HIT, 0); A.with(|_| ()); assert_eq!(HIT, 0); }).join().unwrap(); assert_eq!(HIT, 1); } } </ins>


drop(tx); thread.join().unwrap(); <ins> if !check { update_rustfmt_version(build); } </ins> }


self.index = index; } <del> pub fn look_ahead(&self, n: usize) -> Option<&TokenTree> { self.stream.0[self.index..].get(n).map(|(tree, _)| tree) </del> <ins> pub fn look_ahead(&self, n: usize) -> Option<TokenTree> { self.stream.0[self.index..].get(n).map(|(tree, _)| tree.clone()) </ins> } }


fn roundtrip(_1: *const u8) -> *const u8 { debug x => _1; let mut _0: *const u8; <del> let mut _2: *mut u8; let mut _3: *const u8; </del> <ins> let mut _2: *const u8; let mut _3: *mut u8; let mut _4: *const u8; </ins> bb0: { StorageLive(_2); StorageLive(_3); <del> _3 = _1; _2 = move _3 as *mut u8 (PtrToPtr); _0 = move _2 as *const u8 (PointerCoercion(MutToConstPointer)); </del> <ins> StorageLive(_4); _4 = _1; _3 = move _4 as *mut u8 (PtrToPtr); _2 = move _3 as *const u8 (PointerCoercion(MutToConstPointer)); StorageDead(_4); </ins> StorageDead(_3); <ins> -         _0 = move _2 as *const u8 (PtrToPtr); +         _0 = move _2; </ins> StorageDead(_2); return; }


<ins> // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" // build-pass #![no_std] extern crate alloc; /// ``` /// assert!(true) /// ``` pub fn f() {} </ins>


crate fn run( krate: clean::Crate, <del> renderopts: config::RenderOptions, </del> <ins> mut renderopts: config::RenderOptions, </ins> cache: formats::cache::Cache, tcx: TyCtxt<'_>, options: ScrapeExamplesOptions, ) -> interface::Result<()> { let inner = move || -> Result<(), String> { // Generates source files for examples <ins> renderopts.no_emit_shared = true; </ins> let (cx, _) = Context::init(krate, renderopts, cache, tcx).map_err(|e| e.to_string())?; // Collect CrateIds corresponding to provided target crates


impl<'tcx> FnCtxt<'_, 'tcx> { fn pattern_cause(&self, ti: TopInfo<'tcx>, cause_span: Span) -> ObligationCause<'tcx> { <del> let code = Pattern { span: ti.span, root_ty: ti.expected, origin_expr: ti.origin_expr }; </del> <ins> let code = Pattern { span: ti.span, root_ty: ti.expected, origin_expr: ti.origin_expr.is_some() }; </ins> self.cause(cause_span, code) }


#[allow(missing_docs)] pub mod color { /// Number for a terminal color <del> pub type Color = u16; </del> <ins> pub type Color = u32; </ins> pub const BLACK: Color = 0; pub const RED: Color = 1;


&& expected.iter().any(|tok| matches!(tok, TokenType::Token(TokenKind::Eq))) { // Likely typo: `=` → `==` in let expr or enum item <del> return Err(self.dcx().create_err(UseEqInstead { span: self.token.span, suggestion: self.token.span.with_lo(self.token.span.lo() + BytePos(1)), })); </del> <ins> return Err(self.dcx().create_err(UseEqInstead { span: self.token.span })); </ins> } if self.token.is_keyword(kw::Move) && self.prev_token.is_keyword(kw::Async) {


<ins> error: unnamed fields are not allowed outside of structs or unions --> $DIR/anon-struct-in-enum-issue-121446.rs:7:9 | LL |         _ : struct { field: u8 }, |         -^^^^^^^^^^^^^^^^^^^^^^^ |         | |         unnamed field declared here error: anonymous structs are not allowed outside of unnamed struct or union fields --> $DIR/anon-struct-in-enum-issue-121446.rs:7:13 | LL |         _ : struct { field: u8 }, |             ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here error: aborting due to 2 previous errors </ins>


<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. enum A { A { foo: usize, } } fn main() { let x = A::A { foo: 3 }; match x { A::A { fob } => { println!("{}", fob); } } } </ins>


<ins> error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:51 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                                   ^ not found in this scope error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:62 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                                              ^ not found in this scope error[E0425]: cannot find value `g` in this scope --> $DIR/issue-114423.rs:11:22 | LL |     let _ = RGB { r, g, b }; |                      ^ help: a local variable with a similar name exists: `b` error[E0308]: mismatched types --> $DIR/issue-114423.rs:7:50 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                ---------------   ^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements |                                | |                                expected due to this | = note: expected tuple `(f32, f32, f32)` found tuple `(f32, f32)` error[E0560]: struct `RGB` has no field named `r` --> $DIR/issue-114423.rs:11:19 | LL |     let _ = RGB { r, g, b }; |                   ^ `RGB` does not have this field | = note: all struct fields are already assigned error[E0308]: mismatched types --> $DIR/issue-114423.rs:11:25 | LL |     let _ = RGB { r, g, b }; |                         ^ expected `f64`, found `f32` | help: you can convert an `f32` to an `f64` | LL |     let _ = RGB { r, g, b: b.into() }; |                         ++  +++++++ error: aborting due to 6 previous errors Some errors have detailed explanations: E0308, E0425, E0560. For more information about an error, try `rustc --explain E0308`. </ins>


fn mir_const_qualif(&self, id: DefIndex) -> mir::ConstQualifs { match self.kind(id) { <del> EntryKind::Const(qualif, _) </del> <ins> EntryKind::AnonConst(qualif, _) | EntryKind::Const(qualif, _) </ins> | EntryKind::AssocConst( AssocContainer::ImplDefault | AssocContainer::ImplFinal


<ins> error: expected one of `,` or `>`, found `==` --> $DIR/issue-87493.rs:8:22 | LL |     T: MyTrait<Assoc == S::Assoc>, |                      ^^ expected one of `,` or `>` | help: if you meant to use an associated type binding, replace `==` with `=` | LL |     T: MyTrait<Assoc = S::Assoc>, |                      ~ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-87493.rs:8:8 | LL |     T: MyTrait<Assoc == S::Assoc>, |        ^^^^^^^------------------- help: remove these generics |        | |        expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/issue-87493.rs:1:11 | LL | pub trait MyTrait { |           ^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. </ins>


RUN /tmp/build-cloudabi-toolchain.sh x86_64-unknown-cloudabi COPY dist-various-2/build-fuchsia-toolchain.sh /tmp/ RUN /tmp/build-fuchsia-toolchain.sh <del> # FIXME(#61022) - reenable solaris # COPY dist-various-2/build-solaris-toolchain.sh /tmp/ # RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386 # RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc </del> <ins> COPY dist-various-2/build-solaris-toolchain.sh /tmp/ RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386 RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc </ins> COPY dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/ # We pass the commit id of the port of LLVM's libunwind to the build script. # Any update to the commit id here, should cause the container image to be re-built from this point on.


pub struct DropLogger<'a, T> { extra: T, id: usize, <del> log: &'a panic::AssertUnwindSafe<RefCell<Vec<usize>>> </del> <ins> log: &'a panic::AssertUnwindSafe<RefCell<Vec<usize>>>, </ins> } impl<'a, T> Drop for DropLogger<'a, T> {


} } <ins> pub fn rustc_lib_paths(&self, compiler: Compiler) -> Vec<PathBuf> { let mut dylib_dirs = vec![self.rustc_libdir(compiler)]; // Ensure that the downloaded LLVM libraries can be found. if self.config.llvm_from_ci { let ci_llvm_lib = self.out.join(&*compiler.host.triple).join("ci-llvm").join("lib"); dylib_dirs.push(ci_llvm_lib); } dylib_dirs } </ins> /// Adds the compiler's directory of dynamic libraries to `cmd`'s dynamic /// library lookup path. pub fn add_rustc_lib_path(&self, compiler: Compiler, cmd: &mut Command) {


<ins> error[E0408]: variable `v` is not bound in all patterns --> $DIR/tabs-trimming.rs:9:16 | LL | ...   v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT... |       -       ^   ^ pattern doesn't bind `v` |       |       | |       |       pattern doesn't bind `v` |       variable not in all patterns error: aborting due to previous error For more information about this error, try `rustc --explain E0408`. </ins>


StatementKind::PlaceMention(place) => { self.visit_place( place, <del> PlaceContext::NonUse(NonUseContext::PlaceMention), </del> <ins> PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention), </ins> location ); }


} }; <del> if self.suggest_constraining_numerical_ty( </del> <ins> if self.suggest_wrapping_range_with_parens( tcx, actual, source, span, item_name, &ty_str, ) || self.suggest_constraining_numerical_ty( </ins> tcx, actual, source, span, item_kind, item_name, &ty_str, ) { return None;


<ins> //@ aux-build:issue-76736-1.rs //@ aux-build:issue-76736-2.rs // https://github.com/rust-lang/rust/issues/124635 #![crate_name = "foo"] #![feature(rustc_private, staged_api)] #![unstable(feature = "rustc_private", issue = "none")] extern crate issue_76736_1; extern crate issue_76736_2; // @has foo/struct.Foo.html // @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub struct Foo; // @has foo/struct.Bar.html // @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub use issue_76736_2::Bar; </ins>


generics_of => { table } inferred_outlives_of => { table_defaulted_array } super_predicates_of => { table } <ins> implied_predicates_of => { table } </ins> type_of => { table } type_alias_is_lazy => { cdata.root.tables.type_alias_is_lazy.get(cdata, def_id.index) } variances_of => { table }


if sess.opts.incremental.is_none() { return; } <ins> // This is going to be deleted in finalize_session_directory, so let's not create it if sess.has_errors_or_delayed_span_bugs() { return; } </ins> debug!("save_work_product_index()"); dep_graph.assert_ignored();


Some(hir::CoroutineKind::Coroutine(_)) | Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Gen, _)) | None => { <del> return hir::ExprKind::Err(self.dcx().emit_err(AwaitOnlyInAsyncFnAndBlocks { await_kw_span, item_span: self.current_item, })); </del> <ins> // Lower to a block `{ EXPR; <error> }` so that the awaited expr // is not accidentally orphaned. let stmt_id = self.next_id(); let expr_err = self.expr( expr.span, hir::ExprKind::Err(self.dcx().emit_err(AwaitOnlyInAsyncFnAndBlocks { await_kw_span, item_span: self.current_item, })), ); return hir::ExprKind::Block( self.block_all( expr.span, arena_vec![self; hir::Stmt { hir_id: stmt_id, kind: hir::StmtKind::Semi(expr), span: expr.span, }], Some(self.arena.alloc(expr_err)), ), None, ); </ins> } };


extern crate lint_unused_extern_crate as other; // no error, the use * marks it as used <ins> #[macro_use] extern crate core; // no error, the `#[macro_use]` marks it as used </ins> #[allow(unused_imports)] use rand::isaac::IsaacRng;


}; if self.can_coerce(ref_ty, expected) { if let Ok(src) = cm.span_to_snippet(sp) { <del> let sugg_expr = match expr.node { // parenthesize if needed (Issue #46756) </del> <ins> let needs_parens = match expr.node { // parenthesize if needed (Issue #46756) </ins> hir::ExprKind::Cast(_, _) | <del> hir::ExprKind::Binary(_, _, _) => format!("({})", src), _ => src, </del> <ins> hir::ExprKind::Binary(_, _, _) => true, // parenthesize borrows of range literals (Issue #54505) _ if self.is_range_literal(expr) => true, _ => false, </ins> }; <ins> let sugg_expr = if needs_parens { format!("({})", src) } else { src }; </ins> if let Some(sugg) = self.can_use_as_ref(expr) { return Some(sugg); }


SRC: . AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN) <ins> condition: and(succeeded(), not(variables.SKIP_JOB)) </ins> displayName: Run build # If we're a deploy builder, use the `aws` command to publish everything to our


$(TMPDIR)/$(call BIN,directly_linked): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked.rs -l static:+whole-archive=c_static_lib_with_constructor <ins> # Native lib linked into test executable, +whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_plus_whole_archive.rs --test -l static:+whole-archive=c_static_lib_with_constructor # Native lib linked into test executable, -whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_minus_whole_archive.rs --test -l static:-whole-archive=c_static_lib_with_constructor </ins> # Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable $(TMPDIR)/$(call BIN,indirectly_linked): $(TMPDIR)/librlib_with_cmdline_native_lib.rlib $(RUSTC) indirectly_linked.rs


// the post-inference `trait_ref`, as it's more accurate. trait_: Some(trait_ref.clean(cx)), for_: ty.clean(cx), <del> items: cx .tcx .associated_items(impl_def_id) .in_definition_order() .map(|x| x.clean(cx)) .collect::<Vec<_>>(), </del> <ins> items, </ins> polarity: ty::ImplPolarity::Positive, kind: ImplKind::Blanket(box trait_ref.self_ty().clean(cx)), }),


let rcvr_substs = self.fresh_receiver_substs(self_ty, &pick); let all_substs = self.instantiate_method_substs(&pick, segment, rcvr_substs); <del> debug!("all_substs={:?}", all_substs); </del> <ins> debug!("rcvr_substs={rcvr_substs:?}, all_substs={all_substs:?}"); </ins> // Create the final signature for the method, replacing late-bound regions. let (method_sig, method_predicates) = self.instantiate_method_sig(&pick, all_substs); <ins> // If there is a `Self: Sized` bound and `Self` is a trait object, it is possible that // something which derefs to `Self` actually implements the trait and the caller // wanted to make a static dispatch on it but forgot to import the trait. // See test `src/test/ui/issue-35976.rs`. // // In that case, we'll error anyway, but we'll also re-run the search with all traits // in scope, and if we find another method which can be used, we'll output an // appropriate hint suggesting to import the trait. let filler_substs = rcvr_substs .extend_to(self.tcx, pick.item.def_id, |def, _| self.tcx.mk_param_from_def(def)); let illegal_sized_bound = self.predicates_require_illegal_sized_bound( &self.tcx.predicates_of(pick.item.def_id).instantiate(self.tcx, filler_substs), ); </ins> // Unify the (adjusted) self type with what the method expects. // // SUBTLE: if we want good error messages, because of "guessing" while matching


<ins> // aux-build: issue_24843.rs // check-pass extern crate issue_24843; static _TEST_STR_2: &'static str = &issue_24843::TEST_STR; fn main() {} </ins>


<del> #![feature(duration_as_u128)] </del> <ins> #![cfg_attr(stage0, feature(duration_as_u128))] </ins> use std::{collections::VecDeque, time::Instant}; const VECDEQUE_LEN: i32 = 100000;


import.crate_lint(), ); let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len; <del> if let Some(orig_unusable_binding) = orig_unusable_binding { self.r.unusable_binding = orig_unusable_binding; } </del> import.vis.set(orig_vis); if let PathResult::Failed { .. } | PathResult::NonModule(..) = path_res { // Consider erroneous imports used to avoid duplicate diagnostics.


&Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public }, hir::CRATE_HIR_ID, &krate.item.module, <del> None, </del> <ins> Some(self.cx.tcx.crate_name), </ins> ); top_level_module.is_crate = true; // Attach the crate's exported macros to the top-level module.


#![feature(maybe_uninit_extra)] #![feature(maybe_uninit_ref)] #![feature(maybe_uninit_slice)] <ins> #![feature(maybe_uninit_uninit_array)] </ins> #![feature(min_specialization)] #![feature(needs_panic_runtime)] #![feature(negative_impls)]


} else if self.label_right - self.span_left <= self.column_width { // Attempt to fit the code window considering only the spans and labels. let padding_left = (self.column_width - (self.label_right - self.span_left)) / 2; <del> self.computed_left = self.span_left - padding_left; </del> <ins> self.computed_left = self.span_left.saturating_sub(padding_left); </ins> self.computed_right = self.computed_left + self.column_width; } else if self.span_right - self.span_left <= self.column_width { // Attempt to fit the code window considering the spans and labels plus padding. let padding_left = (self.column_width - (self.span_right - self.span_left)) / 5 * 2; <del> self.computed_left = self.span_left - padding_left; </del> <ins> self.computed_left = self.span_left.saturating_sub(padding_left); </ins> self.computed_right = self.computed_left + self.column_width; } else { // Mostly give up but still don't show the full line. self.computed_left = self.span_left;


// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR. <del> // Compiling with `-Cpanic=abort` because PGO+unwinding isn't supported on all platforms. </del> // needs-profiler-support <del> // compile-flags: -Cprofile-generate -Ccodegen-units=1 -Cpanic=abort </del> <ins> // compile-flags: -Cprofile-generate -Ccodegen-units=1 </ins> // CHECK: @__llvm_profile_raw_version = // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global


<ins> // run-rustfix // check-only #[derive(Debug)] struct Demo { a: String } trait GetString { fn get_a(&self) -> &String; } trait UseString: std::fmt::Debug + GetString { fn use_string(&self) { println!("{:?}", self.get_a()); //~ ERROR no method named `get_a` found for type `&Self` } } trait UseString2: GetString { fn use_string(&self) { println!("{:?}", self.get_a()); //~ ERROR no method named `get_a` found for type `&Self` } } impl GetString for Demo { fn get_a(&self) -> &String { &self.a } } impl UseString for Demo {} impl UseString2 for Demo {} #[cfg(test)] mod tests { use crate::{Demo, UseString}; #[test] fn it_works() { let d = Demo { a: "test".to_string() }; d.use_string(); } } fn main() {} </ins>


/// /// [`to_ascii_lowercase`]: Self::to_ascii_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] <del> #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] </del> <ins> #[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] </ins> #[inline] <ins> #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] </ins> pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); }


// * Our custom AssertRecoverSafe wrapper is indeed recover safe impl RecoverSafe for .. {} impl<'a, T: ?Sized> !RecoverSafe for &'a mut T {} <del> impl<'a, T: NoUnsafeCell + ?Sized> RecoverSafe for &'a T {} impl<T: NoUnsafeCell + ?Sized> RecoverSafe for *const T {} impl<T: NoUnsafeCell + ?Sized> RecoverSafe for *mut T {} </del> <ins> impl<'a, T: RefRecoverSafe + ?Sized> RecoverSafe for &'a T {} impl<T: RefRecoverSafe + ?Sized> RecoverSafe for *const T {} impl<T: RefRecoverSafe + ?Sized> RecoverSafe for *mut T {} </ins> impl<T: RecoverSafe> RecoverSafe for Unique<T> {} <del> impl<T: NoUnsafeCell + ?Sized> RecoverSafe for Shared<T> {} </del> <ins> impl<T: RefRecoverSafe + ?Sized> RecoverSafe for Shared<T> {} </ins> impl<T: ?Sized> RecoverSafe for Mutex<T> {} impl<T: ?Sized> RecoverSafe for RwLock<T> {} impl<T> RecoverSafe for AssertRecoverSafe<T> {}


changes = true; // remove a "[ t]**" block from each line, if possible for line in lines.iter_mut() { <del> if horizontal + 1 < line.len() { *line = &line[horizontal + 1..]; </del> <ins> if let Some(tmp) = line.strip_prefix(&horizontal) { *line = tmp; if kind == CommentKind::Block && (*line == "*" || line.starts_with("* ") || line.starts_with("**")) { *line = &line[1..]; } </ins> } } }


<ins> // check-pass // edition:2021 #![feature(type_alias_impl_trait)] use std::future::Future; use std::marker::PhantomData; trait Stream { type Item; } struct Empty<T> { _phantom: PhantomData<T>, } impl<T> Stream for Empty<T> { type Item = T; } trait X { type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a; type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream<Item = Repr>; type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async { Empty { _phantom: PhantomData } } } } fn main() {} </ins>


/// // See how many bytes are currently buffered /// let bytes_buffered = buf_writer.buffer().len(); /// ``` <del> #[unstable(feature = "bufreader_buffer", issue = "45323")] </del> <ins> #[stable(feature = "bufreader_buffer", since = "1.37.0")] </ins> pub fn buffer(&self) -> &[u8] { &self.buf }


/// `//[foo]`), then the property is ignored unless `cfg` is /// `Some("foo")`. fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) { <del> // In CI, we've sometimes encountered non-determinism related to truncating very long paths. // Set a consistent (short) prefix to avoid issues, but only in CI to avoid regressing the // contributor experience. if CiEnv::is_ci() { self.remap_src_base = config.mode == Mode::Ui && !config.suite.contains("rustdoc"); } </del> let mut has_edition = false; if !testfile.is_dir() { let file = File::open(testfile).unwrap();


use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; <del> use rustc_ast::{Attribute, LitKind, NestedMetaItem}; </del> <ins> use rustc_ast::{Attribute, Lit, LitKind, NestedMetaItem}; </ins> use rustc_errors::{pluralize, struct_span_err}; use rustc_hir as hir; use rustc_hir::def_id::LocalDefId;


assert_eq!(stripped.as_str(), "!test"); }) } <ins> #[test] fn test_doc_blocks() { create_default_session_globals_then(|| { let stripped = beautify_doc_string(Symbol::intern(" # Returnsn     *n     "), CommentKind::Block); assert_eq!(stripped.as_str(), " # Returnsnn"); let stripped = beautify_doc_string( Symbol::intern("n     * # Returnsn     *n     "), CommentKind::Block, ); assert_eq!(stripped.as_str(), " # Returnsnn"); let stripped = beautify_doc_string(Symbol::intern("n *     an "), CommentKind::Block); assert_eq!(stripped.as_str(), "     an"); }) } </ins>


/// assert_eq!("grÜße, jÜrgen ❤", s); /// ``` #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] <del> #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] </del> <ins> #[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] </ins> #[inline] <ins> #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] </ins> pub const fn make_ascii_lowercase(&mut self) { // SAFETY: changing ASCII letters only does not invalidate UTF-8. let me = unsafe { self.as_bytes_mut() };


.with_indent_lines(true) .with_ansi(true) .with_targets(true) <del> .with_thread_ids(true) .with_thread_names(true) </del> .with_wraparound(10) .with_verbose_exit(true) .with_verbose_entry(true) .with_indent_amount(2); <ins> #[cfg(parallel_compiler)] let layer = layer.with_thread_ids(true).with_thread_names(true); </ins> use tracing_subscriber::layer::SubscriberExt; let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);


<ins> fn test1() { let mut chars = "Hello".chars(); for _c in chars.by_ref() { chars.next(); //~ ERROR cannot borrow `chars` as mutable more than once at a time } } fn test2() { let v = vec![1, 2, 3]; let mut iter = v.iter(); for _i in iter { iter.next(); //~ ERROR borrow of moved value: `iter` } } fn main() { } </ins>


<ins> // This used to cause assert_10_13 to unexpectingly fail, due to simd_shuffle_indices being passed // the wrong Instance, causing issues with inlining. See #67557. // // run-pass // compile-flags: -Zmir-opt-level=3 #![feature(platform_intrinsics, repr_simd)] extern "platform-intrinsic" { fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U; } #[repr(simd)] #[derive(Debug, PartialEq)] struct Simd2(u8, u8); fn main() { unsafe { let p_res: Simd2 = simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 1]); let a_res: Simd2 = inline_me(); assert_10_11(p_res); assert_10_13(a_res); } } #[inline(never)] fn assert_10_11(x: Simd2) { assert_eq!(x, Simd2(10, 11)); } #[inline(never)] fn assert_10_13(x: Simd2) { assert_eq!(x, Simd2(10, 13)); } #[inline(always)] unsafe fn inline_me() -> Simd2 { simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3]) } </ins>


let mut etc_span = None; while self.token != token::CloseDelim(token::Brace) { <del> let attrs = self.parse_outer_attributes()?; </del> <ins> let attrs = match self.parse_outer_attributes() { Ok(attrs) => attrs, Err(err) => { if let Some(mut delayed) = delayed_err { delayed.emit(); } return Err(err); }, }; </ins> let lo = self.token.span; // check that a comma comes after every field


<ins> //@ only-x86_64 //@ compile-flags: -C opt-level=3 #![crate_type = "lib"] #![no_std] #![feature(str_internals)] extern crate alloc; /// Ensure that the ascii-prefix loop for `str::to_lowercase` and `str::to_uppercase` uses vector /// instructions. /// /// The llvm ir should be the same for all targets that support some form of simd. Only targets /// without any simd instructions would see scalarized ir. /// Unfortunately, there is no `only-simd` directive to only run this test on only such platforms, /// and using test revisions would still require the core libraries for all platforms. // CHECK-LABEL: @lower_while_ascii // CHECK: [[A:%[0-9]]] = load <16 x i8> // CHECK-NEXT: [[B:%[0-9]]] = icmp slt <16 x i8> [[A]], zeroinitializer // CHECK-NEXT: [[C:%[0-9]]] = bitcast <16 x i1> [[B]] to i16 #[no_mangle] pub fn lower_while_ascii(s: &str) -> (alloc::string::String, &str) { alloc::str::convert_while_ascii(s, u8::to_ascii_lowercase) } </ins>


<ins> error[E0277]: can't compare `[B; _]` with `&&[A]` --> $DIR/hash-tyvid-regression-2.rs:12:16 | LL |         self.0 == other |                ^^ no implementation for `[B; _] == &&[A]` | = help: the trait `PartialEq<&&[A]>` is not implemented for `[B; _]` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>


} impl Reader for UdpStream { <ins> /// Returns the next non-empty message from the specified address. </ins> fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { let peer = self.connected_to; self.as_socket(|sock| { <del> match sock.recv_from(buf) { Ok((_nread, src)) if src != peer => Ok(0), Ok((nread, _src)) => Ok(nread), Err(e) => Err(e), </del> <ins> loop { let (nread, src) = try!(sock.recv_from(buf)); if nread > 0 && src == peer { return Ok(nread); } </ins> } }) }


source: self.mirror_expr(source), cast: PointerCoercion::ArrayToPointer, } <del> } else { // check whether this is casting an enum variant discriminant // to prevent cycles, we refer to the discriminant initializer </del> <ins> } else if let hir::ExprKind::Path(ref qpath) = source.kind && 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() && let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), variant_ctor_id) = res { // Check whether this is casting an enum variant discriminant. // To prevent cycles, we refer to the discriminant initializer, </ins> // which is always an integer and thus doesn't need to know the <del> // enum's layout (or its tag type) to compute it during const eval </del> <ins> // enum's layout (or its tag type) to compute it during const eval. </ins> // Example: // enum Foo { //     A,


/// /// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] <del> #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] </del> <ins> #[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] </ins> #[inline] <ins> #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] </ins> pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); }


#![allow(dead_code)] #![feature(recover)] <del> use std::panic::RecoverSafe; </del> <ins> use std::panic::{RecoverSafe, AssertRecoverSafe}; </ins> use std::cell::RefCell; use std::sync::{Mutex, RwLock, Arc}; use std::rc::Rc;


/// # use std::fmt::Write; /// # let mut buf = String::new(); /// # let name = "World"; <del> /// /// // Bad </del> /// write!(buf, "Hello {}!n", name); <del> /// /// // Good /// writeln!(buf, "Hello {}!", name); </del> /// ``` pub WRITE_WITH_NEWLINE, style,


[dependencies] # tidy-alphabetical-start <del> ar_archive_writer = "0.4.0" </del> <ins> ar_archive_writer = "0.4.2" </ins> arrayvec = { version = "0.7", default-features = false } bitflags = "2.4.1" cc = "1.0.90"


fn rustc_tables(&mut self, f: &mut dyn FnMut(&mut Tables<'_>)); } <del> thread_local! { /// A thread local variable that stores a pointer to the tables mapping between TyCtxt /// datastructures and stable MIR datastructures. static TLV: Cell<*mut ()> = const { Cell::new(std::ptr::null_mut()) }; } </del> <ins> // A thread local variable that stores a pointer to the tables mapping between TyCtxt // datastructures and stable MIR datastructures scoped_thread_local! (static TLV: Cell<*mut ()>); </ins> pub fn run(mut context: impl Context, f: impl FnOnce()) { <del> assert!(TLV.get().is_null()); </del> <ins> assert!(!TLV.is_set()); </ins> fn g<'a>(mut context: &mut (dyn Context + 'a), f: impl FnOnce()) { <del> TLV.set(&mut context as *mut &mut _ as _); f(); TLV.replace(std::ptr::null_mut()); </del> <ins> let ptr: *mut () = &mut context as *mut &mut _ as _; TLV.set(&Cell::new(ptr), || { f(); }); </ins> } g(&mut context, f); }


} } } <ins> #[inline] fn len_utf8(code: u32) -> usize { if code < MAX_ONE_B { 1 } else if code < MAX_TWO_B { 2 } else if code < MAX_THREE_B { 3 } else { 4 } } /// Encodes a raw u32 value as UTF-8 into the provided byte buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf8`, this method also handles codepoints in the surrogate range. /// (Creating a `char` in the surrogate range is UB.) /// The result is valid [generalized UTF-8] but not valid UTF-8. /// /// [generalized UTF-8]: https://simonsapin.github.io/wtf-8/#generalized-utf8 /// /// # Panics /// /// Panics if the buffer is not large enough. /// A buffer of length four is large enough to encode any `char`. #[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] #[doc(hidden)] #[inline] pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] { let len = len_utf8(code); match (len, &mut dst[..]) { (1, [a, ..]) => { *a = code as u8; } (2, [a, b, ..]) => { *a = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; *b = (code & 0x3F) as u8 | TAG_CONT; } (3, [a, b, c, ..]) => { *a = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; *b = (code >> 6 & 0x3F) as u8 | TAG_CONT; *c = (code & 0x3F) as u8 | TAG_CONT; } (4, [a, b, c, d, ..]) => { *a = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; *b = (code >> 12 & 0x3F) as u8 | TAG_CONT; *c = (code >> 6 & 0x3F) as u8 | TAG_CONT; *d = (code & 0x3F) as u8 | TAG_CONT; } _ => panic!( "encode_utf8: need {} bytes to encode U+{:X}, but the buffer has {}", len, code, dst.len(), ), }; &mut dst[..len] } /// Encodes a raw u32 value as UTF-16 into the provided `u16` buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf16`, this method also handles codepoints in the surrogate range. /// (Creating a `char` in the surrogate range is UB.) /// /// # Panics /// /// Panics if the buffer is not large enough. /// A buffer of length 2 is large enough to encode any `char`. #[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] #[doc(hidden)] #[inline] pub fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] { // SAFETY: each arm checks whether there are enough bits to write into unsafe { if (code & 0xFFFF) == code && !dst.is_empty() { // The BMP falls through *dst.get_unchecked_mut(0) = code as u16; slice::from_raw_parts_mut(dst.as_mut_ptr(), 1) } else if dst.len() >= 2 { // Supplementary planes break into surrogates. code -= 0x1_0000; *dst.get_unchecked_mut(0) = 0xD800 | ((code >> 10) as u16); *dst.get_unchecked_mut(1) = 0xDC00 | ((code as u16) & 0x3FF); slice::from_raw_parts_mut(dst.as_mut_ptr(), 2) } else { panic!( "encode_utf16: need {} units to encode U+{:X}, but the buffer has {}", from_u32_unchecked(code).len_utf16(), code, dst.len(), ) } } } </ins>


LLVMInitializeMSP430Target, LLVMInitializeMSP430TargetMC, LLVMInitializeMSP430AsmPrinter); <ins> init_target!(all(llvm_component = "msp430", llvm_has_msp430_asm_parser), LLVMInitializeMSP430AsmParser); </ins> init_target!(llvm_component = "riscv", LLVMInitializeRISCVTargetInfo, LLVMInitializeRISCVTarget,


use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_metadata::find_native_static_library; use rustc_middle::middle::dependency_format::Linkage; <ins> use rustc_middle::middle::exported_symbols; </ins> use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo, SymbolExportKind}; use rustc_middle::ty::TyCtxt; use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};


<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 A<'a> { func: &'a fn() -> Option<int> } impl<'a> A<'a> { fn call(&self) -> Option<int> { (*self.func)() } } fn foo() -> Option<int> { None } fn create() -> A<'static> { A { func: &foo, //~ ERROR borrowed value does not live long enough } } fn main() { let a = create(); a.call(); } </ins>


<ins> error: range endpoint is out of range for `u8` --> $DIR/issue-109529.rs:4:14 | LL |     for _ in 0..256 as u8 {} |              ------^^^^^^ |              | |              help: use an inclusive range instead: `0..=255` | = note: `#[deny(overflowing_literals)]` on by default error: range endpoint is out of range for `u8` --> $DIR/issue-109529.rs:5:14 | LL |     for _ in 0..(256 as u8) {} |              ^^^^^^^^^^^^^^ | help: use an inclusive range instead | LL |     for _ in 0..=(255 as u8) {} |                 + ~~~ error: aborting due to 2 previous errors </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. mod foo { pub mod bar { pub mod baz { pub fn name() -> &'static str { module_path!() } } } } fn main() { assert_eq!(module_path!(), "issue-18859"); assert_eq!(foo::bar::baz::name(), "issue-18859::foo::bar::baz"); } </ins>


let (resolver, resolver_caches) = { let (krate, resolver, _) = &*abort_on_err(queries.expansion(), sess).peek(); let resolver_caches = resolver.borrow_mut().access(|resolver| { <del> collect_intra_doc_links::early_resolve_intra_doc_links(resolver, krate, externs) </del> <ins> collect_intra_doc_links::early_resolve_intra_doc_links( resolver, krate, externs, document_private, ) </ins> }); (resolver.clone(), resolver_caches) };


} } <ins> /// Constructs a new locked handle to the standard input of the current /// process. /// /// Each handle returned is a guard granting locked access to a shared /// global buffer whose access is synchronized via a mutex. If you need /// more explicit control over locking, for example, in a multi-threaded /// program, use the [`io::stdin`] function to obtain an unlocked handle, /// along with the [`Stdin::lock`] method. /// /// The lock is released when the returned guard goes out of scope. The /// returned guard also implements the [`Read`] and [`BufRead`] traits for /// accessing the underlying data. /// /// **Note**: The mutex locked by this handle is not reentrant. Even in a /// single-threaded program, calling other code that accesses [`Stdin`] /// could cause a deadlock or panic, if this locked handle is held across /// that call. /// /// ### Note: Windows Portability Consideration /// When operating in a console, the Windows implementation of this stream does not support /// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return /// an error. /// /// # Examples /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Read}; /// /// fn main() -> io::Result<()> { ///     let mut buffer = String::new(); ///     let mut handle = io::stdin_locked(); /// ///     handle.read_to_string(&mut buffer)?; ///     Ok(()) /// } /// ``` #[unstable(feature = "stdio_locked", issue = "none")] pub fn stdin_locked() -> StdinLock<'static> { stdin().into_locked() } </ins> impl Stdin { /// Locks this handle to the standard input stream, returning a readable /// guard.


if sess.opts.incremental.is_none() { return; } <ins> // This is going to be deleted in finalize_session_directory, so let's not create it if sess.has_errors_or_delayed_span_bugs() { return; } </ins> let query_cache_path = query_cache_path(sess); let dep_graph_path = dep_graph_path(sess);


# ignore-cross-compile -- compiling C++ code does not work well when cross-compiling <del> # This test case makes sure that native libraries are linked with --whole-archive semantics # when the `-bundle,+whole-archive` modifiers are applied to them. </del> <ins> # This test case makes sure that native libraries are linked with appropriate semantics # when the `[+-]bundle,[+-]whole-archive` modifiers are applied to them. </ins> # # The test works by checking that the resulting executables produce the expected output, # part of which is emitted by otherwise unreferenced C code. If +whole-archive didn't work


<ins> #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash // We should probably be able to infer the types here. However, this test is checking that we don't // get an ICE in this case. It may be modified later to not be an error. struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]); fn main() { let _ = Foo::<3>([1, 2, 3]); //~ ERROR type annotations needed } </ins>


else { // 10 is not constructed d(10, None) <del> } </del> <ins> }, </ins> ); <del> assert_eq!(get(), vec![3, 8, 7, 1, 2]); </del> <ins> assert_eq!(get(), vec![8, 7, 1, 3, 2]); </ins> } assert_eq!(get(), vec![0, 4, 6, 9, 5]);


// Fudge the receiver, so we can do new inference on it. let possible_rcvr_ty = possible_rcvr_ty.fold_with(&mut fudger); let method = self <del> .lookup_method( </del> <ins> .lookup_method_for_diagnostic( </ins> possible_rcvr_ty, segment, DUMMY_SP, call_expr, binding, <del> args, </del> ) .ok()?; // Unify the method signature with our incompatible arg, to


Use verbose output. .TP fB--externfR fINAMEfR=fIPATHfR <del> Specify where an external rust library is located. </del> <ins> Specify where an external rust library is located. These should match fIexternfR declarations in the crate's source code. </ins> .TP fB--sysrootfR fIPATHfR Override the system root.


} } <del> // FIXME #31379: We can use methods from imported traits shadowed by non-import items if !binding.is_import() { for glob_binding in resolution.duplicate_globs.iter() { </del> <ins> // We can always use methods from the prelude traits for glob_binding in resolution.duplicate_globs.iter() { if glob_binding.defined_with(DefModifiers::PRELUDE) { </ins> module.shadowed_traits.borrow_mut().push(glob_binding); } }


/// Test whether this TLS key has been `set` for the current thread. pub fn is_set(&'static self) -> bool { <del> unsafe { !self.inner.get().is_null() } </del> <ins> unsafe { !(self.inner)().get().is_null() } </ins> } }


bootstrap_out.display() ) } <ins> config.check_build_rustc_version(); </ins> if rust_info.is_from_tarball() && config.description.is_none() { config.description = Some("built from a source tarball".to_owned());


retained: &mut retained, access_levels: &access_levels, }; <del> krate = stripper.fold_crate(krate); </del> <ins> krate = ImportStripper.fold_crate(stripper.fold_crate(krate)); </ins> } // strip all private implementations of traits


} let total = arg.layout.size; <ins> if total.bits() > 128 { arg.make_indirect(); return; } </ins> arg.cast_to(Uniform { unit: Reg::i64(), total


"clippy_lints", "compiletest_rs", "derive-new", <del> "git2", </del> "lazy_static 1.4.0", "regex", "rustc-workspace-hack",


matches!(self.kind, ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..)) } <ins> /// Check if this is an [`ItemKind::Struct`] or [`ItemKind::Union`]. pub fn is_struct_or_union(&self) -> bool { matches!(self.kind, ItemKind::Struct(..) | ItemKind::Union(..)) } </ins> expect_methods_self_kind! { expect_extern_crate, Option<Symbol>, ItemKind::ExternCrate(s), *s;


}); }; <ins> suite("check-ui", "src/test/ui", "ui", "ui"); </ins> suite("check-rpass-full", "src/test/run-pass-fulldeps", "run-pass", "run-pass-fulldeps"); suite("check-rfail-full", "src/test/run-fail-fulldeps",


<ins> error[E0599]: no method named `push` found for struct `SmallVec` in the current scope --> $DIR/hash-tyvid-regression-4.rs:23:19 | LL |         node.keys.push(k); |                   ^^^^ method not found in `SmallVec<_, { D * 2 }>` ... LL | struct SmallVec<T, const D: usize> { | ---------------------------------- method `push` not found for this error: aborting due to previous error For more information about this error, try `rustc --explain E0599`. </ins>


} try!(self.maybe_print_comment(attr.span.lo)); if attr.node.is_sugared_doc { <del> word(self.writer(), &attr.value_str().unwrap()) </del> <ins> try!(word(self.writer(), &attr.value_str().unwrap())); hardbreak(self.writer()) </ins> } else { match attr.node.style { ast::AttrStyle::Inner => try!(word(self.writer(), "#![")),


//@aux-build:proc_macro_attr.rs:proc-macro <ins> // Flaky test, see https://github.com/rust-lang/rust/issues/113585. //@ignore-32bit //@ignore-64bit </ins> #![warn(clippy::empty_line_after_outer_attr)] #![allow(clippy::assertions_on_constants)] #![feature(custom_inner_attributes)]


g: &'tcx hir::Generics, id: ast::NodeId) { if self.should_warn_about_variant(&variant.node) { <del> self.warn_dead_code(variant.node.data.id(), variant.span, variant.node.name, "variant"); </del> <ins> self.warn_dead_code(variant.node.data.id(), variant.span, variant.node.name, "variant", "constructed"); </ins> } else { intravisit::walk_variant(self, variant, g, id); }


// Make sure nobody calls `drop()` explicitly. self.enforce_illegal_method_limitations(&pick); <del> // If there is a `Self: Sized` bound and `Self` is a trait object, it is possible that // something which derefs to `Self` actually implements the trait and the caller // wanted to make a static dispatch on it but forgot to import the trait. // See test `src/test/ui/issue-35976.rs`. // // In that case, we'll error anyway, but we'll also re-run the search with all traits // in scope, and if we find another method which can be used, we'll output an // appropriate hint suggesting to import the trait. let illegal_sized_bound = self.predicates_require_illegal_sized_bound(&method_predicates); </del> // Add any trait/regions obligations specified on the method's type parameters. // We won't add these if we encountered an illegal sized bound, so that we can use // a custom error in that case.


COMMON_FLAGS=-Copt-level=2 -Ccodegen-units=1 -Cllvm-args=-disable-preinline <del> # LLVM doesn't support instrumenting binaries that use SEH: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMMON_FLAGS+= -Cpanic=abort endif </del> ifeq ($(UNAME),Darwin) # macOS does not have the `tac` command, but `tail -r` does the same thing TAC := tail -r


} ty::UnsizeVtable(ref ty_trait, self_ty) => { vtable::check_object_safety(self.tcx(), ty_trait, span); // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` implements `Foo`: vtable::register_object_cast_obligations(self, <del> span, ty_trait, self_ty); </del> <ins> span, ty_trait, self_ty); </ins> // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` outlives `'a`:


// `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. <del> PlaceContext::NonUse(NonUseContext::PlaceMention) | </del> <ins> PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | </ins> PlaceContext::NonUse(NonUseContext::AscribeUserTy) | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) |


// option. This file may not be copied, modified, or distributed // except according to those terms. <del> // ignore-android: FIXME(#10381) </del> // ignore-windows // min-lldb-version: 310


} #[bench] <ins> fn from_utf8_lossy_100_ascii(bh: &mut BenchHarness) { let s = bytes!("Hello there, the quick brown fox jumped over the lazy dog!  Lorem ipsum dolor sit amet, consectetur. "); assert_eq!(100, s.len()); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_100_multibyte(bh: &mut BenchHarness) { let s = bytes!("𐌀𐌖𐌋𐌄𐌑𐌉ปรدولة الكويتทศไทย中华𐍅𐌿𐌻𐍆𐌹𐌻𐌰"); assert_eq!(100, s.len()); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_invalid(bh: &mut BenchHarness) { let s = bytes!("Hello", 0xC0, 0x80, " There", 0xE6, 0x83, " Goodbye"); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_100_invalid(bh: &mut BenchHarness) { let s = ::vec::from_elem(100, 0xF5u8); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] </ins> fn bench_with_capacity(bh: &mut BenchHarness) { bh.iter(|| { let _ = with_capacity(100);


/// Map of capability name to boolean value pub bools: HashMap<String, bool>, /// Map of capability name to numeric value <del> pub numbers: HashMap<String, u16>, </del> <ins> pub numbers: HashMap<String, u32>, </ins> /// Map of capability name to raw (unexpanded) string pub strings: HashMap<String, Vec<u8>>, }


* * Strings are a packed UTF-8 representation of text, stored as null * terminated buffers of u8 bytes.  Strings should be indexed in bytes, <del> * for efficiency, but UTF-8 unsafe operations should be avoided.  For * some heavy-duty uses, try extra::rope. </del> <ins> * for efficiency, but UTF-8 unsafe operations should be avoided. </ins> */ use at_vec;


//! These structs are a subset of the ones found in `rustc_errors::json`. <del> //! They are only used for deserialization of JSON output provided by libtest. </del> use std::path::{Path, PathBuf}; use std::str::FromStr;


<ins> use crate::cmp::{max, min}; </ins> use crate::io::prelude::*; <del> use crate::io::{copy, empty, repeat, sink, Empty, Repeat, SeekFrom, Sink}; </del> <ins> use crate::io::{ copy, empty, repeat, sink, BufWriter, Empty, Repeat, Result, SeekFrom, Sink, DEFAULT_BUF_SIZE, }; </ins> #[test] fn copy_copies() {


<ins> error[E0308]: mismatched types --> $DIR/dont-suggest-through-inner-const.rs:4:9 | LL |         0 |         ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/dont-suggest-through-inner-const.rs:1:17 | LL | const fn f() -> usize { |          -      ^^^^^ expected `usize`, found `()` |          | |          implicitly returns `()` as its body has no tail or `return` expression error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. </ins>


COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/ RUN ./build-openssl.sh <del> # The `curl` binary on CentOS doesn't support SNI which is needed for fetching </del> <ins> # The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching </ins> # some https urls we have, so install a new version of libcurl + curl which is # using the openssl we just built previously. # # Note that we also disable a bunch of optional features of curl that we don't # really need. COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/ <del> RUN ./build-curl.sh </del> <ins> RUN ./build-curl.sh && apt-get remove -y curl </ins> # binutils < 2.22 has a bug where the 32-bit executables it generates # immediately segfault in Rust, so we need to install our own binutils.


explicitly_linked: bool) -> (ast::CrateNum, Rc<cstore::crate_metadata>, cstore::CrateSource) { <ins> self.verify_rustc_version(name, span, &lib.metadata); </ins> // Claim this crate number and cache it let cnum = self.next_crate_num; self.next_crate_num += 1;


return this.tcx().types.err; } _ => { <del> let id_node = tcx.map.as_local_node_id(def.def_id()).unwrap(); </del> span_err!(tcx.sess, span, E0248, "found value `{}` used as a type", <del> tcx.map.path_to_string(id_node)); </del> <ins> tcx.item_path_str(def.def_id())); </ins> return this.tcx().types.err; } }


<del> Subproject commit 777efaf5644706b36706a7a5c51edb63835e05ca </del> <ins> Subproject commit f1ed22803f09e3b2c2b86d773db07ce70804987a </ins>


<ins> // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that we cannot return a stack allocated slice fn function(x: int) -> &'static [int] { &[x] //~ ERROR mismatched types } fn main() { let x = function(1); let y = x[0]; } </ins>


EncodeCrossCrate::No, coroutines, experimental!(coroutines) ), <del> // `#[pointee]` attribute to designate the pointee type in SmartPointer derive-macro gated!( pointee, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No, derive_smart_pointer, experimental!(pointee) ), </del> // RFC 3543 // `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` gated!(


} else { // If another opaque type that we contain is recursive, then it // will report the error, so we don't have to. <ins> self.found_any_recursion = true; </ins> self.found_recursion = def_id == *self.primary_def_id.as_ref().unwrap(); None }


} ItemKind::Static(ref ty, _, ref expr) | ItemKind::Const(_, ref ty, ref expr) => { <del> debug!("resolve_item ItemKind::Const"); </del> self.with_item_rib(HasGenericParams::No, |this| { this.visit_ty(ty); if let Some(expr) = expr {


<ins> pub trait NSWindow: Sized { fn frame(self) -> () { unimplemented!() } fn setFrame_display_(self, display: ()) {} } impl NSWindow for () {} pub struct NSRect {} use std::ops::Deref; struct MainThreadSafe<T = ()>(T); impl<T> Deref for MainThreadSafe<T> { type Target = T; fn deref(&self) -> &T { unimplemented!() } } fn main() { || { let ns_window = MainThreadSafe(()); // Don't record adjustments twice for `*ns_window` (*ns_window).frame(); ns_window.setFrame_display_(0); //~^ ERROR mismatched types }; } </ins>


<del> // known-bug: #102688 </del> <ins> // check-pass </ins> // edition:2021 #![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]


// Before we start looking for candidates, we have to get our hands // on the type user is trying to perform invocation on; basically: <del> // we're transforming `HashMap::new` into just `HashMap` let path = if let Some((_, path)) = path.split_last() { path } else { return Some(parent_err); </del> <ins> // we're transforming `HashMap::new` into just `HashMap`. let path = match path.split_last() { Some((_, path)) if !path.is_empty() => path, _ => return Some(parent_err), </ins> }; let (mut err, candidates) =


<ins> error: unknown disambiguator `hello` --> $DIR/email-address-localhost.rs:3:18 | LL | //! Email me at <hello@localhost>. |                  ^^^^^ | note: the lint level is defined here --> $DIR/email-address-localhost.rs:1:9 | LL | #![deny(warnings)] |         ^^^^^^^^ = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]` error: aborting due to previous error </ins>


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-tidy-linelength #![deny(deprecated)] extern crate url; fn main() { let _ = url::Url::parse("http://example.com"); //~^ ERROR use of deprecated item: This is being removed. Use rust-url instead. http://servo.github.io/rust-url/ } </ins>


// @has - '//*[@class="sidebar-elems"]//section//a' 'Output' // @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types' // @has - '//*[@class="sidebar-elems"]//section//a' 'Extra' <ins> // @has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' 'Object Safety' </ins> pub trait Foo { const FOO: usize; const BAR: u32 = 0;


<ins> enum will { s#[c"owned_box"] //~^ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `#` //~|ERROR expected item, found `"owned_box"` } </ins>


None, ); } <del> // If `ty` is a `repr(transparent)` newtype, and the non-zero-sized type is a generic // argument, which after substitution, is `()`, then this branch can be hit. FfiResult::FfiUnsafe { ty, .. } if is_return_type && ty.is_unit() => {} </del> FfiResult::FfiUnsafe { ty, reason, help } => { self.emit_ffi_unsafe_type_lint(ty, sp, reason, help); }


<ins> use std::io::Write; #[test] fn test_thing() { print!("ran the test"); std::io::stdout().flush().unwrap(); } </ins>


/// println!("{:?}", Foo(10, "Hello World".to_string())); /// ``` #[stable(feature = "debug_builders", since = "1.2.0")] <del> #[inline] </del> pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> { builders::debug_tuple_new(self, name) }


hir::TraitItemKind::Fn(_, hir::TraitFn::Required(_)) | hir::TraitItemKind::Type(..) => false, }, <del> Some(Node::ImplItem(impl_item)) => { match impl_item.kind { hir::ImplItemKind::Const(..) => true, hir::ImplItemKind::Fn(..) => { let attrs = self.tcx.codegen_fn_attrs(def_id); let generics = self.tcx.generics_of(def_id); if generics.requires_monomorphization(self.tcx) || attrs.requests_inline() { true } else { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); let impl_did = self.tcx.hir().get_parent_item(hir_id); // Check the impl. If the generics on the self // type of the impl require inlining, this method // does too. match self.tcx.hir().expect_item(impl_did).kind { hir::ItemKind::Impl { .. } => { let generics = self.tcx.generics_of(impl_did); generics.requires_monomorphization(self.tcx) } _ => false, } } } hir::ImplItemKind::TyAlias(_) => false, </del> <ins> Some(Node::ImplItem(impl_item)) => match impl_item.kind { hir::ImplItemKind::Const(..) => true, hir::ImplItemKind::Fn(..) => { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); let impl_did = self.tcx.hir().get_parent_item(hir_id); method_might_be_inlined(self.tcx, impl_item, impl_did) </ins> } <del> } </del> <ins> hir::ImplItemKind::TyAlias(_) => false, }, </ins> Some(_) => false, None => false, // This will happen for default methods. }


let cursor_snapshot_next_calls = cursor_snapshot.num_next_calls; let mut end_pos = self.token_cursor.num_next_calls; <ins> let mut captured_trailing = false; </ins> // Capture a trailing token if requested by the callback 'f' match trailing { TrailingToken::None => {} <ins> TrailingToken::Gt => { assert_eq!(self.token.kind, token::Gt); } </ins> TrailingToken::Semi => { assert_eq!(self.token.kind, token::Semi); end_pos += 1; <ins> captured_trailing = true; </ins> } TrailingToken::MaybeComma => { if self.token.kind == token::Comma { end_pos += 1; <ins> captured_trailing = true; </ins> } } }


<ins> error[E0580]: `main` function has wrong type --> $DIR/issue-111879-1.rs:12:1 | LL | fn main(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | = note: expected fn pointer `fn()` found fn pointer `fn(for<'a> fn(Foo<fn(&'a ())>::Assoc))` error: aborting due to previous error For more information about this error, try `rustc --explain E0580`. </ins>


<del> //@ known-bug: rust-lang/rust#129503 use std::arch::asm; unsafe fn f6() { asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "r} {}")); } </del>


<del> Subproject commit 51f104bf1cc6c3a588a11c90a3b4a4a18ee080ac </del> <ins> Subproject commit e45c75de1148456a9eb1a67c14a66df4dfb50c94 </ins>


<ins> error: function can not have more than 65535 arguments --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:24 | LL |           fn _f($($t: ()),*) {} |  ________________________^ LL | |     } LL | | } LL | | LL | | many_args!{[_]########## ######} | |____________^ error: aborting due to previous error </ins>


emit, generate_link_to_definition, call_locations, <ins> no_emit_shared: false, </ins> }, crate_name, output_format,


<ins> //@ check-pass //@ edition: 2021 // issue: rust-lang/rust#123697 #![feature(async_closure)] struct S { t: i32 } fn test(s: &S, t: &i32) { async || { println!("{}", s.t); println!("{}", t); }; } fn main() {} </ins>


/// Basic usage: /// /// ``` <del> /// #![feature(nonzero_is_power_of_two)] /// </del> #[doc = concat!("let eight = std::num::", stringify!($Ty), "::new(8).unwrap();")] /// assert!(eight.is_power_of_two()); #[doc = concat!("let ten = std::num::", stringify!($Ty), "::new(10).unwrap();")] /// assert!(!ten.is_power_of_two()); /// ``` #[must_use] <del> #[unstable(feature = "nonzero_is_power_of_two", issue = "81106")] </del> <ins> #[stable(feature = "nonzero_is_power_of_two", since = "1.59.0")] </ins> #[inline] pub const fn is_power_of_two(self) -> bool { // LLVM 11 normalizes `unchecked_sub(x, 1) & x == 0` to the implementation seen here.