id: AllocId, liveness: AllocCheck, ) -> InterpResult<'static, (Size, Align)> { <del> // Regular allocations. if let Ok(alloc) = self.get(id) { return Ok((Size::from_bytes(alloc.bytes.len() as u64), alloc.align)); } // Function pointers. if let Ok(_) = self.get_fn_alloc(id) { return if let AllocCheck::Dereferencable = liveness { // The caller requested no function pointers. err!(DerefFunctionPointer) } else { Ok((Size::ZERO, Align::from_bytes(1).unwrap())) }; } // Foreign statics. // Can't do this in the match argument, we may get cycle errors since the lock would // be held throughout the match. let alloc = self.tcx.alloc_map.lock().get(id); match alloc { Some(GlobalAlloc::Static(did)) => { assert!(self.tcx.is_foreign_item(did)); // Use size and align of the type let ty = self.tcx.type_of(did); let layout = self.tcx.layout_of(ParamEnv::empty().and(ty)).unwrap(); return Ok((layout.size, layout.align.abi)); </del> <ins> // Don't use `self.get` here as that will // a) cause cycles in case `id` refers to a static // b) duplicate a static's allocation in miri match self.alloc_map.get_or(id, || Err(())) { Ok((_, alloc)) => Ok((Size::from_bytes(alloc.bytes.len() as u64), alloc.align)), Err(()) => { // Not a local allocation, check the global `tcx.alloc_map`. // Can't do this in the match argument, we may get cycle errors since the lock would // be held throughout the match. let alloc = self.tcx.alloc_map.lock().get(id); match alloc { Some(GlobalAlloc::Static(did)) => { // Use size and align of the type. let ty = self.tcx.type_of(did); let layout = self.tcx.layout_of(ParamEnv::empty().and(ty)).unwrap(); Ok((layout.size, layout.align.abi)) }, Some(GlobalAlloc::Memory(alloc)) => // Need to duplicate the logic here, because the global allocations have // different associated types than the interpreter-local ones. Ok((Size::from_bytes(alloc.bytes.len() as u64), alloc.align)), Some(GlobalAlloc::Function(_)) => { if let AllocCheck::Dereferencable = liveness { // The caller requested no function pointers. err!(DerefFunctionPointer) } else { Ok((Size::ZERO, Align::from_bytes(1).unwrap())) } }, // The rest must be dead. None => if let AllocCheck::MaybeDead = liveness { // Deallocated pointers are allowed, we should be able to find // them in the map. Ok(*self.dead_alloc_map.get(&id) .expect("deallocated pointers should all be recorded in  `dead_alloc_map`")) } else { err!(DanglingPointerDeref) }, } </ins> } <del> _ => {} } // The rest must be dead. if let AllocCheck::MaybeDead = liveness { // Deallocated pointers are allowed, we should be able to find // them in the map. Ok(*self.dead_alloc_map.get(&id) .expect("deallocated pointers should all be recorded in `dead_alloc_map`")) } else { err!(DanglingPointerDeref) </del> } }


<ins> // We used to not lower the extra `b @ ..` into `b @ _` which meant that no type // was registered for the binding `b` although it passed through resolve. // This resulted in an ICE (#69103). fn main() { let [a @ .., b @ ..] = &mut [1, 2]; //~^ ERROR `..` can only be used once per slice pattern b; let [.., c @ ..] = [1, 2]; //~^ ERROR `..` can only be used once per slice pattern c; // This never ICEd, but let's make sure it won't regress either. let (.., d @ ..) = (1, 2); //~^ ERROR `..` patterns are not allowed here d; } </ins>


replace_late_bound_regions(tcx, value, |_, _| ty::ReStatic).0 } <ins> /// Rewrite any late-bound regions so that they are anonymous.  Region numbers are /// assigned starting at 1 and increasing monotonically in the order traversed /// by the fold operation. /// /// The chief purpose of this function is to canonicalize regions so that two /// `FnSig`s or `TraitRef`s which are equivalent up to region naming will become /// structurally identical.  For example, `for<'a, 'b> fn(&'a int, &'b int)` and /// `for<'a, 'b> fn(&'b int, &'a int)` will become identical after anonymization. pub fn anonymize_late_bound_regions<'tcx, HR>(tcx: &ctxt<'tcx>, sig: &HR) -> HR where HR: HigherRankedFoldable<'tcx> { let mut counter = 0; replace_late_bound_regions(tcx, sig, |_, db| { counter += 1; ReLateBound(db, BrAnon(counter)) }).0 } </ins> /// Replaces the late-bound-regions in `value` that are bound by `value`. pub fn replace_late_bound_regions<'tcx, HR, F>( tcx: &ty::ctxt<'tcx>,


set -ex source shared.sh <del> curl https://cmake.org/files/v3.6/cmake-3.6.3.tar.gz | tar xzf - </del> <ins> CMAKE=3.13.4 curl -L https://github.com/Kitware/CMake/releases/download/v$CMAKE/cmake-$CMAKE.tar.gz | tar xzf - </ins> mkdir cmake-build cd cmake-build <del> hide_output ../cmake-3.6.3/configure --prefix=/rustroot </del> <ins> hide_output ../cmake-$CMAKE/configure --prefix=/rustroot </ins> hide_output make -j10 hide_output make install cd .. rm -rf cmake-build <del> rm -rf cmake-3.6.3 </del> <ins> rm -rf cmake-$CMAKE </ins>


// preventing the latter from being formatted. ignore_fmt.add(&format!("!/{}", untracked_path)).expect(&untracked_path); } <ins> if !check && paths.is_empty() { if let Some(files) = get_modified_files(build) { for file in files { println!("formatting modified file {file}"); ignore_fmt.add(&format!("/{file}")).expect(&file); } } } </ins> } else { println!("Not in git tree. Skipping git-aware format checks"); }


LL |     #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item |                  ^^^^^^^^ <ins> error[E0565]: literal in `deprecated` value must be a string --> $DIR/deprecation-sanity.rs:19:25 | LL |     #[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string |                         ^^^^^^^ help: consider removing the prefix: `"test"` error[E0565]: item in `deprecated` must be a key/value pair --> $DIR/deprecation-sanity.rs:22:18 | LL |     #[deprecated("test")] //~ ERROR item in `deprecated` must be a key/value pair |                  ^^^^^^ </ins> error[E0550]: multiple deprecated attributes <del> --> $DIR/deprecation-sanity.rs:22:1 </del> <ins> --> $DIR/deprecation-sanity.rs:28:1 </ins> | LL | fn multiple1() { } //~ ERROR multiple deprecated attributes | ^^^^^^^^^^^^^^^^^^ error[E0538]: multiple 'since' items <del> --> $DIR/deprecation-sanity.rs:24:27 </del> <ins> --> $DIR/deprecation-sanity.rs:30:27 </ins> | LL | #[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items |                           ^^^^^^^^^^^ <del> error: aborting due to 7 previous errors </del> <ins> error: aborting due to 9 previous errors </ins> <del> Some errors occurred: E0538, E0541, E0550, E0551. </del> <ins> Some errors occurred: E0538, E0541, E0550, E0551, E0565. </ins> For more information about an error, try `rustc --explain E0538`.


// ensure that we issue lints in a repeatable order def_ids.sort_by_cached_key(|&def_id| self.tcx.def_path_hash(def_id)); <del> for def_id in def_ids { </del> <ins> 'lifetimes: for def_id in def_ids { </ins> debug!("check_uses_for_lifetimes_defined_by_scope: def_id = {:?}", def_id); let lifetimeuseset = self.lifetime_uses.remove(&def_id);


_ => self.get(item.def_id), }; <ins> // Update levels of nested things. match item.kind { hir::ItemKind::Enum(ref def, _) => { for variant in def.variants { let variant_level = self.update_with_hir_id(variant.id, item_level); if let Some(ctor_hir_id) = variant.data.ctor_hir_id() { self.update_with_hir_id(ctor_hir_id, item_level); } for field in variant.data.fields() { self.update_with_hir_id(field.hir_id, variant_level); } } } hir::ItemKind::Impl(ref impl_) => { for impl_item_ref in impl_.items { if impl_.of_trait.is_some() || self.tcx.visibility(impl_item_ref.id.def_id) == ty::Visibility::Public { self.update(impl_item_ref.id.def_id, item_level); } } } hir::ItemKind::Trait(.., trait_item_refs) => { for trait_item_ref in trait_item_refs { self.update(trait_item_ref.id.def_id, item_level); } } hir::ItemKind::Struct(ref def, _) | hir::ItemKind::Union(ref def, _) => { if let Some(ctor_hir_id) = def.ctor_hir_id() { self.update_with_hir_id(ctor_hir_id, item_level); } for field in def.fields() { if field.vis.node.is_pub() { self.update_with_hir_id(field.hir_id, item_level); } } } hir::ItemKind::Macro(ref macro_def) => { self.update_reachability_from_macro(item.def_id, macro_def); } hir::ItemKind::ForeignMod { items, .. } => { for foreign_item in items { if self.tcx.visibility(foreign_item.id.def_id) == ty::Visibility::Public { self.update(foreign_item.id.def_id, item_level); } } } hir::ItemKind::OpaqueTy(..) | hir::ItemKind::Use(..) | hir::ItemKind::Static(..) | hir::ItemKind::Const(..) | hir::ItemKind::GlobalAsm(..) | hir::ItemKind::TyAlias(..) | hir::ItemKind::Mod(..) | hir::ItemKind::TraitAlias(..) | hir::ItemKind::Fn(..) | hir::ItemKind::ExternCrate(..) => {} } </ins> // Mark all items in interfaces of reachable items as reachable. match item.kind { // The interface is empty. <del> hir::ItemKind::ExternCrate(..) => {} </del> <ins> hir::ItemKind::Macro(..) | hir::ItemKind::ExternCrate(..) => {} </ins> // All nested items are checked by `visit_item`. hir::ItemKind::Mod(..) => {} <ins> // Handled in the access level of in rustc_resolve </ins> hir::ItemKind::Use(..) => {} // The interface is empty. hir::ItemKind::GlobalAsm(..) => {}


"rls-rustc", "rls-span", "rls-vfs", <del> "rustc-serialize", </del> "rustc-workspace-hack", "rustc_tools_util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustfmt-nightly",


ByteStr(_) | ByteStrRaw(..) => "byte string" } } <ins> // See comments in `interpolated_to_tokenstream` for why we care about // *probably* equal here rather than actual equality fn probably_equal_for_proc_macro(&self, other: &Lit) -> bool { mem::discriminant(self) == mem::discriminant(other) } </ins> } pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {


impl Scalar { pub fn is_bool(&self) -> bool { <del> if let Int(I8, _) = self.value { self.valid_range == (0..=1) } else { false } </del> <ins> matches!(self.value, Int(I8, false)) && self.valid_range == (0..=1) </ins> } /// Returns the valid range as a `x..y` range.


<ins> // check-pass struct Sqlite {} trait HasArguments<'q> { type Arguments; } impl<'q> HasArguments<'q> for Sqlite { type Arguments = std::marker::PhantomData<&'q ()>; } fn foo() { let _ = <Sqlite as HasArguments>::Arguments::default(); } fn main() {} </ins>


// Get the `hir::Param` to verify whether it already has any bounds. // We do this to avoid suggesting code that ends up as `T: FooBar`, // instead we suggest `T: Foo + Bar` in that case. <del> let mut has_bounds = None; let mut impl_trait = false; if let Node::GenericParam(ref param) = hir.get(id) { let kind = &param.kind; if let hir::GenericParamKind::Type { synthetic: Some(_), .. } = kind { // We've found `fn foo(x: impl Trait)` instead of // `fn foo<T>(x: T)`. We want to suggest the correct // `fn foo(x: impl Trait + TraitBound)` instead of // `fn foo<T: TraitBound>(x: T)`. (See #63706.) impl_trait = true; has_bounds = param.bounds.get(1); } else { has_bounds = param.bounds.get(0); </del> <ins> match hir.get(id) { Node::GenericParam(ref param) => { let mut impl_trait = false; let has_bounds = if let hir::GenericParamKind::Type { synthetic: Some(_), .. } = &param.kind { // We've found `fn foo(x: impl Trait)` instead of // `fn foo<T>(x: T)`. We want to suggest the correct // `fn foo(x: impl Trait + TraitBound)` instead of // `fn foo<T: TraitBound>(x: T)`. (#63706) impl_trait = true; param.bounds.get(1) } else { param.bounds.get(0) }; let sp = hir.span(id); let sp = if let Some(first_bound) = has_bounds { // `sp` only covers `T`, change it so that it covers // `T:` when appropriate sp.until(first_bound.span()) } else { sp }; // FIXME: contrast `t.def_id` against `param.bounds` to not suggest // traits already there. That can happen when the cause is that // we're in a const scope or associated function used as a method. err.span_suggestions( sp, &message(format!( "restrict type parameter `{}` with", param.name.ident().as_str(), )), candidates.iter().map(|t| format!( "{}{} {}{}", param.name.ident().as_str(), if impl_trait { " +" } else { ":" }, self.tcx.def_path_str(t.def_id), if has_bounds.is_some() { " + "} else { "" }, )), Applicability::MaybeIncorrect, ); suggested = true; } Node::Item(hir::Item { kind: hir::ItemKind::Trait(.., bounds, _), ident, .. }) => { let (sp, sep, article) = if bounds.is_empty() { (ident.span.shrink_to_hi(), ":", "a") } else { (bounds.last().unwrap().span().shrink_to_hi(), " +", "another") }; err.span_suggestions( sp, &message(format!("add {} supertrait for", article)), candidates.iter().map(|t| format!( "{} {}", sep, self.tcx.def_path_str(t.def_id), )), Applicability::MaybeIncorrect, ); suggested = true; </ins> } <ins> _ => {} </ins> } <del> let sp = hir.span(id); // `sp` only covers `T`, change it so that it covers `T:` when appropriate. let sp = if let Some(first_bound) = has_bounds { sp.until(first_bound.span()) } else { sp }; // FIXME: contrast `t.def_id` against `param.bounds` to not suggest traits // already there. That can happen when the cause is that we're in a const // scope or associated function used as a method. err.span_suggestions( sp, &msg[..], candidates.iter().map(|t| format!( "{}{} {}{}", param, if impl_trait { " +" } else { ":" }, self.tcx.def_path_str(t.def_id), if has_bounds.is_some() { " + " } else { "" }, )), Applicability::MaybeIncorrect, ); suggested = true; </del> } }; } if !suggested { <ins> let mut msg = message(if let Some(param) = param_type { format!("restrict type parameter `{}` with", param) } else { "implement".to_string() }); </ins> for (i, trait_info) in candidates.iter().enumerate() { msg.push_str(&format!( "ncandidate #{}: `{}`",


fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, ast_generics: &hir::Generics, space: ParamSpace, <del> index: u32) </del> <ins> index: u32, allow_defaults: bool) </ins> -> ty::TypeParameterDef<'tcx> { let param = &ast_generics.ty_params[index as usize];


<del> Subproject commit f5532b22b5d741f3ea207b5b07e3e1ca63476f9b </del> <ins> Subproject commit 02b3734a5ba6de984eb5a02c50860cc014e58d56 </ins>


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


// appears to be the most interesting point to report to the // user via an even more ad-hoc guess. categorized_path.sort_by(|p0, p1| p0.category.cmp(&p1.category)); <del> debug!("`: sorted_path={:#?}", categorized_path); </del> <ins> debug!("best_blame_constraint: sorted_path={:#?}", categorized_path); </ins> categorized_path.remove(0) }


<ins> // test for trait methods with `doc(hidden)`. #![crate_name = "foo"] // @has foo/trait.Trait.html // @!has - '//*[@id="associatedtype.Foo"]' 'type Foo' // @has - '//*[@id="associatedtype.Bar"]' 'type Bar' // @!has - '//*[@id="tymethod.f"]' 'fn f()' // @has - '//*[@id="tymethod.g"]' 'fn g()' pub trait Trait { #[doc(hidden)] type Foo; type Bar; #[doc(hidden)] fn f(); fn g(); } // @has foo/struct.S.html // @!has - '//*[@id="associatedtype.Foo"]' 'type Foo' // @has - '//*[@id="associatedtype.Bar"]' 'type Bar' // @!has - '//*[@id="method.f"]' 'fn f()' // @has - '//*[@id="method.g"]' 'fn g()' pub struct S; impl Trait for S { type Foo = (); type Bar = (); fn f() {} fn g() {} } </ins>


<ins> //@ revisions: enable-backchain disable-backchain //@ assembly-output: emit-asm //@ compile-flags: -O --crate-type=lib --target=s390x-unknown-linux-gnu //@ needs-llvm-components: systemz //@[enable-backchain] compile-flags: -Ctarget-feature=+backchain //@[disable-backchain] compile-flags: -Ctarget-feature=-backchain #![feature(no_core, lang_items)] #![no_std] #![no_core] #[lang = "sized"] trait Sized {} extern "C" { fn extern_func(); } // CHECK-LABEL: test_backchain #[no_mangle] extern "C" fn test_backchain() -> i32 { // Here we try to match if backchain register is saved to the parameter area (stored in r15/sp) // And also if a new parameter area (160 bytes) is allocated for the upcoming function call // enable-backchain: lgr [[REG1:.*]], %r15 // enable-backchain-NEXT: aghi %r15, -160 // enable-backchain: stg [[REG1]], 0(%r15) // disable-backchain: aghi %r15, -160 // disable-backchain-NOT: stg %r{{.*}}, 0(%r15) unsafe { extern_func(); } // enable-backchain-NEXT: brasl %r{{.*}}, extern_func@PLT // disable-backchain: brasl %r{{.*}}, extern_func@PLT // Make sure that the expected return value is written into %r2 (return register): // enable-backchain-NEXT: lghi %r2, 1 // disable-backchain: lghi %r2, 0 #[cfg(target_feature = "backchain")] { 1 } #[cfg(not(target_feature = "backchain"))] { 0 } // CHECK: br %r{{.*}} } </ins>


use syntax::ast; use syntax::source_map::Spanned; use syntax::ptr::P; <ins> use syntax::util::lev_distance::find_best_match_for_name; </ins> use syntax_pos::Span; impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {


<ins> error[E0384]: cannot assign twice to immutable variable `a` --> $DIR/tainted-promoteds.rs:7:5 | LL |     let a = 0; |         - |         | |         first assignment to `a` |         help: consider making this binding mutable: `mut a` LL |     a = &0 * &1 * &2 * &3; |     ^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error For more information about this error, try `rustc --explain E0384`. </ins>


for attr in &data.attrs { match attr.style { crate::AttrStyle::Outer => { <del> assert!( inner_attrs.len() == 0, "Found outer attribute {:?} after inner attrs {:?}", attr, inner_attrs ); </del> outer_attrs.push(attr); } crate::AttrStyle::Inner => {


// option. This file may not be copied, modified, or distributed // except according to those terms. <del> // compile-flags:--no-defaults --passes "collapse-docs" --passes "unindent-comments" </del> <ins> // compile-flags:--no-defaults --passes collapse-docs --passes unindent-comments </ins> // @has issue_15347/fn.foo.html #[doc(hidden)]


E0495, // cannot infer an appropriate lifetime due to conflicting requirements E0496, // .. name `..` shadows a .. name that is already in scope E0498, // malformed plugin attribute <ins> E0514, // metadata version mismatch </ins> }


} fn build_free<'tcx>(tcx: &ty::ctxt<'tcx>, <del> cfg: &mut CFG<'tcx>, </del> unit_temp: Lvalue<'tcx>, data: &FreeData<'tcx>, <del> target: BasicBlock) -> BasicBlock { </del> <ins> target: BasicBlock) -> Terminator<'tcx> { </ins> let free_func = tcx.lang_items.box_free_fn() .expect("box_free language item is missing"); let substs = tcx.mk_substs(Substs::new( VecPerParamSpace::new(vec![], vec![], vec![data.item_ty]), VecPerParamSpace::new(vec![], vec![], vec![]) )); <del> let block = cfg.start_new_cleanup_block(); cfg.terminate(block, Terminator::Call { </del> <ins> Terminator::Call { </ins> func: Operand::Constant(Constant { span: data.span, ty: tcx.lookup_item_type(free_func).ty.subst(tcx, substs),


LL |     type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>; |                                              +++ <del> error: aborting due to previous error </del> <ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-85347.rs:3:46 | LL |     type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; |                                              ^^^^^^^^^^^^^ associated type not allowed here error: aborting due to 2 previous errors </ins> <del> For more information about this error, try `rustc --explain E0107`. </del> <ins> Some errors have detailed explanations: E0107, E0229. For more information about an error, try `rustc --explain E0107`. </ins>


fn in_call( cx: &ConstCx<'_, 'tcx>, callee: &Operand<'tcx>, <del> _args: &[Operand<'tcx>], </del> <ins> args: &[Operand<'tcx>], </ins> _return_ty: Ty<'tcx>, ) -> bool { if cx.mode == Mode::Fn {


} fn is_try_block(&self) -> bool { <del> self.token.is_keyword(kw::Try) && self.look_ahead(1, |t| *t == token::OpenDelim(token::Brace)) && self.token.uninterpolated_span().rust_2018() && // Prevent `while try {} {}`, `if try {} {} else {}`, etc. !self.restrictions.contains(Restrictions::NO_STRUCT_LITERAL) </del> <ins> self.token.is_keyword(kw::Try) && self.look_ahead(1, |t| *t == token::OpenDelim(token::Brace)) && self.token.uninterpolated_span().rust_2018() </ins> } /// Parses an `async move? {...}` expression.


[submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git <del> branch = rustc/16.0-2023-03-06 </del> <ins> branch = rustc/16.0-2023-04-05 </ins> [submodule "src/doc/embedded-book"] path = src/doc/embedded-book url = https://github.com/rust-embedded/book.git


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


<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 46112: An extern crate pub reexporting libcore was causing // paths rooted from `std` to be misrendered in the diagnostic output. // ignore-windows // aux-build:xcrate_issue_46112_rexport_core.rs extern crate xcrate_issue_46112_rexport_core; fn test(r: Result<Option<()>, &'static str>) { } fn main() { test(Ok(())); } //~^ mismatched types </ins>


#[license = "MIT/ASL2"]; #[crate_type = "dylib"]; #[crate_type = "rlib"]; <del> #[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png", </del> <ins> #[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", </ins> html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")];


verbose_help); } <ins> fn print_wall_help() { println!(" The flag `-Wall` does not exist in `rustc`. Most useful lints are enabled by default. Use `rustc -W help` to see all available lints. It's more common to put warning settings in the crate root using `#![warn(LINT_NAME)]` instead of using the command line flag directly. "); } </ins> fn describe_lints(sess: &Session, lint_store: &lint::LintStore, loaded_plugins: bool) { println!(" Available lint options:


Command::new("mkdir").arg("./").output().unwrap() }; <del> assert!(status.code() == Some(1)); </del> <ins> assert!(status.code().is_some()); assert!(status.code() != Some(0)); </ins> assert_eq!(stdout, Vec::new()); assert!(!stderr.is_empty()); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_finish_once() { let mut prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).spawn().unwrap() } else { <del> Command::new("false").spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("false").spawn().unwrap() </ins> }; assert!(prog.wait().unwrap().code() == Some(1)); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_finish_twice() { let mut prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).spawn().unwrap() } else { <del> Command::new("false").spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("false").spawn().unwrap() </ins> }; assert!(prog.wait().unwrap().code() == Some(1)); assert!(prog.wait().unwrap().code() == Some(1)); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_wait_with_output_once() { let prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "echo hello"]).stdout(Stdio::piped()).spawn().unwrap() } else { <del> Command::new("echo").arg("hello").stdout(Stdio::piped()).spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("echo hello").stdout(Stdio::piped()).spawn().unwrap() </ins> }; let Output { status, stdout, stderr } = prog.wait_with_output().unwrap();


expanded_cache: FxHashMap::default(), primary_def_id: Some(def_id), found_recursion: false, <ins> found_any_recursion: false, </ins> check_recursion: true, tcx: self, };


Box::new(MaybeUninit::uninit()) } <del> // FIXME: add a test for a bigger box. Currently broken, see // https://github.com/rust-lang/rust/issues/58201. </del> <ins> // https://github.com/rust-lang/rust/issues/58201 #[no_mangle] pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> { // CHECK-LABEL: @box_uninitialized2 // CHECK-NOT: store // CHECK-NOT: alloca // CHECK-NOT: memcpy // CHECK-NOT: memset Box::new(MaybeUninit::uninit()) } </ins> // Hide the `allocalign` attribute in the declaration of __rust_alloc // from the CHECK-NOT above, and also verify the attributes got set reasonably.


use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, LocalDefIdSet}; <del> use rustc_hir::intravisit::{walk_item, Visitor}; </del> <ins> use rustc_hir::intravisit::{walk_body, walk_item, Visitor}; </ins> use rustc_hir::{Node, CRATE_HIR_ID}; use rustc_middle::hir::nested_filter; use rustc_middle::ty::TyCtxt;


<ins> error[E0308]: mismatched types --> $DIR/bad-type-in-vec-push.rs:11:17 | LL |     vector.sort(); |     ------ here the type of `vector` is inferred to be `Vec<_>` LL |     result.push(vector); |            ---- ^^^^^^ expected integer, found struct `Vec` |            | |            arguments to this method are incorrect | = note: expected type `{integer}` found struct `Vec<_>` note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL error[E0308]: mismatched types --> $DIR/bad-type-in-vec-push.rs:18:12 | LL |     x.push(""); |       ---- ^^ expected integer, found `&str` |       | |       arguments to this method are incorrect | note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. </ins>


} fn run(self, builder: &Builder<'_>) { <del> // This gets called by `promote-release` // (https://github.com/rust-lang/rust-central-station/tree/master/promote-release). </del> let mut cmd = builder.tool_cmd(Tool::BuildManifest); if builder.config.dry_run { return;


impl ErrorIndex { pub fn command(builder: &Builder<'_>) -> Command { <del> // This uses stage-1 to match the behavior of building rustdoc. // Error-index-generator links with the rustdoc library, so we want to // use the same librustdoc to avoid building rustdoc twice (and to // avoid building the compiler an extra time). This uses // saturating_sub to deal with building with stage 0. (Using stage 0 // isn't recommended, since it will fail if any new error index tests // use new syntax, but it should work otherwise.) let compiler = builder.compiler(builder.top_stage.saturating_sub(1), builder.config.build); </del> <ins> // Error-index-generator links with the rustdoc library, so we need to add `rustc_lib_paths` // for rustc_private and libLLVM.so, and `sysroot_lib` for libstd, etc. let host = builder.config.build; let compiler = builder.compiler_for(builder.top_stage, host, host); </ins> let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); <del> add_dylib_path( vec![ PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)), builder.rustc_libdir(compiler), ], &mut cmd, ); </del> <ins> let mut dylib_paths = builder.rustc_lib_paths(compiler); dylib_paths.push(PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))); add_dylib_path(dylib_paths, &mut cmd); </ins> cmd } }


<ins> #![feature(doc_alias)] #![feature(trait_alias)] pub struct Foo; pub trait Bar { const BAZ: u8; } impl Bar for Foo { #[doc(alias = "CONST_BAZ")] //~ ERROR const BAZ: u8 = 0; } impl Foo { #[doc(alias = "CONST_FOO")] // ok! pub const FOO: u8 = 0; pub fn bar() -> u8 { Self::FOO } } </ins>


fn test1() { let a: i32 = "foo"; //~^ ERROR: mismatched types <ins> let b: i32 = "f'oo"; //~^ ERROR: mismatched types </ins> } fn test2() {


fn after_krate(&mut self) -> Result<(), Error> { debug!("Done with crate"); <del> debug!("Adding Primitive impls"); for primitive in Rc::clone(&self.cache).primitive_locations.values() { self.get_impls(*primitive); } </del> let e = ExternalCrate { crate_num: LOCAL_CRATE }; let index = (*self.index).clone().into_inner(); debug!("Constructing Output");


<del> // Copyright 2014-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. //! Scoped thread-local storage //! //! This module provides the ability to generate *scoped* thread-local //! variables. In this sense, scoped indicates that thread local storage //! actually stores a reference to a value, and this reference is only placed //! in storage for a scoped amount of time. //! //! There are no restrictions on what types can be placed into a scoped //! variable, but all scoped variables are initialized to the equivalent of //! null. Scoped thread local storage is useful when a value is present for a known //! period of time and it is not required to relinquish ownership of the //! contents. //! //! # Examples //! //! ``` //! # #![feature(scoped_tls)] //! scoped_thread_local!(static FOO: u32); //! //! // Initially each scoped slot is empty. //! assert!(!FOO.is_set()); //! //! // When inserting a value, the value is only in place for the duration //! // of the closure specified. //! FOO.set(&1, || { //!     FOO.with(|slot| { //!         assert_eq!(*slot, 1); //!     }); //! }); //! ``` #![unstable(feature = "thread_local_internals")] use prelude::v1::*; // macro hygiene sure would be nice, wouldn't it? #[doc(hidden)] pub mod __impl { pub use super::imp::KeyInner; pub use sys_common::thread_local::INIT as OS_INIT; } /// Type representing a thread local storage key corresponding to a reference /// to the type parameter `T`. /// /// Keys are statically allocated and can contain a reference to an instance of /// type `T` scoped to a particular lifetime. Keys provides two methods, `set` /// and `with`, both of which currently use closures to control the scope of /// their contents. #[unstable(feature = "scoped_tls", reason = "scoped TLS has yet to have wide enough use to fully consider  stabilizing its interface")] pub struct ScopedKey<T> { #[doc(hidden)] pub inner: __impl::KeyInner<T> } /// Declare a new scoped thread local storage key. /// /// This macro declares a `static` item on which methods are used to get and /// set the value stored within. #[macro_export] #[allow_internal_unstable] macro_rules! scoped_thread_local { (static $name:ident: $t:ty) => ( __scoped_thread_local_inner!(static $name: $t); ); (pub static $name:ident: $t:ty) => ( __scoped_thread_local_inner!(pub static $name: $t); ); } #[macro_export] #[doc(hidden)] #[allow_internal_unstable] macro_rules! __scoped_thread_local_inner { (static $name:ident: $t:ty) => ( #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")), thread_local)] static $name: ::std::thread::ScopedKey<$t> = __scoped_thread_local_inner!($t); ); (pub static $name:ident: $t:ty) => ( #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")), thread_local)] pub static $name: ::std::thread::ScopedKey<$t> = __scoped_thread_local_inner!($t); ); ($t:ty) => ({ use std::thread::ScopedKey as __Key; #[cfg(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")))] const _INIT: __Key<$t> = __Key { inner: ::std::thread::__scoped::KeyInner { inner: ::std::cell::UnsafeCell { value: 0 as *mut _ }, } }; #[cfg(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64"))] const _INIT: __Key<$t> = __Key { inner: ::std::thread::__scoped::KeyInner { inner: ::std::thread::__scoped::OS_INIT, marker: ::std::marker::PhantomData::<::std::cell::Cell<$t>>, } }; _INIT }) } #[unstable(feature = "scoped_tls", reason = "scoped TLS has yet to have wide enough use to fully consider  stabilizing its interface")] impl<T> ScopedKey<T> { /// Insert a value into this scoped thread local storage slot for a /// duration of a closure. /// /// While `cb` is running, the value `t` will be returned by `get` unless /// this function is called recursively inside of `cb`. /// /// Upon return, this function will restore the previous value, if any /// was available. /// /// # Examples /// /// ``` /// # #![feature(scoped_tls)] /// scoped_thread_local!(static FOO: u32); /// /// FOO.set(&100, || { ///     let val = FOO.with(|v| *v); ///     assert_eq!(val, 100); /// ///     // set can be called recursively ///     FOO.set(&101, || { ///         // ... ///     }); /// ///     // Recursive calls restore the previous value. ///     let val = FOO.with(|v| *v); ///     assert_eq!(val, 100); /// }); /// ``` pub fn set<R, F>(&'static self, t: &T, cb: F) -> R where F: FnOnce() -> R, { struct Reset<'a, T: 'a> { key: &'a __impl::KeyInner<T>, val: *mut T, } #[unsafe_destructor] impl<'a, T> Drop for Reset<'a, T> { fn drop(&mut self) { unsafe { self.key.set(self.val) } } } let prev = unsafe { let prev = self.inner.get(); self.inner.set(t as *const T as *mut T); prev }; let _reset = Reset { key: &self.inner, val: prev }; cb() } /// Get a value out of this scoped variable. /// /// This function takes a closure which receives the value of this /// variable. /// /// # Panics /// /// This function will panic if `set` has not previously been called. /// /// # Examples /// /// ```no_run /// # #![feature(scoped_tls)] /// scoped_thread_local!(static FOO: u32); /// /// FOO.with(|slot| { ///     // work with `slot` /// }); /// ``` pub fn with<R, F>(&'static self, cb: F) -> R where F: FnOnce(&T) -> R { unsafe { let ptr = self.inner.get(); assert!(!ptr.is_null(), "cannot access a scoped thread local  variable without calling `set` first"); cb(&*ptr) } } /// Test whether this TLS key has been `set` for the current thread. pub fn is_set(&'static self) -> bool { unsafe { !self.inner.get().is_null() } } } #[cfg(not(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64")))] mod imp { use std::cell::UnsafeCell; #[doc(hidden)] pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> } unsafe impl<T> ::marker::Sync for KeyInner<T> { } #[doc(hidden)] impl<T> KeyInner<T> { #[doc(hidden)] pub unsafe fn set(&self, ptr: *mut T) { *self.inner.get() = ptr; } #[doc(hidden)] pub unsafe fn get(&self) -> *mut T { *self.inner.get() } } } #[cfg(any(windows, target_os = "android", target_os = "ios", target_os = "openbsd", target_arch = "aarch64"))] mod imp { use marker; use std::cell::Cell; use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] pub struct KeyInner<T> { pub inner: OsStaticKey, pub marker: marker::PhantomData<Cell<T>>, } unsafe impl<T> ::marker::Sync for KeyInner<T> { } #[doc(hidden)] impl<T> KeyInner<T> { #[doc(hidden)] pub unsafe fn set(&self, ptr: *mut T) { self.inner.set(ptr as *mut _) } #[doc(hidden)] pub unsafe fn get(&self) -> *mut T { self.inner.get() as *mut _ } } } #[cfg(test)] mod tests { use cell::Cell; use prelude::v1::*; scoped_thread_local!(static FOO: u32); #[test] fn smoke() { scoped_thread_local!(static BAR: u32); assert!(!BAR.is_set()); BAR.set(&1, || { assert!(BAR.is_set()); BAR.with(|slot| { assert_eq!(*slot, 1); }); }); assert!(!BAR.is_set()); } #[test] fn cell_allowed() { scoped_thread_local!(static BAR: Cell<u32>); BAR.set(&Cell::new(1), || { BAR.with(|slot| { assert_eq!(slot.get(), 1); }); }); } #[test] fn scope_item_allowed() { assert!(!FOO.is_set()); FOO.set(&1, || { assert!(FOO.is_set()); FOO.with(|slot| { assert_eq!(*slot, 1); }); }); assert!(!FOO.is_set()); } } </del>


<ins> use core::fmt; </ins> use core::iter::FusedIterator; <ins> use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; </ins> use core::ptr::{self, NonNull}; <del> use core::{fmt, mem}; </del> use crate::alloc::{Allocator, Global}; <del> use super::{count, Iter, VecDeque}; </del> <ins> use super::{count, wrap_index, VecDeque}; </ins> /// A draining iterator over the elements of a `VecDeque`. ///


use std::collections::BTreeMap; use std::env; <del> use std::fs; </del> <ins> use std::fs::{self, File}; </ins> use std::io::{self, Read, Write}; use std::path::{PathBuf, Path}; use std::process::{Command, Stdio}; <ins> use std::collections::HashMap; </ins> static HOSTS: &[&str] = &[ "aarch64-unknown-linux-gnu",


pub mod fun_treemap; pub mod list; pub mod priority_queue; <del> pub mod rope; </del> pub mod smallintmap; pub mod sort;


[`std::env`]: https://doc.rust-lang.org/stable/std/env/index.html#functions [strikethrough]: https://github.github.com/gfm/#strikethrough-extension- [tables]: https://github.github.com/gfm/#tables-extension- <ins> [task list extension]: https://github.github.com/gfm/#task-list-items-extension- </ins>


} else { // `sret` parameter thus one less integer register available arg.make_indirect(); <ins> // NOTE(eddyb) return is handled first, so no registers // should've been used yet. assert_eq!(int_regs, MAX_INT_REGS); </ins> int_regs -= 1; } } Ok(ref cls) => { // split into sized chunks passed individually <del> int_regs -= needed_int; sse_regs -= needed_sse; </del> if arg.layout.is_aggregate() { let size = arg.layout.size; arg.cast_to(cast_target(cls, size))


Err(CharTryFromError(())) } else { // SAFETY: checked that it's a legal unicode value <del> Ok(unsafe { from_u32_unchecked(i) }) </del> <ins> Ok(unsafe { transmute(i) }) </ins> } } }


} fn run_ui_cargo(config: &mut compiletest::Config) { <ins> if cargo::is_rustc_test_suite() { return; } </ins> fn run_tests( config: &compiletest::Config, filter: &Option<String>,


#[rustc_doc_primitive = "f64"] #[doc(alias = "double")] <del> /// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008). </del> <ins> /// A 64-bit floating-point type (specifically, the "binary64" type defined in IEEE 754-2008). </ins> /// /// This type is very similar to [`prim@f32`], but has increased precision by using twice as many /// bits. Please see [the documentation for `f32`](prim@f32) or [Wikipedia on double-precision


/// the hashmap because certain items (traits and types) need to have their mappings for trait /// implementations filled out before they're inserted. fn item(&mut self, item: clean::Item) -> Result<(), Error> { <del> let local_blanket_impl = match item.def_id { clean::ItemId::Blanket { impl_id, .. } => impl_id.is_local(), clean::ItemId::Auto { .. } | clean::ItemId::DefId(_) | clean::ItemId::Primitive(_, _) => false, }; </del> // Flatten items that recursively store other items <del> // FIXME(CraftSpider): We skip children of local blanket implementations, as we'll have //     already seen the actual generic impl, and the generated ones don't need documenting. //     This is necessary due to the visibility, return type, and self arg of the generated //     impls not quite matching, and will no longer be necessary when the mismatch is fixed. if !local_blanket_impl { item.kind.inner_items().for_each(|i| self.item(i.clone()).unwrap()); } </del> <ins> item.kind.inner_items().for_each(|i| self.item(i.clone()).unwrap()); </ins> let id = item.def_id; if let Some(mut new_item) = self.convert_item(item) {


//      '👎 Deprecated since 1.0.0: deprecated' // @has issue_32374/struct.U.html '//*[@class="stab unstable"]'  //      '🔬 This is a nightly-only experimental API. (test #32374)' <del> // @has issue_32374/struct.U.html '//details'  //      '🔬 This is a nightly-only experimental API. (test #32374)' // @has issue_32374/struct.U.html '//summary'  //      '🔬 This is a nightly-only experimental API. (test #32374)' // @has issue_32374/struct.U.html '//details/p'  //      'unstable' </del> #[rustc_deprecated(since = "1.0.0", reason = "deprecated")] #[unstable(feature = "test", issue = "32374", reason = "unstable")] pub struct U;


let external_paths = ctxt.external_paths.borrow_mut().take(); *analysis.external_paths.borrow_mut() = external_paths; let map = ctxt.external_typarams.borrow_mut().take(); *analysis.external_typarams.borrow_mut() = map; let map = ctxt.inlined.borrow_mut().take(); *analysis.inlined.borrow_mut() = map; analysis.deref_trait_did = ctxt.deref_trait_did.get(); <del> (krate, analysis) }), &sess) </del> <ins> Some((krate, analysis)) }), &sess); krate_and_analysis.unwrap() </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. use std::io; use std::vec; pub struct Container<'a> { reader: &'a mut Reader //~ ERROR explicit lifetime bound required } impl<'a> Container<'a> { pub fn wrap<'s>(reader: &'s mut Reader) -> Container<'s> { Container { reader: reader } } pub fn read_to(&mut self, vec: &mut [u8]) { self.reader.read(vec); } } pub fn for_stdin<'a>() -> Container<'a> { let mut r = io::stdin(); Container::wrap(&mut r as &mut Reader) } fn main() { let mut c = for_stdin(); let mut v = vec::Vec::from_elem(10, 0u8); c.read_to(v.as_mut_slice()); } </ins>


fn main() { let _x = "test" as &::std::any::Any; //~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `str` <del> //~^^ NOTE the trait `core::kinds::Sized` must be implemented for the cast to the object type </del> <ins> //~^^ ERROR the trait `core::kinds::Sized` is not implemented for the type `str` </ins> }


<del> Subproject commit 8485d40a3264b15b92d391e99cb3d1abf8f25025 </del> <ins> Subproject commit 23549a8c362a403026432f65a6cb398cb10d44b7 </ins>


use foo::self; //~ ERROR unresolved import `foo::self` //~^ ERROR `self` imports are only allowed within a { } list <ins> use std::mem::self; //~^ ERROR `self` imports are only allowed within a { } list </ins> fn main() {}


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


<ins> error[E0119]: conflicting implementations of trait `Bar` for type `()` --> $DIR/dont-drop-upcast-candidate.rs:10:1 | LL | impl<T> Bar for T where dyn Foo: Unsize<dyn Bar> {} | ------------------------------------------------ first implementation here LL | impl Bar for () {} | ^^^^^^^^^^^^^^^ conflicting implementation for `()` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0119`. </ins>


fn check_trait_fn_not_async(&self, span: Span, asyncness: IsAsync) { if asyncness.is_async() { <del> struct_span_err!(self.session, span, E0706, "trait fns cannot be declared `async`").emit() </del> <ins> struct_span_err!(self.session, span, E0706, "trait fns cannot be declared `async`") .note("`async` trait functions are not currently supported") .note("consider using the `async-trait` crate:  https://crates.io/crates/async-trait") .emit(); </ins> } }


// Note that currently the `wasm-import-module` doesn't do anything, but // eventually LLVM 7 should read this and ferry the appropriate import // module to the output file. <del> if cx.tcx.sess.target.target.arch == "wasm32" { if let Some(module) = wasm_import_module(cx.tcx, id) { llvm::AddFunctionAttrStringValue( llfn, llvm::AttributePlace::Function, const_cstr!("wasm-import-module"), &module, ); </del> <ins> if let Some(id) = id { if cx.tcx.sess.target.target.arch == "wasm32" { if let Some(module) = wasm_import_module(cx.tcx, id) { llvm::AddFunctionAttrStringValue( llfn, llvm::AttributePlace::Function, const_cstr!("wasm-import-module"), &module, ); } </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. #![feature(nll)] fn main() { let foo = &16; //~^ HELP consider changing this to be a mutable reference //~| SUGGESTION &mut 16 *foo = 32; //~^ ERROR cannot assign to `*foo` which is behind a `&` reference let bar = foo; //~^ HELP consider changing this to be a mutable reference //~| SUGGESTION &mut i32 *bar = 64; //~^ ERROR cannot assign to `*bar` which is behind a `&` reference } </ins>


|              help: replace `_` with the correct type: `i32` error[E0121]: the type placeholder `_` is not allowed within types on item signatures <ins> --> $DIR/typeck_type_placeholder_item.rs:197:26 | LL |     type F: std::ops::Fn(_); |                          ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures </ins> --> $DIR/typeck_type_placeholder_item.rs:40:24 | LL |     fn test9(&self) -> _ { () }


<ins> // aux-build:impl-const.rs // run-pass #![feature(const_generics)] #![allow(incomplete_features)] extern crate impl_const; use impl_const::*; pub fn main() { let n = Num::<5>; n.five(); } </ins>


/// } /// ``` #[stable(feature = "io_error_inner", since = "1.3.0")] <ins> #[inline] </ins> pub fn into_inner(self) -> Option<Box<dyn error::Error + Send + Sync>> { match self.repr { Repr::Os(..) => None,


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


let bin_root = self.out.join(host.triple).join("rustfmt"); let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host)); let rustfmt_stamp = bin_root.join(".rustfmt-stamp"); <ins> let legacy_rustfmt = self.initial_rustc.with_file_name(exe("rustfmt", host)); if !legacy_rustfmt.exists() { t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt)); } </ins> if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) { return Some(rustfmt_path); }


// except according to those terms. // aux-build:attr-on-trait.rs <ins> // ignore-stage1 </ins> #![feature(proc_macro)]


let host_libs = builder .stage_out(compiler, Mode::ToolRustc) .join(builder.cargo_dir()); <ins> let target_libs = builder .stage_out(compiler, Mode::ToolRustc) .join(&self.host) .join(builder.cargo_dir()); </ins> cargo.env("HOST_LIBS", host_libs); <ins> cargo.env("TARGET_LIBS", target_libs); </ins> // clippy tests need to find the driver cargo.env("CLIPPY_DRIVER_PATH", clippy);


pub fn get_linker(sess: &Session) -> (String, Command, Vec<(OsString, OsString)>) { let envs = vec![("PATH".into(), command_path(sess))]; <ins> // If our linker looks like a batch script on Windows then to execute this // we'll need to spawn `cmd` explicitly. This is primarily done to handle // emscripten where the linker is `emcc.bat` and needs to be spawned as // `cmd /c emcc.bat ...`. // // This worked historically but is needed manually since #42436 (regression // was tagged as #42791) and some more info can be found on #44443 for // emscripten itself. let cmd = |linker: &str| { if cfg!(windows) && linker.ends_with(".bat") { let mut cmd = Command::new("cmd"); cmd.arg("/c").arg(linker); cmd } else { Command::new(linker) } }; </ins> if let Some(ref linker) = sess.opts.cg.linker { <del> (linker.clone(), Command::new(linker), envs) </del> <ins> (linker.clone(), cmd(linker), envs) </ins> } else if sess.target.target.options.is_like_msvc { let (cmd, envs) = msvc_link_exe_cmd(sess); ("link.exe".to_string(), cmd, envs) } else { let linker = &sess.target.target.options.linker; <del> (linker.clone(), Command::new(&linker), envs) </del> <ins> (linker.clone(), cmd(linker), envs) </ins> } }


<ins> // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #77650 struct C<T, const N: core::num::NonZeroUsize>([T; N.get()]) where [T; N.get()]: Sized; impl<'a, const N: core::num::NonZeroUsize, A, B: PartialEq<A>> PartialEq<&'a [A]> for C<B, N> where [B; N.get()]: Sized, { fn eq(&self, other: &&'a [A]) -> bool { self.0 == other //~^ error: can't compare } } fn main() {} </ins>


retry pip3 install awscli --upgrade --user echo "##vso[task.prependpath]$HOME/.local/bin" displayName: Install awscli (Linux) <del> condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux')) </ins> - script: pip install awscli displayName: Install awscli (non-Linux) <del> condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Linux')) </ins> # Configure our CI_JOB_NAME variable which log analyzers can use for the main # step to see what's going on.


<del> Subproject commit 941968db2fd9c85788a4f971c8e425d46b4cb734 </del> <ins> Subproject commit 75a5f9236c689a547fe207a10854f0775bce7937 </ins>


|| self.suggest_into(err, expr, expr_ty, expected) || self.suggest_floating_point_literal(err, expr, expected) || self.suggest_null_ptr_for_literal_zero_given_to_ptr_arg(err, expr, expected) <del> || self.suggest_coercing_result_via_try_operator(err, expr, expected, expr_ty) || self.suggest_missing_unwrap_expect(err, expr, expected, expr_ty); </del> <ins> || self.suggest_coercing_result_via_try_operator(err, expr, expected, expr_ty); </ins> if !suggested { self.note_source_of_type_mismatch_constraint(


/// context it's calculated within. This is used by the `type_id` intrinsic. pub fn hash_crate_independent(tcx: &ctxt, ty: Ty, svh: &Svh) -> u64 { let mut state = sip::SipState::new(); <del> macro_rules! byte( ($b:expr) => { ($b as u8).hash(&mut state) } ); macro_rules! hash( ($e:expr) => { $e.hash(&mut state) } ); let region = |_state: &mut sip::SipState, r: Region| { match r { ReStatic => {} ReEmpty | ReEarlyBound(..) | ReLateBound(..) | ReFree(..) | ReScope(..) | ReInfer(..) => { tcx.sess.bug("non-static region found when hashing a type") </del> <ins> helper(tcx, ty, svh, &mut state); return state.result(); fn helper(tcx: &ctxt, ty: Ty, svh: &Svh, state: &mut sip::SipState) { macro_rules! byte( ($b:expr) => { ($b as u8).hash(state) } ); macro_rules! hash( ($e:expr) => { $e.hash(state) } ); let region = |state: &mut sip::SipState, r: Region| { match r { ReStatic => {} ReLateBound(db, BrAnon(i)) => { db.hash(state); i.hash(state); } ReEmpty | ReEarlyBound(..) | ReLateBound(..) | ReFree(..) | ReScope(..) | ReInfer(..) => { tcx.sess.bug("unexpected region found when hashing a type") } </ins> } <del> } }; let did = |state: &mut sip::SipState, did: DefId| { let h = if ast_util::is_local(did) { svh.clone() } else { tcx.sess.cstore.get_crate_hash(did.krate) </del> }; <del> h.as_str().hash(state); did.node.hash(state); }; let mt = |state: &mut sip::SipState, mt: mt| { mt.mutbl.hash(state); }; ty::walk_ty(ty, |ty| { match ty.sty { ty_bool => byte!(2), ty_char => byte!(3), ty_int(i) => { byte!(4); hash!(i); } ty_uint(u) => { byte!(5); hash!(u); } ty_float(f) => { byte!(6); hash!(f); } ty_str => { byte!(7); } ty_enum(d, _) => { byte!(8); did(&mut state, d); } ty_uniq(_) => { byte!(9); } ty_vec(_, Some(n)) => { byte!(10); n.hash(&mut state); } ty_vec(_, None) => { byte!(11); } ty_ptr(m) => { byte!(12); mt(&mut state, m); } ty_rptr(r, m) => { byte!(13); region(&mut state, r); mt(&mut state, m); } ty_bare_fn(ref b) => { byte!(14); hash!(b.unsafety); hash!(b.abi); </del> <ins> let did = |state: &mut sip::SipState, did: DefId| { let h = if ast_util::is_local(did) { svh.clone() } else { tcx.sess.cstore.get_crate_hash(did.krate) }; h.as_str().hash(state); did.node.hash(state); }; let mt = |state: &mut sip::SipState, mt: mt| { mt.mutbl.hash(state); }; let fn_sig = |state: &mut sip::SipState, sig: &FnSig| { let sig = anonymize_late_bound_regions(tcx, sig); for a in sig.inputs.iter() { helper(tcx, *a, svh, state); } if let ty::FnConverging(output) = sig.output { helper(tcx, output, svh, state); </ins> } <del> ty_closure(ref c) => { byte!(15); hash!(c.unsafety); hash!(c.onceness); hash!(c.bounds); match c.store { UniqTraitStore => byte!(0), RegionTraitStore(r, m) => { byte!(1) region(&mut state, r); assert_eq!(m, ast::MutMutable); </del> <ins> }; maybe_walk_ty(ty, |ty| { match ty.sty { ty_bool => byte!(2), ty_char => byte!(3), ty_int(i) => { byte!(4); hash!(i); } ty_uint(u) => { byte!(5); hash!(u); } ty_float(f) => { byte!(6); hash!(f); } ty_str => { byte!(7); } ty_enum(d, _) => { byte!(8); did(state, d); } ty_uniq(_) => { byte!(9); } ty_vec(_, Some(n)) => { byte!(10); n.hash(state); } ty_vec(_, None) => { byte!(11); } ty_ptr(m) => { byte!(12); mt(state, m); } ty_rptr(r, m) => { byte!(13); region(state, r); mt(state, m); } ty_bare_fn(ref b) => { byte!(14); hash!(b.unsafety); hash!(b.abi); fn_sig(state, &b.sig); return false; } ty_closure(ref c) => { byte!(15); hash!(c.unsafety); hash!(c.onceness); hash!(c.bounds); match c.store { UniqTraitStore => byte!(0), RegionTraitStore(r, m) => { byte!(1); region(state, r); assert_eq!(m, ast::MutMutable); } </ins> } <ins> fn_sig(state, &c.sig); return false; </ins> } <del> } ty_trait(box TyTrait { ref principal, bounds }) => { byte!(17); did(&mut state, principal.def_id); hash!(bounds); } ty_struct(d, _) => { byte!(18); did(&mut state, d); } ty_tup(ref inner) => { byte!(19); hash!(inner.len()); } ty_param(p) => { byte!(20); hash!(p.idx); did(&mut state, p.def_id); } ty_open(_) => byte!(22), ty_infer(_) => unreachable!(), ty_err => byte!(23), ty_unboxed_closure(d, r, _) => { byte!(24); did(&mut state, d); region(&mut state, r); } } }); </del> <ins> ty_trait(box TyTrait { ref principal, bounds }) => { byte!(17); did(state, principal.def_id); hash!(bounds); let principal = anonymize_late_bound_regions(tcx, principal); for subty in principal.substs.types.iter() { helper(tcx, *subty, svh, state); } </ins> <del> state.result() </del> <ins> return false; } ty_struct(d, _) => { byte!(18); did(state, d); } ty_tup(ref inner) => { byte!(19); hash!(inner.len()); } ty_param(p) => { byte!(20); hash!(p.idx); did(state, p.def_id); } ty_open(_) => byte!(22), ty_infer(_) => unreachable!(), ty_err => byte!(23), ty_unboxed_closure(d, r, _) => { byte!(24); did(state, d); region(state, r); } } true }); } </ins> } impl Variance {


<ins> error[E0425]: cannot find function `printf` in this scope --> $DIR/seggest_print_over_printf.rs:6:5 | LL |     printf("%d", x); |     ^^^^^^ not found in this scope | help: you may have meant to use the `print` macro | LL |     print!("%d", x); |     ~~~~~~ error: aborting due to previous error For more information about this error, try `rustc --explain E0425`. </ins>


<ins> #[deny(single_use_lifetimes)] // edition:2018 // check-pass // Prior to the fix, the compiler complained that the 'a lifetime was only used // once. This was obviously wrong since the lifetime is used twice: For the s3 // parameter and the return type. The issue was caused by the compiler // desugaring the async function into a generator that uses only a single // lifetime, which then the validator complained about becauase of the // single_use_lifetimes constraints. async fn bar<'a>(s1: String, s2: &'_ str, s3: &'a str) -> &'a str { s3 } fn foo<'a>(s1: String, s2: &'_ str, s3: &'a str) -> &'a str { s3 } fn main() {} </ins>


<ins> error[E0277]: `&mut ()` is not a tuple --> $DIR/issue-57404.rs:6:41 | LL |     handlers.unwrap().as_mut().call_mut(&mut ()); |                                -------- -^^^^^^ |                                |        | |                                |        the trait `Tuple` is not implemented for `&mut ()` |                                |        help: consider removing the leading `&`-reference |                                required by a bound introduced by this call | note: required by a bound in `call_mut` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>


impl Step for RustcDocs { type Output = Option<GeneratedTarball>; const DEFAULT: bool = true; <ins> const ONLY_HOSTS: bool = true; </ins> fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder;


<ins> error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42 | LL |         V = [PhantomData; { [ () ].len() ].len() as isize, |             -             -              ^ mismatched closing delimiter |             |             | |             |             unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36 | LL |         V = [Vec::new; { [].len()  ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36 | LL |         V = [Vec::new; { [0].len() ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42 | LL |         V = [PhantomData; { [ () ].len() ].len() as isize, |             -             -              ^ mismatched closing delimiter |             |             | |             |             unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36 | LL |         V = [Vec::new; { [].len()  ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36 | LL |         V = [Vec::new; { [0].len() ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42 | LL |         V = [PhantomData; { [ () ].len() ].len() as isize, |             -             -              ^ mismatched closing delimiter |             |             | |             |             unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36 | LL |         V = [Vec::new; { [].len()  ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36 | LL |         V = [Vec::new; { [0].len() ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42 | LL |         V = [PhantomData; { [ () ].len() ].len() as isize, |             -             -              ^ mismatched closing delimiter |             |             | |             |             unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36 | LL |         V = [Vec::new; { [].len()  ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error: mismatched closing delimiter: `]` --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36 | LL |         V = [Vec::new; { [0].len() ].len() as isize, |             -          -           ^ mismatched closing delimiter |             |          | |             |          unclosed delimiter |             closing delimiter possibly meant for this error[E0282]: type annotations needed --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:29 | LL |         V = [Vec::new; { [].len()  ].len() as isize, |                             ^^^ cannot infer type for type parameter `T` error[E0282]: type annotations needed --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:14 | LL |         V = [Vec::new; { [0].len() ].len() as isize, |              ^^^^^^^^ cannot infer type for type parameter `T` error: aborting due to 14 previous errors For more information about this error, try `rustc --explain E0282`. </ins>


euv::AutoRef(..) | euv::ClosureInvocation(..) | euv::ForLoop(..) | <del> euv::RefBinding(..) => { </del> <ins> euv::RefBinding(..) | euv::MatchDiscriminant(..) => { </ins> format!("previous borrow of `{}` occurs here", self.bccx.loan_path_to_string(&*old_loan.loan_path)) }


<ins> error[E0499]: cannot borrow `chars` as mutable more than once at a time --> $DIR/issue-102972.rs:4:9 | LL |     for _c in chars.by_ref() { |               -------------- |               | |               first mutable borrow occurs here |               first borrow later used here LL |         chars.next(); |         ^^^^^^^^^^^^ second mutable borrow occurs here | = note: a for loop advances the iterator for you, the result is stored in `_c`. = help: if you want to call `next` on a iterator within the loop, consider using `while let`. error[E0382]: borrow of moved value: `iter` --> $DIR/issue-102972.rs:12:9 | LL |     let mut iter = v.iter(); |         -------- move occurs because `iter` has type `std::slice::Iter<'_, i32>`, which does not implement the `Copy` trait LL |     for _i in iter { |               ---- `iter` moved due to this implicit call to `.into_iter()` LL |         iter.next(); |         ^^^^^^^^^^^ value borrowed here after move | = note: a for loop advances the iterator for you, the result is stored in `_i`. = help: if you want to call `next` on a iterator within the loop, consider using `while let`. note: `into_iter` takes ownership of the receiver `self`, which moves `iter` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL error: aborting due to 2 previous errors Some errors have detailed explanations: E0382, E0499. For more information about an error, try `rustc --explain E0382`. </ins>


fn fmt(&self, f: &mut Formatter) -> Result { try!(write!(f, """)); for c in self.chars().flat_map(|c| c.escape_default()) { <del> try!(write!(f, "{}", c)); </del> <ins> try!(f.write_char(c)) </ins> } write!(f, """) }


<ins> //@ check-pass #![feature(inherent_associated_types)] //~^ WARN the feature `inherent_associated_types` is incomplete struct D<T> { a: T } impl<T: Default> D<T> { type Item = T; fn next() -> Self::Item { Self::Item::default() } } fn main() { } </ins>


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


<ins> use std::convert::TryInto; struct S; fn main() { let _: u32 = 5i32.try_into::<32>().unwrap(); //~ ERROR wrong number of const arguments S.f::<0>(); //~ ERROR no method named `f` S::<0>; //~ ERROR  wrong number of const arguments } </ins>


); } <ins> let is_fn_trait = [ self.tcx.lang_items().fn_trait(), self.tcx.lang_items().fn_mut_trait(), self.tcx.lang_items().fn_once_trait(), ] .contains(&Some(trait_ref.def_id())); let is_target_feature_fn = if let ty::FnDef(def_id, _) = trait_ref.skip_binder().self_ty().kind { !self.tcx.codegen_fn_attrs(def_id).target_features.is_empty() } else { false }; if is_fn_trait && is_target_feature_fn { err.note( "`#[target_feature]` functions do not implement the `Fn` traits", ); } </ins> // Try to report a help message if !trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)


ty ); // Fast path: if this is a primitive simple `==` will work <del> let saw_impl = impl_type == ty; </del> <ins> // NOTE: the `match` is necessary; see #92662. // this allows us to ignore generics because the user input // may not include the generic placeholders // e.g. this allows us to match Foo (user comment) with Foo<T> (actual type) let saw_impl = impl_type == ty || match (impl_type.kind(), ty.kind()) { (ty::Adt(impl_def, _), ty::Adt(ty_def, _)) => { debug!("impl def_id: {:?}, ty def_id: {:?}", impl_def.did, ty_def.did); impl_def.did == ty_def.did } _ => false, }; </ins> if saw_impl { Some(trait_) } else { None } })


#[derive(Clone)] enum Enum { <del> Variant1, //~ ERROR: variant is never used </del> <ins> Variant1, //~ ERROR: variant is never constructed </ins> Variant2, }


/// of the type. fn in_any_value_of_ty(_cx: &ConstCx<'_, 'tcx>, _ty: Ty<'tcx>) -> bool; <del> fn in_static(cx: &ConstCx<'_, 'tcx>, def_id: DefId) -> bool { // `mir_const_qualif` does return the qualifs in the final value of a `static`, so we could // use value-based qualification here, but we shouldn't do this without a good reason. Self::in_any_value_of_ty(cx, cx.tcx.type_of(def_id)) } </del> fn in_projection_structurally( cx: &ConstCx<'_, 'tcx>, per_local: &impl Fn(Local) -> bool,


/// with this error. /// /// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked <del> /// [`&str`]: ../../std/primitive.str.html </del> <ins> /// [`String`]: struct.String.html </ins> /// [`u8`]: ../../std/primitive.u8.html /// [`Vec<u8>`]: ../../std/vec/struct.Vec.html /// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html <del> /// [`as_bytes`]: struct.String.html#method.as_bytes </del> <ins> /// [`into_bytes`]: struct.String.html#method.into_bytes </ins> /// [`FromUtf8Error`]: struct.FromUtf8Error.html /// [`Err`]: ../../std/result/enum.Result.html#variant.Err #[inline]


self.lldb_git_commit_hash = self.git_commit_hash("lldb", "x86_64-unknown-linux-gnu"); self.miri_git_commit_hash = self.git_commit_hash("miri", "x86_64-unknown-linux-gnu"); <ins> self.check_toolstate(); </ins> self.digest_and_sign(); let manifest = self.build_manifest(); self.write_channel_files(&self.rust_release, &manifest);


} TokenTree::Token(t) => { <del> // Doc comments cannot appear in a matcher. debug_assert!(!matches!(t, Token { kind: DocComment(..), .. })); // If the token matches, we can just advance the parser. Otherwise, this // match hash failed, there is nothing to do, and hopefully another item in // `cur_items` will match. if token_name_eq(&t, token) { </del> <ins> // If it's a doc comment, we just ignore it and move on to the next tt in // the matcher. If the token matches, we can just advance the parser. // Otherwise, this match has failed, there is nothing to do, and hopefully // another item in `cur_items` will match. if matches!(t, Token { kind: DocComment(..), .. }) { item.idx += 1; self.cur_items.push(item); } else if token_name_eq(&t, token) { </ins> item.idx += 1; self.next_items.push(item); }


}; use rustc_hir::def_id::DefId; use rustc_macros::{LintDiagnostic, Subdiagnostic}; <del> use rustc_middle::ty::{Predicate, Ty, TyCtxt}; </del> <ins> use rustc_middle::ty::{PolyExistentialTraitRef, Predicate, Ty, TyCtxt}; </ins> use rustc_session::parse::ParseSess; use rustc_span::{edition::Edition, sym, symbol::Ident, Span, Symbol};


<ins> // The error message here still is pretty confusing. fn main() { let mut result = vec![1]; // The type of `result` is constrained to be `Vec<{integer}>` here. // But the logic we use to find what expression constrains a type // is not sophisticated enough to know this. let mut vector = Vec::new(); vector.sort(); result.push(vector); //~^ ERROR mismatched types // So it thinks that the type of `result` is constrained here. } fn example2() { let mut x = vec![1]; x.push(""); //~^ ERROR mismatched types } </ins>


/// /// assert_eq!(actual, expected); /// ``` <del> #[unstable(feature = "ptr_hash", reason = "newly added", issue = "56286")] </del> <ins> #[stable(feature = "ptr_hash", since = "1.35.0")] </ins> pub fn hash<T: ?Sized, S: hash::Hasher>(hashee: *const T, into: &mut S) { use hash::Hash; hashee.hash(into);


ENV TARGETS=$TARGETS,aarch64-fuchsia ENV TARGETS=$TARGETS,wasm32-unknown-unknown ENV TARGETS=$TARGETS,wasm32-wasi <del> # FIXME(#61022) - reenable solaris # ENV TARGETS=$TARGETS,sparcv9-sun-solaris # ENV TARGETS=$TARGETS,x86_64-sun-solaris </del> <ins> ENV TARGETS=$TARGETS,sparcv9-sun-solaris ENV TARGETS=$TARGETS,x86_64-sun-solaris </ins> ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32 ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx


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


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


<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(fn_traits)] fn main() { <fn() as Fn()>::call; //~^ ERROR associated type bindings are not allowed here [E0229] } </ins>


| sym::default_lib_allocator | sym::start | sym::custom_mir, <ins> .. </ins> ] => {} [name, ..] => { match BUILTIN_ATTRIBUTE_MAP.get(name) { // checked below Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {} Some(_) => { <del> // FIXME: differentiate between unstable and internal attributes just like we do with features instead // of just accepting `rustc_` attributes by name. That should allow trimming the above list, too. </del> <ins> // FIXME: differentiate between unstable and internal attributes just // like we do with features instead of just accepting `rustc_` // attributes by name. That should allow trimming the above list, too. </ins> if !name.as_str().starts_with("rustc_") { span_bug!( attr.span,


repr_packed, repr_simd, repr_transparent, <ins> require, </ins> residual, result, rhs,


<ins> goto: file://|DOC_PATH|/lib2/struct.Foo.html // This test checks that the font weight is correctly applied. assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"}) assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"}) assert: ("#method.a_method > code", {"font-weight": "600"}) assert: ("#associatedtype.X > code", {"font-weight": "600"}) assert: ("#associatedconstant.Y > code", {"font-weight": "600"}) </ins>


} if let Some(ref dox) = i.impl_item.opt_doc_value() {  if trait_.is_none() && i.inner_impl().items.is_empty() {   if trait_.is_none() && impl_.items.is_empty() {  w.write_str( "

This impl block contains no items.


<ins> // Regression test for #121534 // Tests that no ICE occurs in KnownPanicsLint when it // evaluates an operation whose operands have different // layout types even though they have the same type. // This situation can be contrived through the use of // unions as in this test //@ build-pass union Union { u32_field: u32, i32_field: i32, } pub fn main() { let u32_variant = Union { u32_field: 2 }; let i32_variant = Union { i32_field: 3 }; let a = unsafe { u32_variant.u32_field }; let b = unsafe { i32_variant.u32_field }; let _diff = a - b; } </ins>


<ins> error: invalid `?` in type --> $DIR/issue-103748-ICE-wrong-braces.rs:3:36 | LL | struct Apple((Apple, Option(Banana ? Citron))); |                                    ^ `?` is only allowed on expressions, not types | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | LL | struct Apple((Apple, Option(Option<Banana > Citron))); |                             +++++++       ~ error: expected one of `)` or `,`, found `Citron` --> $DIR/issue-103748-ICE-wrong-braces.rs:3:38 | LL | struct Apple((Apple, Option(Banana ? Citron))); |                                     -^^^^^^ expected one of `)` or `,` |                                     | |                                     help: missing `,` error[E0412]: cannot find type `Citron` in this scope --> $DIR/issue-103748-ICE-wrong-braces.rs:3:38 | LL | struct Apple((Apple, Option(Banana ? Citron))); |                                      ^^^^^^ not found in this scope error[E0214]: parenthesized type parameters may only be used with a `Fn` trait --> $DIR/issue-103748-ICE-wrong-braces.rs:3:22 | LL | struct Apple((Apple, Option(Banana ? Citron))); |                      ^^^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses | help: use angle brackets instead | LL | struct Apple((Apple, Option<Banana ? Citron>)); |                            ~               ~ error[E0072]: recursive type `Apple` has infinite size --> $DIR/issue-103748-ICE-wrong-braces.rs:3:1 | LL | struct Apple((Apple, Option(Banana ? Citron))); | ^^^^^^^^^^^^  ----- recursive without indirection | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | LL | struct Apple((Box<Apple>, Option(Banana ? Citron))); |               ++++     + error: aborting due to 5 previous errors Some errors have detailed explanations: E0072, E0214, E0412. For more information about an error, try `rustc --explain E0072`. </ins>


// Multibyte case is a fn to allow char_range_at to inline cleanly fn multibyte_char_range_at(s: &str, i: uint) -> CharRange { <del> let mut val = s[i] as uint; </del> <ins> let mut val = s[i] as u32; </ins> let w = UTF8_CHAR_WIDTH[val] as uint; assert!((w != 0));


let crate_types = if options.proc_macro_crate { vec![config::CrateType::ProcMacro] } else { <del> vec![config::CrateType::Dylib] </del> <ins> vec![config::CrateType::Rlib] </ins> }; let sessopts = config::Options {


#![feature(ptr_offset_from)] #![feature(rustc_attrs)] #![feature(receiver_trait)] <del> #![feature(slice_from_raw_parts)] </del> #![feature(specialization)] #![feature(staged_api)] #![feature(std_internals)]


#[doc(keyword = "struct")] // <del> /// The `struct` keyword. </del> <ins> /// The keyword used to define structs. </ins> /// <del> /// The `struct` keyword is used to define a struct type. </del> <ins> /// Structs in Rust come in three flavours: Regular structs, tuple structs, /// and empty structs. </ins> /// <del> /// Example: </del> <ins> /// ```rust /// struct Regular { ///     field1: f32, ///     field2: String, ///     pub field3: bool /// } /// /// struct Tuple(u32, String); </ins> /// <ins> /// struct Empty; </ins> /// ``` <del> /// struct Foo { ///     field1: u32, ///     field2: String, </del> <ins> /// /// Regular structs are the most commonly used. Each field defined within them has a name and a /// type, and once defined can be accessed using `example_struct.field` syntax. The fields of a /// struct share its mutability, so `foo.bar = 2;` would only be valid if `foo` was mutable. Adding /// `pub` to a field makes it visible to code in other modules, as well as allowing it to be /// directly accessed and modified. /// /// Tuple structs are similar to regular structs, but its fields have no names. They are used like /// tuples, with deconstruction possible via `let TupleStruct(x, y) = foo;` syntax.  For accessing /// individual variables, the same syntax is used as with regular tuples, namely `foo.0`, `foo.1`, /// etc, starting at zero. /// /// Empty structs, or unit-like structs, are most commonly used as markers, for example /// [`PhantomData`]. Empty structs have a size of zero bytes, but unlike empty enums they can be /// instantiated, making them similar to the unit type `()`. Unit-like structs are useful when you /// need to implement a trait on something, but don't need to store any data inside it. /// /// # Instantiation /// /// Structs can be instantiated in a manner of different ways, each of which can be mixed and /// matched as needed. The most common way to make a new struct is via a constructor method such as /// `new()`, but when that isn't available (or you're writing the constructor itself), struct /// literal syntax is used: /// /// ```rust /// # struct Foo { field1: f32, field2: String, etc: bool } /// let example = Foo { ///     field1: 42.0, ///     field2: "blah".to_string(), ///     etc: true, /// }; /// ``` /// /// It's only possible to directly instantiate a struct using struct literal syntax when all of its /// fields are visible to you. /// /// There are a handful of shortcuts provided to make writing constructors more convenient, most /// common of which is the Field Init shorthand. When there is a variable and a field of the same /// name, the assignment can be simplified from `field: field` into simply `field`. The following /// example of a hypothetical constructor demonstrates this: /// /// ```rust /// struct User { ///     name: String, ///     admin: bool, </ins> /// } <ins> /// /// impl User { ///     pub fn new(name: String) -> Self { ///         Self { ///             name, ///             admin: false, ///         } ///     } /// } /// ``` /// /// Another shortcut for struct instantiation is available, used when you need to make a new /// struct that has the same values as most of a previous struct of the same type, called struct /// update syntax: /// /// ```rust /// # struct Foo { field1: String, field2: () } /// # let thing = Foo { field1: "".to_string(), field2: () }; /// let updated_thing = Foo { ///     field1: "a new value".to_string(), ///     ..thing /// }; </ins> /// ``` /// <del> /// There are different kinds of structs. For more information, take a look at the /// [Rust Book][book]. </del> <ins> /// Tuple structs are instantiated in the same way as tuples themselves, except with the struct's /// name as a prefix: `Foo(123, false, 0.1)`. /// /// Empty structs are instantiated with just their name, and don't need anything else. `let thing = /// EmptyStruct;` /// /// # Style conventions /// /// Structs are always written in CamelCase, with few exceptions. While the trailing comma on a /// struct's list of fields can be omitted, it's usually kept for convenience in adding and /// removing fields down the line. /// /// For more information on structs, take a look at the [Rust Book][book] or the /// [Reference][reference]. </ins> /// <ins> /// [`PhantomData`]: marker/struct.PhantomData.html </ins> /// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html <ins> /// [reference]: https://doc.rust-lang.org/reference/items/structs.html </ins> mod struct_keyword { }


let mut _0: *const &u8; let mut _2: *const &u8; let mut _3: *const &u8; <ins> let mut _4: *const &u8; </ins> scope 1 (inlined generic_cast::<&u8, &u8>) { <del> debug x => _3; let mut _4: *const &u8; </del> <ins> debug x => _4; let mut _5: *const &u8; </ins> } bb0: { StorageLive(_2); StorageLive(_3); <del> _3 = _1; </del> StorageLive(_4); <del> _4 = _3; -         _2 = move _4 as *const &u8 (PtrToPtr); +         _2 = move _4; </del> <ins> _4 = _1; StorageLive(_5); _5 = _4; -         _3 = move _5 as *const &u8 (PtrToPtr); +         _3 = move _5; StorageDead(_5); </ins> StorageDead(_4); <del> StorageDead(_3); </del> <ins> -         _2 = move _3 as *const &u8 (PtrToPtr); +         _2 = move _3; </ins> _0 = _2; <ins> StorageDead(_3); </ins> StorageDead(_2); return; }


// extern-return-TwoU64s // foreign-fn-with-byval // issue-28676 <ins> // issue-62350-sysv-neg-reg-counts </ins> // struct-return // ignore-android


} // Determine if a node with the given attributes should be included in this configuation. <del> fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool { </del> <ins> pub fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool { </ins> attrs.iter().all(|attr| { // When not compiling with --test we should not compile the #[test] functions if !self.should_test && is_test_or_bench(attr) {


<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. // error-pattern:explicit failure pub fn main() { fail!(); println!("{}", 1i); } </ins>


There’s just one line of this first example left: ```rust,ignore <del> println!("You guessed: {}", input); </del> <ins> println!("You guessed: {}", guess); </ins> } ``` This prints out the string we saved our input in. The `{}`s are a placeholder, <del> and so we pass it `input` as an argument. If we had multiple `{}`s, we would </del> <ins> and so we pass it `guess` as an argument. If we had multiple `{}`s, we would </ins> pass multiple arguments: ```rust


<ins> // compile-flags: -Zsave-analysis </ins> // only-x86_64 <ins> // Also test for #72960 </ins> #![feature(asm)]


}; ``` <del> At the moment, `if` and `match`, as well as the looping constructs `for`, `while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`. </del> <ins> At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden inside a `const`, `static`, or `const fn`. </ins> <del> This will be allowed at some point in the future, but the implementation is not yet complete. See the tracking issue for [conditionals] or [loops] in a const context for the current status. </del> <ins> This may be allowed at some point in the future, but the implementation is not yet complete. See the tracking issues for [`async`] and [`?`] in `const fn`, and (to support `for` loops in `const fn`) the tracking issues for [`impl const Trait for Ty`] and [`&mut T`] in `const fn`. </ins> <del> [conditionals]: https://github.com/rust-lang/rust/issues/49146 [loops]: https://github.com/rust-lang/rust/issues/52000 </del> <ins> [`async`]: https://github.com/rust-lang/rust/issues/69431 [`?`]: https://github.com/rust-lang/rust/issues/74935 [`impl const Trait for Ty`]: https://github.com/rust-lang/rust/issues/67792 [`&mut T`]: https://github.com/rust-lang/rust/issues/57349 </ins>


<ins> error[E0597]: borrowed value does not live long enough --> $DIR/issue-52049.rs:16:10 | LL |     foo(&unpromotable(5u32)); |          ^^^^^^^^^^^^^^^^^^ - temporary value only lives until here |          | |          temporary value does not live long enough | = note: borrowed value must be valid for the static lifetime... error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. </ins>


id, expr_ty.repr(self.tcx()), def); match def { <del> def::DefStruct(..) | def::DefVariant(..) => { </del> <ins> def::DefStruct(..) | def::DefVariant(..) | def::DefFn(..) | def::DefStaticMethod(..) => { </ins> Ok(self.cat_rvalue_node(id, span, expr_ty)) } <del> def::DefFn(..) | def::DefStaticMethod(..) | def::DefMod(_) | def::DefForeignMod(_) | def::DefStatic(_, false) | </del> <ins> def::DefMod(_) | def::DefForeignMod(_) | def::DefStatic(_, false) | </ins> def::DefUse(_) | def::DefTrait(_) | def::DefTy(_) | def::DefPrimTy(_) | def::DefTyParam(..) | def::DefTyParamBinder(..) | def::DefRegion(_) | def::DefLabel(_) | def::DefSelfTy(..) | def::DefMethod(..) => {


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


#[diag(parse_use_eq_instead)] pub(crate) struct UseEqInstead { #[primary_span] <ins> #[suggestion(style = "verbose", applicability = "machine-applicable", code = "=")] </ins> pub span: Span, <del> #[suggestion(style = "verbose", applicability = "machine-applicable", code = "")] pub suggestion: Span, </del> } #[derive(Diagnostic)]


<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Foo { const AMT: usize; } enum Bar<A, B> { First(A), Second(B), } impl<A: Foo, B: Foo> Foo for Bar<A, B> { const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; //~ ERROR constant evaluation } impl Foo for u8 { const AMT: usize = 1; } impl Foo for u16 { const AMT: usize = 2; } fn main() { println!("{}", <Bar<u16, u8> as Foo>::AMT); } </ins>


use crate::build::{BlockAnd, BlockAndExtension, Builder}; use crate::build::{GuardFrame, GuardFrameLocal, LocalsForNode}; use crate::hair::{self, *}; <del> use rustc_data_structures::fx::{FxHashMap, FxHashSet}; </del> <ins> use rustc_data_structures::{fx::{FxHashMap, FxHashSet}, stack::ensure_sufficient_stack}; </ins> use rustc_hir::HirId; use rustc_index::bit_set::BitSet; use rustc_middle::middle::region;


<ins> //@ check-pass //@ edition: 2021 #![feature(async_closure)] // Make sure that we don't hit a query cycle when validating // the by-move coroutine body for an async closure. use std::future::Future; async fn test<Fut: Future>(operation: impl Fn() -> Fut) { operation().await; } pub async fn orchestrate_simple_crud() { test(async || async {}.await).await; } fn main() {} </ins>


<ins> //@ aux-build:implied-predicates.rs //@ check-pass extern crate implied_predicates; use implied_predicates::Bar; fn bar<B: Bar>() {} fn main() {} </ins>


} code, pre, h1.fqn { <del> font-family: Menlo, Monaco, Consolas, "Inconsolata", "Courier New", monospace; </del> <ins> font-family: "Inconsolata", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace; </ins> } code, pre { color: #333;


<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // aux-build:issue-30535.rs extern crate issue_30535 as foo; fn bar( _: foo::Foo::FooV //~ ERROR value `foo::Foo::FooV` used as a type ) {} fn main() {} </ins>


message.push_str(&format!(" ({})", feature));  if let Some(unstable_reason) = reason { let mut ids = cx.id_map.borrow_mut(); message = format!( "{}{}", message, MarkdownHtml( &unstable_reason.as_str(), &mut ids, error_codes, cx.shared.edition(), &cx.shared.playground, ) .into_string() ); }  extra_info.push(format!("
{}
", message)); }


let file = annotated_file.file.clone(); let line = &annotated_file.lines[line_idx]; if let Some(source_string) = file.get_line(line.line_index - 1) { <del> let leading_whitespace = source_string.chars().take_while(|c| c.is_whitespace()).count(); </del> <ins> let leading_whitespace = source_string .chars() .take_while(|c| c.is_whitespace()) .map(|c| { match c { // Tabs are displayed as 4 spaces 't' => 4, _ => 1, } }) .sum(); </ins> if source_string.chars().any(|c| !c.is_whitespace()) { whitespace_margin = min(whitespace_margin, leading_whitespace); }


candidates.ambiguous = true; // Could wind up being a fn() type. } // Provide an impl, but only for suitable `fn` pointers. <del> ty::FnDef(..) | ty::FnPtr(_) => { </del> <ins> ty::FnPtr(_) => { </ins> if let ty::FnSig { unsafety: hir::Unsafety::Normal, abi: Abi::Rust,


traits_in_scope: Default::default(), all_traits: Default::default(), all_trait_impls: Default::default(), <ins> document_private_items, </ins> }; // Because of the `crate::` prefix, any doc comment can reference


<ins> // compile-pass // note this was only reproducible with lib crates // compile-flags: --crate-type=lib pub struct Hz; impl Hz { pub const fn num(&self) -> u32 { 42 } pub const fn normalized(&self) -> Hz { Hz } pub const fn as_u32(&self) -> u32 { self.normalized().num() // this used to promote the `self.normalized()` } } </ins>


/// does not have any "extra" NaN payloads, then the output NaN is guaranteed to be preferred. /// /// The non-deterministic choice happens when the operation is executed; i.e., the result of a <del> /// NaN-producing floating point operation is a stable bit pattern (looking at these bits multiple </del> <ins> /// NaN-producing floating-point operation is a stable bit pattern (looking at these bits multiple </ins> /// times will yield consistent results), but running the same operation twice with the same inputs /// can produce different results. ///


#[stable(feature = "unicode_version", since = "1.45.0")] pub use crate::unicode::UNICODE_VERSION; <ins> // perma-unstable re-exports #[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] pub use self::methods::encode_utf16_raw; #[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] pub use self::methods::encode_utf8_raw; </ins> use crate::fmt::{self, Write}; use crate::iter::FusedIterator;


))] mod imp { use super::Handler; <ins> use crate::io; </ins> use crate::mem; use crate::ptr;


} else { val + n }; <ins> // zero the upper bits let val = val as u128; let val = (val << amt) >> amt; </ins> (Self { val: val as u128, ty: self.ty, }, oflo) } else { <del> let (min, max) = match int { Integer::I8 => (u8::min_value() as u128, u8::max_value() as u128), Integer::I16 => (u16::min_value() as u128, u16::max_value() as u128), Integer::I32 => (u32::min_value() as u128, u32::max_value() as u128), Integer::I64 => (u64::min_value() as u128, u64::max_value() as u128), Integer::I128 => (u128::min_value(), u128::max_value()), }; </del> <ins> let max = u128::max_value() >> amt; </ins> let val = self.val; let oflo = val > max - n; let val = if oflo { <del> min + (n - (max - val) - 1) </del> <ins> n - (max - val) - 1 </ins> } else { val + n };


pub fn fully_expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment { let orig_expansion_data = self.cx.current_expansion.clone(); let orig_force_mode = self.cx.force_mode; <del> self.cx.current_expansion.depth = 0; </del> // Collect all macro invocations and replace them with placeholders. let (mut fragment_with_placeholders, mut invocations) =


.RE .TP fB-lfR [fIKINDfR=]fINAMEfR <del> Link the generated crate(s) to the specified native library fINAMEfR. </del> <ins> Link the generated crate(s) to the specified library fINAMEfR. </ins> The optional fIKINDfR can be one of fIstaticfR, fIdylibfR, or fIframeworkfR. If omitted, fIdylibfR is assumed.


/// let localhost = Ipv4Addr::new(127, 0, 0, 1); /// assert_eq!("127.0.0.1".parse(), Ok(localhost)); /// assert_eq!(localhost.is_loopback(), true); <ins> /// assert!("012.004.002.000".parse::<Ipv4Addr>().is_err()); // all octets are in octal /// assert!("0000000.0.0.0".parse::<Ipv4Addr>().is_err()); // first octet is a zero in octal /// assert!("0xcb.0x0.0x71.0x00".parse::<Ipv4Addr>().is_err()); // all octets are in hex </ins> /// ``` #[derive(Copy)] #[stable(feature = "rust1", since = "1.0.0")]


.collect(), _ => Vec::new(), }; <ins> candidates.retain(|candidate| *candidate != self.tcx.parent(result.callee.def_id)); </ins> return Err(IllegalSizedBound(candidates, needs_mut, span)); }


/// /// Note that this call does not perform any actual network communication, /// because UDP is a datagram protocol. <ins> #[deprecated = "`UdpStream` has been deprecated"] #[allow(deprecated)] </ins> pub fn connect(self, other: SocketAddr) -> UdpStream { UdpStream { socket: self,


<ins> // compile-flags: --document-private-items // This ensures that no ICE is triggered when rustdoc is run on this code. mod stdlib { pub (crate) use std::i8; } </ins>


fn has_errors(&self) -> bool { self.err_count() > 0 } <ins> fn has_errors_or_delayed_span_bugs(&self) -> bool { self.has_errors() || !self.delayed_span_bugs.is_empty() } </ins> fn abort_if_errors_and_should_abort(&mut self) { self.emit_stashed_diagnostics();


/// This unifies the logic used for resolving `include_X!`, and `#[doc(include)]` file paths. /// /// Returns an absolute path to the file that `path` refers to. <del> pub fn resolve_path(&self, path: impl Into<PathBuf>, span: Span) -> PathBuf { </del> <ins> pub fn resolve_path( &self, path: impl Into<PathBuf>, span: Span, ) -> Result<PathBuf, DiagnosticBuilder<'a>> { </ins> let path = path.into(); // Relative paths are resolved relative to the file in which they are found


// The root node must be created with create_root_def() assert!(data != DefPathData::CrateRoot); <del> // Find a unique DefKey. This basically means incrementing the disambiguator // until we get no match. let mut key = DefKey { </del> <ins> // Find the next free disambiguator for this key. let disambiguator = { let next_disamb = self.next_disambiguator.entry((parent, data.clone())).or_insert(0); let disambiguator = *next_disamb; *next_disamb = next_disamb.checked_add(1).expect("disambiguator overflow"); disambiguator }; let key = DefKey { </ins> parent: Some(parent), disambiguated_data: DisambiguatedDefPathData { <del> data, disambiguator: 0 </del> <ins> data, disambiguator </ins> } }; <del> while self.keys_created.contains(&key) { key.disambiguated_data.disambiguator += 1; } self.keys_created.insert(key.clone()); </del> let parent_hash = self.table.def_path_hash(parent); let def_path_hash = key.compute_stable_hash(parent_hash);


<ins> // Regression test for the ICE described in #87496. // check-pass #[repr(transparent)] struct TransparentCustomZst(()); extern "C" { fn good17(p: TransparentCustomZst); //~^ WARNING: `extern` block uses type `TransparentCustomZst`, which is not FFI-safe } fn main() {} </ins>


let lib_llvm = out_dir.join("build").join("lib").join(lib_name); if !lib_llvm.exists() { <del> t!(builder.symlink_file("libLLVM.dylib", &lib_llvm)); </del> <ins> t!(builder.build.config.symlink_file("libLLVM.dylib", &lib_llvm)); </ins> } }


if let DefKind::Trait = def_kind { record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id)); record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id)); <ins> record!(self.tables.implied_predicates_of[def_id] <- self.tcx.implied_predicates_of(def_id)); </ins> let module_children = self.tcx.module_children_local(local_id); record_array!(self.tables.module_children_non_reexports[def_id] <-


// Only pass correct values for these flags for the `run-make` suite as it // requires that a C++ compiler was configured which isn't always the case. if suite == "run-make" { <del> let llvm_config = build.llvm_config(target); </del> let llvm_components = output(Command::new(&llvm_config).arg("--components")); let llvm_cxxflags = output(Command::new(&llvm_config).arg("--cxxflags")); cmd.arg("--cc").arg(build.cc(target))