#[inline] fn next(&mut self) -> Option<T> { <del> self.iter.next().map(|elt| unsafe { ptr::read(elt) }) </del> <ins> if self.tail == self.head { return None; } let tail = self.tail; self.tail = wrap_index(self.tail.wrapping_add(1), self.ring.len()); // Safety: // - `self.tail` 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(tail))) } </ins> } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { <del> self.iter.size_hint() </del> <ins> let len = count(self.tail, self.head, self.ring.len()); (len, Some(len)) </ins> } }


fn build_external_function(cx: &DocContext, did: DefId) -> clean::Function { let sig = cx.tcx.fn_sig(did); <del> let constness = if cx.tcx.is_const_fn(did) { </del> <ins> let constness = if cx.tcx.is_min_const_fn(did) { </ins> hir::Constness::Const } else { hir::Constness::NotConst


<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. const X: &'static str = "12345"; fn test(s: String) -> bool { match s.as_slice() { X => true, _ => false } } fn main() { assert!(test("12345".to_string())); } </ins>


Some(f) => f, None => return DummyResult::any(sp) }; <del> let file = cx.resolve_path(file, sp); </del> <ins> let file = match cx.resolve_path(file, sp) { Ok(f) => f, Err(mut err) => { err.emit(); return DummyResult::any(sp); }, }; </ins> match cx.source_map().load_binary_file(&file) { Ok(bytes) => match std::str::from_utf8(&bytes) { Ok(src) => {


#[diag(lint_range_endpoint_out_of_range)] pub struct RangeEndpointOutOfRange<'a> { pub ty: &'a str, <del> #[suggestion(code = "{start}..={literal}{suffix}", applicability = "machine-applicable")] pub suggestion: Span, pub start: String, pub literal: u128, pub suffix: &'a str, </del> <ins> #[subdiagnostic] pub sub: UseInclusiveRange<'a>, } #[derive(Subdiagnostic)] pub enum UseInclusiveRange<'a> { #[suggestion( lint_range_use_inclusive_range, code = "{start}..={literal}{suffix}", applicability = "machine-applicable" )] WithoutParen { #[primary_span] sugg: Span, start: String, literal: u128, suffix: &'a str, }, #[multipart_suggestion(lint_range_use_inclusive_range, applicability = "machine-applicable")] WithParen { #[suggestion_part(code = "=")] eq_sugg: Span, #[suggestion_part(code = "{literal}{suffix}")] lit_sugg: Span, literal: u128, suffix: &'a str, }, </ins> } #[derive(LintDiagnostic)]


use rustc_hir as hir; use rustc_middle::mir::visit::MutVisitor; use rustc_middle::mir::{self, dump_mir, MirPass}; <del> use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt}; </del> <ins> use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt, TypeVisitableExt}; </ins> use rustc_target::abi::FieldIdx; pub struct ByMoveBody;


// Parse: `for <src_pat> in <src_expr> <src_loop_block>` let pat = self.parse_pat()?; <del> self.expect_keyword(keywords::In)?; </del> <ins> if !self.eat_keyword(keywords::In) { let in_span = self.prev_span.between(self.span); let mut err = self.sess.span_diagnostic .struct_span_err(in_span, "missing `in` in `for` loop"); err.span_suggestion_short(in_span, "try adding `in` here", " in ".into()); err.emit(); } </ins> let expr = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?; let (iattrs, loop_block) = self.parse_inner_attrs_and_block()?; attrs.extend(iattrs);


<ins> #![feature(const_generics)] #![allow(incomplete_features)] use std::ffi::{CStr, CString}; unsafe fn unsafely_do_the_thing<const F: fn(&CStr) -> usize>(ptr: *const i8) -> usize { //~^ ERROR: using function pointers as const generic parameters is forbidden F(CStr::from_ptr(ptr)) } fn safely_do_the_thing(s: &CStr) -> usize { s.to_bytes().len() } fn main() { let baguette = CString::new("baguette").unwrap(); let ptr = baguette.as_ptr(); println!("{}", unsafe { unsafely_do_the_thing::<safely_do_the_thing>(ptr) }); } </ins>


<ins> // check-pass //! [my_module] //~^ WARN public documentation for `private_from_crate_level` links to private item `my_module` mod my_module {} </ins>


} } <ins> // This stripper discards all private import statements (`use`, `extern crate`) struct ImportStripper; impl fold::DocFolder for ImportStripper { fn fold_item(&mut self, i: Item) -> Option<Item> { match i.inner { clean::ExternCrateItem(..) | clean::ImportItem(..) if i.visibility != Some(hir::Public) => None, _ => self.fold_item_recur(i) } } } pub fn strip_priv_imports(krate: clean::Crate)  -> plugins::PluginResult { (ImportStripper.fold_crate(krate), None) } </ins> pub fn unindent_comments(krate: clean::Crate) -> plugins::PluginResult { struct CommentCleaner;


// except according to those terms. use std::fmt::self; //~ ERROR E0429 <del> //~^ ERROR E0432 </del> fn main () { }


use prelude::v1::*; <ins> #[doc(hidden)] pub use self::imp::KeyInner as __KeyInner; </ins> /// Type representing a thread local storage key corresponding to a reference /// to the type parameter `T`. ///


pub fn has_errors(&self) -> bool { self.diagnostic().has_errors() } <ins> pub fn has_errors_or_delayed_span_bugs(&self) -> bool { self.diagnostic().has_errors_or_delayed_span_bugs() } </ins> pub fn abort_if_errors(&self) { self.diagnostic().abort_if_errors(); }


<del> Subproject commit 6b3dbcc81a470e5da84576d63fcfc19e3b1154cd </del> <ins> Subproject commit 221a195b62f4373a8893f4d022e4ce981b09a857 </ins>


<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn foo(_: &'static u32) {} fn unpromotable<T>(t: T) -> T { t } fn main() { foo(&unpromotable(5u32)); } //~^^ ERROR borrowed value does not live long enough </ins>


/// Constructs a floating point number by multiplying `x` by 2 raised to the /// power of `exp` #[inline] <del> fn ldexp(x: f32, exp: int) -> f32 { unsafe { cmath::ldexpf(x, exp as c_int) } </del> <ins> fn ldexp(self, exp: isize) -> f32 { unsafe { cmath::ldexpf(self, exp as c_int) } </ins> } /// Breaks the number into a normalized fraction and a base-2 exponent,


# # Check travis config for `gdb --batch` command to print all crash logs <ins> parameters: # When this parameter is set to anything other than an empty string the tests # will only be executed when the commit updates submodules only_on_updated_submodules: '' </ins> steps: # Disable automatic line ending conversion, which is enabled by default on


.find_ancestor_inside(value.span) .map(|span| (value.span.with_hi(span.lo()), value.span.with_lo(span.hi()))), ast::ExprKind::Paren(ref expr) => { <del> expr.span.find_ancestor_inside(value.span).map(|expr_span| { </del> <ins> // For the expr with attributes, like `let _ = (#[inline] || println!("Hello!"));`, // the span should contains the attributes, or the suggestion will remove them. let expr_span_with_attrs = if let Some(attr_lo) = expr.attrs.iter().map(|attr| attr.span.lo()).min() { expr.span.with_lo(attr_lo) } else { expr.span }; expr_span_with_attrs.find_ancestor_inside(value.span).map(|expr_span| { </ins> (value.span.with_hi(expr_span.lo()), value.span.with_lo(expr_span.hi())) }) }


assert_eq!(id, LOCAL_CRATE); tcx.crate_name }; <del> providers.maybe_unused_trait_import = |tcx, id| tcx.resolutions(()).maybe_unused_trait_imports.contains(&id); </del> <ins> providers.maybe_unused_trait_imports = |tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports; </ins> providers.maybe_unused_extern_crates = |tcx, ()| &tcx.resolutions(()).maybe_unused_extern_crates[..]; providers.names_imported_by_glob_use = |tcx, id| {


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


<ins> // https://github.com/rust-lang/rust/issues/113462 struct S2<'b>(&'b ()); struct S<'a, const N: S2>(&'a ()); //~^ ERROR missing lifetime specifier [E0106] //~| ERROR `S2<'_>` is forbidden as the type of a const generic parameter fn main() {} </ins>


| token::CloseDelim(DelimToken::NoDelim) // The pretty printer collapses many semicolons into one. | token::Semi <ins> // We don't preserve leading `|` tokens in patterns, so // we ignore them entirely | token::BinOp(token::BinOpToken::Or) // We don't preserve trailing '+' tokens in trait bounds, // so we ignore them entirely | token::BinOp(token::BinOpToken::Plus) </ins> // The pretty printer can turn `$crate` into `::crate_name` | token::ModSep = token.kind { return false;


<ins> // edition:2018 struct S { foo: usize, } impl S { async fn bar(&self) { //~ HELP consider changing this to be a mutable reference //~| SUGGESTION &mut self self.foo += 1; //~ ERROR cannot assign to `self.foo`, which is behind a `&` reference [E0594] } } fn main() { S { foo: 1 }.bar(); } </ins>


<ins> // check-pass struct Foo { foo: Option<&'static Foo> } static FOO: Foo = Foo { foo: Some(&FOO), }; fn main() {} </ins>


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn foo(params: Option<&[&str]>) -> uint { params.unwrap().head().unwrap().len() } fn main() { let name = "Foo"; let msg = foo(Some(&[name.as_slice()])); //~^ ERROR mismatched types: expected `core::option::Option<&[&str]>` assert_eq!(msg, 3); } </ins>


fn ty_generics<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, space: ParamSpace, ast_generics: &hir::Generics, <del> base_generics: &ty::Generics<'tcx>) </del> <ins> base_generics: &ty::Generics<'tcx>, allow_defaults: bool) </ins> -> ty::Generics<'tcx> { let tcx = ccx.tcx;


<del> Subproject commit 81e59e6b92cf1729aabbbbf09b81a81a03775d64 </del> <ins> Subproject commit dadcbebfbd017aac2358cf652a4bd71a91694edc </ins>


// Output the documentation for each function individually if !required.is_empty() { write!(w, "
Required Methods

 Required Methods

 ")?; for m in &required {


<ins> error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-101421.rs:10:8 | LL |     ().f::<()>(()); |        ^------ help: remove these generics |        | |        expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-101421.rs:2:8 | LL |     fn f(&self, _: ()); |        ^ error: aborting due to previous error For more information about this error, try `rustc --explain E0107`. </ins>


<ins> // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #79251 struct Node<const D: usize> where SmallVec<{ D * 2 }>: , { keys: SmallVec<{ D * 2 }>, } impl<const D: usize> Node<D> where SmallVec<{ D * 2 }>: , { fn new() -> Self { let mut node = Node::new(); node.keys.some_function(); //~^ error: no method named node } } struct SmallVec<const D: usize> {} fn main() {} </ins>


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub mod two_tuple { trait T {} struct P<'a>(&'a T + 'a, &'a T + 'a); pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> { P(car, cdr) } } pub mod two_fields { trait T {} struct P<'a> { car: &'a T + 'a, cdr: &'a T + 'a } pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> { P{ car: car, cdr: cdr } } } fn main() {} </ins>


rhses: &[quoted::TokenTree]) -> Box<MacResult+'cx> { if cx.trace_macros() { <del> let sp = sp.macro_backtrace().last().map(|trace| trace.call_site).unwrap_or(sp); let mut values: &mut Vec<String> = cx.expansions.entry(sp).or_insert_with(Vec::new); values.push(format!("expands to `{}! {{ {} }}`", name, arg)); </del> <ins> trace_macros_note(cx, sp, format!("expanding `{}! {{ {} }}`", name, arg)); </ins> } // Which arm's failure should we report? (the one furthest along)


<ins> #![crate_name = "foo"] // @has 'foo/trait.Unsafe.html' // @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' // @has - '//*[@id="object-safety"]' 'Object Safety' pub trait Unsafe { fn foo() -> Self; } // @has 'foo/trait.Unsafe2.html' // @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' // @has - '//*[@id="object-safety"]' 'Object Safety' pub trait Unsafe2<T> { fn foo(i: T); } // @has 'foo/trait.Safe.html' // @!has - '//*[@class="object-safety-info"]' '' // @!has - '//*[@id="object-safety"]' '' pub trait Safe { fn foo(&self); } // @has 'foo/struct.Foo.html' // @!has - '//*[@class="object-safety-info"]' '' // @!has - '//*[@id="object-safety"]' '' pub struct Foo; </ins>


config.as_ref().cloned().unwrap_or_else(|| PathBuf::from(default)) } <del> fn prepare_dir(mut path: PathBuf) -> String { </del> <ins> fn prepare_dir(destdir_env: &Option<PathBuf>, mut path: PathBuf) -> String { </ins> // The DESTDIR environment variable is a standard way to install software in a subdirectory // while keeping the original directory structure, even if the prefix or other directories // contain absolute paths. // // More information on the environment variable is available here: // https://www.gnu.org/prep/standards/html_node/DESTDIR.html <del> if let Some(destdir) = env::var_os("DESTDIR").map(PathBuf::from) { // Sanity check for the user write access on DESTDIR assert!(is_dir_writable_for_user(&destdir), "User doesn't have write access on DESTDIR."); </del> <ins> if let Some(destdir) = destdir_env { </ins> let without_destdir = path.clone(); <del> path = destdir; </del> <ins> path = destdir.clone(); </ins> // Custom .join() which ignores disk roots. for part in without_destdir.components() { if let Component::Normal(s) = part {


<ins> trait Hello { fn example(val: ()); } struct Test1(i32); impl Hello for Test1 { fn example(&self, input: &i32) { //~^ ERROR `&self` declaration in the impl, but not in the trait *input = self.0; //~^ ERROR cannot assign to `*input`, which is behind a `&` reference } } fn main() {} </ins>


<ins> error[E0308]: mismatched types --> $DIR/issue-46112.rs:19:21 | 19 | fn main() { test(Ok(())); } |                     ^^ |                     | |                     expected enum `std::option::Option`, found () |                     help: try using a variant of the expected type: `Some(())` | = note: expected type `std::option::Option<()>` found type `()` error: aborting due to previous error </ins>


options: TargetOptions { // Info about features at https://wiki.debian.org/ArmHardFloatPort <del> features: "+v7,+vfp3,+d16,+thumb2".to_string(), </del> <ins> features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), </ins> cpu: "generic".to_string(), max_atomic_width: 64, .. base


OverloadedOperator, ClosureInvocation, ForLoop, <ins> MatchDiscriminant </ins> } #[deriving(PartialEq,Show)]


key!(limit_rdylib_exports, bool); key!(override_export_symbols, opt_list); key!(merge_functions, MergeFunctions)?; <del> key!(mcount = "target_mcount"); </del> <ins> key!(mcount = "target-mcount"); </ins> key!(llvm_abiname); key!(relax_elf_relocations, bool); key!(llvm_args, list);


id: fld.new_id(a.id), } } //used in noop_fold_expr, and possibly elsewhere in the future fn fold_mac_(m: &mac, fld: @ast_fold) -> mac { spanned { <del> node: match m.node { mac_invoc_tt(*) => copy m.node }, span: fld.new_span(m.span), </del> <ins> node: match m.node { mac_invoc_tt(p,ref tts) => mac_invoc_tt(fld.fold_path(p), fold_tts(*tts,fld)) }, span: fld.new_span(m.span) } } fn fold_tts(tts : &[token_tree], fld: @ast_fold) -> ~[token_tree] { do tts.map |tt| { match *tt { tt_tok(span, ref tok) => tt_tok(span,maybe_fold_ident(tok,fld)), tt_delim(ref tts) => tt_delim(fold_tts(*tts,fld)), tt_seq(span, ref pattern, ref sep, is_optional) => tt_seq(span, fold_tts(*pattern,fld), sep.map(|tok|maybe_fold_ident(tok,fld)), is_optional), tt_nonterminal(sp,ref ident) => tt_nonterminal(sp,fld.fold_ident(*ident)) } } } // apply ident folder if it's an ident, otherwise leave it alone fn maybe_fold_ident(t : &token::Token, fld: @ast_fold) -> token::Token { match *t { token::IDENT(id,followed_by_colons) => token::IDENT(fld.fold_ident(id),followed_by_colons), _ => copy *t </ins> } }


self.fields.infcx.tcx } <ins> fn relate_item_args( &mut self, item_def_id: rustc_hir::def_id::DefId, a_arg: ty::GenericArgsRef<'tcx>, b_arg: ty::GenericArgsRef<'tcx>, ) -> RelateResult<'tcx, ty::GenericArgsRef<'tcx>> { if self.ambient_variance == ty::Variance::Invariant { // Avoid fetching the variance if we are in an invariant // context; no need, and it can induce dependency cycles // (e.g., #41849). relate_args_invariantly(self, a_arg, b_arg) } else { let tcx = self.tcx(); let opt_variances = tcx.variances_of(item_def_id); relate_args_with_variances(self, item_def_id, opt_variances, a_arg, b_arg, false) } } </ins> fn relate_with_variance<T: Relate<'tcx>>( &mut self, variance: ty::Variance,


.map(|did| tcx.provided_trait_methods(did).map(|meth| meth.name).collect()) .unwrap_or_default() } <ins> pub(crate) fn is_negative_trait_impl(&self) -> bool { matches!(self.polarity, ty::ImplPolarity::Negative) } </ins> } #[derive(Clone, Debug)]


use rustc_errors::{Applicability, DiagnosticBuilder}; <ins> use rustc_infer::infer::TyCtxtInferExt; </ins> use rustc_middle::mir::*; use rustc_middle::ty; use rustc_span::source_map::DesugaringKind;


#[test] fn wtf8buf_show() { <del> let mut string = Wtf8Buf::from_str("aé 💩"); </del> <ins> let mut string = Wtf8Buf::from_str("até 💩r"); </ins> string.push(CodePoint::from_u32(0xD800).unwrap()); <del> assert_eq!(format!("{:?}", string), r#""aé 💩u{D800}""#); </del> <ins> assert_eq!(format!("{:?}", string), r#""atu{e9} u{1f4a9}ru{D800}""#); </ins> } #[test]


getSearchInput().focus(); } <del> // Removes the focus from the search bar </del> <ins> // Removes the focus from the search bar. </ins> function defocusSearchBar() { getSearchInput().blur(); }


self.warn_dead_code(impl_item.id, impl_item.span, impl_item.name, <del> "associated const"); </del> <ins> "associated const", "used"); </ins> } self.visit_nested_body(body_id) } hir::ImplItemKind::Method(_, body_id) => { if !self.symbol_is_live(impl_item.id, None) { let span = self.tcx.sess.codemap().def_span(impl_item.span); <del> self.warn_dead_code(impl_item.id, span, impl_item.name, "method"); </del> <ins> self.warn_dead_code(impl_item.id, span, impl_item.name, "method", "used"); </ins> } self.visit_nested_body(body_id) }


<ins> // This test asserts that `index` is not polluted with unrelated items. // See https://github.com/rust-lang/rust/issues/114039 //@ count "$.index[*]" 1 fn main() {} </ins>


expected, found, block_or_return_id, <del> parent_id, </del> <ins> fcx.body_id, </ins> ); }


<ins> // force-host // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::{Group, Spacing, Punct, TokenTree, TokenStream}; // This macro exists as part of a reproduction of #61963 but without using quote/syn/proc_macro2. #[proc_macro_attribute] pub fn dom_struct(_: TokenStream, input: TokenStream) -> TokenStream { // Construct the expected output tokens - the input but with a `#[derive(DomObject)]` applied. let attributes: TokenStream = "#[derive(DomObject)]".to_string().parse().unwrap(); let output: TokenStream = attributes.into_iter() .chain(input.into_iter()).collect(); let mut tokens: Vec<_> = output.into_iter().collect(); // Adjust the spacing of `>` tokens to match what `quote` would produce. for token in tokens.iter_mut() { if let TokenTree::Group(group) = token { let mut tokens: Vec<_> = group.stream().into_iter().collect(); for token in tokens.iter_mut() { if let TokenTree::Punct(p) = token { if p.as_char() == '>' { *p = Punct::new('>', Spacing::Alone); } } } let mut stream = TokenStream::new(); stream.extend(tokens); *group = Group::new(group.delimiter(), stream); } } let mut output = TokenStream::new(); output.extend(tokens); output } </ins>


self.assign(local, DefLocation::Body(location)); } <del> PlaceContext::NonUse(_) | PlaceContext::MutatingUse(MutatingUseContext::Retag) => {} </del> <ins> PlaceContext::NonUse(_) | PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | PlaceContext::MutatingUse(MutatingUseContext::Retag) => {} </ins> PlaceContext::NonMutatingUse( NonMutatingUseContext::Copy | NonMutatingUseContext::Move,


<ins> // compile-flags: -Zvalidate-mir fn _test() { let x = || 45; missing(); //~^ ERROR cannot find function `missing` in this scope } fn main() {} </ins>


| ------- similarly named trait `I` defined here LL | type K = dyn I; LL | impl K for isize {} <del> |      ^ |      | |      type aliases cannot be used as traits |      help: a trait with a similar name exists: `I` </del> <ins> |      ^ type aliases cannot be used as traits </ins> | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias <del> --> $DIR/issue-5035.rs:2:1 </del> | <del> LL | type K = dyn I; | ^^^^^^^^^^^^^^^ </del> <ins> LL | trait K = dyn I; | help: a trait with a similar name exists | LL | impl I for isize {} |      ^ </ins> error: aborting due to 2 previous errors


<ins> #[deprecated = b"test"] //~ ERROR attribute must be of the form fn foo() {} fn main() {} </ins>


F: FnOnce(&T) -> R { unsafe { <del> let ptr = self.inner.get(); </del> <ins> let ptr = (self.inner)().get(); </ins> assert!(!ptr.is_null(), "cannot access a scoped thread local  variable without calling `set` first"); cb(&*ptr)


strings.insert("setab".to_string(), b"x1B[4%p1%dm".to_vec()); let mut numbers = HashMap::new(); <del> numbers.insert("colors".to_string(), 8u16); </del> <ins> numbers.insert("colors".to_string(), 8); </ins> TermInfo { names: vec!["cygwin".to_string()], // msys is a fork of an older cygwin version


<ins> // force-host // no-prefer-dynamic #![crate_type="lib"] // Issue 111888: this crate (1.) is imported by a proc-macro crate and (2.) // exports a no_mangle function; that combination of acts was broken for some // period of time. See further discussion in the test file that imports this // crate. #[no_mangle] pub fn some_no_mangle_function() { } </ins>


use std::collections::HashMap; use std::collections::hashmap::{Occupied, Vacant}; use std::slice; <del> use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64}; </del> <ins> use std::{int, i8, i16, i32, i64, uint, u8, u16, u32, u64, f32, f64}; </ins> use syntax::abi; use syntax::ast_map; <ins> use syntax::ast_util::is_shift_binop; </ins> use syntax::attr::AttrMetaMethods; use syntax::attr; use syntax::codemap::Span; use syntax::parse::token; use syntax::{ast, ast_util, visit}; <ins> use syntax::ast::{TyI, TyU, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64}; </ins> use syntax::ptr::P; use syntax::visit::Visitor;


<ins> error: this file contains an unclosed delimiter --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |     --    ^ |     || |     |unclosed delimiter |     unclosed delimiter error: this file contains an unclosed delimiter --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |     --    ^ |     || |     |unclosed delimiter |     unclosed delimiter error: expected pattern, found `=` --> $DIR/issue-81804.rs:9:7 | LL | fn p([=(} |       ^ expected pattern error: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` --> $DIR/issue-81804.rs:9:8 | LL | fn p([=(} |        ^ -^ |        | | |        | help: `)` may belong here |        unclosed delimiter error: expected item, found `]` --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |           ^ expected item error: aborting due to 5 previous errors </ins>


<ins> #![feature(optin_builtin_traits)] // Test for issue #56934 - that it is impossible to redundantly // implement an auto-trait for a trait object type that contains it. // Positive impl variant. auto trait Marker1 {} auto trait Marker2 {} trait Object: Marker1 {} // A supertrait marker is illegal... impl Marker1 for dyn Object + Marker2 { }   //~ ERROR E0371 // ...and also a direct component. impl Marker2 for dyn Object + Marker2 { }   //~ ERROR E0371 // But implementing a marker if it is not present is OK. impl Marker2 for dyn Object {} // OK // A non-principal trait-object type is orphan even in its crate. unsafe impl Send for dyn Marker2 {} //~ ERROR E0117 // And impl'ing a remote marker for a local trait object is forbidden // by one of these special orphan-like rules. unsafe impl Send for dyn Object {} //~ ERROR E0321 unsafe impl Send for dyn Object + Marker2 {} //~ ERROR E0321 fn main() { } </ins>


let mut rbml_w = Encoder::new(wr); <ins> encode_rustc_version(&mut rbml_w); </ins> encode_crate_name(&mut rbml_w, &ecx.link_meta.crate_name); encode_crate_triple(&mut rbml_w, &tcx.sess.opts.target_triple); encode_hash(&mut rbml_w, &ecx.link_meta.crate_hash);


<ins> //@ run-rustfix // Check the `unused_parens` suggestion for paren_expr with attributes. // The suggestion should retain attributes in the front. #![feature(stmt_expr_attributes)] #![deny(unused_parens)] pub fn foo() -> impl Fn() { let _ = #[inline] #[allow(dead_code)] || println!("Hello!"); //~ERROR unnecessary parentheses #[inline] #[allow(dead_code)] || println!("Hello!") //~ERROR unnecessary parentheses } fn main() { let _ = foo(); } </ins>


} fn lower_expr_yield(&mut self, span: Span, opt_expr: Option<&Expr>) -> hir::ExprKind<'hir> { <ins> let yielded = opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span)); </ins> let is_async_gen = match self.coroutine_kind { Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Gen, _)) => false, Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::AsyncGen, _)) => true, Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _)) => { <del> return hir::ExprKind::Err( self.dcx().emit_err(AsyncCoroutinesNotSupported { span }), </del> <ins> // Lower to a block `{ EXPR; <error> }` so that the awaited expr // is not accidentally orphaned. let stmt_id = self.next_id(); let expr_err = self.expr( yielded.span, hir::ExprKind::Err(self.dcx().emit_err(AsyncCoroutinesNotSupported { span })), ); return hir::ExprKind::Block( self.block_all( yielded.span, arena_vec![self; hir::Stmt { hir_id: stmt_id, kind: hir::StmtKind::Semi(yielded), span: yielded.span, }], Some(self.arena.alloc(expr_err)), ), None, </ins> ); } Some(hir::CoroutineKind::Coroutine(_)) => {


<ins> // unit-test: DeadStoreElimination // compile-flags: -Zmir-keep-place-mention // EMIT_MIR place_mention.main.DeadStoreElimination.diff fn main() { // Verify that we account for the `PlaceMention` statement as a use of the tuple, // and don't remove it as a dead store. let (_, _) = ("Hello", "World"); } </ins>


expr: &'tcx hir::Expr<'tcx>, ty: &str, ) -> bool { <ins> // Look past casts to support cases like `0..256 as u8` let (expr, lit_span) = if let Node::Expr(par_expr) = cx.tcx.hir().get(cx.tcx.hir().parent_id(expr.hir_id)) && let ExprKind::Cast(_, _) = par_expr.kind { (par_expr, expr.span) } else { (expr, expr.span) }; </ins> // We only want to handle exclusive (`..`) ranges, // which are represented as `ExprKind::Struct`. let par_id = cx.tcx.hir().parent_id(expr.hir_id);


let mut confirm_cx = ConfirmContext::new(self, span, self_expr, call_expr); confirm_cx.confirm(unadjusted_self_ty, pick, segment) } <ins> pub fn confirm_method_for_diagnostic( &self, span: Span, self_expr: &'tcx hir::Expr<'tcx>, call_expr: &'tcx hir::Expr<'tcx>, unadjusted_self_ty: Ty<'tcx>, pick: &probe::Pick<'tcx>, segment: &hir::PathSegment<'_>, ) -> ConfirmResult<'tcx> { let mut confirm_cx = ConfirmContext::new(self, span, self_expr, call_expr); confirm_cx.skip_record_for_diagnostics = true; confirm_cx.confirm(unadjusted_self_ty, pick, segment) } </ins> } impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {


pub fn get_z(x: S) -> u64; pub fn get_c_many_params(_: *const (), _: *const (), _: *const (), _: *const (), f: Quad) -> u64; <ins> pub fn get_c_exhaust_sysv64_ints( _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), _: *const (), h: QuadFloats, ) -> f32; </ins> pub fn rust_dbg_abi_1(q: Quad) -> Quad; pub fn rust_dbg_abi_2(f: Floats) -> Floats; }


// Refers to temporaries which cannot be promoted as // promote_consts decided they weren't simple enough. <ins> // FIXME(oli-obk,eddyb): Remove this flag entirely and // solely process this information via `IsNotConst`. </ins> struct IsNotPromotable; impl Qualif for IsNotPromotable {


COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)" <del> # LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMPILE_FLAGS+= -Cpanic=abort endif </del> all: $(RUSTC) $(COMPILE_FLAGS) test.rs $(call RUN,test) || exit 1


let mut impl_items = Buffer::empty_from(w); let mut default_impl_items = Buffer::empty_from(w); <ins> let impl_ = i.inner_impl(); </ins> <del> for trait_item in &i.inner_impl().items { doc_impl_item( &mut default_impl_items, &mut impl_items, cx, trait_item, if trait_.is_some() { &i.impl_item } else { parent }, link, render_mode, false, trait_, rendering_params, ); </del> <ins> if !impl_.is_negative_trait_impl() { for trait_item in &impl_.items { doc_impl_item( &mut default_impl_items, &mut impl_items, cx, trait_item, if trait_.is_some() { &i.impl_item } else { parent }, link, render_mode, false, trait_, rendering_params, ); } </ins> } fn render_default_items(


assert_eq!(cnum, LOCAL_CRATE); let mut visible_parent_map: DefIdMap<DefId> = DefIdMap(); <ins> // Issue 46112: We want the map to prefer the shortest // paths when reporting the path to an item. Therefore we // build up the map via a breadth-first search (BFS), // which naturally yields minimal-length paths. // // Note that it needs to be a BFS over the whole forest of // crates, not just each individual crate; otherwise you // only get paths that are locally minimal with respect to // whatever crate we happened to encounter first in this // traversal, but not globally minimal across all crates. let bfs_queue = &mut VecDeque::new(); </ins> for &cnum in tcx.crates().iter() { // Ignore crates without a corresponding local `extern crate` item. if tcx.missing_extern_crate_item(cnum) { continue } <del> let bfs_queue = &mut VecDeque::new(); </del> <ins> bfs_queue.push_back(DefId { krate: cnum, index: CRATE_DEF_INDEX }); } // (restrict scope of mutable-borrow of `visible_parent_map`) { </ins> let visible_parent_map = &mut visible_parent_map; let mut add_child = |bfs_queue: &mut VecDeque<_>, child: &def::Export,


<ins> // This test ensures that negative impls don't have items listed inside them. #![feature(negative_impls)] #![crate_name = "foo"] pub struct Thing; //@ has 'foo/struct.Thing.html' // We check the full path to ensure there is no `<details>` element. //@ has - '//div[@id="trait-implementations-list"]/section[@id="impl-Iterator-for-Thing"]/h3'  // 'impl !Iterator for Thing' impl !Iterator for Thing {} // This struct will allow us to compare both paths. pub struct Witness; //@ has 'foo/struct.Witness.html' //@ has - '//div[@id="trait-implementations-list"]/details//section[@id="impl-Iterator-for-Witness"]/h3'  // 'impl Iterator for Witness' impl Iterator for Witness { type Item = u8; fn next(&mut self) -> Option<Self::Item> { None } } </ins>


<ins> // Confusing diagnostic when using variable as a type: // // Previous warnings indicate Foo is not used, when in fact it is // used improperly as a variable or constant. New warning points // out user may be trying to use variable as a type. Test demonstrates // cases for both local variable and const. fn main() { let Baz: &str = ""; println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz` } #[allow(non_upper_case_globals)] pub const Foo: &str = ""; mod submod { use super::Foo; fn function() { println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo` } } </ins>


<ins> fn main() {} trait T { fn qux() -> Option<usize> { let _ = if true { }); //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;` //~^^ ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `}` //~^^^ ERROR 6:11: 6:12: expected identifier, found `;` //~^^^^ ERROR missing `fn`, `type`, or `const` for trait-item declaration Some(4) } </ins>


// Make this module private for now since external users should not call these directly. mod rustc_smir; <ins> #[macro_use] extern crate scoped_tls; </ins>


throw_ub_custom!(fluent::const_eval_copy_nonoverlapping_overlapping); } } <ins> } </ins> <del> for i in 0..num_copies { ptr::copy( src_bytes, dest_bytes.add((size * i).bytes_usize()), // `Size` multiplication size.bytes_usize(), ); </del> <ins> let size_in_bytes = size.bytes_usize(); // For particularly large arrays (where this is perf-sensitive) it's common that // we're writing a single byte repeatedly. So, optimize that case to a memset. if size_in_bytes == 1 && num_copies >= 1 { // SAFETY: `src_bytes` would be read from anyway by copies below (num_copies >= 1). // Since size_in_bytes = 1, then the `init.no_bytes_init()` check above guarantees // that this read at type `u8` is OK -- it must be an initialized byte. let value = *src_bytes; dest_bytes.write_bytes(value, (size * num_copies).bytes_usize()); } else if src_alloc_id == dest_alloc_id { let mut dest_ptr = dest_bytes; for _ in 0..num_copies { ptr::copy(src_bytes, dest_ptr, size_in_bytes); dest_ptr = dest_ptr.add(size_in_bytes); </ins> } } else { <del> for i in 0..num_copies { ptr::copy_nonoverlapping( src_bytes, dest_bytes.add((size * i).bytes_usize()), // `Size` multiplication size.bytes_usize(), ); </del> <ins> let mut dest_ptr = dest_bytes; for _ in 0..num_copies { ptr::copy_nonoverlapping(src_bytes, dest_ptr, size_in_bytes); dest_ptr = dest_ptr.add(size_in_bytes); </ins> } } }


sysinfo = { version = "0.26.0", optional = true } clap = { version = "4.2.4", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] } clap_complete = "4.2.2" <ins> semver = "1.0.17" </ins> # Solaris doesn't support flock() and thus fd-lock is not option now [target.'cfg(not(target_os = "solaris"))'.dependencies]


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


None } }) <del> .filter(|feature| { RUSTC_SPECIAL_FEATURES.contains(feature) || features.contains(&Symbol::intern(feature)) }) </del> <ins> .filter(|feature| features.contains(&Symbol::intern(feature))) </ins> .map(|feature| Symbol::intern(feature)) .collect() }


c::BCRYPT_USE_SYSTEM_PREFERRED_RNG, ) }; <del> if ret == 0 { Ok(v) } else { Err(io::Error::last_os_error()) } </del> <ins> if ret != 0 { fallback_rng() } else { v } </ins> } /// Generate random numbers using the fallback RNG function (RtlGenRandom) #[cfg(not(target_vendor = "uwp"))] <del> fn fallback_rng() -> Result<(u64, u64), io::Error> { </del> <ins> #[inline(never)] fn fallback_rng() -> (u64, u64) { </ins> let mut v = (0, 0); let ret = unsafe { c::RtlGenRandom(&mut v as *mut _ as *mut u8, mem::size_of_val(&v) as c::ULONG) }; <del> if ret != 0 { Ok(v) } else { Err(io::Error::last_os_error()) } </del> <ins> if ret != 0 { v } else { panic!("fallback RNG broken: {}", io::Error::last_os_error()) } </ins> } /// We can't use RtlGenRandom with UWP, so there is no fallback #[cfg(target_vendor = "uwp")] <del> fn fallback_rng() -> Result<(u64, u64), io::Error> { Err(io::const_io_error!(io::ErrorKind::Unsupported, "RtlGenRandom() not supported on UWP")) </del> <ins> #[inline(never)] fn fallback_rng() -> (u64, u64) { panic!("fallback RNG broken: RtlGenRandom() not supported on UWP"); </ins> }


# libcurl, instead it should compile its own. ENV LIBCURL_NO_PKG_CONFIG 1 <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 `src/ci/run.sh` where this takes effect. ENV SET_HARD_RLIMIT_STACK 1 </ins> ENV DIST_REQUIRE_ALL_TOOLS 1


/// println!("last OS error: {:?}", Error::last_os_error()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] <ins> #[inline] </ins> pub fn last_os_error() -> Error { Error::from_raw_os_error(sys::os::errno() as i32) }


/// /// # Examples ///  /// Converts an Option<[String]> into an Option<[usize]>, consuming /// the original:   /// Calculates the length of an Option<[String]> as an /// Option<[usize]>, consuming the original:  /// /// [String]: ../../std/string/struct.String.html "String" /// ```


&mut err, ); <ins> self.suggest_deref_unwrap_or( &mut err, error_span, callee_ty, call_ident, expected_ty, provided_ty, provided_args[*provided_idx], is_method, ); </ins> // Call out where the function is defined self.label_fn_like( &mut err,


} unsafe fn get_stackp() -> *mut libc::c_void { <del> let stackp = mmap(ptr::null_mut(), SIGSTKSZ, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); </del> <ins> let stackp = mmap( ptr::null_mut(), SIGSTKSZ + page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0, ); </ins> if stackp == MAP_FAILED { panic!("failed to allocate an alternative stack"); } <del> stackp </del> <ins> let guard_result = libc::mprotect(stackp, page_size(), PROT_NONE); if guard_result != 0 { panic!("failed to set up alternative stack guard page"); } stackp.add(page_size()) </ins> } #[cfg(any(


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


use super::*; use crate::panic::{RefUnwindSafe, UnwindSafe}; <ins> use crate::sync::mpsc::sync_channel; </ins> use crate::thread; #[test]


} fn maybe_stage_features(sess: &Session, krate: &ast::Crate) { <ins> use rustc_errors::Applicability; </ins> if !sess.opts.unstable_features.is_nightly_build() { <ins> let lang_features = &sess.features_untracked().declared_lang_features; </ins> for attr in krate.attrs.iter().filter(|attr| sess.check_name(attr, sym::feature)) { <del> struct_span_err!( </del> <ins> let mut err = struct_span_err!( </ins> sess.parse_sess.span_diagnostic, attr.span, E0554, "`#![feature]` may not be used on the {} release channel", option_env!("CFG_RELEASE_CHANNEL").unwrap_or("(unknown)") <del> ) .emit(); </del> <ins> ); let mut all_stable = true; for ident in attr.meta_item_list().into_iter().flatten().map(|nested| nested.ident()).flatten() { let name = ident.name; let stable_since = lang_features .iter() .flat_map(|&(feature, _, since)| if feature == name { since } else { None }) .next(); if let Some(since) = stable_since { err.help(&format!( "the feature `{}` has been stable since {} and no longer requires  an attribute to enable", name, since )); } else { all_stable = false; } } if all_stable { err.span_suggestion( attr.span, "remove the attribute", String::new(), Applicability::MachineApplicable, ); } err.emit(); </ins> } } }


-include ../tools.mk <ins> LOG := $(TMPDIR)/log.txt # FIXME(#46126) ThinLTO for libstd broke this test ifeq (1,0) </ins> all: ifeq ($(TARGET),x86_64-unknown-linux-gnu) ifdef SANITIZER_SUPPORT $(RUSTC) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | grep -q librustc_lsan <del> $(TMPDIR)/leak 2>&1 | grep -q 'detected memory leaks' </del> <ins> $(TMPDIR)/leak 2>&1 | tee $(LOG) grep -q 'detected memory leaks' $(LOG) endif </ins> endif <ins> else all: </ins> endif


<del> Subproject commit e57bd02999c9f40d52116e0beca7d1dccb0643de </del> <ins> Subproject commit bda50510d1daf6e9c53ad6ccf603da6e0fa8103f </ins>


<ins> error: any use of this value will cause an error --> $DIR/const-external-macro-const-err.rs:12:5 | LL |     static_assert!(2 + 2 == 5); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 | = note: `#[deny(const_err)]` on by default = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error </ins>


<ins> // Non-regression test for issue #122674: a change in the format args visitor missed nested awaits. //@ edition: 2021 //@ check-pass pub fn f1() -> impl std::future::Future<Output = Result<(), String>> + Send { async { should_work().await?; Ok(()) } } async fn should_work() -> Result<String, String> { let x = 1; Err(format!("test: {}: {}", x, inner().await?)) } async fn inner() -> Result<String, String> { Ok("test".to_string()) } fn main() {} </ins>


version = "0.12.0" 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> ] [[package]]


Adjust, Adjustment, AutoBorrow, AutoBorrowMutability, PointerCast, }; use rustc_middle::ty::subst::{InternalSubsts, SubstsRef}; <del> use rustc_middle::ty::{self, AdtKind, Ty}; </del> <ins> use rustc_middle::ty::{self, AdtKind, Ty, TypeFoldable}; </ins> use rustc_span::Span; impl<'tcx> Mirror<'tcx> for &'tcx hir::Expr<'tcx> {


} } <ins> const LOADERS: &Vec<&'static u8> = &Vec::new(); pub fn break_code() -> Option<&'static u8> { for loader in *LOADERS { //~ ERROR cannot move out of a shared reference return Some(loader); } None } </ins> fn main() {}


let stdin = stdin.to_handle(c::STD_INPUT_HANDLE, &mut pipes.stdin)?; let stdout = stdout.to_handle(c::STD_OUTPUT_HANDLE, &mut pipes.stdout)?; let stderr = stderr.to_handle(c::STD_ERROR_HANDLE, &mut pipes.stderr)?; <del> si.hStdInput = stdin.as_raw_handle(); si.hStdOutput = stdout.as_raw_handle(); si.hStdError = stderr.as_raw_handle(); </del> <ins> let mut si = zeroed_startupinfo(); si.cb = mem::size_of::<c::STARTUPINFO>() as c::DWORD; // If at least one of stdin, stdout or stderr are set (i.e. are non null) // then set the `hStd` fields in `STARTUPINFO`. // Otherwise skip this and allow the OS to apply its default behaviour. // This provides more consistent behaviour between Win7 and Win8+. let is_set = |stdio: &Handle| !stdio.as_raw_handle().is_null(); if is_set(&stderr) || is_set(&stdout) || is_set(&stdin) { si.dwFlags |= c::STARTF_USESTDHANDLES; si.hStdInput = stdin.as_raw_handle(); si.hStdOutput = stdout.as_raw_handle(); si.hStdError = stderr.as_raw_handle(); } </ins> unsafe { cvt(c::CreateProcessW(


return None } None => { <del> if !tcx.sess.has_errors() { </del> <ins> if !tcx.sess.has_errors_or_delayed_span_bugs() { </ins> bug!("try_mark_previous_green() - Forcing the DepNode  should have set its color") } else { <del> // If the query we just forced has resulted // in some kind of compilation error, we // don't expect that the corresponding // dep-node color has been updated. </del> <ins> // If the query we just forced has resulted in // some kind of compilation error, we cannot rely on // the dep-node color having been properly updated. // This means that the query system has reached an // invalid state. We let the compiler continue (by // returning `None`) so it can emit error messages // and wind down, but rely on the fact that this // invalid state will not be persisted to the // incremental compilation cache because of // compilation errors being present. debug!("try_mark_previous_green({:?}) - END -  dependency {:?} resulted in compilation error", dep_node, dep_dep_node); return None </ins> } } }


<ins> // Checks that `SimplifyArmIdentity` is not applied if enums have incompatible layouts. // Regression test for issue #66856. // // compile-flags: -Zmir-opt-level=2 enum Src { Foo(u8), Bar, } enum Dst { Foo(u8), } fn main() { let e: Src = Src::Foo(0); let _: Dst = match e { Src::Foo(x) => Dst::Foo(x), Src::Bar => Dst::Foo(0), }; } // END RUST SOURCE // START rustc.main.SimplifyArmIdentity.before.mir // fn main() -> () { //     ... //     bb0: { //         StorageLive(_1); //         ((_1 as Foo).0: u8) = const 0u8; //         discriminant(_1) = 0; //         StorageLive(_2); //         _3 = discriminant(_1); //         switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; //     } //     bb1: { //         ((_2 as Foo).0: u8) = const 0u8; //         discriminant(_2) = 0; //         goto -> bb4; //     } //     ... //     bb3: { //         _4 = ((_1 as Foo).0: u8); //         ((_2 as Foo).0: u8) = move _4; //         discriminant(_2) = 0; //         goto -> bb4; //     } //     ... // } // END rustc.main.SimplifyArmIdentity.before.mir // START rustc.main.SimplifyArmIdentity.after.mir // fn main() -> () { //     ... //     bb0: { //         StorageLive(_1); //         ((_1 as Foo).0: u8) = const 0u8; //         discriminant(_1) = 0; //         StorageLive(_2); //         _3 = discriminant(_1); //         switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; //     } //     bb1: { //         ((_2 as Foo).0: u8) = const 0u8; //         discriminant(_2) = 0; //         goto -> bb4; //     } //     ... //     bb3: { //         _4 = ((_1 as Foo).0: u8); //         ((_2 as Foo).0: u8) = move _4; //         discriminant(_2) = 0; //         goto -> bb4; //     } //     ... // } // END rustc.main.SimplifyArmIdentity.after.mir </ins>


traits_in_scope: DefIdMap<Vec<TraitCandidate>>, all_traits: Vec<DefId>, all_trait_impls: Vec<DefId>, <ins> document_private_items: bool, </ins> } impl IntraLinkCrateLoader<'_, '_> {


pub fn has_errors(&self) -> bool { self.inner.borrow().has_errors() } <ins> pub fn has_errors_or_delayed_span_bugs(&self) -> bool { self.inner.borrow().has_errors_or_delayed_span_bugs() } </ins> pub fn print_error_count(&self, registry: &Registry) { self.inner.borrow_mut().print_error_count(registry)


<del> Subproject commit 5f28fda13efeb85097fe082af4b4827a58b0ecf6 </del> <ins> Subproject commit 58e01ea4d7df69e658c034afbfa6d0abd90808ed </ins>


<ins> //! This is a regression test for #129020 //! It ensures we can use `/WHOLEARCHIVE` to link a rust staticlib into DLL //! using the MSVC linker //@ only-msvc // Reason: this is testing the MSVC linker use std::path::PathBuf; use run_make_support::{cc, cmd, env_var, extra_c_flags, rustc}; fn main() { // Build the staticlib rustc().crate_type("staticlib").input("static.rs").output("static.lib").run(); // Build an empty object to pass to the linker. cc().input("c.c").output("c.obj").args(["-c"]).run(); // Find the C toolchain's linker. let mut linker = PathBuf::from(env_var("CC")); let linker_flavour = if linker.file_stem().is_some_and(|s| s == "cl") { linker.set_file_name("link.exe"); "msvc" } else if linker.file_stem().is_some_and(|s| s == "clang-cl") { linker.set_file_name("lld-link.exe"); "llvm" } else { panic!("unknown C toolchain"); }; // As a sanity check, make sure this works without /WHOLEARCHIVE. // Otherwise the actual test failure may be caused by something else. cmd(&linker) .args(["c.obj", "./static.lib", "-dll", "-def:dll.def", "-out:dll.dll"]) .args(extra_c_flags()) .run(); // FIXME(@ChrisDenton): this doesn't currently work with llvm's lld-link for other reasons. // May need LLVM patches. if linker_flavour == "msvc" { // Link in the staticlib using `/WHOLEARCHIVE` and produce a DLL. cmd(&linker) .args([ "c.obj", "-WHOLEARCHIVE:./static.lib", "-dll", "-def:dll.def", "-out:dll_whole_archive.dll", ]) .args(extra_c_flags()) .run(); } } </ins>


<ins> From 0d741cf82c3c908616abd39dc84ebf7d8702e0c3 Mon Sep 17 00:00:00 2001 From: Chris Denton <chris@chrisdenton.dev> Date: Tue, 16 Apr 2024 15:51:34 +0000 Subject: [PATCH] Revert use raw-dylib for Windows futex APIs --- library/std/src/sys/pal/windows/c.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 9d58ce05f01..1c828bac4b6 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -357,19 +357,7 @@ pub fn GetTempPath2W(bufferlength: u32, buffer: PWSTR) -> u32 { } #[cfg(not(target_vendor = "win7"))] -// Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library. -#[cfg_attr( -    target_arch = "x86", -    link( -        name = "api-ms-win-core-synch-l1-2-0", -        kind = "raw-dylib", -        import_name_type = "undecorated" -    ) -)] -#[cfg_attr( -    not(target_arch = "x86"), -    link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib") -)] +#[link(name = "synchronization")] extern "system" { pub fn WaitOnAddress( address: *const c_void, -- 2.42.0.windows.2 </ins>


<ins> error: custom derive attribute panicked --> $DIR/issue-36935.rs:17:15 | 17 | #[derive(Foo, Bar)] |               ^^^ | = help: message: lolnope </ins>


<ins> warning: unused variable: `Mod` --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | LL |     let Mod: usize = 0; |         ^^^ help: if this is intentional, prefix it with an underscore: `_Mod` | note: the lint level is defined here --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:1:9 | LL | #![warn(unused)] |         ^^^^^^ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` warning: unused variable: `Super` --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | LL |     let Super: usize = 0; |         ^^^^^ help: if this is intentional, prefix it with an underscore: `_Super` error: module `Impl` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:5:5 | LL | mod Impl {} |     ^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:3:9 | LL | #![deny(non_snake_case)] |         ^^^^^^^^^^^^^^ help: rename the identifier or convert it to a snake case raw identifier | LL | mod r#impl {} |     ^^^^^^ error: function `While` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4 | LL | fn While() {} |    ^^^^^ | help: rename the identifier or convert it to a snake case raw identifier | LL | fn r#while() {} |    ^^^^^^^ error: variable `Mod` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | LL |     let Mod: usize = 0; |         ^^^ | help: rename the identifier or convert it to a snake case raw identifier | LL |     let r#mod: usize = 0; |         ^^^^^ error: variable `Super` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | LL |     let Super: usize = 0; |         ^^^^^ help: rename the identifier | = note: `super` cannot be used as a raw identifier error: aborting due to 4 previous errors; 2 warnings emitted </ins>


if !(eps[1].expr.hir_id == expr.hir_id && lit_val - 1 == max) { return false; }; <del> let Ok(start) = cx.sess().source_map().span_to_snippet(eps[0].span) else { return false }; </del> use rustc_ast::{LitIntType, LitKind}; let suffix = match lit.node {


<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="struct"][@title="foo::Print struct"]' 1 pub struct Print; </ins>


fn stability(&self, def: DefId) -> Option<attr::Stability> { bug!("stability") } fn deprecation(&self, def: DefId) -> Option<attr::Deprecation> { bug!("deprecation") } fn visibility(&self, def: DefId) -> ty::Visibility { bug!("visibility") } <del> fn visible_parent_map<'a>(&'a self) -> ::std::cell::RefMut<'a, DefIdMap<DefId>> { </del> <ins> fn visible_parent_map<'a>(&'a self) -> ::std::cell::Ref<'a, DefIdMap<DefId>> { </ins> bug!("visible_parent_map") } fn item_generics_cloned(&self, def: DefId) -> ty::Generics


<ins> error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-minimal-example.rs:10:5 | LL | const _CONST: &() = &f(&|_| {}); |                      ---------- inside `_CONST` at $DIR/issue-88434-minimal-example.rs:4:22 ... LL |     panic!() |     ^^^^^^^^ |     | |     the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:10:5 |     inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:4:25: 4:31]>` 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>


use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write}; use crate::path::{Path, PathBuf}; use crate::sealed::Sealed; <ins> use crate::sync::Arc; </ins> use crate::sys::fs as fs_imp; use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner}; use crate::time::SystemTime;


"test/bench/shootout-meteor.rs", # BSD "test/bench/shootout-pidigits.rs", # BSD "test/bench/shootout-regex-dna.rs", # BSD <ins> "test/bench/shootout-threadring.rs", # BSD </ins> ] def check_license(name, contents):


pub fn noop_fold_ty_binding<T: Folder>(b: TypeBinding, fld: &mut T) -> TypeBinding { TypeBinding { id: fld.new_id(b.id), <del> ident: b.ident, </del> <ins> ident: fld.fold_ident(b.ident), </ins> ty: fld.fold_ty(b.ty), span: fld.new_span(b.span), }


// stream they came from. Here we attempt to extract these // lossless token streams before we fall back to the // stringification. <del> // // During early phases of the compiler, though, the AST could // get modified directly (e.g. attributes added or removed) and // the internal cache of tokens my not be invalidated or // updated. Consequently if the "lossless" token stream // disagrees with our actuall stringification (which has // historically been much more battle-tested) then we go with // the lossy stream anyway (losing span information). </del> let mut tokens = None; match nt.0 {


<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. // Issue 33903: // Built-in indexing should be used even when the index is not // trivially an integer // Only built-in indexing can be used in constant expresssions const FOO: i32 = [12, 34][0 + 1]; fn main() {} </ins>


panic!(); } } <ins> #[test] fn test_issue_82291() { use std::cell::Cell; let mut v1 = [()]; let v2 = [()]; let called = Cell::new(0); let mut zip = v1 .iter_mut() .map(|r| { called.set(called.get() + 1); r }) .zip(&v2); zip.next_back(); assert_eq!(called.get(), 1); zip.next(); assert_eq!(called.get(), 1); } </ins>


<ins> #![allow(bare_trait_objects)] // check-pass pub struct FormatWith<'a, I, F> { sep: &'a str, /// FormatWith uses interior mutability because Display::fmt takes &self. inner: RefCell<Option<(I, F)>>, } use std::cell::RefCell; use std::fmt; struct Layout; pub fn new_format<'a, I, F>(iter: I, separator: &'a str, f: F) -> FormatWith<'a, I, F> where I: Iterator, F: FnMut(I::Item, &mut FnMut(&fmt::Display) -> fmt::Result) -> fmt::Result, { FormatWith { sep: separator, inner: RefCell::new(Some((iter, f))) } } fn main() { let _ = new_format(0..32, " | ", |i, f| f(&format_args!("0x{:x}", i))); } </ins>


}); tcx.infer_ctxt().ignoring_regions().enter(|ref infcx| { <del> let mut fulfill_ctxt = <dyn TraitEngine<'_>>::new(tcx); fulfill_ctxt.register_predicate_obligations(infcx, predicates_for_trait); !fulfill_ctxt.select_all_or_error(infcx).is_empty() </del> <ins> for obligation in predicates_for_trait { // Ignore overflow error, to be conservative. if let Ok(result) = infcx.evaluate_obligation(&obligation) && !result.may_apply() { return true; } } false </ins> }) }


|| self.suggest_into(err, expr, expr_ty, expected) || self.suggest_floating_point_literal(err, expr, expected); if !suggested { <del> self.point_at_expr_source_of_inferred_type(err, expr, expr_ty, expected); </del> <ins> self.point_at_expr_source_of_inferred_type(err, expr, expr_ty, expected, expr.span); </ins> } }


<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct StateMachineIter<'a> { statefn: &'a fn(&mut StateMachineIter<'a>) -> Option<&'static str> } impl<'a> Iterator<&'static str> for StateMachineIter<'a> { fn next(&mut self) -> Option<&'static str> { return  (*self.statefn)(self); } } fn state1(self_: &mut StateMachineIter) -> Option<&'static str> { self_.statefn = &state2; //~^ ERROR borrowed value does not live long enough return Some("state1"); } fn state2(self_: &mut StateMachineIter) -> Option<(&'static str)> { self_.statefn = &state3; //~^ ERROR borrowed value does not live long enough return Some("state2"); } fn state3(self_: &mut StateMachineIter) -> Option<(&'static str)> { self_.statefn = &finished; //~^ ERROR borrowed value does not live long enough return Some("state3"); } fn finished(_: &mut StateMachineIter) -> Option<(&'static str)> { return None; } fn state_iter() -> StateMachineIter<'static> { StateMachineIter { statefn: &state1 //~ ERROR borrowed value does not live long enough } } fn main() { let mut it = state_iter(); println!("{}",it.next()); println!("{}",it.next()); println!("{}",it.next()); println!("{}",it.next()); println!("{}",it.next()); } </ins>


let b: Vec<isize> = a.iter().cloned().collect(); assert!(a == b); } <ins> // just tests by whether or not this compiles fn _empty_impl_all_auto_traits<T>() { use std::panic::{RefUnwindSafe, UnwindSafe}; fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {} all_auto_traits::<std::iter::Empty<T>>(); } </ins>


#![feature(const_cstr_unchecked)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] <del> #![feature(duration_as_u128)] </del> <ins> #![cfg_attr(stage0, feature(duration_as_u128))] </ins> #![feature(exact_size_is_empty)] #![feature(external_doc)] #![feature(fixed_size_array)]


//~^ ERROR missing code example in this documentation pub fn bar() {} } <ins> // This impl is here to ensure the lint isn't emitted for foreign traits implementations. impl std::ops::Neg for Foo { type Output = Self; fn neg(self) -> Self::Output { Self } } </ins>


}), } } else { <del> self.instantiate_canonical_var(cause.span, info, |u| { universe_map[u.as_usize()] }) </del> <ins> // For placeholders which were already part of the input, we simply map this // universal bound variable back the placeholder of the input. opt_values[BoundVar::new(index)].expect( "expected placeholder to be unified with itself during response", ) </ins> } }), ),


/// Here's an example of how a collection might make use of needs_drop: /// /// ``` <del> /// #![feature(needs_drop)] </del> /// use std::{mem, ptr}; /// /// pub struct MyCollection<T> {


if !parser.errors.is_empty() { let err = parser.errors.remove(0); <del> let err_sp = template_span.from_inner(InnerSpan::new(err.span.start, err.span.end)); </del> <ins> let err_sp = if template_is_mac_call { // If the template is a macro call we can't reliably point to the error's // span so just use the template's span as the error span (fixes #129503) template_span } else { template_span.from_inner(InnerSpan::new(err.span.start, err.span.end)) }; </ins> let msg = format!("invalid asm template string: {}", err.description); let mut e = ecx.dcx().struct_span_err(err_sp, msg); e.span_label(err_sp, err.label + " in asm template string");


<ins> // check-pass struct Indexable; impl Indexable { fn boo(&mut self) {} } impl std::ops::Index<&str> for Indexable { type Output = Indexable; fn index(&self, field: &str) -> &Indexable { self } } impl std::ops::IndexMut<&str> for Indexable { fn index_mut(&mut self, field: &str) -> &mut Indexable { self } } fn main() { let mut v = Indexable; let field = "hello".to_string(); v[field.as_str()].boo(); v[&field].boo(); // < This should work } </ins>


} } <ins> fn trace_macros_note(cx: &mut ExtCtxt, sp: Span, message: String) { let sp = sp.macro_backtrace().last().map(|trace| trace.call_site).unwrap_or(sp); let mut values: &mut Vec<String> = cx.expansions.entry(sp).or_insert_with(Vec::new); values.push(message); } </ins> /// Given `lhses` and `rhses`, this is the new macro we create fn generic_extension<'cx>(cx: &'cx mut ExtCtxt, sp: Span,


<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. // #29924 #![feature(const_fn, associated_consts)] trait Trait { const N: usize; } impl Trait { //~^ ERROR the trait `Trait` cannot be made into an object [E0038] const fn n() -> usize { Self::N } } fn main() {} </ins>


return; } <ins> // We may fail to resolve higher-ranked ty/const vars that are mentioned by APIT. // AST-based resolution does not care for impl-trait desugaring, which are the // responsibility of lowering. This may create a mismatch between the resolution // AST found (`param_def_id`) which points to HRTB, and what HIR allows. // ``` // fn foo(x: impl for<T> Trait<Assoc = impl Trait2<T>>) {} // ``` // // In such case, walk back the binders to diagnose it properly. let mut scope = self.scope; loop { match *scope { Scope::Binder { where_bound_origin: Some(hir::PredicateOrigin::ImplTrait), .. } => { let guar = self.tcx.sess.emit_err(match self.tcx.def_kind(param_def_id) { DefKind::TyParam => errors::LateBoundInApit::Type { span: self.tcx.hir().span(hir_id), param_span: self.tcx.def_span(param_def_id), }, DefKind::ConstParam => errors::LateBoundInApit::Const { span: self.tcx.hir().span(hir_id), param_span: self.tcx.def_span(param_def_id), }, kind => { bug!("unexpected def-kind: {}", kind.descr(param_def_id.to_def_id())) } }); self.map.defs.insert(hir_id, ResolvedArg::Error(guar)); return; } Scope::Root { .. } => break, Scope::Binder { s, .. } | Scope::Body { s, .. } | Scope::Elision { s, .. } | Scope::ObjectLifetimeDefault { s, .. } | Scope::Supertrait { s, .. } | Scope::TraitRefBoundary { s, .. } | Scope::AnonConstBoundary { s } => { scope = s; } } } </ins> self.tcx.sess.delay_span_bug( self.tcx.hir().span(hir_id), format!("could not resolve {param_def_id:?}"),


set -e mkdir -p $HOME/rustsrc $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc <del> condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Windows_NT')) </ins> displayName: Check out submodules (Unix) - script: | if not exist D:cacherustsrcNUL mkdir D:cacherustsrc sh src/ci/init_repo.sh . /d/cache/rustsrc <del> condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Windows_NT')) </ins> displayName: Check out submodules (Windows) # Ensure the `aws` CLI is installed so we can deploy later on, cache docker


item_segment.args(), item_segment.infer_args, None, <del> ) .0 </del> <ins> ); let assoc_bindings = self.create_assoc_bindings_for_generic_args(item_segment.args()); if let Some(b) = assoc_bindings.first() { Self::prohibit_assoc_ty_binding(self.tcx(), b.span); } args </ins> } /// Instantiates the path for the given trait reference, assuming that it's


version = "0.0.0" dependencies = [ "alloc 0.0.0", <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> "cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", "compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0",


<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. // Make sure the type inference for the new range expression work as // good as the old one. Check out issue #21672, #21595 and #21649 for // more details. fn main() { let xs = (0..8).map(|i| i == 1u64).collect::<Vec<_>>(); assert_eq!(xs[1], true); let xs = (0..8).map(|i| 1u64 == i).collect::<Vec<_>>(); assert_eq!(xs[1], true); let xs: Vec<u8> = (0..10).collect(); assert_eq!(xs.len(), 10); for x in 0..10 { x % 2; } for x in 0..100 { x as f32; } let array = [true, false]; for i in 0..1 { array[i]; } } </ins>


<del> Subproject commit 2b9c52f66815bb8d6ea74a4b26df3410602be9b0 </del> <ins> Subproject commit 585a6eb3ebf7c40fd7c1b23e3ece557b3cc2aa36 </ins>


None } } <ins> Target::AssocConst => { let parent_hir_id = self.tcx.hir().get_parent_item(hir_id); let containing_item = self.tcx.hir().expect_item(parent_hir_id); // We can't link to trait impl's consts. let err = "associated constant in trait implementation block"; match containing_item.kind { ItemKind::Impl { of_trait: Some(_), .. } => Some(err), _ => None, } } </ins> _ => None, } { self.tcx .sess .struct_span_err( meta.span(), <del> &format!("`#[doc(alias = "...")]` isn't allowed on {}", err,), </del> <ins> &format!("`#[doc(alias = "...")]` isn't allowed on {}", err), </ins> ) .emit(); }


let mut llvm_args = Vec::with_capacity(n_args + 1); llvm::LLVMRustInstallFatalErrorHandler(); <ins> // On Windows, an LLVM assertion will open an Abort/Retry/Ignore dialog // box for the purpose of launching a debugger. However, on CI this will // cause it to hang until it times out, which can take several hours. if std::env::var_os("CI").is_some() { llvm::LLVMRustDisableSystemDialogsOnCrash(); } </ins> fn llvm_arg_to_arg_name(full_arg: &str) -> &str { full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")


- checkout: self fetchDepth: 2 <ins> # Set the SKIP_JOB environment variable if this job is supposed to only run # when submodules are updated and they were not. The following time consuming # tasks will be skipped when the environment variable is present. - ${{ if parameters.only_on_updated_submodules }}: - bash: | set -e # Submodules pseudo-files inside git have the 160000 permissions, so when # those files are present in the diff a submodule was updated. if git diff HEAD^ | grep "^index .* 160000" >/dev/null 2>&1; then echo "Executing the job since submodules are updated" else echo "Not executing this job since no submodules were updated" echo "##vso[task.setvariable variable=SKIP_JOB;]1" fi displayName: Decide whether to run this job </ins> # Spawn a background process to collect CPU usage statistics which we'll upload # at the end of the build. See the comments in the script here for more # information.


<ins> // ignore-tidy-linelength // FIXME: this doesn't test as much as I'd like; ideally it would have these query too: // has task_lists/index.html '//li/input[@type="checkbox" and disabled]/following-sibling::text()' 'a' // has task_lists/index.html '//li/input[@type="checkbox"]/following-sibling::text()' 'b' // Unfortunately that requires LXML, because the built-in xml module doesn't support all of xpath. // @has task_lists/index.html '//ul/li/input[@type="checkbox"]' '' // @has task_lists/index.html '//ul/li/input[@disabled]' '' // @has task_lists/index.html '//ul/li' 'a' // @has task_lists/index.html '//ul/li' 'b' //! This tests 'task list' support, a common markdown extension. //! - [ ] a //! - [x] b </ins>


needs_codegen_cfg } <del> const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_"; </del> <ins> pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_"; </ins> fn is_codegen_cfg_needed(path: &TaskPath, run: &RunConfig<'_>) -> bool { if path.path.to_str().unwrap().contains(&CODEGEN_BACKEND_PREFIX) {


) } <del> fn base_expr<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> { loop { match expr.kind { hir::ExprKind::Field(base, ..) => expr = base, _ => return expr, } } } </del> struct MarkSymbolVisitor<'tcx> { worklist: Vec<hir::HirId>, tcx: TyCtxt<'tcx>,


fn visit_expr(&mut self, e: &'gcx hir::Expr) { self.fix_scalar_builtin_expr(e); <ins> self.fix_index_builtin_expr(e); </ins> self.visit_node_id(e.span, e.hir_id);


<ins> fn main() { todo!(); } fn other(_: i32)) {} //~ ERROR unexpected closing delimiter: `)` </ins>


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


/// /// # Examples ///  /// Converts an Option<[String]> into an Option<[usize]>, preserving /// the original. The [`map`] method takes the `self` argument by value, consuming the original, /// so this technique uses `as_ref` to first take an `Option` to a reference /// to the value inside the original.   /// Calculates the length of an Option<[String]> as an Option<[usize]> /// without moving the [`String`]. The [`map`] method takes the `self` argument by value, /// consuming the original, so this technique uses `as_ref` to first take an `Option` to a /// reference to the value inside the original.  /// /// [`map`]: Option::map /// [String]: ../../std/string/struct.String.html "String"  /// [`String`]: ../../std/string/struct.String.html "String"  /// /// ``` /// let text: Option<String> = Some("Hello, world!".to_string());


if let Some(&(_, res)) = rib.bindings.get(&normalized_ident) { self.record_lifetime_res(lifetime.id, res, LifetimeElisionCandidate::Named); <del> if let LifetimeRes::Param { param, .. } = res { </del> <ins> if let LifetimeRes::Param { param, binder } = res { </ins> match self.lifetime_uses.entry(param) { Entry::Vacant(v) => { debug!("First use of {:?} at {:?}", res, ident.span);


B: TrustedRandomAccess + Iterator, { fn new(a: A, b: B) -> Self { <del> let len = cmp::min(a.size(), b.size()); Zip { a, b, index: 0, len } </del> <ins> let a_len = a.size(); let len = cmp::min(a_len, b.size()); Zip { a, b, index: 0, len, a_len } </ins> } #[inline]


let mut head = self.head.index.load(Ordering::Acquire); let mut block = self.head.block.load(Ordering::Acquire); <ins> // If we're going to be dropping messages we need to synchronize with initialization if head >> SHIFT != tail >> SHIFT { // The block can be null here only if a sender is in the process of initializing the // channel while another sender managed to send a message by inserting it into the // semi-initialized channel and advanced the tail. // In that case, just wait until it gets initialized. while block.is_null() { backoff.spin_heavy(); block = self.head.block.load(Ordering::Acquire); } } </ins> unsafe { // Drop all messages between head and tail and deallocate the heap-allocated blocks. while head >> SHIFT != tail >> SHIFT {


<ins> - // MIR for `main` before DeadStoreElimination + // MIR for `main` after DeadStoreElimination fn main() -> () { let mut _0: ();                      // return place in scope 0 at $DIR/place_mention.rs:+0:11: +0:11 let mut _1: (&str, &str);            // in scope 0 at $DIR/place_mention.rs:+3:18: +3:36 scope 1 { } bb0: { StorageLive(_1);                 // scope 0 at $DIR/place_mention.rs:+3:18: +3:36 _1 = (const "Hello", const "World"); // scope 0 at $DIR/place_mention.rs:+3:18: +3:36 // mir::Constant // + span: $DIR/place_mention.rs:8:19: 8:26 // + literal: Const { ty: &str, val: Value(Slice(..)) } // mir::Constant // + span: $DIR/place_mention.rs:8:28: 8:35 // + literal: Const { ty: &str, val: Value(Slice(..)) } PlaceMention(_1);                // scope 0 at $DIR/place_mention.rs:+3:18: +3:36 StorageDead(_1);                 // scope 0 at $DIR/place_mention.rs:+3:36: +3:37 _0 = const ();                   // scope 0 at $DIR/place_mention.rs:+0:11: +4:2 return;                          // scope 0 at $DIR/place_mention.rs:+4:2: +4:2 } } </ins>


target = if let Some(cached_block) = free_data.cached_block { cached_block } else { <del> let t = build_free(tcx, cfg, unit_temp, free_data, target); free_data.cached_block = Some(t); t </del> <ins> let into = cfg.start_new_cleanup_block(); cfg.terminate(into, build_free(tcx, unit_temp, free_data, target)); free_data.cached_block = Some(into); into </ins> } };


// frames above our current position. let my_stack_bottom = my_stack_top + 20000 - OS_DEFAULT_STACK_ESTIMATE; <ins> // When using libgreen, one of the first things that we do is to turn off // the SIGPIPE signal (set it to ignore). By default, some platforms will // send a *signal* when a EPIPE error would otherwise be delivered. This // runtime doesn't install a SIGPIPE handler, causing it to kill the // program, which isn't exactly what we want! // // Hence, we set SIGPIPE to ignore when the program starts up in order to // prevent this problem. #[cfg(windows)] fn ignore_sigpipe() {} #[cfg(unix)] fn ignore_sigpipe() { use std::libc; use std::libc::funcs::posix01::signal::signal; unsafe { assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != -1); } } ignore_sigpipe(); </ins> rt::init(argc, argv); let mut exit_code = None; let mut main = Some(main);


/// /// `Ipv4Addr` provides a [`FromStr`] implementation. The four octets are in decimal /// notation, divided by `.` (this is called "dot-decimal notation"). <del> /// Notably, octal numbers and hexadecimal numbers are not allowed per [IETF RFC 6943]. </del> <ins> /// Notably, octal numbers (which are indicated with a leading `0`) and hexadecimal numbers (which /// are indicated with a leading `0x`) are not allowed per [IETF RFC 6943]. </ins> /// /// [IETF RFC 6943]: https://tools.ietf.org/html/rfc6943#section-3.1.1 /// [`FromStr`]: crate::str::FromStr


match memchr::memrchr(b'n', buf) { Some(i) => { let n = try!(self.inner.write(&buf[..i + 1])); <del> if n != i + 1 { return Ok(n) } try!(self.inner.flush()); </del> <ins> if n != i + 1 || self.inner.flush().is_err() { // Do not return errors on partial writes. return Ok(n); } </ins> self.inner.write(&buf[i + 1..]).map(|i| n + i) } None => self.inner.write(buf),


= help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date <del> error[E0658]: the `#[pointee]` attribute is an experimental feature --> $DIR/feature-gate-derive-smart-pointer.rs:5:22 | LL | struct MyPointer<'a, #[pointee] T: ?Sized> { |                      ^^^^^^^^^^ | = note: see issue #123430 <https://github.com/rust-lang/rust/issues/123430> for more information = help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date </del> error[E0658]: use of unstable library feature 'derive_smart_pointer' --> $DIR/feature-gate-derive-smart-pointer.rs:1:5 |


let mut late_depth = 0; let mut scope = self.scope; let mut crossed_anon_const = false; let result = loop { match *scope { Scope::Body { s, .. } => {


<ins> #[derive(PartialEq, Eq)] enum X { A, B, C, } fn main() { let x = X::A; let y = Some(X::A); match (x, y) { //~^ ERROR non-exhaustive patterns: `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 //~| more not covered (_, None) => false, (v, Some(w)) if v == w => true, (X::B, Some(X::C)) => false, (X::B, Some(X::A)) => false, (X::A, Some(X::C)) | (X::C, Some(X::A)) => false, }; } </ins>


extern "C" { pub fn LLVMRustInstallFatalErrorHandler(); <ins> pub fn LLVMRustDisableSystemDialogsOnCrash(); </ins> // Create and destroy contexts. pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context;


expected: Expectation) { check_expr_has_type(fcx, cond_expr, ty::mk_bool()); <ins> // Disregard "castable to" expectations because they // can lead us astray. Consider for example `if cond // {22} else {c} as u8` -- if we propagate the // "castable to u8" constraint to 22, it will pick the // type 22u8, which is overly constrained (c might not // be a u8). In effect, the problem is that the // "castable to" expectation is not the tightest thing // we can say, so we want to drop it in this case. // The tightest thing we can say is "must unify with // else branch". Note that in the case of a "has type" // constraint, this limitation does not hold. // If the expected type is just a type variable, then don't use // an expected type. Otherwise, we might write parts of the type // when checking the 'then' block which are incompatible with the // 'else' branch. let expected = match expected.only_has_type() { ExpectHasType(ety) => { match infer::resolve_type(fcx.infcx(), Some(sp), ety, force_tvar) { Ok(rty) if !ty::type_is_ty_var(rty) => ExpectHasType(rty), _ => NoExpectation } } _ => NoExpectation }; check_block_with_expected(fcx, then_blk, expected); let then_ty = fcx.node_ty(then_blk.id); </ins> let branches_ty = match opt_else_expr { Some(ref else_expr) => { <del> // Disregard "castable to" expectations because they // can lead us astray. Consider for example `if cond // {22} else {c} as u8` -- if we propagate the // "castable to u8" constraint to 22, it will pick the // type 22u8, which is overly constrained (c might not // be a u8). In effect, the problem is that the // "castable to" expectation is not the tightest thing // we can say, so we want to drop it in this case. // The tightest thing we can say is "must unify with // else branch". Note that in the case of a "has type" // constraint, this limitation does not hold. // If the expected type is just a type variable, then don't use // an expected type. Otherwise, we might write parts of the type // when checking the 'then' block which are incompatible with the // 'else' branch. let expected = match expected.only_has_type() { ExpectHasType(ety) => { match infer::resolve_type(fcx.infcx(), Some(sp), ety, force_tvar) { Ok(rty) if !ty::type_is_ty_var(rty) => ExpectHasType(rty), _ => NoExpectation } } _ => NoExpectation }; check_block_with_expected(fcx, then_blk, expected); let then_ty = fcx.node_ty(then_blk.id); </del> check_expr_with_expectation(fcx, &**else_expr, expected); let else_ty = fcx.expr_ty(&**else_expr); infer::common_supertype(fcx.infcx(),


E0701: include_str!("./error_codes/E0701.md"), E0704: include_str!("./error_codes/E0704.md"), E0705: include_str!("./error_codes/E0705.md"), <ins> E0706: include_str!("./error_codes/E0706.md"), </ins> E0712: include_str!("./error_codes/E0712.md"), E0713: include_str!("./error_codes/E0713.md"), E0714: include_str!("./error_codes/E0714.md"),


// don't create labels for compiler-generated spans Some(_) => None, None => { <del> let (span, suggestion) = suggest_ampmut( self.infcx.tcx, local_decl, opt_assignment_rhs_span, *opt_ty_info, ); </del> <ins> let (span, suggestion) = if name != kw::SelfLower { suggest_ampmut( self.infcx.tcx, local_decl, opt_assignment_rhs_span, *opt_ty_info, ) } else { match local_decl.local_info.as_deref() { Some(LocalInfo::User(ClearCrossCrate::Set( mir::BindingForm::Var(mir::VarBindingForm { opt_ty_info: None, .. }), ))) => { suggest_ampmut_self(self.infcx.tcx, local_decl) } // explicit self (eg `self: &'a Self`) _ => suggest_ampmut( self.infcx.tcx, local_decl, opt_assignment_rhs_span, *opt_ty_info, ), } }; </ins> Some((true, span, suggestion)) } }


/// Was the origin of the `span` from a scrutinee expression? /// /// Otherwise there is no scrutinee and it could be e.g. from the type of a formal parameter. <del> origin_expr: bool, </del> <ins> origin_expr: Option<&'tcx hir::Expr<'tcx>>, </ins> /// The span giving rise to the `expected` type, if one could be provided. /// /// If `origin_expr` is `true`, then this is the span of the scrutinee as in:


[submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git <del> branch = rustc/18.0-2024-02-13 </del> <ins> branch = rustc/18.1-2024-05-19 </ins> shallow = true [submodule "src/doc/embedded-book"] path = src/doc/embedded-book


} let source_string = match file.get_line(line.line_index - 1) { <del> Some(s) => s, </del> <ins> Some(s) => replace_tabs(&*s), </ins> None => return Vec::new(), };


import_id: Option<LocalDefId>, ) { debug!("visiting item {:?}", item); <ins> if self.inside_body { // Only impls can be "seen" outside a body. For example: // // ``` // struct Bar; // // fn foo() { //     impl Bar { fn bar() {} } // } // Bar::bar(); // ``` if let hir::ItemKind::Impl(impl_) = item.kind && // Don't duplicate impls when inlining or if it's implementing a trait, we'll pick // them up regardless of where they're located. impl_.of_trait.is_none() { self.add_to_current_mod(item, None, None); } return; } </ins> let name = renamed.unwrap_or(item.ident.name); let tcx = self.cx.tcx;


<ins> // check-pass // aux-build:test-macros.rs // compile-flags: -Z span-debug // // Regression test for issue #76182 // Tests that we properly handle patterns with a leading vert #![no_std] // Don't load unnecessary hygiene information from std extern crate std; extern crate test_macros; #[test_macros::print_attr] fn main() { match () { | () => () } } </ins>


fn is_expr_delims_necessary(inner: &ast::Expr, followed_by_block: bool) -> bool { followed_by_block && match inner.kind { <del> ast::ExprKind::Ret(_) | ast::ExprKind::Break(..) => true, </del> <ins> ExprKind::Ret(_) | ExprKind::Break(..) => true, </ins> _ => parser::contains_exterior_struct_lit(&inner), } }


fs::write(&self.path, self.hash.as_deref().unwrap_or(b"")) } } <ins> #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct CrtBeginEnd { pub target: TargetSelection, } impl Step for CrtBeginEnd { type Output = PathBuf; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/llvm-project/compiler-rt/lib/crt") } fn make_run(run: RunConfig<'_>) { run.builder.ensure(CrtBeginEnd { target: run.target }); } /// Build crtbegin.o/crtend.o for musl target. fn run(self, builder: &Builder<'_>) -> Self::Output { let out_dir = builder.native_dir(self.target).join("crt"); if builder.config.dry_run { return out_dir; } let crtbegin_src = builder.src.join("src/llvm-project/compiler-rt/lib/crt/crtbegin.c"); let crtend_src = builder.src.join("src/llvm-project/compiler-rt/lib/crt/crtend.c"); if up_to_date(&crtbegin_src, &out_dir.join("crtbegin.o")) && up_to_date(&crtend_src, &out_dir.join("crtendS.o")) { return out_dir; } builder.info("Building crtbegin.o and crtend.o"); t!(fs::create_dir_all(&out_dir)); let mut cfg = cc::Build::new(); if let Some(ar) = builder.ar(self.target) { cfg.archiver(ar); } cfg.compiler(builder.cc(self.target)); cfg.cargo_metadata(false) .out_dir(&out_dir) .target(&self.target.triple) .host(&builder.config.build.triple) .warnings(false) .debug(false) .opt_level(3) .file(crtbegin_src) .file(crtend_src); // Those flags are defined in src/llvm-project/compiler-rt/lib/crt/CMakeLists.txt // Currently only consumer of those objects is musl, which use .init_array/.fini_array // instead of .ctors/.dtors cfg.flag("-std=c11") .define("CRT_HAS_INITFINI_ARRAY", None) .define("EH_USE_FRAME_REGISTRY", None); cfg.compile("crt"); t!(fs::copy(out_dir.join("crtbegin.o"), out_dir.join("crtbeginS.o"))); t!(fs::copy(out_dir.join("crtend.o"), out_dir.join("crtendS.o"))); out_dir } } </ins>


} } <del> /// Checks `#[doc(hidden)]` attributes. Returns `true` if valid. fn check_doc_hidden( &self, attr: &Attribute, meta_index: usize, meta: &NestedMetaItem, hir_id: HirId, target: Target, ) -> bool { if let Target::AssocConst | Target::AssocTy | Target::Method(MethodKind::Trait { body: true }) = target { let parent_hir_id = self.tcx.hir().get_parent_item(hir_id); let containing_item = self.tcx.hir().expect_item(parent_hir_id); if let hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }) = containing_item.kind { let meta_items = attr.meta_item_list().unwrap(); let (span, replacement_span) = if meta_items.len() == 1 { (attr.span, attr.span) } else { let meta_span = meta.span(); ( meta_span, meta_span.until(match meta_items.get(meta_index + 1) { Some(next_item) => next_item.span(), None => match attr.get_normal_item().args { MacArgs::Delimited(DelimSpan { close, .. }, ..) => close, _ => unreachable!(), }, }), ) }; // FIXME: #[doc(hidden)] was previously erroneously allowed on trait impl items, // so for backward compatibility only emit a warning and do not mark it as invalid. self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, span, |lint| { lint.build("`#[doc(hidden)]` is ignored on trait impl items") .warn( "this was previously accepted by the compiler but is  being phased out; it will become a hard error in  a future release!", ) .note( "whether the impl item is `doc(hidden)` or not  entirely depends on the corresponding trait item", ) .span_suggestion( replacement_span, "remove this attribute", "", Applicability::MachineApplicable, ) .emit(); }); } } true } </del> /// Checks that an attribute is *not* used at the crate level. Returns `true` if valid. fn check_attr_not_crate_level( &self,


&base_segments[base_segments.len()-2], base_segments.last().unwrap()) } <del> Def::Mod(id) => { </del> <ins> Def::Mod(..) => { </ins> // Used as sentinel by callers to indicate the `<T>::A::B::C` form. // FIXME(#22519) This part of the resolution logic should be // avoided entirely for that form, once we stop needed a Def


mod predecessors; mod query; pub mod tcx; <ins> pub mod terminator; pub use terminator::*; </ins> pub mod traversal; mod type_foldable; pub mod visit;


.try_resolve_as_non_binding(pat_src, pat, bmode, ident, has_sub) .unwrap_or_else(|| self.fresh_binding(ident, pat.id, pat_src, bindings)); self.r.record_partial_res(pat.id, PartialRes::new(res)); <ins> self.r.record_pat_span(pat.id, pat.span); </ins> } PatKind::TupleStruct(ref path, ref sub_patterns) => { self.smart_resolve_path(


<ins> // build-pass // aux-build:issue-97708-aux.rs extern crate issue_97708_aux; use issue_97708_aux::TaskStub; static TASK_STUB: TaskStub = TaskStub::new(); fn main() {} </ins>


[[package]] name = "compiler_builtins" <del> version = "0.1.114" </del> <ins> version = "0.1.117" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "eb58b199190fcfe0846f55a3b545cd6b07a34bdd5930a476ff856f3ebcc5558a" </del> <ins> checksum = "a91dae36d82fe12621dfb5b596d7db766187747749b22e33ac068e1bfc356f4a" </ins> dependencies = [ "cc", "rustc-std-workspace-core",


} match self.parse_expr_res(Restrictions::CONST_EXPR, None) { Ok(expr) => { <del> if token::Comma == self.token.kind || self.token.kind.should_end_const_arg() { </del> <ins> // Find a mistake like `MyTrait<Assoc == S::Assoc>`. if token::EqEq == snapshot.token.kind { err.span_suggestion( snapshot.token.span, "if you meant to use an associated type binding, replace `==` with `=`", "=".to_string(), Applicability::MaybeIncorrect, ); let value = self.mk_expr_err(start.to(expr.span)); err.emit(); return Ok(GenericArg::Const(AnonConst { id: ast::DUMMY_NODE_ID, value })); } else if token::Comma == self.token.kind || self.token.kind.should_end_const_arg() { </ins> // Avoid the following output by checking that we consumed a full const arg: // help: expressions must be enclosed in braces to be used as const generic //       arguments


LL |     f: i32, |     ^^^^^^ <del> error: aborting due to 3 previous errors </del> <ins> error: field is never read: `y` --> $DIR/write-only-field.rs:28:9 | LL |         y: bool, |         ^^^^^^^ error: field is never read: `u` --> $DIR/write-only-field.rs:58:9 | LL |         u: u32, |         ^^^^^^ error: field is never read: `v` --> $DIR/write-only-field.rs:59:9 | LL |         v: u32, |         ^^^^^^ error: aborting due to 6 previous errors </ins>


&ccx.int_type); let llfn = decl_cdecl_fn(ccx, "main", llfty, ty::mk_nil()); <ins> // FIXME: #16581: Marking a symbol in the executable with `dllexport` // linkage forces MinGW's linker to output a `.reloc` section for ASLR if ccx.sess().targ_cfg.os == OsWindows { unsafe { llvm::LLVMRustSetDLLExportStorageClass(llfn) } } </ins> let llbb = "top".with_c_str(|buf| { unsafe { llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)


<ins> error[E0425]: cannot find value `a` in this scope --> $DIR/format-args-capture-issue-102057.rs:2:18 | LL |     format!("x7Ba}"); |                  ^ not found in this scope error[E0425]: cannot find value `a` in this scope --> $DIR/format-args-capture-issue-102057.rs:4:18 | LL |     format!("x7Bax7D"); |                  ^ not found in this scope error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:9:22 | LL |     format!("x7Ba} {b}"); |                      ^ help: a local variable with a similar name exists: `a` error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:11:25 | LL |     format!("x7Bax7D {b}"); |                         ^ help: a local variable with a similar name exists: `a` error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:13:25 | LL |     format!("x7Ba} x7Bb}"); |                         ^ help: a local variable with a similar name exists: `a` error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:15:28 | LL |     format!("x7Bax7D x7Bb}"); |                            ^ help: a local variable with a similar name exists: `a` error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:17:28 | LL |     format!("x7Bax7D x7Bbx7D"); |                            ^ help: a local variable with a similar name exists: `a` error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0425`. </ins>


self.draw_line( &mut buffer, <del> &unannotated_line, </del> <ins> &replace_tabs(&unannotated_line), </ins> annotated_file.lines[line_idx + 1].line_index - 1, last_buffer_line_num, width_offset,


LifetimeRibKind::Item | LifetimeRibKind::AnonymousReportError | LifetimeRibKind::ElisionFailure => Some(LifetimeUseSet::Many), <del> // An anonymous lifetime is legal here, go ahead. LifetimeRibKind::AnonymousCreateParameter { .. } => { Some(LifetimeUseSet::One { use_span: ident.span, use_ctxt }) } </del> <ins> // An anonymous lifetime is legal here, and bound to the right // place, go ahead. LifetimeRibKind::AnonymousCreateParameter { binder: anon_binder, .. } => Some(if binder == anon_binder { LifetimeUseSet::One { use_span: ident.span, use_ctxt } } else { LifetimeUseSet::Many }), </ins> // Only report if eliding the lifetime would have the same // semantics. LifetimeRibKind::Elided(r) => Some(if res == r {


}; ExprKind::Cast { source } <ins> } else { // Default to `ExprKind::Cast` for all explicit casts. // MIR building then picks the right MIR casts based on the types. ExprKind::Cast { source: self.mirror_expr(source) } </ins> } }


<del> // check-pass </del> // aux-build:import_crate_var.rs #[macro_use] extern crate import_crate_var; fn main() { m!(); <del> //~^ WARN `$crate` may not be imported //~| NOTE `use $crate;` was erroneously allowed and will become a hard error </del> <ins> //~^ ERROR `$crate` may not be imported </ins> }


); // print the suggestion draw_col_separator(&mut buffer, row_num, max_line_num_len + 1); <del> buffer.append(row_num, line, Style::NoStyle); </del> <ins> buffer.append(row_num, &replace_tabs(line), Style::NoStyle); </ins> row_num += 1; }


<ins> fn main() { let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; //~^ ERROR expected a pattern, found an expression //~| ERROR cannot find type `T` in this scope //~| ERROR type and const arguments are not allowed on builtin type `str` //~| ERROR expected unit struct, unit variant or constant, found associated function `str<, T>::as_bytes` } </ins>


use rustc_middle::mir::ConstraintCategory; use rustc_middle::traits::query::OutlivesBound; use rustc_middle::ty::{self, RegionVid, Ty}; <del> use rustc_span::{Span, DUMMY_SP}; </del> <ins> use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; </ins> use rustc_trait_selection::traits::query::type_op::{self, TypeOp}; use std::rc::Rc; use type_op::TypeOpOutput;


<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 blah() -> int { //~ ERROR not all control paths return a value 1i ; //~ NOTE consider removing this semicolon: } fn main() { } </ins>


} fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} <del> //~^ ERROR `impl Trait` can only mention lifetimes bound at the fn or impl level </del> <ins> //~^ ERROR `impl Trait` can only mention lifetimes from an fn or impl </ins> fn main() {}


let debugger_visualizers = stat!("debugger-visualizers", || self.encode_debugger_visualizers()); <del> // Encode exported symbols info. This is prefetched in `encode_metadata` so we encode // this as late as possible to give the prefetching as much time as possible to complete. </del> <ins> // Encode exported symbols info. This is prefetched in `encode_metadata`. </ins> let exported_symbols = stat!("exported-symbols", || { self.encode_exported_symbols(tcx.exported_symbols(LOCAL_CRATE)) });


<ins> #![feature(optin_builtin_traits)] // Test for issue #56934 - that it is impossible to redundantly // implement an auto-trait for a trait object type that contains it. // Negative impl variant. auto trait Marker1 {} auto trait Marker2 {} trait Object: Marker1 {} // A supertrait marker is illegal... impl !Marker1 for dyn Object + Marker2 { }   //~ ERROR E0371 // ...and also a direct component. impl !Marker2 for dyn Object + Marker2 { }   //~ ERROR E0371 // But implementing a marker if it is not present is OK. impl !Marker2 for dyn Object {} // OK // A non-principal trait-object type is orphan even in its crate. impl !Send for dyn Marker2 {} //~ ERROR E0117 // And impl'ing a remote marker for a local trait object is forbidden // by one of these special orphan-like rules. impl !Send for dyn Object {} //~ ERROR E0321 impl !Send for dyn Object + Marker2 {} //~ ERROR E0321 fn main() { } </ins>


/// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn lock(&self) -> StdoutLock<'_> { <ins> self.lock_any() } // Locks this handle with any lifetime. This depends on the // implementation detail that the underlying `ReentrantMutex` is // static. fn lock_any<'a>(&self) -> StdoutLock<'a> { </ins> StdoutLock { inner: self.inner.lock() } } <ins> /// Consumes this handle to the standard output stream, locking the /// shared global buffer associated with the stream and returning a /// writable guard. /// /// The lock is released when the returned lock goes out of scope. The /// returned guard also implements the [`Write`] trait for writing data. /// /// It is often simpler to directly get a locked handle using the /// [`io::stdout_locked`] function instead, unless nearby code also /// needs to use an unlocked handle. /// /// # Examples /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Write}; /// /// fn main() -> io::Result<()> { ///     let mut handle = io::stdout().into_locked(); /// ///     handle.write_all(b"hello world")?; /// ///     Ok(()) /// } /// ``` #[unstable(feature = "stdio_locked", issue = "none")] pub fn into_locked(self) -> StdoutLock<'static> { self.lock_any() } </ins> } #[stable(feature = "std_debug", since = "1.16.0")]


pub fn print_tts(&mut self, tts: &[ast::TokenTree]) -> IoResult<()> { try!(self.ibox(0)); <ins> let mut suppress_space = false; </ins> for (i, tt) in tts.iter().enumerate() { <del> if i != 0 { </del> <ins> if i != 0 && !suppress_space { </ins> try!(space(&mut self.s)); } try!(self.print_tt(tt)); <ins> // There should be no space between the module name and the following `::` in paths, // otherwise imported macros get re-parsed from crate metadata incorrectly (#20701) suppress_space = match tt { &ast::TtToken(_, token::Ident(_, token::ModName)) | &ast::TtToken(_, token::MatchNt(_, _, _, token::ModName)) | &ast::TtToken(_, token::SubstNt(_, token::ModName)) => true, _ => false } </ins> } self.end() }


hir_analysis_invalid_union_field_sugg = wrap the field type in `ManuallyDrop<...>` <ins> hir_analysis_late_bound_const_in_apit = `impl Trait` can only mention const parameters from an fn or impl .label = const parameter declared here hir_analysis_late_bound_lifetime_in_apit = `impl Trait` can only mention lifetimes from an fn or impl .label = lifetime declared here hir_analysis_late_bound_type_in_apit = `impl Trait` can only mention type parameters from an fn or impl .label = type parameter declared here </ins> hir_analysis_lifetimes_or_bounds_mismatch_on_trait = lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration .label = lifetimes do not match {$item_kind} in trait