} key!(is_builtin, bool); <del> key!(endian = "target_endian"); key!(c_int_width = "target_c_int_width"); </del> <ins> key!(endian = "target-endian"); key!(c_int_width = "target-c-int-width"); </ins> key!(os); key!(env); key!(vendor);


LL |     let _: &dyn const Trait; |                 ^^^^^^^^^^^ <del> error: aborting due to 1 previous error </del> <ins> error: `~const` is not allowed here --> $DIR/const-trait-bounds-trait-objects.rs:9:17 | LL |     let _: &dyn ~const Trait; |                 ^^^^^^ | = note: trait objects cannot have `~const` trait bounds error: const trait bounds are not allowed in trait object types --> $DIR/const-trait-bounds-trait-objects.rs:14:25 | LL | const fn handle(_: &dyn const NonConst) {} |                         ^^^^^^^^^^^^^^ error: `~const` is not allowed here --> $DIR/const-trait-bounds-trait-objects.rs:16:23 | LL | const fn take(_: &dyn ~const NonConst) {} |                       ^^^^^^ | = note: trait objects cannot have `~const` trait bounds error: aborting due to 4 previous errors </ins>


without modifying the original"] #[stable(feature = "unicode_case_mapping", since = "1.2.0")] pub fn to_uppercase(&self) -> String { <del> let out = convert_while_ascii(self.as_bytes(), u8::to_ascii_uppercase); // Safety: we know this is a valid char boundary since // out.len() is only progressed if ascii bytes are found let rest = unsafe { self.get_unchecked(out.len()..) }; // Safety: We have written only valid ASCII to our vec let mut s = unsafe { String::from_utf8_unchecked(out) }; </del> <ins> let (mut s, rest) = convert_while_ascii(self, u8::to_ascii_uppercase); </ins> for c in rest.chars() { match conversions::to_upper(c) {


t1.next().is_none() && t2.next().is_none() } <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: &TokenStream) -> bool { let mut t1 = self.trees(); let mut t2 = other.trees(); for (t1, t2) in t1.by_ref().zip(t2.by_ref()) { if !t1.probably_equal_for_proc_macro(&t2) { return false; } } t1.next().is_none() && t2.next().is_none() } </ins> /// Precondition: `self` consists of a single token tree. /// Returns true if the token tree is a joint operation w.r.t. `proc_macro::TokenNode`. pub fn as_tree(self) -> (TokenTree, bool /* joint? */) {


impl EmptyTrait2 for HasEmptyTraits {} #[doc(cfg(feature = "some-feature"))] impl EmptyTrait3 for HasEmptyTraits {} <ins> mod macros; pub use macros::*; </ins>


<ins> // This test ensures that there is no macro duplicates in the sidebar. goto: file://|DOC_PATH|/test_docs/macro.a.html // Waiting for the elements in the sidebar to be rendered. wait-for: ".sidebar-elems .others .macro" // Check there is only one macro named "a" listed in the sidebar. assert-count: ( "//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='a']", 1, ) // Check there is only one macro named "b" listed in the sidebar. assert-count: ( "//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='b']", 1, ) </ins>


let parent = tcx.map.get_parent(param.id); <del> if space != TypeSpace && default.is_some() { </del> <ins> if !allow_defaults && default.is_some() { </ins> if !tcx.sess.features.borrow().default_type_parameter_fallback { tcx.sess.add_lint( lint::builtin::INVALID_TYPE_PARAM_DEFAULT,


<ins> // force-host // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_derive(ICE)] pub fn derive(_: TokenStream) -> TokenStream { r#"#[allow(missing_docs)] struct X { }"#.parse().unwrap() } </ins>


//~^^^ ERROR: function takes 1 generic argument but 2 generic arguments were supplied //~^^^^ ERROR: unconstrained generic constant //~^^^^^ ERROR: unconstrained generic constant `{const expr}` <ins> //~^^^^^^ ERROR: unconstrained generic constant `{const expr}` </ins> } fn main() {}


}); if check_params && let Some(args) = path.segments.last().unwrap().args { let params_in_repr = tcx.params_in_repr(def_id); <del> for (i, arg) in args.args.iter().enumerate() { </del> <ins> // the domain size check is needed because the HIR may not be well-formed at this point for (i, arg) in args.args.iter().enumerate().take(params_in_repr.domain_size()) { </ins> if let hir::GenericArg::Type(ty) = arg && params_in_repr.contains(i as u32) { find_item_ty_spans(tcx, ty, needle, spans, seen_representable); }


builder.info(&format!("Assembling stage{} compiler ({})", stage, host)); // Link in all dylibs to the libdir <ins> let stamp = librustc_stamp(builder, build_compiler, target_compiler.host); let proc_macros = builder .read_stamp_file(&stamp) .into_iter() .filter_map(|(path, dependency_type)| { if dependency_type == DependencyType::Host { Some(path.file_name().unwrap().to_owned().into_string().unwrap()) } else { None } }) .collect::<HashSet<_>>(); </ins> let sysroot = builder.sysroot(target_compiler); let rustc_libdir = builder.rustc_libdir(target_compiler); t!(fs::create_dir_all(&rustc_libdir)); let src_libdir = builder.sysroot_libdir(build_compiler, host); for f in builder.read_dir(&src_libdir) { let filename = f.file_name().into_string().unwrap(); <del> if is_dylib(&filename) { </del> <ins> if is_dylib(&filename) && !proc_macros.contains(&filename) { </ins> builder.copy(&f.path(), &rustc_libdir.join(&filename)); } }


<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. struct A; impl A { fn take_mutably(&mut self) {} } fn identity<T>(t: T) -> T { t } // Issue 46095 // Built-in indexing should be used even when the index is not // trivially an integer // Overloaded indexing would cause wrapped to be borrowed mutably fn main() { let mut a1 = A; let mut a2 = A; let wrapped = [&mut a1, &mut a2]; { wrapped[0 + 1 - 1].take_mutably(); } { wrapped[identity(0)].take_mutably(); } } </ins>


code_offset: usize, margin: Margin, ) { <ins> // Tabs are assumed to have been replaced by spaces in calling code. assert!(!source_string.contains('t')); </ins> let line_len = source_string.len(); // Create the source line we will highlight. let left = margin.left(line_len);


// #55810: Type check patterns first so we get types for all bindings. let scrut_span = scrut.span.find_ancestor_inside(expr.span).unwrap_or(scrut.span); for arm in arms { <del> self.check_pat_top(&arm.pat, scrutinee_ty, Some(scrut_span), true); </del> <ins> self.check_pat_top(&arm.pat, scrutinee_ty, Some(scrut_span), Some(scrut)); </ins> } // Now typecheck the blocks.


<ins> // GVN may create indirect constants with higher alignment than their type requires. Verify that we // do not ICE during codegen, and that the LLVM constant has the higher alignment. // // compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+GVN // compile-flags: -Cno-prepopulate-passes // only-64bit struct S(i32); struct SmallStruct(f32, Option<S>, &'static [f32]); // CHECK: @0 = private unnamed_addr constant // CHECK-SAME: , align 8 fn main() { // CHECK-LABEL: @_ZN20overaligned_constant4main // CHECK: [[full:%_.*]] = alloca %SmallStruct, align 8 // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[full]], ptr align 8 @0, i64 32, i1 false) // CHECK: %b.0 = load i32, ptr @0, align 4, // CHECK: %b.1 = load i32, ptr getelementptr inbounds ({ i32, i32 }, ptr @0, i32 0, i32 1), align 4 let mut s = S(1); s.0 = 3; // SMALL_VAL corresponds to a MIR allocation with alignment 8. const SMALL_VAL: SmallStruct = SmallStruct(4., Some(S(1)), &[]); // In pre-codegen MIR: // `a` is a scalar 4. // `b` is an indirect constant at `SMALL_VAL`'s alloc with 0 offset. // `c` is the empty slice. // // As a consequence, during codegen, we create a LLVM allocation for `SMALL_VAL`, with // alignment 8, but only use the `Option<S>` field, at offset 0 with alignment 4. let SmallStruct(a, b, c) = SMALL_VAL; } </ins>


<ins> // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #79251 #[derive(Debug)] struct Node<K, const D: usize> where SmallVec<K, { D * 2 }>: , { keys: SmallVec<K, { D * 2 }>, } impl<K, const D: usize> Node<K, D> where SmallVec<K, { D * 2 }>: , { fn new() -> Self { panic!() } #[inline(never)] fn split(&mut self, i: usize, k: K, right: bool) -> Node<K, D> { let mut node = Node::new(); node.keys.push(k); //~^ error: no method named node } } #[derive(Debug)] struct SmallVec<T, const D: usize> { data: [T; D], } impl<T, const D: usize> SmallVec<T, D> { fn new() -> Self { panic!() } } fn main() {} </ins>


<ins> // aux-build:issue-89971-outer-attr-following-inner-attr-ice.rs #[macro_use] extern crate issue_89971_outer_attr_following_inner_attr_ice; fn main() { Mew(); X {}; } #![deny(missing_docs)] //~^ ERROR an inner attribute is not permitted in this context #[derive(ICE)] #[deny(missing_docs)] struct Mew(); </ins>


<ins> error: using function pointers as const generic parameters is forbidden --> $DIR/issue-72352.rs:6:42 | LL | unsafe fn unsafely_do_the_thing<const F: fn(&CStr) -> usize>(ptr: *const i8) -> usize { |                                          ^^^^^^^^^^^^^^^^^^ 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>


{ hidden_ty } <ins> // FIXME(RPITIT): This can go away when we move to associated types ty::Projection(proj) if def_id.to_def_id() == proj.item_def_id && substs == proj.substs => { hidden_ty } </ins> _ => ty, }, lt_op: |lt| lt,


<ins> // regression test for #67609. // check-pass static NONE: Option<String> = None; static NONE_REF_REF: &&Option<String> = { let x = &&NONE; x }; fn main() { println!("{:?}", NONE_REF_REF); } </ins>


/// /// # NaN bit patterns /// <del> /// This section defines the possible NaN bit patterns returned by non-"bitwise" floating point /// operations. The bitwise operations are unary `-`, `abs`, `copysign`; those are guaranteed to /// exactly preserve the bit pattern of their input except for possibly changing the sign bit. </del> <ins> /// This section defines the possible NaN bit patterns returned by floating-point operations. </ins> /// <del> /// A floating-point NaN value consists of: /// - a sign bit /// - a quiet/signaling bit </del> <ins> /// The bit pattern of a floating-point NaN value is defined by: /// - a sign bit. /// - a quiet/signaling bit. Rust assumes that the quiet/signaling bit being set to `1` indicates a ///   quiet NaN (QNaN), and a value of `0` indicates a signaling NaN (SNaN). In the following we ///   will hence just call it the "quiet bit". </ins> /// - a payload, which makes up the rest of the significand (i.e., the mantissa) except for the <del> ///   quiet/signaling bit. /// /// Rust assumes that the quiet/signaling bit being set to `1` indicates a quiet NaN (QNaN), and a /// value of `0` indicates a signaling NaN (SNaN). In the following we will hence just call it the /// "quiet bit". /// /// The following rules apply when a NaN value is returned: the result has a non-deterministic sign. /// The quiet bit and payload are non-deterministically chosen from the following set of options: /// /// - **Preferred NaN**: The quiet bit is set and the payload is all-zero. /// - **Quieting NaN propagation**: The quiet bit is set and the payload is copied from any input ///   operand that is a NaN. If the inputs and outputs do not have the same payload size (i.e., for ///   `as` casts), then ///   - If the output is smaller than the input, low-order bits of the payload get dropped. ///   - If the output is larger than the input, the payload gets filled up with 0s in the low-order ///     bits. /// - **Unchanged NaN propagation**: The quiet bit and payload are copied from any input operand ///   that is a NaN. If the inputs and outputs do not have the same size (i.e., for `as` casts), the ///   same rules as for "quieting NaN propagation" apply, with one caveat: if the output is smaller ///   than the input, droppig the low-order bits may result in a payload of 0; a payload of 0 is not ///   possible with a signaling NaN (the all-0 significand encodes an infinity) so unchanged NaN ///   propagation cannot occur with some inputs. /// - **Target-specific NaN**: The quiet bit is set and the payload is picked from a target-specific ///   set of "extra" possible NaN payloads. The set can depend on the input operand values. ///   See the table below for the concrete NaNs this set contains on various targets. </del> <ins> ///   quiet bit. /// /// The rules for NaN values differ between *arithmetic* and *non-arithmetic* (or "bitwise") /// operations. The non-arithmetic operations are unary `-`, `abs`, `copysign`, `signum`, /// `{to,from}_bits`, `{to,from}_{be,le,ne}_bytes` and `is_sign_{positive,negative}`. These /// operations are guaranteed to exactly preserve the bit pattern of their input except for possibly /// changing the sign bit. /// /// The following rules apply when a NaN value is returned from an arithmetic operation: /// - The result has a non-deterministic sign. /// - The quiet bit and payload are non-deterministically chosen from ///   the following set of options: /// ///   - **Preferred NaN**: The quiet bit is set and the payload is all-zero. ///   - **Quieting NaN propagation**: The quiet bit is set and the payload is copied from any input ///     operand that is a NaN. If the inputs and outputs do not have the same payload size (i.e., for ///     `as` casts), then ///     - If the output is smaller than the input, low-order bits of the payload get dropped. ///     - If the output is larger than the input, the payload gets filled up with 0s in the low-order ///       bits. ///   - **Unchanged NaN propagation**: The quiet bit and payload are copied from any input operand ///     that is a NaN. If the inputs and outputs do not have the same size (i.e., for `as` casts), the ///     same rules as for "quieting NaN propagation" apply, with one caveat: if the output is smaller ///     than the input, droppig the low-order bits may result in a payload of 0; a payload of 0 is not ///     possible with a signaling NaN (the all-0 significand encodes an infinity) so unchanged NaN ///     propagation cannot occur with some inputs. ///   - **Target-specific NaN**: The quiet bit is set and the payload is picked from a target-specific ///     set of "extra" possible NaN payloads. The set can depend on the input operand values. ///     See the table below for the concrete NaNs this set contains on various targets. </ins> /// /// In particular, if all input NaNs are quiet (or if there are no input NaNs), then the output NaN /// is definitely quiet. Signaling NaN outputs can only occur if they are provided as an input


let Some(rcvr_ty) = self.node_ty_opt(rcvr.hir_id) else { continue; }; let rcvr_ty = rcvr_ty.fold_with(&mut fudger); let Ok(method) = <del> self.lookup_method(rcvr_ty, segment, DUMMY_SP, parent_expr, rcvr, args) </del> <ins> self.lookup_method_for_diagnostic(rcvr_ty, segment, DUMMY_SP, parent_expr, rcvr) </ins> else { continue; }; let ideal_rcvr_ty = rcvr_ty.fold_with(&mut fudger); let ideal_method = self <del> .lookup_method(ideal_rcvr_ty, segment, DUMMY_SP, parent_expr, rcvr, args) </del> <ins> .lookup_method_for_diagnostic(ideal_rcvr_ty, segment, DUMMY_SP, parent_expr, rcvr) </ins> .ok() .and_then(|method| { let _ = self.at(&ObligationCause::dummy(), self.param_env)


<del> use crate::io::{self, ErrorKind, Read, Write}; </del> <ins> use super::{BufWriter, ErrorKind, Read, Result, Write, DEFAULT_BUF_SIZE}; </ins> use crate::mem::MaybeUninit; /// Copies the entire contents of a reader into a writer.


<ins> // ignore-tidy-linelength #![feature(no_core)] #![no_core] pub enum Foo { // @set Unit = "$.index[*][?(@.name=='Unit')].id" // @is "$.index[*][?(@.name=='Unit')].inner.variant_kind" '"plain"' // @is "$.index[*][?(@.name=='Unit')].inner.variant_inner" null Unit, // @set Named = "$.index[*][?(@.name=='Named')].id" // @is "$.index[*][?(@.name=='Named')].inner.variant_kind" '"struct"' // @is "$.index[*][?(@.name=='Named')].inner.variant_inner" '{"fields": [], "fields_stripped": false}' Named {}, // @set Tuple = "$.index[*][?(@.name=='Tuple')].id" // @is "$.index[*][?(@.name=='Tuple')].inner.variant_kind" '"tuple"' // @is "$.index[*][?(@.name=='Tuple')].inner.variant_inner" [] Tuple(), // @set NamedField = "$.index[*][?(@.name=='NamedField')].id" // @set x = "$.index[*][?(@.name=='x' && @.kind=='struct_field')].id" // @is "$.index[*][?(@.name=='NamedField')].inner.variant_kind" '"struct"' // @is "$.index[*][?(@.name=='NamedField')].inner.variant_inner.fields[*]" $x // @is "$.index[*][?(@.name=='NamedField')].inner.variant_inner.fields_stripped" false NamedField { x: i32 }, // @set TupleField = "$.index[*][?(@.name=='TupleField')].id" // @is "$.index[*][?(@.name=='TupleField')].inner.variant_kind" '"tuple"' // @set tup_field = "$.index[*][?(@.name=='0' && @.kind=='struct_field')].id" // @is "$.index[*][?(@.name=='TupleField')].inner.variant_inner[*]" $tup_field TupleField(i32), } // @is    "$.index[*][?(@.name=='Foo')].inner.variants[0]" $Unit // @is    "$.index[*][?(@.name=='Foo')].inner.variants[1]" $Named // @is    "$.index[*][?(@.name=='Foo')].inner.variants[2]" $Tuple // @is    "$.index[*][?(@.name=='Foo')].inner.variants[3]" $NamedField // @is    "$.index[*][?(@.name=='Foo')].inner.variants[4]" $TupleField // @count "$.index[*][?(@.name=='Foo')].inner.variants[*]" 5 </ins>


let sp = var_origin.span(); let return_sp = sub_origin.span(); let param = self.find_param_with_region(*sup_r, *sub_r)?; <ins> let simple_ident = param.param.pat.simple_ident(); </ins> let lifetime_name = if sup_r.has_name() { sup_r.to_string() } else { "'_".to_owned() }; let (mention_influencer, influencer_point) =


<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. trait VecN { const DIM: usize; } trait Mat { type Row: VecN; } fn m<M: Mat>() { let x = M::Row::DIM; } fn main() {} </ins>


<ins> // compile-flags: -Zmir-opt-level=2 -Copt-level=0 // run-pass type M = [i64; 2]; fn f(a: &M) -> M { let mut b: M = M::default(); b[0] = a[0] * a[0]; b } fn main() { let mut a: M = [1, 1]; a = f(&a); assert_eq!(a[0], 1); } </ins>


}; let column_width = if let Some(width) = self.terminal_width { <del> width </del> <ins> width.saturating_sub(code_offset) </ins> } else if self.ui_testing { 140 } else { <del> term_size::dimensions().map(|(w, _)| w - code_offset).unwrap_or(140) </del> <ins> term_size::dimensions() .map(|(w, _)| w.saturating_sub(code_offset)) .unwrap_or(std::usize::MAX) </ins> }; let margin = Margin::new(


|        ^^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias <del> --> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:4:1 </del> | <del> LL | type Typedef = isize; | ^^^^^^^^^^^^^^^^^^^^^ </del> <ins> LL | trait Typedef = isize; | </ins> error: aborting due to 2 previous errors


fn resolve_module_prefix(&mut self, module_path: &[Ident], span: Option<Span>) -> ResolveResult<ModulePrefixResult<'a>> { if &*module_path[0].name.as_str() == "$crate" { <del> let mut ctxt = module_path[0].ctxt; while ctxt.source().0 != SyntaxContext::empty() { ctxt = ctxt.source().0; } let module = self.invocations[&ctxt.source().1].module.get(); let crate_root = if module.def_id().unwrap().is_local() { self.graph_root } else { module }; return Success(PrefixFound(crate_root, 1)) </del> <ins> return Success(PrefixFound(self.resolve_crate_var(module_path[0].ctxt), 1)); </ins> } // Start at the current module if we see `self` or `super`, or at the


<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(specialization)] trait Iterate<'a> { type Ty: Valid; fn iterate(self); } impl<'a, T> Iterate<'a> for T where T: Check { default type Ty = (); default fn iterate(self) {} } trait Check {} impl<'a, T> Check for T where <T as Iterate<'a>>::Ty: Valid {} trait Valid {} fn main() { Iterate::iterate(0); } </ins>


} ast::ExprMatch(ref discr, ref arms) => { <del> // treatment of the discriminant is handled while // walking the arms: self.walk_expr(&**discr); </del> let discr_cmt = return_if_err!(self.mc.cat_expr(&**discr)); <ins> self.borrow_expr(&**discr, ty::ReEmpty, ty::ImmBorrow, MatchDiscriminant); // treatment of the discriminant is handled while walking the arms. </ins> for arm in arms.iter() { self.walk_arm(discr_cmt.clone(), arm); }


inner: VaListImpl<'f>, #[cfg(all( <del> any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"), </del> <ins> any( target_arch = "aarch64", target_arch = "powerpc", target_arch = "s390x", target_arch = "x86_64" ), </ins> any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))), not(target_family = "wasm"), not(target_arch = "asmjs"),


llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod); llvm::LLVMRustAddPass(pm, "verify0".as_ptr() as *const _); <del> let opt = sess.opts.cg.opt_level.unwrap_or(0) as libc::c_uint; </del> <ins> let opt = match sess.opts.optimize { config::No => 0, config::Less => 1, config::Default => 2, config::Aggressive => 3, }; </ins> let builder = llvm::LLVMPassManagerBuilderCreate(); llvm::LLVMPassManagerBuilderSetOptLevel(builder, opt);


emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(8).unwrap(), true) } "aarch64" => emit_aapcs_va_arg(bx, addr, target_ty), <ins> "s390x" => emit_s390x_va_arg(bx, addr, target_ty), </ins> // Windows x86_64 "x86_64" if target.is_like_windows => { let target_ty_size = bx.cx.size_of(target_ty).bytes();


false } <ins> /// Suggest possible range with adding parentheses, for example: /// when encountering `0..1.map(|i| i + 1)` suggest `(0..1).map(|i| i + 1)`. fn suggest_wrapping_range_with_parens( &self, tcx: TyCtxt<'tcx>, actual: Ty<'tcx>, source: SelfSource<'tcx>, span: Span, item_name: Ident, ty_str: &str, ) -> bool { if let SelfSource::MethodCall(expr) = source { for (_, parent) in tcx.hir().parent_iter(expr.hir_id).take(5) { if let Node::Expr(parent_expr) = parent { let lang_item = match parent_expr.kind { ExprKind::Struct(ref qpath, _, _) => match **qpath { QPath::LangItem(LangItem::Range, ..) => Some(LangItem::Range), QPath::LangItem(LangItem::RangeTo, ..) => Some(LangItem::RangeTo), QPath::LangItem(LangItem::RangeToInclusive, ..) => { Some(LangItem::RangeToInclusive) } _ => None, }, ExprKind::Call(ref func, _) => match func.kind { // `..=` desugars into `::std::ops::RangeInclusive::new(...)`. ExprKind::Path(QPath::LangItem(LangItem::RangeInclusiveNew, ..)) => { Some(LangItem::RangeInclusiveStruct) } _ => None, }, _ => None, }; if lang_item.is_none() { continue; } let span_included = match parent_expr.kind { hir::ExprKind::Struct(_, eps, _) => { eps.len() > 0 && eps.last().map_or(false, |ep| ep.span.contains(span)) } // `..=` desugars into `::std::ops::RangeInclusive::new(...)`. hir::ExprKind::Call(ref func, ..) => func.span.contains(span), _ => false, }; if !span_included { continue; } let range_def_id = self.tcx.require_lang_item(lang_item.unwrap(), None); let range_ty = self.tcx.bound_type_of(range_def_id).subst(self.tcx, &[actual.into()]); let pick = self.probe_for_name( span, Mode::MethodCall, item_name, IsSuggestion(true), range_ty, expr.hir_id, ProbeScope::AllTraits, ); if pick.is_ok() { let range_span = parent_expr.span.with_hi(expr.span.hi()); tcx.sess.emit_err(errors::MissingParentheseInRange { span, ty_str: ty_str.to_string(), method_name: item_name.as_str().to_string(), add_missing_parentheses: Some(errors::AddMissingParenthesesInRange { func_name: item_name.name.as_str().to_string(), left: range_span.shrink_to_lo(), right: range_span.shrink_to_hi(), }), }); return true; } } } } false } </ins> fn suggest_constraining_numerical_ty( &self, tcx: TyCtxt<'tcx>,


<ins> struct Wrapper<'rom>(T); //~^ ERROR cannot find type `T` in this scope trait Foo { fn bar() -> Wrapper<impl Sized>; //~^ ERROR missing lifetime specifier //~| ERROR struct takes 0 generic arguments but 1 generic argument was supplied } impl Foo for () { fn bar() -> i32 { //~^ ERROR method `bar` has an incompatible type for trait //~| ERROR method `bar` has an incompatible return type for trait 0 } } fn main() {} </ins>


<ins> // 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. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-fast // Be sure that when a SIGPIPE would have been received that the entire process // doesn't die in a ball of fire, but rather it's gracefully handled. use std::os; use std::io::{PipeStream, Process}; fn test() { let os::Pipe { input, out } = os::pipe(); let input = PipeStream::open(input); let mut out = PipeStream::open(out); drop(input); let _ = out.write([1]); } fn main() { let args = os::args(); if args.len() > 1 && args[1].as_slice() == "test" { return test(); } let mut p = Process::new(args[0], [~"test"]).unwrap(); assert!(p.wait().success()); } </ins>


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


self.borrow(assignee_place, diag_expr_id, ty::BorrowKind::MutBorrow); } } <ins> /// Rust doesn't permit moving fields out of a type that implements drop fn restrict_precision_for_drop_types<'a, 'tcx>( fcx: &'a FnCtxt<'a, 'tcx>, mut place: Place<'tcx>, mut curr_mode: ty::UpvarCapture<'tcx>, span: Span, ) -> (Place<'tcx>, ty::UpvarCapture<'tcx>) { let is_copy_type = fcx.infcx.type_is_copy_modulo_regions(fcx.param_env, place.ty(), span); if let (false, UpvarCapture::ByValue(..)) = (is_copy_type, curr_mode) { for i in 0..place.projections.len() { match place.ty_before_projection(i).kind() { ty::Adt(def, _) if def.destructor(fcx.tcx).is_some() => { truncate_place_to_len_and_update_capture_kind(&mut place, &mut curr_mode, i); break; } _ => {} } } } (place, curr_mode) } </ins> /// Truncate `place` so that an `unsafe` block isn't required to capture it. /// - No projections are applied to raw pointers, since these require unsafe blocks. We capture ///   them completely.


<ins> //! Regression test for #128622. //! //! PR #128581 introduced an assertion that all builtin attributes are actually checked via //! `CheckAttrVisitor` and aren't accidentally usable on completely unrelated HIR nodes. //! Unfortunately, the check had correctness problems. //! //! The match on attribute path segments looked like //! //! ```rs,ignore //! [sym::should_panic] => /* check is implemented */ //! match BUILTIN_ATTRIBUTE_MAP.get(name) { //!     // checked below //!     Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {} //!     Some(_) => { //!         if !name.as_str().starts_with("rustc_") { //!             span_bug!( //!                 attr.span, //!                 "builtin attribute {name:?} not handled by `CheckAttrVisitor`" //!             ) //!         } //!     } //!     None => (), //! } //! ``` //! //! However, it failed to account for edge cases such as an attribute whose: //! //! 1. path segments *starts* with a builtin attribute such as `should_panic` //! 2. which does not start with `rustc_`, and //! 3. is also an `AttributeType::Normal` attribute upon registration with the builtin attribute map //! //! These conditions when all satisfied cause the span bug to be issued for e.g. //! `#[should_panic::skip]` because the `[sym::should_panic]` arm is not matched (since it's //! `[sym::should_panic, sym::skip]`). //! //! This test checks that the span bug is not fired for such cases. //! //! issue: rust-lang/rust#128622 // Notably, `should_panic` is a `AttributeType::Normal` attribute that is checked separately. struct Foo { #[should_panic::skip] //~^ ERROR failed to resolve pub field: u8, #[should_panic::a::b::c] //~^ ERROR failed to resolve pub field2: u8, } fn foo() {} fn main() { #[deny::skip] //~^ ERROR failed to resolve foo(); } </ins>


<ins> // This used to mis-compile because the mir-opt `SimplifyArmIdentity` // did not check that the types matched up in the `Ok(r)` branch. // // run-pass // compile-flags: -Zmir-opt-level=2 #[derive(Debug, PartialEq, Eq)] enum SpecialsRes { Res(u64) } fn e103() -> SpecialsRes { if let Ok(r) = "1".parse() { SpecialsRes::Res(r) } else { SpecialsRes::Res(42) } } fn main() { assert_eq!(e103(), SpecialsRes::Res(1)); } </ins>


for (idx, (param_ty, param)) in inputs_fn.chain(maybe_va_list).zip(body.params).enumerate() { // Check the pattern. let ty_span = try { inputs_hir?.get(idx)?.span }; <del> fcx.check_pat_top(&param.pat, param_ty, ty_span, false); </del> <ins> fcx.check_pat_top(&param.pat, param_ty, ty_span, None); </ins> // Check that argument is Sized. // The check for a non-trivial pattern is a hack to avoid duplicate warnings


/// Converts a vector of bytes to a `String`. /// <del> /// A string slice ([`&str`]) is made of bytes ([`u8`]), and a vector of bytes </del> <ins> /// A string ([`String`]) is made of bytes ([`u8`]), and a vector of bytes </ins> /// ([`Vec<u8>`]) is made of bytes, so this function converts between the /// two. Not all byte slices are valid `String`s, however: `String` /// requires that it is valid UTF-8. `from_utf8()` checks to ensure that


use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; <del> use crate::clean::{self, Attributes, AttributesExt, FakeDefId, GetDefId, ToSource}; </del> <ins> use crate::clean::{ self, Attributes, AttributesExt, FakeDefId, GetDefId, NestedAttributesExt, ToSource, Type, }; </ins> use crate::core::DocContext; use crate::formats::item_type::ItemType;


<ins> // Regression test for #71546. // ignore-compare-mode-nll // NLL stderr is different from the original one. pub fn serialize_as_csv<V>(value: &V) -> Result<String, &str> where V: 'static, for<'a> &'a V: IntoIterator, for<'a> <&'a V as IntoIterator>::Item: ToString + 'static, { let csv_str: String = value //~ ERROR: the associated type `<&'a V as IntoIterator>::Item` may not live long enough .into_iter() .map(|elem| elem.to_string()) .collect::<String>(); Ok(csv_str) } fn main() {} </ins>


// check if the RHS is from desugaring let opt_assignment_rhs_span = self.body.find_assignments(local).first().map(|&location| { <del> let stmt = &self.body[location.block].statements [location.statement_index]; match stmt.kind { mir::StatementKind::Assign(box ( _, mir::Rvalue::Use(mir::Operand::Copy(place)), )) => { self.body.local_decls[place.local].source_info.span } _ => self.body.source_info(location).span, </del> <ins> if let Some(mir::Statement { source_info: _, kind: mir::StatementKind::Assign(box ( _, mir::Rvalue::Use(mir::Operand::Copy(place)), )), }) = self.body[location.block] .statements .get(location.statement_index) { self.body.local_decls[place.local].source_info.span } else { self.body.source_info(location).span </ins> } }); match opt_assignment_rhs_span.and_then(|s| s.desugaring_kind()) {


2) } <ins> // Indicate that we want CodeView debug information on MSVC if cx.sess().target.target.options.is_like_msvc { llvm::LLVMRustAddModuleFlag(cx.llmod(), "CodeView0".as_ptr() as *const _, 1) } </ins> // Prevent bitcode readers from deleting the debug info. let ptr = "Debug Info Version0".as_ptr(); llvm::LLVMRustAddModuleFlag(cx.llmod(), ptr as *const _,


if let ast::ExprKind::Await(_, _) | ast::ExprKind::Yield(_) = e.kind { ControlFlow::Break(()) } else { <del> visit::walk_expr(self, e); ControlFlow::Continue(()) </del> <ins> visit::walk_expr(self, e) </ins> } }


self.rust_codegen_backends.get(0).cloned() } <ins> pub fn check_build_rustc_version(&self) { if self.dry_run() { return; } // check rustc version is same or lower with 1 apart from the building one let mut cmd = Command::new(&self.initial_rustc); cmd.arg("--version"); let rustc_output = output(&mut cmd) .lines() .next() .unwrap() .split(' ') .nth(1) .unwrap() .split('-') .next() .unwrap() .to_owned(); let rustc_version = Version::parse(&rustc_output.trim()).unwrap(); let source_version = Version::parse(&fs::read_to_string(self.src.join("src/version")).unwrap().trim()) .unwrap(); if !(source_version == rustc_version || (source_version.major == rustc_version.major && source_version.minor == rustc_version.minor + 1)) { let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1); eprintln!( "Unexpected rustc version: {}, we should use {}/{} to build source with {}", rustc_version, prev_version, source_version, source_version ); crate::detail_exit(1); } } </ins> /// Returns the commit to download, or `None` if we shouldn't download CI artifacts. fn download_ci_rustc_commit(&self, download_rustc: Option<StringOrBool>) -> Option<String> { // If `download-rustc` is not set, default to rebuilding.


LL | import std::{ | ^^^^^^ help: items are imported using the `use` keyword <ins> error: expected item, found `require` --> $DIR/use_instead_of_import.rs:9:1 | LL | require std::time::Duration; | ^^^^^^^ help: items are imported using the `use` keyword error: expected item, found `include` --> $DIR/use_instead_of_import.rs:12:1 | LL | include std::time::Instant; | ^^^^^^^ help: items are imported using the `use` keyword </ins> error: expected item, found `using` <del> --> $DIR/use_instead_of_import.rs:9:5 </del> <ins> --> $DIR/use_instead_of_import.rs:15:5 </ins> | LL | pub using std::io; |     ^^^^^ help: items are imported using the `use` keyword <del> error: aborting due to 2 previous errors </del> <ins> error: aborting due to 4 previous errors </ins>


ref s => { tcx.sess.span_bug( span, <del> format!("ty_region() invoked on in appropriate ty: {:?}", </del> <ins> format!("ty_region() invoked on an inappropriate ty: {:?}", </ins> s).as_slice()); } }


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


#[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn len_utf8(self) -> usize { <del> let code = self as u32; if code < MAX_ONE_B { 1 } else if code < MAX_TWO_B { 2 } else if code < MAX_THREE_B { 3 } else { 4 } </del> <ins> len_utf8(self as u32) </ins> } /// Returns the number of 16-bit code units this `char` would need if


<ins> #![feature(no_core)] #![no_core] // @set 1.1.0 = "$.index[*][?(@.docs=='1.1.0')].id" // @set 2.1.0 = "$.index[*][?(@.docs=='2.1.0')].id" // @set 2.1.1 = "$.index[*][?(@.docs=='2.1.1')].id" // @set 2.2.1 = "$.index[*][?(@.docs=='2.2.1')].id" // @set 2.3.0 = "$.index[*][?(@.docs=='2.3.0')].id" // @set 3.1.1 = "$.index[*][?(@.docs=='3.1.1')].id" // @set 3.1.2 = "$.index[*][?(@.docs=='3.1.2')].id" // @set 3.2.0 = "$.index[*][?(@.docs=='3.2.0')].id" // @set 3.2.2 = "$.index[*][?(@.docs=='3.2.2')].id" // @set 3.3.0 = "$.index[*][?(@.docs=='3.3.0')].id" // @set 3.3.1 = "$.index[*][?(@.docs=='3.3.1')].id" pub enum EnumWithStrippedTupleVariants { // @is    "$.index[*][?(@.name=='None')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='None')].inner.variant_inner[*]" 0 None(), // @is    "$.index[*][?(@.name=='One')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='One')].inner.variant_inner[*]" 1 // @is    "$.index[*][?(@.name=='One')].inner.variant_inner[0]" $1.1.0 One(/** 1.1.0*/ bool), // @is    "$.index[*][?(@.name=='OneHidden')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='OneHidden')].inner.variant_inner[*]" 1 // @is    "$.index[*][?(@.name=='OneHidden')].inner.variant_inner[0]" null OneHidden(#[doc(hidden)] bool), // @is    "$.index[*][?(@.name=='Two')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='Two')].inner.variant_inner[*]" 2 // @is    "$.index[*][?(@.name=='Two')].inner.variant_inner[0]" $2.1.0 // @is    "$.index[*][?(@.name=='Two')].inner.variant_inner[1]" $2.1.1 Two(/** 2.1.0*/ bool, /** 2.1.1*/ bool), // @is    "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[*]" 2 // @is    "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[0]" null // @is    "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[1]" $2.2.1 TwoLeftHidden(#[doc(hidden)] bool, /** 2.2.1*/ bool), // @is    "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[*]" 2 // @is    "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[0]" $2.3.0 // @is    "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[1]" null TwoRightHidden(/** 2.3.0*/ bool, #[doc(hidden)] bool), // @is    "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[*]" 2 // @is    "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[0]" null // @is    "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[1]" null TwoBothHidden(#[doc(hidden)] bool, #[doc(hidden)] bool), // @is    "$.index[*][?(@.name=='Three1')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='Three1')].inner.variant_inner[*]" 3 // @is    "$.index[*][?(@.name=='Three1')].inner.variant_inner[0]" null // @is    "$.index[*][?(@.name=='Three1')].inner.variant_inner[1]" $3.1.1 // @is    "$.index[*][?(@.name=='Three1')].inner.variant_inner[2]" $3.1.2 Three1(#[doc(hidden)] bool, /** 3.1.1*/ bool, /** 3.1.2*/ bool), // @is    "$.index[*][?(@.name=='Three2')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='Three2')].inner.variant_inner[*]" 3 // @is    "$.index[*][?(@.name=='Three2')].inner.variant_inner[0]" $3.2.0 // @is    "$.index[*][?(@.name=='Three2')].inner.variant_inner[1]" null // @is    "$.index[*][?(@.name=='Three2')].inner.variant_inner[2]" $3.2.2 Three2(/** 3.2.0*/ bool, #[doc(hidden)] bool, /** 3.2.2*/ bool), // @is    "$.index[*][?(@.name=='Three3')].inner.variant_kind" '"tuple"' // @count "$.index[*][?(@.name=='Three3')].inner.variant_inner[*]" 3 // @is    "$.index[*][?(@.name=='Three3')].inner.variant_inner[0]" $3.3.0 // @is    "$.index[*][?(@.name=='Three3')].inner.variant_inner[1]" $3.3.1 // @is    "$.index[*][?(@.name=='Three3')].inner.variant_inner[2]" null Three3(/** 3.3.0*/ bool, /** 3.3.1*/ bool, #[doc(hidden)] bool), } // @is "$.index[*][?(@.docs=='1.1.0')].name" '"0"' // @is "$.index[*][?(@.docs=='2.1.0')].name" '"0"' // @is "$.index[*][?(@.docs=='2.1.1')].name" '"1"' // @is "$.index[*][?(@.docs=='2.2.1')].name" '"1"' // @is "$.index[*][?(@.docs=='2.3.0')].name" '"0"' // @is "$.index[*][?(@.docs=='3.1.1')].name" '"1"' // @is "$.index[*][?(@.docs=='3.1.2')].name" '"2"' // @is "$.index[*][?(@.docs=='3.2.0')].name" '"0"' // @is "$.index[*][?(@.docs=='3.2.2')].name" '"2"' // @is "$.index[*][?(@.docs=='3.3.0')].name" '"0"' // @is "$.index[*][?(@.docs=='3.3.1')].name" '"1"' // @is "$.index[*][?(@.docs=='1.1.0')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='2.1.0')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='2.1.1')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='2.2.1')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='2.3.0')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.1.1')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.1.2')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.2.0')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.2.2')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.3.0')].inner" '{"kind": "primitive", "inner": "bool"}' // @is "$.index[*][?(@.docs=='3.3.1')].inner" '{"kind": "primitive", "inner": "bool"}' </ins>


use rustc_span::{BytePos, Span, Symbol}; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::ObligationCtxt; <ins> use std::iter; </ins> use crate::borrow_set::TwoPhaseActivation; use crate::borrowck_errors;


.primitive_type() .and_then(|t| self.cache.primitive_locations.get(&t).cloned()); <del> if let Some(did) = did { dids.insert(did); } </del> <ins> dids.extend(did); </ins> } } if let Some(generics) = i.trait_.as_ref().and_then(|t| t.generics()) { for bound in generics { <del> if let Some(did) = bound.def_id(self.cache) { dids.insert(did); } </del> <ins> dids.extend(bound.def_id(self.cache)); </ins> } } let impl_item = Impl { impl_item: item }; <del> if impl_item.trait_did().map_or(true, |d| self.cache.traits.contains_key(&d)) { </del> <ins> let impl_did = impl_item.def_id(); let trait_did = impl_item.trait_did(); if trait_did.map_or(true, |d| self.cache.traits.contains_key(&d)) { </ins> for did in dids { <del> if self.impl_ids.entry(did).or_default().insert(impl_item.def_id()) { self.cache .impls .entry(did) .or_insert_with(Vec::new) .push(impl_item.clone()); </del> <ins> if self.impl_ids.entry(did).or_default().insert(impl_did) { self.cache.impls.entry(did).or_default().push(impl_item.clone()); </ins> } } } else { <del> let trait_did = impl_item.trait_did().expect("no trait did"); </del> <ins> let trait_did = trait_did.expect("no trait did"); </ins> self.cache.orphan_trait_impls.push((trait_did, dids, impl_item)); } None


// Now create the real type parameters. for i in 0..ast_generics.ty_params.len() { <del> let def = get_or_create_type_parameter_def(ccx, ast_generics, space, i as u32); </del> <ins> let def = get_or_create_type_parameter_def(ccx, ast_generics, space, i as u32, allow_defaults); </ins> debug!("ty_generics: def for type param: {:?}, {:?}", def, space); result.types.push(space, def); }


<ins> error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered --> $DIR/issue-50900.rs:15:11 | LL | pub struct Tag(pub Context, pub u16); | ------------------------------------- `Tag` defined here ... LL |     match Tag::ExifIFDPointer { |           ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error: aborting due to previous error For more information about this error, try `rustc --explain E0004`. </ins>


<ins> #![feature(const_generics)] #![allow(incomplete_features)] fn func<A, const F: fn(inner: A)>(outer: A) { //~^ ERROR: using function pointers as const generic parameters is forbidden F(outer); } fn main() {} </ins>


[[package]] name = "rls" <del> version = "1.39.0" </del> <ins> version = "1.40.0" </ins> dependencies = [ "cargo", "cargo_metadata 0.8.0", "clippy_lints", "crossbeam-channel", "difference", <del> "env_logger 0.6.2", </del> <ins> "env_logger 0.7.0", </ins> "failure", "futures", "heck",


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


}; let encl_def_id = parent_item.unwrap_or(first_item.def_id); <ins> // If parent of encl_def_id is an enum, use the parent ID intead. let encl_def_id = get_parent_if_enum_variant(tcx, encl_def_id); </ins> let ignored_derived_impls = if let Some(ign_traits) = self.ignored_derived_traits.get(&encl_def_id) { let trait_list = ign_traits


- [You can now pass the `--features` option multiple times to enable multiple features.][cargo/7084] <ins> Rustdoc ------- - [Documentation on `pub use` statements is prepended to the documentation of the re-exported item][63048] </ins> Misc ---- - [`rustc` will now warn about some incorrect uses of


let ptr_ty = ptr.ty; // Create an *internal* temp for the pointer, so that unsafety // checking won't complain about the raw pointer assignment. <del> let ptr_temp = this.local_decls.push(LocalDecl::with_source_info( ptr_ty, source_info, ).internal()); </del> <ins> let ptr_temp = this .local_decls .push(LocalDecl::with_source_info(ptr_ty, source_info).internal()); </ins> let ptr_temp = Place::from(ptr_temp); let block = unpack!(this.into(ptr_temp, block, ptr)); this.into(this.hir.tcx().mk_place_deref(ptr_temp), block, val)


fn run(self, builder: &Builder<'_>) { let stage = self.stage; let target = self.target; <ins> let crates = if self.crates.is_empty() { builder .in_tree_crates("sysroot", Some(target)) .iter() .map(|c| c.name.to_string()) .collect() } else { self.crates }; </ins> let out = match self.format { DocumentationFormat::Html => builder.doc_out(target), DocumentationFormat::Json => builder.json_doc_out(target),


<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. pub struct Test; </ins>


use core::borrow::{Borrow, BorrowMut}; use core::iter::FusedIterator; <ins> use core::mem::MaybeUninit; </ins> #[stable(feature = "encode_utf16", since = "1.8.0")] pub use core::str::EncodeUtf16; #[stable(feature = "split_ascii_whitespace", since = "1.34.0")]


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


/// println!("{:?}", Foo(vec![10, 11])); /// ``` #[stable(feature = "debug_builders", since = "1.2.0")] <del> #[inline] </del> pub fn debug_set<'b>(&'b mut self) -> DebugSet<'b, 'a> { builders::debug_set_new(self) }


/// Basic implementation of a `va_list`. // The name is WIP, using `VaListImpl` for now. #[cfg(any( <del> all(not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "x86_64")), </del> <ins> all( not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "s390x"), not(target_arch = "x86_64") ), </ins> all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")), target_family = "wasm", target_arch = "asmjs",


return; } <del> let mut dylib_dirs = vec![self.rustc_libdir(compiler)]; // Ensure that the downloaded LLVM libraries can be found. if self.config.llvm_from_ci { let ci_llvm_lib = self.out.join(&*compiler.host.triple).join("ci-llvm").join("lib"); dylib_dirs.push(ci_llvm_lib); } add_dylib_path(dylib_dirs, cmd); </del> <ins> add_dylib_path(self.rustc_lib_paths(compiler), cmd); </ins> } /// Gets a path to the compiler specified.