assert!(prev_predicates.is_none()); } <del> fn ty_generics_for_type_or_impl<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty()) </del> <ins> fn ty_generics_for_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty(), true) } fn ty_generics_for_impl<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty(), false) </ins> } fn ty_generic_predicates_for_type_or_impl<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,


<ins> // no-system-llvm // compile-flags: -O -C overflow-checks=on #![crate_type = "lib"] pub struct S1<'a> { data: &'a [u8], position: usize, } // CHECK-LABEL: @slice_no_index_order #[no_mangle] pub fn slice_no_index_order<'a>(s: &'a mut S1, n: usize) -> &'a [u8] { // CHECK-NOT: slice_index_order_fail let d = &s.data[s.position..s.position+n]; s.position += n; return d; } // CHECK-LABEL: @test_check #[no_mangle] pub fn test_check<'a>(s: &'a mut S1, x: usize, y: usize) -> &'a [u8] { // CHECK: slice_index_order_fail &s.data[x..y] } </ins>


expr_span, scope, result, <del> value.ty, </del> <ins> expr.ty, </ins> ); }


/// # Example /// /// ```rust <ins> /// # #![allow(deprecated)] </ins> /// use url::Url; /// /// let raw = "https://username@example.com:8080/foo/bar?baz=qux#quz";


exact_paths: Default::default(), modules: vec![om], is_importable_from_parent: true, <ins> inside_body: false, </ins> } }


<ins> #![feature(unsize)] use std::marker::Unsize; use std::ops::Deref; trait Foo: Bar {} trait Bar {} impl<T> Bar for T where dyn Foo: Unsize<dyn Bar> {} impl Bar for () {} //~^ ERROR conflicting implementations of trait `Bar` for type `()` fn main() {} </ins>


// seemingly completely unrelated change. // Unfortunately, LLVM has no "disable" option for this, so we have to set // "enable" to 0 instead. // compile-flags:-g -Cllvm-args=-enable-tail-merge=0 // ignore-pretty as this critically relies on line numbers


&self.buf } <ins> /// Returns a mutable reference to the internal buffer. /// /// This can be used to write data directly into the buffer without triggering writers /// to the underlying writer. /// /// That the buffer is a `Vec` is an implementation detail. /// Callers should not modify the capacity as there currently is no public API to do so /// and thus any capacity changes would be unexpected by the user. pub(in crate::io) fn buffer_mut(&mut self) -> &mut Vec<u8> { &mut self.buf } </ins> /// Returns the number of bytes the internal buffer can hold without flushing. /// /// # Examples


<ins> #![feature(const_generics)] pub struct Num<const N: usize>; // Braces around const expression causes crash impl Num<{5}> { pub fn five(&self) { } } </ins>


} pub fn foobar() {} <ins> pub type Alias = u32; pub struct Foo { pub x: Alias, } impl Foo { pub fn a_method(&self) {} } pub trait Trait { type X; const Y: u32; } impl Trait for Foo { type X = u32; const Y: u32 = 0; } </ins>


<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_type="lib"] pub extern crate core; </ins>


} /* Code highlighting */ <del> .cm-s-default span.cm-keyword {color: #803C8D;} </del> <ins> .cm-s-default span.cm-keyword {color: #8959A8;} </ins> .cm-s-default span.cm-atom {color: #219;} <del> .cm-s-default span.cm-number {color: #2AA198;} .cm-s-default span.cm-def {color: #256EB8;} .cm-s-default span.cm-variable {color: black;} .cm-s-default span.cm-variable-2 {color: #817E61;} .cm-s-default span.cm-variable-3 {color: #085;} </del> <ins> .cm-s-default span.cm-number {color: #3E999F;} .cm-s-default span.cm-def {color: #4271AE;} /*.cm-s-default span.cm-variable {color: #C82829;}*/ .cm-s-default span.cm-variable-2 {color: #6F906C;} .cm-s-default span.cm-variable-3 {color: #B76514;} </ins> .cm-s-default span.cm-property {color: black;} .cm-s-default span.cm-operator {color: black;} <del> .cm-s-default span.cm-comment {color: #A82323;} .cm-s-default span.cm-string {color: #866544;} .cm-s-default span.cm-string-2 {color: #F50;} </del> <ins> .cm-s-default span.cm-comment {color: #8E908C;} .cm-s-default span.cm-string {color: #718C00;} .cm-s-default span.cm-string-2 {color: #866544;} </ins> .cm-s-default span.cm-meta {color: #555;} /*.cm-s-default span.cm-error {color: #F00;}*/ .cm-s-default span.cm-qualifier {color: #555;} .cm-s-default span.cm-builtin {color: #30A;} .cm-s-default span.cm-bracket {color: #CC7;} <del> .cm-s-default span.cm-tag {color: #170;} </del> <ins> .cm-s-default span.cm-tag {color: #C82829;} </ins> .cm-s-default span.cm-attribute {color: #00C;} /* The rest


///   as the compiler doesn't need to prove that it's sound to elide the ///   copy. /// <ins> /// Unaligned values cannot be dropped in place, they must be copied to an aligned /// location first using [`ptr::read_unaligned`]. /// </ins> /// [`ptr::read`]: ../ptr/fn.read.html <ins> /// [`ptr::read_unaligned`]: ../ptr/fn.read_unaligned.html </ins> /// /// # Safety ///


pub const FILE_TYPE_PIPE: u32 = 3; <ins> pub const CP_UTF8: DWORD = 65001; pub const MB_ERR_INVALID_CHARS: DWORD = 0x08; pub const WC_ERR_INVALID_CHARS: DWORD = 0x80; </ins> #[repr(C)] #[derive(Copy)] pub struct WIN32_FIND_DATAW {


// inferred in this method call. let arg = &args[i]; let arg_ty = self.node_ty(arg.hir_id); <del> err.span_label( arg.span, &format!( "this is of type `{arg_ty}`, which causes `{ident}` to be  inferred as `{ty}`", ), ); </del> <ins> if !arg.span.overlaps(mismatch_span) { err.span_label( arg.span, &format!( "this is of type `{arg_ty}`, which causes `{ident}` to be  inferred as `{ty}`", ), ); } </ins> param_args.insert(param_ty, (arg, arg_ty)); } }


} } <ins> fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) { if self .typeck_results() .expr_adjustments(expr) .iter() .any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(_))) { self.visit_expr(expr); } else if let hir::ExprKind::Field(base, ..) = expr.kind { // Ignore write to field self.handle_assign(base); } else { self.visit_expr(expr); } } </ins> fn handle_field_pattern_match( &mut self, lhs: &hir::Pat<'_>,


rbml_w.wr_tagged_str(tag_crate_hash, hash.as_str()); } <ins> fn encode_rustc_version(rbml_w: &mut Encoder) { rbml_w.wr_tagged_str(tag_rustc_version, &rustc_version()); } </ins> fn encode_crate_name(rbml_w: &mut Encoder, crate_name: &str) { rbml_w.wr_tagged_str(tag_crate_crate_name, crate_name); }


<ins> #![deny(warnings)] //! Email me at <hello@localhost>. //~^ ERROR unknown disambiguator `hello` //! This should *not* warn: <hello@example.com>. </ins>


<ins> // This used to cause an ICE for an internal index out of range 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 _: Simd2 = inline_me(); } } #[inline(always)] unsafe fn inline_me() -> Simd2 { simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3]) } </ins>


#[derive(Copy, Clone)] pub struct Quad { a: u64, b: u64, c: u64, d: u64 } <ins> #[derive(Copy, Clone)] pub struct QuadFloats { a: f32, b: f32, c: f32, d: f32 } </ins> #[repr(C)] #[derive(Copy, Clone)] pub struct Floats { a: f64, b: u8, c: f64 }


#[doc(keyword = "CookieMonster")] pub mod keyword {} <ins> /// Just some type alias. pub type SomeType = u32; </ins>


} }; <del> if let Some(path) = path && let Ok(mut out) = crate::fs::File::options().create(true).append(true).open(&path) { write(&mut out, BacktraceStyle::full()); } </del> if let Some(local) = set_output_capture(None) { <del> write(&mut *local.lock().unwrap_or_else(|e| e.into_inner()), backtrace); </del> <ins> write(&mut *local.lock().unwrap_or_else(|e| e.into_inner())); </ins> set_output_capture(Some(local)); } else if let Some(mut out) = panic_output() { <del> write(&mut out, backtrace); </del> <ins> write(&mut out); </ins> } }


<ins> // aux-build:issue-66286.rs // Regression test for #66286. extern crate issue_66286; #[issue_66286::vec_ice] pub extern fn foo(_: Vec(u32)) -> u32 { //~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait 0 } fn main() {} </ins>


// option. This file may not be copied, modified, or distributed // except according to those terms. <del> // ignore-android: FIXME(#9116) Bus error </del> use std::mem; #[repr(packed)]


actual: Ty<'tcx>, ti: TopInfo<'tcx>, ) -> Option<DiagnosticBuilder<'tcx, ErrorGuaranteed>> { <del> self.demand_eqtype_with_origin(&self.pattern_cause(ti, cause_span), expected, actual) </del> <ins> let mut diag = self.demand_eqtype_with_origin(&self.pattern_cause(ti, cause_span), expected, actual)?; if let Some(expr) = ti.origin_expr { self.suggest_fn_call(&mut diag, expr, expected, |output| { self.can_eq(self.param_env, output, actual).is_ok() }); } Some(diag) </ins> } fn demand_eqtype_pat(


infer::RelateOutputImplTypes(_) => "mismatched types", infer::MatchExpressionArm(_, _) => "match arms have incompatible types", infer::IfExpression(_) => "if and else have incompatible types", <ins> infer::IfExpressionWithNoElse(_) => "if may be missing an else clause", </ins> }; self.tcx.sess.span_err(


<ins> // The various #[inline(never)] annotations and std::hint::black_box calls are // an attempt to make unwinding as non-flaky as possible on i686-pc-windows-msvc. #[inline(never)] fn generate_backtrace(x: &u32) { std::hint::black_box(x); let bt = std::backtrace::Backtrace::force_capture(); println!("{}", bt); std::hint::black_box(x); } #[inline(never)] fn fn_in_backtrace(x: &u32) { std::hint::black_box(x); generate_backtrace(x); std::hint::black_box(x); } fn main() { let x = &41; std::hint::black_box(x); fn_in_backtrace(x); std::hint::black_box(x); } </ins>


); } else { // Trivial case: `T` needs an extra bound: `T: Bound`. <del> let (sp, suggestion) = match super_traits { None => predicate_constraint( </del> <ins> let (sp, suggestion) = match ( generics .params .iter() .filter( |p| !matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), ..}), ) .next(), super_traits, ) { (_, None) => predicate_constraint( </ins> generics, trait_ref.without_const().to_predicate(tcx).to_string(), ), <del> Some((ident, bounds)) => match bounds { [.., bound] => ( bound.span().shrink_to_hi(), format!(" + {}", trait_ref.print_only_trait_path().to_string()), ), [] => ( ident.span.shrink_to_hi(), format!(": {}", trait_ref.print_only_trait_path().to_string()), ), }, </del> <ins> (None, Some((ident, []))) => ( ident.span.shrink_to_hi(), format!(": {}", trait_ref.print_only_trait_path().to_string()), ), (_, Some((_, [.., bounds]))) => ( bounds.span().shrink_to_hi(), format!(" + {}", trait_ref.print_only_trait_path().to_string()), ), (Some(_), Some((_, []))) => ( generics.span.shrink_to_hi(), format!(": {}", trait_ref.print_only_trait_path().to_string()), ), </ins> }; err.span_suggestion_verbose(


LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X_$(1)) LLVM_ALL_COMPONENTS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --components) <ins> LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) </ins> endef


///     assert_eq!(v.len(), 42); /// } /// ``` <del> /// should be </del> <ins> /// </ins> /// ```rust <ins> /// // should be </ins> /// fn foo(v: &[i32]) { ///     assert_eq!(v.len(), 42); /// }


<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(conservative_impl_trait)] fn foo() -> impl Copy { foo } fn main() { foo(); } </ins>


LL |     foo::<_, L>([(); L + 1 + L]); |     ^^^^^^^^^^^ <del> error: aborting due to 5 previous errors </del> <ins> error: unconstrained generic constant `{const expr}` --> $DIR/issue_114151.rs:17:5 | LL |     foo::<_, L>([(); L + 1 + L]); |     ^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors </ins> Some errors have detailed explanations: E0107, E0308. For more information about an error, try `rustc --explain E0107`.


target_os = "openbsd", target_arch = "aarch64", no_elf_tls))] <ins> #[doc(hidden)] </ins> mod imp { use prelude::v1::*;


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let mut array = [1, 2, 3]; //~^ ERROR cannot determine a type for this local variable: cannot determine the type of this integ let pie_slice = array.slice(1, 2); } </ins>


// handled below clean::ModuleItem(..) => {} <del> // impls/tymethods have no control over privacy clean::ImplItem(..) | clean::TyMethodItem(..) => {} </del> <ins> // trait impls for private items should be stripped clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: ref for_id, .. }, .. }) => { if !self.exported_items.contains(for_id) { return None; } } clean::ImplItem(..) => {} // tymethods have no control over privacy clean::TyMethodItem(..) => {} </ins> } let fastreturn = match i.inner {


<ins> // Previously, in addition to the real cause of the problem as seen below, // the compiler would tell the user: // // ``` // error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or // predicates // ``` // // With this test, we check that only the relevant error is emitted. trait Foo {} impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope fn main() {} </ins>


<ins> pub trait MyTrait { type Assoc; } pub fn foo<S, T>(_s: S, _t: T) where S: MyTrait, T: MyTrait<Assoc == S::Assoc>, //~^ ERROR: expected one of `,` or `>`, found `==` //~| ERROR: this trait takes 0 generic arguments but 1 generic argument was supplied { } fn main() {} </ins>


let tokens = match *nt { Nonterminal::NtItem(ref item) => prepend_attrs(sess, &item.attrs, nt, item.tokens.as_ref()), Nonterminal::NtBlock(ref block) => convert_tokens(block.tokens.as_ref()), <del> Nonterminal::NtStmt(ref stmt) => prepend_attrs(sess, stmt.attrs(), nt, stmt.tokens()), </del> <ins> Nonterminal::NtStmt(ref stmt) => { let do_prepend = |tokens| prepend_attrs(sess, stmt.attrs(), nt, tokens); if let ast::StmtKind::Empty = stmt.kind { let tokens: TokenStream = tokenstream::TokenTree::token(token::Semi, stmt.span).into(); do_prepend(Some(&LazyTokenStream::new(tokens))) } else { do_prepend(stmt.tokens()) } } </ins> Nonterminal::NtPat(ref pat) => convert_tokens(pat.tokens.as_ref()), Nonterminal::NtTy(ref ty) => convert_tokens(ty.tokens.as_ref()), Nonterminal::NtIdent(ident, is_raw) => {


} bb0: { <del> StorageLive(_2);                 // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_2) = 1;            // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 _1 = ((_2 as Some).0: i32);      // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 StorageDead(_2);                 // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 ((_3 as Some).0: i32) = _1;      // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 </del> <ins> StorageLive(_1);                 // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_1 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_1) = 1;            // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 _2 = ((_1 as Some).0: i32);      // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 StorageDead(_1);                 // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 ((_3 as Some).0: i32) = _2;      // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 </ins> discriminant(_3) = 1;            // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 <del> (_4.0: &i32) = &_1;              // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </del> <ins> (_4.0: &i32) = &_2;              // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL </ins> (_4.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32


// Create generics from the generics specified in the impl head. debug!("convert: ast_generics={:?}", generics); let def_id = ccx.tcx.map.local_def_id(it.id); <del> let ty_generics = ty_generics_for_type_or_impl(ccx, generics); </del> <ins> let ty_generics = ty_generics_for_impl(ccx, generics); </ins> let mut ty_predicates = ty_generic_predicates_for_type_or_impl(ccx, generics); debug!("convert: impl_bounds={:?}", ty_predicates);


<ins> // Test for #78438: ensure underline alignment with many tabs on the left, long line on the right // ignore-tidy-linelength // ignore-tidy-tab fn main() { let money = 42i32; match money { v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT //~^ ERROR variable `v` is not bound in all patterns v => println!("Enough money {}", v), } } </ins>


#[stable(feature = "rust1", since = "1.0.0")] pub use self::mutex::{Mutex, MutexGuard}; #[stable(feature = "rust1", since = "1.0.0")] <ins> #[allow(deprecated)] </ins> pub use self::once::{Once, OnceState, ONCE_INIT}; #[stable(feature = "rust1", since = "1.0.0")] pub use crate::sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult};


let mut lifetime_to_bounds: FxHashMap<_, FxHashSet<_>> = Default::default(); let mut ty_to_traits: FxHashMap<Type, FxHashSet<Path>> = Default::default(); <del> let mut ty_to_fn: FxHashMap<Type, (Option<PolyTrait>, Option<Type>)> = Default::default(); </del> <ins> let mut ty_to_fn: FxHashMap<Type, (PolyTrait, Option<Type>)> = Default::default(); </ins> for p in clean_where_predicates { let (orig_p, p) = (p, p.clean(self.cx));


if let mir::PlaceRef { base: &PlaceBase::Static(box Static { <del> kind: StaticKind::Promoted(promoted, _), </del> <ins> kind: StaticKind::Promoted(promoted, substs), </ins> ty, <del> def_id: _, </del> <ins> def_id, </ins> }), projection: &[], } = place.as_ref() { <del> let c = bx.tcx().const_eval_promoted(self.instance, promoted); </del> <ins> let c = bx.tcx().const_eval_promoted( Instance::new(def_id, self.monomorphize(&substs)), promoted, ); </ins> let (llval, ty) = self.simd_shuffle_indices( &bx, terminator.source_info.span,


use crate::errors::OpaqueHiddenTypeDiag; use crate::infer::{DefiningAnchor, InferCtxt, InferOk}; use crate::traits; <ins> use hir::def::DefKind; </ins> use hir::def_id::{DefId, LocalDefId}; use hir::{HirId, OpaqueTyOrigin}; use rustc_data_structures::sync::Lrc;


<ins> struct RGB { g: f64, b: f64, } fn main() { let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); //~^ ERROR cannot find value `e` in this scope //~| ERROR cannot find value `e` in this scope //~| ERROR mismatched types let _ = RGB { r, g, b }; //~^ ERROR cannot find value `g` in this scope //~| ERROR struct `RGB` has no field named `r` //~| ERROR mismatched types } </ins>


<ins> macro_rules! many_args { ([$($t:tt)*]#$($h:tt)*) => { many_args!{[$($t)*$($t)*]$($h)*} }; ([$($t:tt)*]) => { fn _f($($t: ()),*) {} //~ ERROR function can not have more than 65535 arguments } } many_args!{[_]########## ######} fn main() {} </ins>


} item_mac(ref m) => { // FIXME #2888: we might actually want to do something here. <del> item_mac(copy *m) </del> <ins> // ... okay, we're doing something. It would probably be nicer // to add something to the ast_fold trait, but I'll defer // that work. item_mac(fold_mac_(m,fld)) </ins> } } }


<ins> error: internal compiler error error: internal compiler error encountered ... with incompatible types: left-hand side has type: <IntFactory as Factory<T>>::Item right-hand side has type: usize --> $DIR/select-param-env-instead-of-blanket.rs:42:5 | LL |     let mut x: <IntFactory as Factory<T>>::Item = bar::<T>(); |                                                   ---------- in this inlined function call ... LL |     0usize |     ^^^^^^ | = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:128:36 thread 'rustc' panicked </ins>


} } #[stable(feature = "rust1", since = "1.0.0")] <del> impl Write for File { </del> <ins> impl Write for &File { </ins> fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.inner.write(buf) }


<ins> #![doc(html_logo_url = "https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png")] // Note: this test is paired with logo-class-default.rs. // @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' // @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' // // @has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' // @!has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' '' pub struct SomeStruct; </ins>


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


<del> // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. </del> <ins> // The Computer Language Benchmarks Game // http://benchmarksgame.alioth.debian.org/ </ins> // <del> // 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. </del> <ins> // contributed by the Rust Project Developers // Copyright (c) 2012-2014 The Rust Project Developers // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // - Redistributions of source code must retain the above copyright //   notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright //   notice, this list of conditions and the following disclaimer in //   the documentation and/or other materials provided with the //   distribution. // // - Neither the name of "The Computer Language Benchmarks Game" nor //   the name of "The Computer Language Shootout Benchmarks" nor the //   names of its contributors may be used to endorse or promote //   products derived from this software without specific prior //   written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. </ins> #![feature(phase)] #[phase(plugin)] extern crate green;


} } <ins> // See comments in `interpolated_to_tokenstream` for why we care about // *probably* equal here rather than actual equality // // This is otherwise the same as `eq_unspanned`, only recursing with a // different method. pub fn probably_equal_for_proc_macro(&self, other: &TokenTree) -> bool { match (self, other) { (&TokenTree::Token(_, ref tk), &TokenTree::Token(_, ref tk2)) => { tk.probably_equal_for_proc_macro(tk2) } (&TokenTree::Delimited(_, ref dl), &TokenTree::Delimited(_, ref dl2)) => { dl.delim == dl2.delim && dl.stream().probably_equal_for_proc_macro(&dl2.stream()) } (_, _) => false, } } </ins> /// Retrieve the TokenTree's span. pub fn span(&self) -> Span { match *self {


let mut buf = [0; 2]; self.code_points.next().map(|code_point| { <del> let c = unsafe { char::from_u32_unchecked(code_point.value) }; let n = c.encode_utf16(&mut buf).len(); </del> <ins> let n = char::encode_utf16_raw(code_point.value, &mut buf).len(); </ins> if n == 2 { self.extra = buf[1]; }


#![omit_gdb_pretty_printer_section] <del> // ignore-android: FIXME(#10381) </del> // min-lldb-version: 310 // aux-build:cross_crate_spans.rs


/// If the hash of the input doesn't match or no input is supplied via None, /// it is interpreted as an error and the corresponding enum variant is set. /// The return value signifies whether some kind of source is present. <del> pub fn add_external_src(&self, src: Option<String>) -> bool { </del> <ins> pub fn add_external_src<F>(&self, get_src: F) -> bool where F: FnOnce() -> Option<String> { </ins> if *self.external_src.borrow() == ExternalSource::AbsentOk { <ins> let src = get_src(); </ins> let mut external_src = self.external_src.borrow_mut(); if let Some(src) = src { let mut hasher: StableHasher<u128> = StableHasher::new();


<ins> #![feature(const_generics)] #![allow(incomplete_features)] struct Test(*const usize); type PassArg = (); unsafe extern "C" fn pass(args: PassArg) { println!("Hello, world!"); } impl Test { pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) { //~^ ERROR: using function pointers as const generic parameters is forbidden self.0 = Self::trampiline::<Args, IDX, FN> as _ } unsafe extern "C" fn trampiline< Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args), //~^ ERROR: using function pointers as const generic parameters is forbidden >( args: Args, ) { FN(args) } } fn main() { let x = Test(); x.call_me::<PassArg, 30, pass>() } </ins>


#[stable(feature = "unicode_encode_char", since = "1.15.0")] #[inline] pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { <del> let mut code = self as u32; // SAFETY: each arm checks whether there are enough bits to write into unsafe { if (code & 0xFFFF) == code && !dst.is_empty() { // The BMP falls through (assuming non-surrogate, as it should) *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(), ) } } </del> <ins> encode_utf16_raw(self as u32, dst) </ins> } /// Returns `true` if this `char` has the `Alphabetic` property.


.lifetime_ribs .iter() .rev() <del> .take_while(|rib| !matches!(rib.kind, LifetimeRibKind::Item)) </del> <ins> .take_while(|rib| { !matches!(rib.kind, LifetimeRibKind::Item | LifetimeRibKind::ConstParamTy) }) </ins> .flat_map(|rib| rib.bindings.iter()) .map(|(&ident, &res)| (ident, res)) .filter(|(ident, _)| ident.name != kw::UnderscoreLifetime)


///   both arguments were negative, then it is -0.0. Subtraction `a - b` is ///   regarded as a sum `a + (-b)`. /// <del> /// For more information on floating point numbers, see [Wikipedia][wikipedia]. </del> <ins> /// For more information on floating-point numbers, see [Wikipedia][wikipedia]. </ins> /// /// *[See also the `std::f32::consts` module](crate::f32::consts).* ///


"num_cpus", "ordslice", "racer", <del> "rand 0.6.1", </del> <ins> "rand 0.7.0", </ins> "rayon", "regex", "rls-analysis",


AR_x86_64_pc_solaris=x86_64-pc-solaris2.10-ar  CC_x86_64_pc_solaris=x86_64-pc-solaris2.10-gcc  CXX_x86_64_pc_solaris=x86_64-pc-solaris2.10-g++  <ins> AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar  CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc  CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++  </ins> CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-8  CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-8  AR_x86_64_fortanix_unknown_sgx=ar


<ins> // edition:2018 use std::sync::{Arc, Mutex}; pub async fn f(_: ()) {} pub async fn run() { let x: Arc<Mutex<()>> = unimplemented!(); f(*x.lock().unwrap()).await; } </ins>


E0242, // internal error looking up a definition E0245, // not a trait //  E0246, // invalid recursive type <ins> //  E0247, </ins> //  E0319, // trait impls for defaulted traits allowed just for structs/enums E0320, // recursive overflow during dropck E0328, // cannot implement Unsize explicitly


<ins> #![feature(inherent_associated_types)] #![allow(incomplete_features)] // Check that we don't crash when printing inherent projections in diagnostics. struct Foo<T>(T); impl<'a> Foo<fn(&'a ())> { type Assoc = &'a (); } fn main(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {} //~ ERROR `main` function has wrong type </ins>


{ eprintln!( " <del> Couldn't find required command: ninja You should install ninja, or set `ninja=false` in config.toml in the `[llvm]` section. </del> <ins> Couldn't find required command: ninja (or ninja-build) You should install ninja as described at <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, or set `ninja = false` in the `[llvm]` section of `config.toml`. Alternatively, set `download-ci-llvm = true` in that `[llvm]` section to download LLVM rather than building it. </ins> " ); std::process::exit(1);


} } <ins> let inner = (self.inner)(); </ins> let prev = unsafe { <del> let prev = self.inner.get(); self.inner.set(t as *const T as *mut T); </del> <ins> let prev = inner.get(); inner.set(t as *const T as *mut T); </ins> prev }; <del> let _reset = Reset { key: &self.inner, val: prev }; </del> <ins> let _reset = Reset { key: inner, val: prev }; </ins> cb() }


<ins> error[E0185]: method `example` has a `&self` declaration in the impl, but not in the trait --> $DIR/argument_number_mismatch_ice.rs:8:5 | LL |     fn example(val: ()); |     -------------------- trait method declared without `&self` ... LL |     fn example(&self, input: &i32) { |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl error[E0594]: cannot assign to `*input`, which is behind a `&` reference --> $DIR/argument_number_mismatch_ice.rs:10:9 | LL |         *input = self.0; |         ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written error: aborting due to 2 previous errors Some errors have detailed explanations: E0185, E0594. For more information about an error, try `rustc --explain E0185`. </ins>


<ins> // Doc links in `Trait`'s methods are resolved because it has a local impl. // aux-build:issue-103463-aux.rs extern crate issue_103463_aux; use issue_103463_aux::Trait; pub struct LocalType; impl Trait for LocalType { fn method() {} } fn main() {} </ins>


<ins> pub trait Bar: Super<SuperAssoc: Bound> {} pub trait Super { type SuperAssoc; } pub trait Bound {} </ins>


fn read_le_u16(r: &mut dyn io::Read) -> io::Result<u16> { let mut b = [0; 2]; <del> let mut amt = 0; while amt < b.len() { match r.read(&mut b[amt..])? { 0 => return Err(io::Error::new(io::ErrorKind::Other, "end of file")), n => amt += n, } } </del> <ins> r.read_exact(&mut b)?; </ins> Ok((b[0] as u16) | ((b[1] as u16) << 8)) } <ins> fn read_le_u32(r: &mut dyn io::Read) -> io::Result<u32> { let mut b = [0; 4]; r.read_exact(&mut b)?; Ok((b[0] as u32) | ((b[1] as u32) << 8) | ((b[2] as u32) << 16) | ((b[3] as u32) << 24)) } </ins> fn read_byte(r: &mut dyn io::Read) -> io::Result<u8> { match r.bytes().next() { Some(s) => s,


<ins> // run-rustfix fn main() { for _ in 0..=255 as u8 {} //~ ERROR range endpoint is out of range for _ in 0..=(255 as u8) {} //~ ERROR range endpoint is out of range } </ins>


}, lt_op: |region| { match region { <del> // ignore static regions ty::ReStatic => region, </del> <ins> // Skip static and bound regions: they don't // require substitution. ty::ReStatic | ty::ReLateBound(..) => region, </ins> _ => { trace!("checking {:?}", region); for (subst, p) in opaque_defn.substs.iter().zip(&generics.params) {


// ensure struct variants get warning for their fields enum IJK { <del> I, //~ ERROR variant is never used </del> <ins> I, //~ ERROR variant is never constructed </ins> J { a: String, b: i32, //~ ERROR field is never used c: i32, //~ ERROR field is never used }, <del> K //~ ERROR variant is never used </del> <ins> K //~ ERROR variant is never constructed </ins> }


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


<del> Subproject commit d1ddc34c4b23468f6d2bf553084834b104e16dde </del> <ins> Subproject commit 8b6b5014fdad3a750f7242a6bfdcad83619498d4 </ins>


wShowWindow: 0, cbReserved2: 0, lpReserved2: ptr::null_mut(), <del> hStdInput: c::INVALID_HANDLE_VALUE, hStdOutput: c::INVALID_HANDLE_VALUE, hStdError: c::INVALID_HANDLE_VALUE, </del> <ins> hStdInput: ptr::null_mut(), hStdOutput: ptr::null_mut(), hStdError: ptr::null_mut(), </ins> } }


// The first byte is special, only want bottom 5 bits for width 2, 4 bits // for width 3, and 3 bits for width 4 macro_rules! utf8_first_byte( <del> ($byte:expr, $width:expr) => (($byte & (0x7F >> $width)) as uint) </del> <ins> ($byte:expr, $width:expr) => (($byte & (0x7F >> $width)) as u32) </ins> ) // return the value of $ch updated with continuation byte $byte macro_rules! utf8_acc_cont_byte( <del> ($ch:expr, $byte:expr) => (($ch << 6) | ($byte & 63u8) as uint) </del> <ins> ($ch:expr, $byte:expr) => (($ch << 6) | ($byte & 63u8) as u32) </ins> ) static TAG_CONT_U8: u8 = 128u8; <ins> /// Converts a vector of bytes to a new utf-8 string. /// Any invalid utf-8 sequences are replaced with U+FFFD REPLACEMENT CHARACTER. /// /// # Example /// /// ```rust /// let input = bytes!("Hello ", 0xF0, 0x90, 0x80, "World"); /// let output = std::str::from_utf8_lossy(input); /// assert_eq!(output, ~"Hello uFFFDWorld"); /// ``` pub fn from_utf8_lossy(v: &[u8]) -> ~str { static REPLACEMENT: &'static [u8] = bytes!(0xEF, 0xBF, 0xBD); // U+FFFD in UTF-8 let mut i = 0u; let mut lastgood = 0u; let total = v.len(); fn unsafe_get(xs: &[u8], i: uint) -> u8 { unsafe { *xs.unsafe_ref(i) } } fn safe_get(xs: &[u8], i: uint, total: uint) -> u8 { if i >= total { 0 } else { unsafe_get(xs, i) } } let mut res = with_capacity(total); while i < total { let i_ = i; let byte = unsafe_get(v, i); i += 1; macro_rules! error(() => { unsafe { if lastgood != i_ { raw::push_bytes(&mut res, v.slice(lastgood, i_)); } lastgood = i; raw::push_bytes(&mut res, REPLACEMENT); } }) if byte < 128u8 { // lastgood handles this } else { let w = utf8_char_width(byte); match w { 2 => { if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } 3 => { match (byte, safe_get(v, i, total)) { (0xE0        , 0xA0 .. 0xBF) => (), (0xE1 .. 0xEC, 0x80 .. 0xBF) => (), (0xED        , 0x80 .. 0x9F) => (), (0xEE .. 0xEF, 0x80 .. 0xBF) => (), _ => { error!(); continue; } } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } 4 => { match (byte, safe_get(v, i, total)) { (0xF0        , 0x90 .. 0xBF) => (), (0xF1 .. 0xF3, 0x80 .. 0xBF) => (), (0xF4        , 0x80 .. 0x8F) => (), _ => { error!(); continue; } } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } _ => { error!(); continue; } } } } unsafe { raw::push_bytes(&mut res, v.slice(lastgood, total)) }; res } </ins> /// Unsafe operations pub mod raw { use cast;


debug!("Checking must_not_suspend for {}", ty); match *ty.kind() { <del> ty::Adt(..) if ty.is_box() => { let boxed_ty = ty.boxed_ty(); let descr_pre = &format!("{}boxed ", data.descr_pre); </del> <ins> ty::Adt(_, args) if ty.is_box() => { let boxed_ty = args.type_at(0); let allocator_ty = args.type_at(1); </ins> check_must_not_suspend_ty( tcx, boxed_ty, hir_id, param_env, <del> SuspendCheckData { descr_pre, ..data }, </del> <ins> SuspendCheckData { descr_pre: &format!("{}boxed ", data.descr_pre), ..data }, ) || check_must_not_suspend_ty( tcx, allocator_ty, hir_id, param_env, SuspendCheckData { descr_pre: &format!("{}allocator ", data.descr_pre), ..data }, </ins> ) } ty::Adt(def, _) => check_must_not_suspend_def(tcx, def.did(), hir_id, data),


impl_from!(u32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]); // float -> float <del> impl_from!(f16 => f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")]); impl_from!(f16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]); </del> <ins> // FIXME(f16_f128): adding additional `From` impls for existing types breaks inference. See // <https://github.com/rust-lang/rust/issues/123824> </ins> impl_from!(f16 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]); impl_from!(f32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]); impl_from!(f32 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);


{ let start_len = buf.len(); let mut g = Guard { len: buf.len(), buf }; <del> let ret; </del> loop { if g.len == g.buf.len() { unsafe {


lint_improper_ctypes_char_reason = the `char` type has no C equivalent lint_improper_ctypes_dyn = trait objects have no C equivalent <del> lint_improper_ctypes_enum_phantomdata = this enum contains a PhantomData field </del> lint_improper_ctypes_enum_repr_help = consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum


# riscv targets currently do not need a C compiler, as compiler_builtins # doesn't currently have it enabled, and the riscv gcc compiler is not # installed. <del> ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc  </del> <ins> ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft"  CFLAGS_arm_unknown_linux_musleabi="-march=armv6 -marm"  CFLAGS_arm_unknown_linux_musleabihf="-march=armv6 -marm -mfpu=vfp"  CFLAGS_armv7_unknown_linux_musleabihf="-march=armv7-a"  CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc  </ins> CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc  CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc  CC_mips64_unknown_linux_muslabi64=mips64-linux-gnuabi64-gcc


// option. This file may not be copied, modified, or distributed // except according to those terms. <del> // error-pattern:mismatched types: expected `()`, found `bool` </del> extern crate debug; fn main() { let a = if true { true }; <ins> //~^ ERROR if may be missing an else clause: expected `()`, found `bool` (expected (), found bool) </ins> println!("{:?}", a); }


use rustc_ast as ast; use rustc_ast::expand::allocator::AllocatorKind; use rustc_attr as attr; <del> use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; </del> <ins> use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; </ins> use rustc_data_structures::steal::Steal; use rustc_data_structures::svh::Svh; use rustc_data_structures::sync::Lrc;


<ins> running 1 test test $DIR/test-no_std.rs - f (line 9) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out </ins>


#[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for RangeFull { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { <del> fmt::Debug::fmt("..", fmt) </del> <ins> write!(fmt, "..") </ins> } }


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


/// static START: Once = ONCE_INIT; /// ``` #[stable(feature = "rust1", since = "1.0.0")] <ins> #[rustc_deprecated( since = "1.38.0", reason = "the `new` function is now preferred", suggestion = "Once::new()", )] </ins> pub const ONCE_INIT: Once = Once::new(); // Four states that a Once can be in, encoded into the lower bits of `state` in


// are contravariant while return-position lifetimes are // covariant). _marker: PhantomData<fn(&'a ()) -> &'a ()>, <ins> // Ensure `Context` is `!Send` and `!Sync` in order to allow // for future `!Send` and / or `!Sync` fields. _marker2: PhantomData<*mut ()>, </ins> } impl<'a> Context<'a> {


self.check_pat_walk(&field.pat, field_ty, def_bm, true); } <ins> let mut unmentioned_fields = variant.fields .iter() .map(|field| field.ident.modern()) .filter(|ident| !used_fields.contains_key(&ident)) .collect::<Vec<_>>(); </ins> if inexistent_fields.len() > 0 { let (field_names, t, plural) = if inexistent_fields.len() == 1 { (format!("a field named `{}`", inexistent_fields[0].1), "this", "")


<del> // check-fail // edition:2021 // known-bug: #88908 // This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] use std::future::Future; trait Stream { type Item; } struct Empty<T>(T); impl<T> Stream for Empty<T> { type Item = (); } fn empty<T>() -> Empty<T> { todo!() } 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()} } } fn main() {} </del>


use crate::traits; use rustc_hir as hir; use rustc_hir::lang_items::LangItem; <del> use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; </del> <ins> use rustc_middle::ty::{ self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, }; </ins> use rustc_middle::ty::{GenericArg, GenericArgKind, GenericArgsRef}; use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; use rustc_span::{Span, DUMMY_SP};


<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Regression test for issue #22655: This test should not lead to // infinite recursion. unsafe impl<T: Send + ?Sized> Send for Unique<T> { } pub struct Unique<T:?Sized> { pointer: *const T, } pub struct Node<V> { vals: V, edges: Unique<Node<V>>, } fn is_send<T: Send>() {} fn main() { is_send::<Node<&'static ()>>(); } </ins>


ClosureKind::Coroutine(CoroutineKind::Desugared(_, CoroutineSource::Block)), .. } = move_spans <ins> && can_suggest_clone </ins> { self.suggest_cloning(err, ty, expr, None, Some(move_spans)); <del> } else if self.suggest_hoisting_call_outside_loop(err, expr) { </del> <ins> } else if self.suggest_hoisting_call_outside_loop(err, expr) && can_suggest_clone { </ins> // The place where the type moves would be misleading to suggest clone. // #121466 self.suggest_cloning(err, ty, expr, None, Some(move_spans));


} fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usize> { <ins> debug_assert!(!utf8.is_empty()); </ins> let mut utf16 = [MaybeUninit::<u16>::uninit(); MAX_BUFFER_SIZE / 2]; <del> let mut len_utf16 = 0; for (chr, dest) in utf8.encode_utf16().zip(utf16.iter_mut()) { *dest = MaybeUninit::new(chr); len_utf16 += 1; } // Safety: We've initialized `len_utf16` values. let utf16: &[u16] = unsafe { MaybeUninit::slice_assume_init_ref(&utf16[..len_utf16]) }; </del> <ins> let utf8 = &utf8[..utf8.floor_char_boundary(utf16.len())]; let utf16: &[u16] = unsafe { // Note that this theoretically checks validity twice in the (most common) case // where the underlying byte sequence is valid utf-8 (given the check in `write()`). let result = c::MultiByteToWideChar( c::CP_UTF8,                      // CodePage c::MB_ERR_INVALID_CHARS,         // dwFlags utf8.as_ptr() as c::LPCCH,       // lpMultiByteStr utf8.len() as c::c_int,          // cbMultiByte utf16.as_mut_ptr() as c::LPWSTR, // lpWideCharStr utf16.len() as c::c_int,         // cchWideChar ); assert!(result != 0, "Unexpected error in MultiByteToWideChar"); // Safety: MultiByteToWideChar initializes `result` values. MaybeUninit::slice_assume_init_ref(&utf16[..result as usize]) }; </ins> let mut written = write_u16s(handle, &utf16)?;


<ins> trait Trait<Type> { type Type; fn one(&self, val:  impl Trait<Type: Default>); //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied fn two<T: Trait<Type: Default>>(&self) -> T; //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied fn three<T>(&self) -> T where T: Trait<Type: Default>,; //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied } fn main() {} </ins>


/// /// [`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) { // FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions. let mut i = 0;


<ins> fn main() { super(); //~ ERROR failed to resolve: there are too many leading `super` keywords } </ins>


safety: Safety::Safe, }), }); <del> let source_info = SourceInfo { span, scope: OUTERMOST_SOURCE_SCOPE }; // Some MIR passes will expect the number of parameters to match the // function declaration. for _ in 0..num_params { local_decls.push(LocalDecl::with_source_info(ty, source_info)); } </del> cfg.terminate(START_BLOCK, source_info, TerminatorKind::Unreachable); let mut body = Body::new( <del> MirSource::item(def.to_def_id()), </del> <ins> MirSource::item(def_id.to_def_id()), </ins> cfg.basic_blocks, source_scopes, local_decls, IndexVec::new(), <del> num_params, </del> <ins> inputs.len(), </ins> vec![], span, coroutine_kind, <del> Some(err), </del> <ins> Some(guar), </ins> ); <del> body.coroutine.as_mut().map(|gen| gen.yield_ty = Some(ty)); </del> <ins> body.coroutine.as_mut().map(|gen| gen.yield_ty = yield_ty); </ins> body }


Ok(amount as usize) } <del> #[allow(unused)] </del> fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { <del> let mut written = 0; for chr in char::decode_utf16(utf16.iter().cloned()) { match chr { Ok(chr) => { chr.encode_utf8(&mut utf8[written..]); written += chr.len_utf8(); } Err(_) => { // We can't really do any better than forget all data and return an error. return Err(io::const_io_error!( io::ErrorKind::InvalidData, "Windows stdin in console mode does not support non-UTF-16 input;  encountered unpaired surrogate", )); } } </del> <ins> debug_assert!(utf16.len() <= c::c_int::MAX as usize); debug_assert!(utf8.len() <= c::c_int::MAX as usize); let result = unsafe { c::WideCharToMultiByte( c::CP_UTF8,                    // CodePage c::WC_ERR_INVALID_CHARS,       // dwFlags utf16.as_ptr(),                // lpWideCharStr utf16.len() as c::c_int,       // cchWideChar utf8.as_mut_ptr() as c::LPSTR, // lpMultiByteStr utf8.len() as c::c_int,        // cbMultiByte ptr::null(),                   // lpDefaultChar ptr::null_mut(),               // lpUsedDefaultChar ) }; if result == 0 { // We can't really do any better than forget all data and return an error. Err(io::const_io_error!( io::ErrorKind::InvalidData, "Windows stdin in console mode does not support non-UTF-16 input;  encountered unpaired surrogate", )) } else { Ok(result as usize) </ins> } <del> Ok(written) </del> } impl IncompleteUtf8 {


<ins> error: expected one of `!` or `::`, found `<eof>` --> $DIR/test-compile-fail2.rs:3:1 | 3 | fail | ^^^^ expected one of `!` or `::` error: aborting due to previous error </ins>


assert_eq!(nread, 1); assert_eq!(buf[0], 99); } <del> Err(..) => fail!() </del> <ins> Err(..) => fail!(), </ins> } } Err(..) => fail!()


false } } <ins> fn ignore_llvm(config: &Config, line: &str) -> bool { if let Some(ref actual_version) = config.llvm_version { if line.contains("min-llvm-version") { let min_version = line.trim() .split(' ') .last() .expect("Malformed llvm version directive"); // Ignore if actual version is smaller the minimum required // version &actual_version[..] < min_version } else { false } } else { false } } </ins> } }


// resolve Self::Foo, at the moment we can't resolve the former because // we don't have the trait information around, which is just sad. <del> if !base_segments.is_empty() { let id_node = tcx.map.as_local_node_id(id).unwrap(); span_err!(tcx.sess, span, E0247, "found module name used as a type: {}", tcx.map.node_to_user_string(id_node)); return this.tcx().types.err; } </del> <ins> assert!(base_segments.is_empty()); </ins> opt_self_ty.expect("missing T in <T>::a::b::c") }


use back::svh::Svh; use session::{config, Session}; use session::search_paths::PathKind; <ins> use metadata::common::rustc_version; </ins> use metadata::cstore; use metadata::cstore::{CStore, CrateSource, MetadataBlob}; use metadata::decoder;


curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz |  tar xzf - --strip-components=1 <del> yum install -y patch patch -Np1 < ../llvm-project-centos.patch </del> mkdir clang-build cd clang-build


/// # } /// ``` #[stable(feature = "rust1", since = "1.0.0")] <ins> #[inline] </ins> pub fn from_raw_os_error(code: i32) -> Error { Error { repr: Repr::Os(code) } }


LitKind::Int(_, LitIntType::Unsuffixed) => "", _ => bug!(), }; <del> cx.emit_spanned_lint( OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { ty, suggestion: struct_expr.span, </del> <ins> let sub_sugg = if expr.span.lo() == lit_span.lo() { let Ok(start) = cx.sess().source_map().span_to_snippet(eps[0].span) else { return false }; UseInclusiveRange::WithoutParen { sugg: struct_expr.span.shrink_to_lo().to(lit_span.shrink_to_hi()), </ins> start, literal: lit_val - 1, suffix, <del> }, </del> <ins> } } else { UseInclusiveRange::WithParen { eq_sugg: expr.span.shrink_to_lo(), lit_sugg: lit_span, literal: lit_val - 1, suffix, } }; cx.emit_spanned_lint( OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { ty, sub: sub_sugg }, </ins> ); // We've just emitted a lint, special cased for `(...)..MAX+1` ranges,


std::env::set_var("RUST_BACKTRACE", "full"); } <del> panic::set_hook(Box::new(move |info| { // If the error was caused by a broken pipe then this is not a bug. // Write the error and return immediately. See #98700. #[cfg(windows)] if let Some(msg) = info.payload().downcast_ref::<String>() { if msg.starts_with("failed printing to stdout: ") && msg.ends_with("(os error 232)") { // the error code is already going to be reported when the panic unwinds up the stack let handler = EarlyErrorHandler::new(ErrorOutputType::default()); let _ = handler.early_error_no_abort(msg.clone()); return; } }; // Invoke the default handler, which prints the actual panic message and optionally a backtrace // Don't do this for delayed bugs, which already emit their own more useful backtrace. if !info.payload().is::<rustc_errors::DelayedBugPanic>() { std::panic_hook_with_disk_dump(info, ice_path().as_deref()); </del> <ins> panic::update_hook(Box::new( move |default_hook: &(dyn Fn(&PanicInfo<'_>) + Send + Sync + 'static), info: &PanicInfo<'_>| { // If the error was caused by a broken pipe then this is not a bug. // Write the error and return immediately. See #98700. #[cfg(windows)] if let Some(msg) = info.payload().downcast_ref::<String>() { if msg.starts_with("failed printing to stdout: ") && msg.ends_with("(os error 232)") { // the error code is already going to be reported when the panic unwinds up the stack let handler = EarlyErrorHandler::new(ErrorOutputType::default()); let _ = handler.early_error_no_abort(msg.clone()); return; } }; </ins> <del> // Separate the output with an empty line eprintln!(); } </del> <ins> // Invoke the default handler, which prints the actual panic message and optionally a backtrace // Don't do this for delayed bugs, which already emit their own more useful backtrace. if !info.payload().is::<rustc_errors::DelayedBugPanic>() { default_hook(info); // Separate the output with an empty line eprintln!(); if let Some(ice_path) = ice_path() && let Ok(mut out) = File::options().create(true).append(true).open(&ice_path) { // The current implementation always returns `Some`. let location = info.location().unwrap(); let msg = match info.payload().downcast_ref::<&'static str>() { Some(s) => *s, None => match info.payload().downcast_ref::<String>() { Some(s) => &s[..], None => "Box<dyn Any>", }, }; let thread = std::thread::current(); let name = thread.name().unwrap_or("<unnamed>"); let _ = write!( &mut out, "thread '{name}' panicked at {location}:n {msg}n stack backtrace:n {:#}", std::backtrace::Backtrace::force_capture() ); } } </ins> <del> // Print the ICE message report_ice(info, bug_report_url, extra_info); })); </del> <ins> // Print the ICE message report_ice(info, bug_report_url, extra_info); }, )); </ins> } /// Prints the ICE message, including query stack, but without backtrace.


match expr.kind { hir::ExprKind::Index(ref base_expr, ref index_expr) => { <del> let index_expr_ty = self.node_ty(index_expr.hir_id); </del> <ins> // We need to get the final type in case dereferences were needed for the trait // to apply (#72002). let index_expr_ty = self.tables.borrow().expr_ty_adjusted(index_expr); </ins> self.convert_place_op_to_mutable( PlaceOp::Index, expr,


/// /// # 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_add((y as usize) - (x 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 [`add`], this method basically delays the requirement of staying within the /// same allocated object: [`add`] is immediate Undefined Behavior when crossing object /// boundaries; `wrapping_add` 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. [`add`] /// can be optimized better and is thus preferable in performance-sensitive code. </ins> /// <del> /// Compared to [`add`], this method basically delays the requirement of staying /// within the same allocated object: [`add`] is immediate Undefined Behavior when /// crossing object boundaries; `wrapping_add` produces a pointer but still leads /// to Undefined Behavior if that pointer is dereferenced. [`add`] 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.


if trait_.def_id() == tcx.lang_items().deref_trait() { super::build_deref_target_impls(cx, &trait_items, ret); } <ins> // Return if the trait itself or any types of the generic parameters are doc(hidden). let mut stack: Vec<&Type> = trait_.iter().collect(); stack.push(&for_); while let Some(ty) = stack.pop() { if let Some(did) = ty.def_id() { if cx.tcx.get_attrs(did).lists(sym::doc).has_word(sym::hidden) { return; } } if let Some(generics) = ty.generics() { stack.extend(generics); } } </ins> if let Some(trait_did) = trait_.def_id() { record_extern_trait(cx, trait_did); }


}, }; let mut prev = eraser.fold_ty(ty); <del> let mut prev_span = None; </del> <ins> let mut prev_span: Option<Span> = None; </ins> for binding in expr_finder.uses { // In every expression where the binding is referenced, we will look at that


sp } fn ensure_filemap_source_present(&self, file_map: Rc<FileMap>) -> bool { <del> let src = self.file_loader.read_file(Path::new(&file_map.name)).ok(); return file_map.add_external_src(src) </del> <ins> file_map.add_external_src( || self.file_loader.read_file(Path::new(&file_map.name)).ok() ) </ins> } }


<ins> error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/unstable-const-fn-in-libcore.rs:24:26 | LL |             Opt::None => f(), |                          ^^^ error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/unstable-const-fn-in-libcore.rs:19:53 | LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { |                                                     ^ constant functions cannot evaluate destructors error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/unstable-const-fn-in-libcore.rs:19:47 | LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { |                                               ^^^^ constant functions cannot evaluate destructors error: aborting due to 3 previous errors Some errors have detailed explanations: E0015, E0493. For more information about an error, try `rustc --explain E0015`. </ins>


return noop_visit_attribute(at, self); } <del> let filename = self.cx.resolve_path(&*file.as_str(), it.span()); </del> <ins> let filename = match self.cx.resolve_path(&*file.as_str(), it.span()) { Ok(filename) => filename, Err(mut err) => { err.emit(); continue; } }; </ins> match self.cx.source_map().load_file(&filename) { Ok(source_file) => { let src = source_file.src.as_ref()


14 |     println!("Hello, World!"); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ | <del> = note: expands to `println! { "Hello, World!" }` = note: expands to `print! { concat ! ( "Hello, World!" , "/n" ) }` </del> <ins> = note: expanding `println! { "Hello, World!" }` = note: to `print ! ( concat ! ( "Hello, World!" , "/n" ) )` = note: expanding `print! { concat ! ( "Hello, World!" , "/n" ) }` = note: to `$crate :: io :: _print ( format_args ! ( concat ! ( "Hello, World!" , "/n" ) ) )` </ins>


ulimit -c unlimited fi <ins> # There was a bad interaction between "old" 32-bit binaries on current 64-bit # kernels with selinux enabled, where ASLR mmap would sometimes choose a low # address and then block it for being below `vm.mmap_min_addr` -> `EACCES`. # This is probably a kernel bug, but setting `ulimit -Hs` works around it. # See also `dist-i686-linux` where this setting is enabled. if [ "$SET_HARD_RLIMIT_STACK" = "1" ]; then rlimit_stack=$(ulimit -Ss) if [ "$rlimit_stack" != "" ]; then ulimit -Hs "$rlimit_stack" fi fi </ins> ci_dir=`cd $(dirname $0) && pwd` source "$ci_dir/shared.sh"


checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] <ins> name = "semver" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] </ins> name = "serde" version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index"


<ins> error[E0026]: variant `A::A` does not have a field named `fob` --> $DIR/issue-52717.rs:19:12 | LL |     A::A { fob } => { println!("{}", fob); } |            ^^^ |            | |            variant `A::A` does not have this field |            help: did you mean: `foo` error: aborting due to previous error For more information about this error, try `rustc --explain E0026`. </ins>


} }; <del> let yielded = opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span)); </del> if is_async_gen { // `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`. // This ensures that we store our resumed `ResumeContext` correctly, and also that


ty::Dynamic(ref data, ..) if data.principal_def_id().is_some() => { self.check_def_id(item, data.principal_def_id().unwrap()); } <ins> ty::Dynamic(..) => { struct_span_err!( self.tcx.sess, ty.span, E0785, "cannot define inherent `impl` for a dyn auto trait" ) .span_label(ty.span, "impl requires at least one non-auto trait") .note("define and implement a new trait or type instead") .emit(); } </ins> ty::Bool => { self.check_primitive_impl( item.def_id,


Some((destination, success)) }, from_hir_call, <del> fn_span </del> <ins> fn_span, </ins> }, ); success.unit()


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


} } <ins> fn int_ty_bits(int_ty: ast::IntTy) -> u64 { match int_ty { ast::TyI =>    int::BITS as u64, ast::TyI8 =>   i8::BITS  as u64, ast::TyI16 =>  i16::BITS as u64, ast::TyI32 =>  i32::BITS as u64, ast::TyI64 =>  i64::BITS as u64 } } fn uint_ty_bits(uint_ty: ast::UintTy) -> u64 { match uint_ty { ast::TyU =>    uint::BITS as u64, ast::TyU8 =>   u8::BITS  as u64, ast::TyU16 =>  u16::BITS as u64, ast::TyU32 =>  u32::BITS as u64, ast::TyU64 =>  u64::BITS as u64 } } </ins> fn check_limits(tcx: &ty::ctxt, binop: ast::BinOp, l: &ast::Expr, r: &ast::Expr) -> bool { let (lit, expr, swap) = match (&l.node, &r.node) {


/// # Example /// /// ```rust <ins> /// # #![allow(deprecated)] </ins> /// let query = vec![("title".to_string(), "The Village".to_string()), ///                  ("north".to_string(), "52.91".to_string()), ///                  ("west".to_string(), "4.10".to_string())];


synth_provided, } } else { <del> let num_missing_args = expected_max - provided; </del> <ins> // Check if associated type bounds are incorrectly written in impl block header like: // ``` // trait Foo<T> {} // impl Foo<T: Default> for u8 {} // ``` let parent_is_impl_block = cx .tcx() .hir() .parent_owner_iter(seg.hir_id) .next() .is_some_and(|(_, owner_node)| owner_node.is_impl_block()); if parent_is_impl_block { let constraint_names: Vec<_> = gen_args.constraints.iter().map(|b| b.ident.name).collect(); let param_names: Vec<_> = gen_params .own_params .iter() .filter(|param| !has_self || param.index != 0) // Assumes `Self` will always be the first parameter .map(|param| param.name) .collect(); if constraint_names == param_names { // We set this to true and delay emitting `WrongNumberOfGenericArgs` // to provide a succinct error for cases like issue #113073 all_params_are_binded = true; }; } </ins> <del> let constraint_names: Vec<_> = gen_args.constraints.iter().map(|b| b.ident.name).collect(); let param_names: Vec<_> = gen_params .own_params .iter() .filter(|param| !has_self || param.index != 0) // Assumes `Self` will always be the first parameter .map(|param| param.name) .collect(); if constraint_names == param_names { // We set this to true and delay emitting `WrongNumberOfGenericArgs` // to provide a succinct error for cases like issue #113073 all_params_are_binded = true; }; </del> <ins> let num_missing_args = expected_max - provided; </ins> GenericArgsInfo::MissingTypesOrConsts { num_missing_args,


//@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::needless_arbitrary_self_type)]


<ins> error[E0308]: mismatched types --> $DIR/issue-117669.rs:2:20 | LL |     let abs: i32 = 3i32.checked_abs(); |              ---   ^^^^^^^^^^^^^^^^^^ expected `i32`, found `Option<i32>` |              | |              expected due to this | = note: expected type `i32` found enum `Option<i32>` help: consider using `Option::expect` to unwrap the `Option<i32>` value, panicking if the value is an `Option::None` | LL |     let abs: i32 = 3i32.checked_abs().expect("REASON"); |                                      +++++++++++++++++ error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>


/// # Examples /// /// ```no_run <del> /// # #![feature(bufreader_buffer)] </del> /// use std::io::{BufReader, BufRead}; /// use std::fs::File; ///


traits::RepeatVec => { tcx.sess.span_note( obligation.cause.span, <del> format!( "the `Copy` trait is required because the  repeated element will be copied").as_slice()); </del> <ins> "the `Copy` trait is required because the  repeated element will be copied"); </ins> } traits::VariableType(_) => { tcx.sess.span_note( obligation.cause.span, "all local variables must have a statically known size"); } <ins> traits::ReturnType => { tcx.sess.span_note( obligation.cause.span, "the return type of a function must have a  statically known size"); } </ins> traits::AssignmentLhsSized => { tcx.sess.span_note( obligation.cause.span,


let f1: f32 = FromStrRadix::from_str_radix("1p-123", 16).unwrap(); let f2: f32 = FromStrRadix::from_str_radix("1p-111", 16).unwrap(); let f3: f32 = FromStrRadix::from_str_radix("1.Cp-12", 16).unwrap(); <del> assert_eq!(Float::ldexp(1f32, -123), f1); assert_eq!(Float::ldexp(1f32, -111), f2); </del> <ins> assert_eq!(1f32.ldexp(-123), f1); assert_eq!(1f32.ldexp(-111), f2); </ins> assert_eq!(Float::ldexp(1.75f32, -12), f3); assert_eq!(Float::ldexp(0f32, -123), 0f32);


<ins> error: an inner attribute is not permitted in this context --> $DIR/issue-89971-outer-attr-following-inner-attr-ice.rs:11:1 | LL | #![deny(missing_docs)] | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | struct Mew(); | ------------- the inner attribute doesn't annotate this struct | = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files help: to annotate the struct, change the attribute from inner to outer style | LL - #![deny(missing_docs)] LL + #[deny(missing_docs)] | error: aborting due to previous error </ins>


<ins> // run-rustfix // Regression test for changes introduced while fixing #54505 // This test uses non-literals for Ranges // (expecting no parens with borrow suggestion) use std::ops::RangeBounds; // take a reference to any built-in range fn take_range(_r: &impl RangeBounds<i8>) {} fn main() { take_range(&std::ops::Range { start: 0, end: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::Range { start: 0, end: 1 } take_range(&::std::ops::Range { start: 0, end: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::Range { start: 0, end: 1 } take_range(&std::ops::RangeFrom { start: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeFrom { start: 1 } take_range(&::std::ops::RangeFrom { start: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeFrom { start: 1 } take_range(&std::ops::RangeFull {}); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeFull {} take_range(&::std::ops::RangeFull {}); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeFull {} take_range(&std::ops::RangeInclusive::new(0, 1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeInclusive::new(0, 1) take_range(&::std::ops::RangeInclusive::new(0, 1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeInclusive::new(0, 1) take_range(&std::ops::RangeTo { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeTo { end: 5 } take_range(&::std::ops::RangeTo { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeTo { end: 5 } take_range(&std::ops::RangeToInclusive { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeToInclusive { end: 5 } take_range(&::std::ops::RangeToInclusive { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeToInclusive { end: 5 } } </ins>


<ins> error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:4:30 | LL |     fn one(&self, val:  impl Trait<Type: Default>); |                              ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait<Type> { |       ^^^^^ ---- help: add missing generic argument | LL |     fn one(&self, val:  impl Trait<Type, Type: Default>); |                                    +++++ error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:7:15 | LL |     fn two<T: Trait<Type: Default>>(&self) -> T; |               ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait<Type> { |       ^^^^^ ---- help: add missing generic argument | LL |     fn two<T: Trait<Type, Type: Default>>(&self) -> T; |                     +++++ error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:11:12 | LL |         T: Trait<Type: Default>,; |            ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait<Type> { |       ^^^^^ ---- help: add missing generic argument | LL |         T: Trait<Type, Type: Default>,; |                  +++++ error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0107`. </ins>


.emit(); } EscapeError::MoreThanOneChar => { <ins> let msg = if mode.is_bytes() { "if you meant to write a byte string literal, use double quotes" } else { "if you meant to write a `str` literal, use double quotes" }; </ins> handler .struct_span_err( span_with_quotes,


#[stable(feature = "ip_u32", since = "1.1.0")] impl From<Ipv4Addr> for u32 { <ins> /// It performs the conversion in network order (big-endian). </ins> fn from(ip: Ipv4Addr) -> u32 { let ip = ip.octets(); ((ip[0] as u32) << 24) + ((ip[1] as u32) << 16) + ((ip[2] as u32) << 8) + (ip[3] as u32)


// it.  We do not write to `self` nor reborrow to a mutable reference. // Hence the raw pointer we created above, for `deque`, remains valid. let ring = self.buffer_as_slice(); <del> let iter = Iter::new(ring, drain_tail, drain_head); Drain::new(drain_head, head, iter, deque) </del> <ins> Drain::new(drain_head, head, ring, drain_tail, drain_head, deque) </ins> } }


.map(|v| v.parse().expect("failed to parse rust.llvm-libunwind")); if let Some(ref backends) = rust.codegen_backends { <del> config.rust_codegen_backends = backends.iter().map(|s| INTERNER.intern_str(s)).collect(); </del> <ins> let available_backends = vec!["llvm", "cranelift", "gcc"]; config.rust_codegen_backends = backends.iter().map(|s| { if let Some(backend) = s.strip_prefix(CODEGEN_BACKEND_PREFIX) { if available_backends.contains(&backend) { panic!("Invalid value '{s}' for 'rust.codegen-backends'. Instead, please use '{backend}'."); } else { println!("help: '{s}' for 'rust.codegen-backends' might fail.  Codegen backends are mostly defined without the '{CODEGEN_BACKEND_PREFIX}' prefix.  In this case, it would be referred to as '{backend}'."); } } INTERNER.intern_str(s) }).collect(); </ins> } config.rust_codegen_units = rust.codegen_units.map(threads_from_config);


[[package]] name = "backtrace" <del> version = "0.3.25" </del> <ins> version = "0.3.29" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",


// Private support modules mod panicking; <del> #[unstable(feature = "ice_to_disk", issue = "none")] pub use panicking::panic_hook_with_disk_dump; </del> #[path = "../../backtrace/src/lib.rs"] #[allow(dead_code, unused_attributes, fuzzy_provenance_casts)] mod backtrace_rs;


b, index: 0, // unused len: 0,   // unused <ins> a_len: 0, // unused </ins> } }


let codegen_options = CodegenOptions::build(early_dcx, matches); let unstable_opts = UnstableOptions::build(early_dcx, matches); <del> let force_unstable_if_unmarked = unstable_opts.force_unstable_if_unmarked; </del> let dcx = new_dcx(error_format, None, diagnostic_width, &unstable_opts);


// This zip may have several times the same lifetime in `substs` paired with a different // lifetime from `id_substs`.  Simply `collect`ing the iterator is the correct behaviour: // it will pick the last one, which is the one we introduced in the impl-trait desugaring. <del> let map = substs.iter().zip(id_substs); let map: FxHashMap<GenericArg<'tcx>, GenericArg<'tcx>> = match origin { // HACK: The HIR lowering for async fn does not generate // any `+ Captures<'x>` bounds for the `impl Future<...>`, so all async fns with lifetimes // would now fail to compile. We should probably just make hir lowering fill this in properly. OpaqueTyOrigin::AsyncFn(_) => map.collect(), OpaqueTyOrigin::FnReturn(_) | OpaqueTyOrigin::TyAlias => { // Opaque types may only use regions that are bound. So for // ```rust // type Foo<'a, 'b, 'c> = impl Trait<'a> + 'b; // ``` // we may not use `'c` in the hidden type. let variances = tcx.variances_of(def_id); debug!(?variances); map.filter(|(_, v)| { let ty::GenericArgKind::Lifetime(lt) = v.unpack() else { return true }; let ty::ReEarlyBound(ebr) = lt.kind() else { bug!() }; variances[ebr.index as usize] == ty::Variance::Invariant }) .collect() } }; </del> <ins> let map = substs.iter().zip(id_substs).collect(); </ins> debug!("map = {:#?}", map); // Convert the type from the function into a type valid outside


} #[test] <ins> fn test_line_buffer_fail_flush() { // Issue #32085 struct FailFlushWriter<'a>(&'a mut Vec<u8>); impl<'a> Write for FailFlushWriter<'a> { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.0.extend_from_slice(buf); Ok(buf.len()) } fn flush(&mut self) -> io::Result<()> { Err(io::Error::new(io::ErrorKind::Other, "flush failed")) } } let mut buf = Vec::new(); { let mut writer = LineWriter::new(FailFlushWriter(&mut buf)); let to_write = b"abcndef"; if let Ok(written) = writer.write(to_write) { assert!(written < to_write.len(), "didn't flush on new line"); // PASS return; } } assert!(buf.is_empty(), "write returned an error but wrote data"); } #[test] </ins> fn test_line_buffer() { let mut writer = LineWriter::new(Vec::new()); writer.write(&[0]).unwrap();


} #[test] <ins> #[allow(deprecated)] </ins> fn stream_smoke_test_ip4() { let server_ip = next_test_ip4(); let client_ip = next_test_ip4(); <ins> let dummy_ip = next_test_ip4(); </ins> let (tx1, rx1) = channel(); let (tx2, rx2) = channel(); spawn(proc() { <del> match UdpSocket::bind(client_ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); rx1.recv(); stream.write([99]).unwrap(); </del> <ins> let send_as = |ip, val: &[u8]| { match UdpSocket::bind(ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); stream.write(val).unwrap(); } Err(..) => fail!() </ins> } <del> Err(..) => fail!() } </del> <ins> }; rx1.recv(); send_as(dummy_ip, [98]); send_as(client_ip, [99]); </ins> tx2.send(()); });


} } <ins> // This is only used by a test which asserts that the initialization-tracking is correct. #[cfg(test)] impl<R> BufReader<R> { pub fn initialized(&self) -> usize { self.buf.initialized() } } </ins> impl<R: Seek> BufReader<R> { /// Seeks relative to the current position. If the new position lies within the buffer, /// the buffer will not be flushed, allowing for more efficient seeks.


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


/// consolidate multiple unresolved import errors into a single diagnostic. fn finalize_import(&mut self, import: &'b Import<'b>) -> Option<UnresolvedImportError> { let orig_vis = import.vis.replace(ty::Visibility::Invisible); <del> let orig_unusable_binding = match &import.kind { ImportKind::Single { target_bindings, .. } => { Some(mem::replace(&mut self.r.unusable_binding, target_bindings[TypeNS].get())) } _ => None, }; </del> let prev_ambiguity_errors_len = self.r.ambiguity_errors.len(); let path_res = self.r.resolve_path( &import.module_path,


<ins> #![allow(unused)] </ins> fn main() { <del> let arr = &[0,1,2,3]; for _i in 0..arr.len().rev() { //~ERROR not an iterator // The above error used to say “the method `rev` exists for type `usize`”. // This regression test ensures it doesn't say that any more. } </del> <ins> let arr = &[0, 1, 2, 3]; for _i in 0..arr.len().rev() { //~^ ERROR can't call method //~| surround the range in parentheses // The above error used to say “the method `rev` exists for type `usize`”. // This regression test ensures it doesn't say that any more. } // Test for #102396 for i in 1..11.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } let end: usize = 10; for i in 1..end.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } for i in 1..(end + 1).rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } if 1..(end + 1).is_empty() { //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses } if 1..(end + 1).is_sorted() { //~^ ERROR mismatched types [E0308] //~| ERROR can't call method //~| HELP surround the range in parentheses } let _res: i32 = 3..6.take(2).sum(); //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses let _sum: i32 = 3..6.sum(); //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses let a = 1 as usize; let b = 10 as usize; for _a in a..=b.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } let _res = ..10.contains(3); //~^ ERROR can't call method //~| HELP surround the range in parentheses if 1..end.error_method() { //~^ ERROR no method named `error_method` //~| ERROR mismatched types [E0308] // Won't suggest } let _res = b.take(1)..a; //~^ ERROR `usize` is not an iterator let _res: i32 = ..6.take(2).sum(); //~^ can't call method `take` on ambiguous numeric type //~| ERROR mismatched types [E0308] //~| HELP you must specify a concrete type for this numeric value // Won't suggest because `RangeTo` dest not implemented `take` </ins> }


crate emit: Vec<EmitType>, /// If `true`, HTML source pages will generate links for items to their definition. crate generate_link_to_definition: bool, <ins> /// Set of function-call locations to include as examples </ins> crate call_locations: AllCallLocations, <ins> /// If `true`, Context::init will not emit shared files. crate no_emit_shared: bool, </ins> } #[derive(Copy, Clone, Debug, PartialEq, Eq)]


<ins> // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #77650 fn c<T, const N: std::num::NonZeroUsize>() where [T; N.get()]: Sized, { use std::convert::TryFrom; <[T; N.get()]>::try_from(()) //~^ error: the trait bound //~^^ error: mismatched types } fn main() {} </ins>


use polonius_engine::Atom; pub use rustc_ast::ast::Mutability; <del> use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; </del> use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::dominators::{dominators, Dominators}; use rustc_data_structures::graph::{self, GraphSuccessors};


pub enum TrailingToken { None, Semi, <ins> Gt, </ins> /// If the trailing token is a comma, then capture it /// Otherwise, ignore the trailing token MaybeComma,


/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to: /// /// ```rust <del> /// #![feature(generic_assert_internals)] </del> /// let elem = 1; /// { ///   #[allow(unused_imports)]


"only the last field of a struct or enum variant  may have a dynamically sized type") } <ins> traits::ObjectSized => { span_note!(tcx.sess, obligation.cause.span, "only sized types can be made into objects"); } </ins> } }


<ins> error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:14:1 | LL | impl !Marker1 for dyn Object + Marker2 { }   //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:16:1 | LL | impl !Marker2 for dyn Object + Marker2 { }   //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` error[E0117]: only traits defined in the current crate can be implemented for arbitrary types --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:22:1 | LL | impl !Send for dyn Marker2 {} //~ ERROR E0117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate | = note: the impl does not reference only types defined in this crate = note: define and implement a trait or new type instead error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:26:1 | LL | impl !Send for dyn Object {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:27:1 | LL | impl !Send for dyn Object + Marker2 {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error: aborting due to 5 previous errors Some errors occurred: E0117, E0321, E0371. For more information about an error, try `rustc --explain E0117`. </ins>


let prefix = default_path(&builder.config.prefix, "/usr/local"); let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc")); <ins> let destdir_env = env::var_os("DESTDIR").map(PathBuf::from); </ins> <del> // Sanity check for the user write access on prefix and sysconfdir assert!( is_dir_writable_for_user(&prefix), "User doesn't have write access on `install.prefix` path in the `config.toml`.", ); assert!( is_dir_writable_for_user(&sysconfdir), "User doesn't have write access on `install.sysconfdir` path in `config.toml`." ); </del> <ins> // Sanity checks on the write access of user. // // When the `DESTDIR` environment variable is present, there is no point to // check write access for `prefix` and `sysconfdir` individually, as they // are combined with the path from the `DESTDIR` environment variable. In // this case, we only need to check the `DESTDIR` path, disregarding the // `prefix` and `sysconfdir` paths. if let Some(destdir) = &destdir_env { assert!(is_dir_writable_for_user(destdir), "User doesn't have write access on DESTDIR."); } else { assert!( is_dir_writable_for_user(&prefix), "User doesn't have write access on `install.prefix` path in the `config.toml`.", ); assert!( is_dir_writable_for_user(&sysconfdir), "User doesn't have write access on `install.sysconfdir` path in `config.toml`." ); } </ins> let datadir = prefix.join(default_path(&builder.config.datadir, "share")); let docdir = prefix.join(default_path(&builder.config.docdir, "share/doc/rust"));


issued_borrow.borrowed_place, &issued_spans, ); <ins> self.explain_iterator_advancement_in_for_loop_if_applicable( &mut err, span, &issued_spans, ); </ins> err }


<ins> // This test certify that we can mix attribute macros from Rust and external proc-macros. // For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(SmartPointer)]` uses // `#[pointee]`. // The scoping rule should allow the use of the said two attributes when external proc-macros // are in scope. //@ check-pass //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] #[macro_use] extern crate another_proc_macro; #[pointee] fn f() {} #[default] fn g() {} </ins>


/// This function should maybe change to /// `new_const<const MSG: &'static str>(kind: ErrorKind)` /// in the future, when const generics allow that. <ins> #[inline] </ins> pub(crate) const fn new_const(kind: ErrorKind, message: &'static &'static str) -> Error { Self { repr: Repr::SimpleMessage(kind, message) } }


} } <ins> pub mod signal { use libc::types::os::arch::c95::c_int; use libc::types::os::common::posix01::sighandler_t; #[cfg(not(target_os = "android"))] extern { pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } #[cfg(target_os = "android")] extern { #[link_name = "bsd_signal"] pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } } </ins> pub mod wait { use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::posix88::{pid_t};


<ins> // Regression test for #54779, checks if the diagnostics are confusing. #![feature(nll)] trait DebugWith<Cx: ?Sized> { fn debug_with<'me>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> { DebugCxPair { value: self, cx } } fn fmt_with(&self, cx: &Cx, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result; } struct DebugCxPair<'me, Value: ?Sized, Cx: ?Sized> where Value: DebugWith<Cx>, { value: &'me Value, cx: &'me Cx, } trait DebugContext {} struct Foo { bar: Bar, } impl DebugWith<dyn DebugContext> for Foo { fn fmt_with( &self, cx: &dyn DebugContext, fmt: &mut std::fmt::Formatter<'_>, ) -> std::fmt::Result { let Foo { bar } = self; bar.debug_with(cx); //~ ERROR: lifetime may not live long enough Ok(()) } } struct Bar {} impl DebugWith<dyn DebugContext> for Bar { fn fmt_with( &self, cx: &dyn DebugContext, fmt: &mut std::fmt::Formatter<'_>, ) -> std::fmt::Result { Ok(()) } } fn main() {} </ins>


<ins> // aux-build:issue-99221-aux.rs // build-aux-docs // ignore-cross-compile #![crate_name = "foo"] #[macro_use] extern crate issue_99221_aux; pub use issue_99221_aux::*; // @count foo/index.html '//a[@class="macro"]' 1 mod inner { #[macro_export] macro_rules! print { () => () } } </ins>


map.insert("required-associated-consts".into(), 1); map.insert("required-methods".into(), 1); map.insert("provided-methods".into(), 1); <ins> map.insert("object-safety".into(), 1); </ins> map.insert("implementors".into(), 1); map.insert("synthetic-implementors".into(), 1); map.insert("implementations-list".into(), 1);


}) { let (child_field_idx, child_capture) = child_captures.next().unwrap(); <ins> // This analysis only makes sense if the parent capture is a // prefix of the child capture. assert!( child_capture.place.projections.len() >= parent_capture.place.projections.len(), "parent capture ({parent_capture:#?}) expected to be prefix of  child capture ({child_capture:#?})" ); </ins> // Store this set of additional projections (fields and derefs). // We need to re-apply them later. let child_precise_captures =


/// } /// ``` #[inline] <del> #[unstable(feature = "needs_drop", issue = "41890")] </del> <ins> #[stable(feature = "needs_drop", since = "1.22.0")] </ins> pub fn needs_drop<T>() -> bool { unsafe { intrinsics::needs_drop::<T>() } }


let tcx = self.infcx.tcx; let generics = tcx.generics_of(self.mir_def_id); let param = generics.type_param(&param_ty, tcx); <del> if let Some(generics) = tcx.hir().get_generics(self.mir_def_id) { </del> <ins> if let Some(generics) = tcx.hir().get_generics(tcx.closure_base_def_id(self.mir_def_id)) { </ins> suggest_constraining_type_param( generics, &mut err,


//////////////////////////////////////////////////////////////////////////////// #[macro_use] mod local; <del> #[macro_use] mod scoped; </del> <ins> #[macro_use] mod scoped_tls; </ins> #[stable(feature = "rust1", since = "1.0.0")] pub use self::local::{LocalKey, LocalKeyState};


<ins> error[E0277]: expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` --> $DIR/issue-100690.rs:37:23 | LL |         real_dispatch(f) |         ------------- ^ expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` |         | |         required by a bound introduced by this call | = note: expected a closure with arguments `(&mut UIView<'a, T>,)` found a closure with arguments `(&mut UIView<'_, T>,)` note: required by a bound in `real_dispatch` --> $DIR/issue-100690.rs:9:8 | LL | fn real_dispatch<T, F>(f: F) -> Result<(), io::Error> |    ------------- required by a bound in this ... LL |     F: FnOnce(&mut UIView<T>) -> Result<(), io::Error> + Send + 'static, |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `real_dispatch` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>


<ins> error: unexpected closing delimiter: `}` --> $DIR/issue-98601-delimiter-error-1.rs:7:1 | LL | fn foo() { |          - this delimiter might not be properly closed... LL |     match 0 { LL |       _ => {} |            -- block is empty, you might have not meant to close it ... LL |     } |     - ...as it matches this but it has different indentation LL | } | ^ unexpected closing delimiter error: aborting due to previous error </ins>


// compile-flags: -O // min-llvm-version: 15.0 <del> #![crate_type="lib"] </del> <ins> #![crate_type = "lib"] </ins> use std::mem::MaybeUninit;


println!("`x.py` will now use the configuration at {}", include_path.display()); let build = TargetSelection::from_user(&env!("BUILD_TRIPLE")); <del> let stage_path = ["build", build.rustc_target_arg(), "stage1"].join("/"); </del> <ins> let stage_path = ["build", build.rustc_target_arg(), "stage1"].join(&MAIN_SEPARATOR.to_string()); </ins> println!();


let result_subst = CanonicalVarValues { var_values: self.tcx.mk_args_from_iter( query_response.variables.iter().enumerate().map(|(index, info)| { <del> if info.is_existential() { </del> <ins> if info.universe() != ty::UniverseIndex::ROOT { // A variable from inside a binder of the query. While ideally these shouldn't // exist at all, we have to deal with them for now. self.instantiate_canonical_var(cause.span, info, |u| { universe_map[u.as_usize()] }) } else if info.is_existential() { </ins> match opt_values[BoundVar::new(index)] { Some(k) => k, None => self.instantiate_canonical_var(cause.span, info, |u| {


/// ```rust /// # use std::fmt::Write; /// # let mut buf = String::new(); <del> /// /// // Bad </del> /// writeln!(buf, ""); <del> /// /// // Good /// writeln!(buf); </del> /// ``` pub WRITELN_EMPTY_STRING, style,


assert!(plan.iter().any(|s| s.name.contains("-ui"))); assert!(plan.iter().any(|s| s.name.contains("cfail"))); <del> assert!(plan.iter().any(|s| s.name.contains("cfail"))); </del> assert!(plan.iter().any(|s| s.name.contains("cfail-full"))); assert!(plan.iter().any(|s| s.name.contains("codegen-units"))); assert!(plan.iter().any(|s| s.name.contains("debuginfo")));


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


<ins> // Regression test of #43913. // run-rustfix #![feature(trait_alias)] #![allow(bare_trait_objects, dead_code)] trait Strings = Iterator<Item=String>; struct Struct<S: Strings>(S); //~^ ERROR: expected trait, found type alias `Strings` fn main() {} </ins>


i -= 1u; } <del> let mut val = s[i] as uint; </del> <ins> let mut val = s[i] as u32; </ins> let w = UTF8_CHAR_WIDTH[val] as uint; assert!((w != 0));


<del> #![feature(inherent_associated_types)] #![allow(dead_code, incomplete_features)] #![crate_type = "lib"] #![deny(unused_attributes)] // run-rustfix pub trait Trait { type It; const IT: (); fn it0(); fn it1(); fn it2(); } pub struct Implementor; impl Implementor { #[doc(hidden)] // no error type Inh = (); #[doc(hidden)] // no error const INH: () = (); #[doc(hidden)] // no error fn inh() {} } impl Trait for Implementor { #[doc(hidden)] type It = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden)] const IT: () = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden, alias = "aka")] fn it0() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(alias = "this", hidden,)] fn it1() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden, hidden)] fn it2() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted //~|  ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted } </del>


debug!("ty_generics_for_trait(trait_id={:?}, substs={:?})", ccx.tcx.map.local_def_id(trait_id), substs); <del> let mut generics = ty_generics_for_type_or_impl(ccx, ast_generics); </del> <ins> let mut generics = ty_generics_for_type(ccx, ast_generics); </ins> // Add in the self type parameter. //


self.verbose > 0 } <ins> pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, link: Q) -> io::Result<()> { #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file; if !self.dry_run() { symlink_file(src.as_ref(), link.as_ref()) } else { Ok(()) } } </ins> pub(crate) fn create(&self, path: &Path, s: &str) { if self.dry_run() { return;


<ins> error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:13:61 | LL |     pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) { |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:21:19 | LL |         const FN: unsafe extern "C" fn(Args), |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors </ins>


dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "new_debug_unreachable 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", <del> "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",


impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A> { #[inline] fn next_back(&mut self) -> Option<T> { <del> self.iter.next_back().map(|elt| unsafe { ptr::read(elt) }) </del> <ins> if self.tail == self.head { return None; } self.head = wrap_index(self.head.wrapping_sub(1), self.ring.len()); // Safety: // - `self.head` in a ring buffer is always a valid index. // - `self.head` and `self.tail` equality is checked above. unsafe { Some(ptr::read(self.ring.as_ptr().get_unchecked_mut(self.head))) } </ins> } }