<ins> error[E0582]: binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types --> $DIR/ice-wf-missing-span-in-error-130012.rs:9:28 | LL | trait MyTrait: for<'a> Fun<Assoc = &'a ()> {} |                            ^^^^^^^^^^^^^^ error[E0582]: binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types --> $DIR/ice-wf-missing-span-in-error-130012.rs:9:28 | LL | trait MyTrait: for<'a> Fun<Assoc = &'a ()> {} |                            ^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0582]: binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types --> $DIR/ice-wf-missing-span-in-error-130012.rs:9:28 | LL | trait MyTrait: for<'a> Fun<Assoc = &'a ()> {} |                            ^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0582]: binding for associated type `Assoc` references lifetime `'b`, which does not appear in the trait input types --> $DIR/ice-wf-missing-span-in-error-130012.rs:14:21 | LL | impl<F: for<'b> Fun<Assoc = &'b ()>> MyTrait for F {} |                     ^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/ice-wf-missing-span-in-error-130012.rs:14:50 | LL | impl<F: for<'b> Fun<Assoc = &'b ()>> MyTrait for F {} |                                                  ^ lifetime mismatch | = note: expected reference `&()` found reference `&'b ()` error: aborting due to 5 previous errors Some errors have detailed explanations: E0308, E0582. For more information about an error, try `rustc --explain E0308`. </ins>


writeln!(&mut writer, "{}, {}!", "hello", "world").unwrap(); assert_eq!(writer.get_ref().events, [RecordedEvent::Write("hello, world!n".to_string())]); } <ins> #[test] fn bufreader_full_initialize() { struct OneByteReader; impl Read for OneByteReader { fn read(&mut self, buf: &mut [u8]) -> crate::io::Result<usize> { if buf.len() > 0 { buf[0] = 0; Ok(1) } else { Ok(0) } } } let mut reader = BufReader::new(OneByteReader); // Nothing is initialized yet. assert_eq!(reader.initialized(), 0); let buf = reader.fill_buf().unwrap(); // We read one byte... assert_eq!(buf.len(), 1); // But we initialized the whole buffer! assert_eq!(reader.initialized(), reader.capacity()); } </ins>


<ins> // Issue #86448: test for cross-crate `doc(hidden)` #![crate_name = "foo"] // aux-build:cross-crate-hidden-impl-parameter.rs extern crate cross_crate_hidden_impl_parameter; pub use ::cross_crate_hidden_impl_parameter::{HiddenType, HiddenTrait}; // OK, not re-exported pub enum MyLibType {} // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From<HiddenType> for MyLibType' impl From<HiddenType> for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} } } pub struct T<T>(T); // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType' impl From<T<T<T<T<HiddenType>>>>> for MyLibType { fn from(it: T<T<T<T<HiddenType>>>>) -> MyLibType { todo!() } } // @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' impl HiddenTrait for MyLibType {} // @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>' impl From<MyLibType> for T<T<T<T<HiddenType>>>> { fn from(it: MyLibType) -> T<T<T<T<HiddenType>>>> { match it {} } } </ins>


} } <del> include!(concat!(env!("OUT_DIR"), "/error_codes.rs")); </del> <ins> fn register_all() -> Vec<(&'static str, Option<&'static str>)> { let mut long_codes: Vec<(&'static str, Option<&'static str>)> = Vec::new(); macro_rules! register_diagnostics { ($($ecode:ident: $message:expr,)*) => ( register_diagnostics!{$($ecode:$message,)* ;} ); ($($ecode:ident: $message:expr,)* ; $($code:ident,)*) => ( $( {long_codes.extend([ (stringify!($ecode), Some($message)), ].iter());} )* $( {long_codes.extend([ stringify!($code), ].iter().cloned().map(|s| (s, None)).collect::<Vec<_>>());} )* ) } include!(concat!(env!("OUT_DIR"), "/all_error_codes.rs")); long_codes } </ins>


let (a, b) = ($a, $b); if a != b { let (a, b) = if a > b {(a, b)} else {(b, a)}; <del> assert!(a - Duration::new(0, 1) <= b); </del> <ins> assert!(a - Duration::new(0, 100) <= b); </ins> } }) }


return Some(LexicalScopeBinding::Item(binding)); } } self.early_resolve_ident_in_lexical_scope( orig_ident, ScopeSet::Late(ns, module, record_used_id),


assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2") // We now go to the "foobar" function page. assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules") <del> assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Functions") </del> <ins> assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs") assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits") assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions") assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions") </ins> assert:	("#functions + table td > a", "foobar") click: "#functions + table td > a"


} PathResult::Failed { is_error_from_last_segment: true, span, label, suggestion } => { if no_ambiguity { <del> assert!(import.imported_module.get().is_none()); </del> let err = match self.make_path_suggestion( span, import.module_path.clone(),


AssignmentLhsSized,        // L = X implies that L is Sized StructInitializerSized,    // S { ... } must be Sized VariableType(ast::NodeId), // Type of each variable must be Sized <ins> ReturnType,                // Return type must be Sized </ins> RepeatVec,                 // [T,..n] --> T must be Copy // Captures of variable the given id by a closure (span is the


if let Categorization::Local(local_id) = err.cmt.cat { let span = self.tcx.map.span(local_id); if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(span) { <del> db.span_suggestion( span, &format!("to make the {} mutable, use `mut` as shown:", self.cmt_to_string(&err.cmt)), format!("mut {}", snippet)); </del> <ins> if snippet != "self" { db.span_suggestion( span, &format!("to make the {} mutable, use `mut` as shown:", self.cmt_to_string(&err.cmt)), format!("mut {}", snippet)); } </ins> } } }


parent_item: Option<LocalDefId>, report_on: ReportOn, ) { <ins> fn get_parent_if_enum_variant<'tcx>( tcx: TyCtxt<'tcx>, may_variant: LocalDefId, ) -> LocalDefId { if let Node::Variant(_) = tcx.hir_node_by_def_id(may_variant) && let Some(enum_did) = tcx.opt_parent(may_variant.to_def_id()) && let Some(enum_local_id) = enum_did.as_local() && let Node::Item(item) = tcx.hir_node_by_def_id(enum_local_id) && let ItemKind::Enum(_, _) = item.kind { enum_local_id } else { may_variant } } </ins> let Some(&first_item) = dead_codes.first() else { return; };


} // Reverse scan: Sequence comes before `first`. <del> if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore { </del> <ins> if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore || seq_rep.op == quoted::KleeneOp::ZeroOrOne { </ins> // If sequence is potentially empty, then // union them (preserving first emptiness). first.add_all(&TokenSet { maybe_empty: true, ..subfirst });


/// Loads the current context and calls a function with it. /// Do not nest these, as that will ICE. pub(crate) fn with<R>(f: impl FnOnce(&mut dyn Context) -> R) -> R { <del> let ptr = TLV.replace(std::ptr::null_mut()) as *mut &mut dyn Context; assert!(!ptr.is_null()); let ret = f(unsafe { *ptr }); TLV.set(ptr as _); ret </del> <ins> assert!(TLV.is_set()); TLV.with(|tlv| { let ptr = tlv.get(); assert!(!ptr.is_null()); f(unsafe { *(ptr as *mut &mut dyn Context) }) }) </ins> }


#[stable(feature = "unicode_encode_char", since = "1.15.0")] #[inline] pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str { <del> let code = self as u32; let len = self.len_utf8(); match (len, &mut dst[..]) { (1, [a, ..]) => { *a = code as u8; } (2, [a, b, ..]) => { *a = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; *b = (code & 0x3F) as u8 | TAG_CONT; } (3, [a, b, c, ..]) => { *a = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; *b = (code >> 6 & 0x3F) as u8 | TAG_CONT; *c = (code & 0x3F) as u8 | TAG_CONT; } (4, [a, b, c, d, ..]) => { *a = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; *b = (code >> 12 & 0x3F) as u8 | TAG_CONT; *c = (code >> 6 & 0x3F) as u8 | TAG_CONT; *d = (code & 0x3F) as u8 | TAG_CONT; } _ => panic!( "encode_utf8: need {} bytes to encode U+{:X}, but the buffer has {}", len, code, dst.len(), ), }; // SAFETY: We just wrote UTF-8 content in, so converting to str is fine. unsafe { from_utf8_unchecked_mut(&mut dst[..len]) } </del> <ins> // SAFETY: `char` is not a surrogate, so this is valid UTF-8. unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) } </ins> } /// Encodes this character as UTF-16 into the provided `u16` buffer,


/// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] <del> #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] </del> <ins> #[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] </ins> #[inline] <ins> #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] </ins> pub const fn make_ascii_uppercase(&mut self) { // FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions. let mut i = 0;


<ins> struct NotCopyable; fn func<F: FnMut() -> H, H: FnMut()>(_: F) {} fn parse() { let mut var = None; func(|| { // Shouldn't suggest `move ||.as_ref()` here move || { //~^ ERROR: cannot move out of `var` var = Some(NotCopyable); } }); } fn main() {} </ins>


<ins> // ignore-32bit // This test gives a different error on 32-bit architectures. union Transmute<T: Copy, U: Copy> { t: T, u: U, } trait Bar { fn bar(&self) -> u32; } struct Foo { foo: u32, bar: bool, } impl Bar for Foo { fn bar(&self) -> u32 { self.foo } } #[derive(Copy, Clone)] struct Fat<'a>(&'a Foo, &'static VTable); struct VTable { size: Foo, } const FOO: &dyn Bar = &Foo { foo: 128, bar: false, }; const G: Fat = unsafe { Transmute { t: FOO }.u }; //~^ ERROR it is undefined behavior to use this value fn main() {} </ins>


offsets[usize::try_from(field).unwrap()], layout::FieldPlacement::Array { stride, .. } => { let len = base.len(self)?; <del> assert!(field < len, "Tried to access element {} of array/slice with length {}", field, len); </del> <ins> if field >= len { // This can be violated because this runs during promotion on code where the // type system has not yet ensured that such things don't happen. debug!("Tried to access element {} of array/slice with length {}", field, len); return err!(BoundsCheck { len, index: field }); } </ins> stride * field } layout::FieldPlacement::Union(count) => {


LL | m!(); | ----- in this macro invocation <del> warning: `$crate` may not be imported </del> <ins> error: `$crate` may not be imported </ins> --> $DIR/dollar-crate-is-keyword.rs:9:9 | <del> LL |         use $crate; // OK </del> <ins> LL |         use $crate; </ins> |         ^^^^^^^^^^^ ... LL | m!(); | ----- in this macro invocation <del> | = note: `use $crate;` was erroneously allowed and will become a hard error in a future release warning: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:11:9 </del> <ins> error: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:10:9 </ins> | LL |         use $crate as $crate; |         ^^^^^^^^^^^^^^^^^^^^^ ... LL | m!(); | ----- in this macro invocation <del> | = note: `use $crate;` was erroneously allowed and will become a hard error in a future release error: aborting due to 2 previous errors </del> <ins> error: aborting due to 4 previous errors </ins>


/// ``` #[macro_export] macro_rules! write { <del> ($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*))) </del> <ins> ($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*))) </ins> } /// Equivalent to the `write!` macro, except that a newline is appended after


use libc::{mmap, munmap}; use libc::{sigaction, sighandler_t, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIG_DFL}; use libc::{sigaltstack, SIGSTKSZ, SS_DISABLE}; <del> use libc::{MAP_ANON, MAP_PRIVATE, PROT_READ, PROT_WRITE, SIGSEGV}; </del> <ins> use libc::{MAP_ANON, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SIGSEGV}; use crate::sys::unix::os::page_size; </ins> use crate::sys_common::thread_info; #[cfg(any(target_os = "linux", target_os = "android"))]


let source = pprust::token_to_string(self); parse_stream_from_source_str(FileName::MacroExpansion, source, sess, Some(span)) }); <ins> // During early phases of the compiler the AST could get modified // directly (e.g. attributes added or removed) and the internal cache // of tokens my not be invalidated or updated. Consequently if the // "lossless" token stream disagrees with our actual stringification // (which has historically been much more battle-tested) then we go // with the lossy stream anyway (losing span information). // // Note that the comparison isn't `==` here to avoid comparing spans, // but it *also* is a "probable" equality which is a pretty weird // definition. We mostly want to catch actual changes to the AST // like a `#[cfg]` being processed or some weird `macro_rules!` // expansion. // // What we *don't* want to catch is the fact that a user-defined // literal like `0xf` is stringified as `15`, causing the cached token // stream to not be literal `==` token-wise (ignoring spans) to the // token stream we got from stringification. // // Instead the "probably equal" check here is "does each token // recursively have the same discriminant?" We basically don't look at // the token values here and assume that such fine grained modifications // of token streams doesn't happen. </ins> if let Some(tokens) = tokens { <del> if tokens.eq_unspanned(&tokens_for_real) { </del> <ins> if tokens.probably_equal_for_proc_macro(&tokens_for_real) { </ins> return tokens } } return tokens_for_real } <ins> // See comments in `interpolated_to_tokenstream` for why we care about // *probably* equal here rather than actual equality pub fn probably_equal_for_proc_macro(&self, other: &Token) -> bool { if mem::discriminant(self) != mem::discriminant(other) { return false } match (self, other) { (&Eq, &Eq) | (&Lt, &Lt) | (&Le, &Le) | (&EqEq, &EqEq) | (&Ne, &Ne) | (&Ge, &Ge) | (&Gt, &Gt) | (&AndAnd, &AndAnd) | (&OrOr, &OrOr) | (&Not, &Not) | (&Tilde, &Tilde) | (&At, &At) | (&Dot, &Dot) | (&DotDot, &DotDot) | (&DotDotDot, &DotDotDot) | (&DotDotEq, &DotDotEq) | (&DotEq, &DotEq) | (&Comma, &Comma) | (&Semi, &Semi) | (&Colon, &Colon) | (&ModSep, &ModSep) | (&RArrow, &RArrow) | (&LArrow, &LArrow) | (&FatArrow, &FatArrow) | (&Pound, &Pound) | (&Dollar, &Dollar) | (&Question, &Question) | (&Whitespace, &Whitespace) | (&Comment, &Comment) | (&Eof, &Eof) => true, (&BinOp(a), &BinOp(b)) | (&BinOpEq(a), &BinOpEq(b)) => a == b, (&OpenDelim(a), &OpenDelim(b)) | (&CloseDelim(a), &CloseDelim(b)) => a == b, (&DocComment(a), &DocComment(b)) | (&Shebang(a), &Shebang(b)) => a == b, (&Lifetime(a), &Lifetime(b)) => a.name == b.name, (&Ident(a, b), &Ident(c, d)) => a.name == c.name && b == d, (&Literal(ref a, b), &Literal(ref c, d)) => { b == d && a.probably_equal_for_proc_macro(c) } (&Interpolated(_), &Interpolated(_)) => false, _ => panic!("forgot to add a token?"), } } </ins> } #[derive(Clone, RustcEncodable, RustcDecodable, Eq, Hash)]


// no-pretty-expanded FIXME #15189 // ignore-android FIXME #17520 <del> // ignore-msvc FIXME #28133 </del> <ins> // compile-flags:-g </ins> use std::env; use std::process::{Command, Stdio}; use std::str; <del> use std::ops::{Drop, FnMut, FnOnce}; </del> #[inline(never)] fn foo() {


types that do not implement `Drop` can still have drop glue, consider instead using `{$needs_drop}` to detect whether a type is trivially dropped lint_range_endpoint_out_of_range = range endpoint is out of range for `{$ty}` <del> .suggestion = use an inclusive range instead </del> <ins> lint_range_use_inclusive_range = use an inclusive range instead </ins> lint_overflowing_bin_hex = literal out of range for `{$ty}` .negative_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}`


<ins> PRINT-ATTR INPUT (DISPLAY): fn main() { match() { | () => () } } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", span: $DIR/issue-76182-leading-vert-pat.rs:14:1: 14:3 (#0), }, Ident { ident: "main", span: $DIR/issue-76182-leading-vert-pat.rs:14:4: 14:8 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/issue-76182-leading-vert-pat.rs:14:8: 14:10 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "match", span: $DIR/issue-76182-leading-vert-pat.rs:15:5: 15:10 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/issue-76182-leading-vert-pat.rs:15:11: 15:13 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Punct { ch: '|', spacing: Alone, span: $DIR/issue-76182-leading-vert-pat.rs:15:16: 15:17 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/issue-76182-leading-vert-pat.rs:15:18: 15:20 (#0), }, Punct { ch: '=', spacing: Joint, span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0), }, Punct { ch: '>', spacing: Alone, span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/issue-76182-leading-vert-pat.rs:15:24: 15:26 (#0), }, ], span: $DIR/issue-76182-leading-vert-pat.rs:15:14: 15:28 (#0), }, ], span: $DIR/issue-76182-leading-vert-pat.rs:14:11: 16:2 (#0), }, ] </ins>


let mut cmd = Command::new(SHELL); cmd.current_dir(&empty_dir) .arg(sanitize_sh(&tarball.decompressed_output().join("install.sh"))) <del> .arg(format!("--prefix={}", prepare_dir(prefix))) .arg(format!("--sysconfdir={}", prepare_dir(sysconfdir))) .arg(format!("--datadir={}", prepare_dir(datadir))) .arg(format!("--docdir={}", prepare_dir(docdir))) .arg(format!("--bindir={}", prepare_dir(bindir))) .arg(format!("--libdir={}", prepare_dir(libdir))) .arg(format!("--mandir={}", prepare_dir(mandir))) </del> <ins> .arg(format!("--prefix={}", prepare_dir(&destdir_env, prefix))) .arg(format!("--sysconfdir={}", prepare_dir(&destdir_env, sysconfdir))) .arg(format!("--datadir={}", prepare_dir(&destdir_env, datadir))) .arg(format!("--docdir={}", prepare_dir(&destdir_env, docdir))) .arg(format!("--bindir={}", prepare_dir(&destdir_env, bindir))) .arg(format!("--libdir={}", prepare_dir(&destdir_env, libdir))) .arg(format!("--mandir={}", prepare_dir(&destdir_env, mandir))) </ins> .arg("--disable-ldconfig"); builder.run(&mut cmd); t!(fs::remove_dir_all(&empty_dir));


#[note] pub struct BuiltinInternalFeatures { pub name: Symbol, <del> #[subdiagnostic] pub note: Option<BuiltinFeatureIssueNote>, </del> } #[derive(Subdiagnostic)]


show_type_layout, generate_link_to_definition, call_locations, <ins> no_emit_shared, </ins> .. } = options;


Exercise: use macros to reduce duplication in the above definition of the `bct!` macro. <ins> # Common macros Here are some common macros you’ll see in Rust code. ## panic! This macro causes the current thread to panic. You can give it a message to panic with: ```rust,no_run panic!("oh no!"); ``` ## vec! The `vec!` macro is used throughout the book, so you’ve probably seen it already. It creates `Vec<T>`s with ease: ```rust let v = vec![1, 2, 3, 4, 5]; ``` It also lets you make vectors with repeating values. For example, a hundred zeroes: ```rust let v = vec![0; 100]; ``` ## assert! and assert_eq! These two macros are used in tests. `assert!` takes a boolean, and `assert_eq!` takes two values and compares them. Truth passes, success `panic!`s. Like this: ```rust,no_run // A-ok! assert!(true); assert_eq!(5, 3 + 2); // nope :( assert!(5 < 3); assert_eq!(5, 3); ``` ## try! `try!` is used for error handling. It takes something that can return a `Result<T, E>`, and gives `T` if it’s a `Ok<T>`, and `return`s with the `Err(E)` if it’s that. Like this: ```rust,no_run use std::fs::File; fn foo() -> std::io::Result<()> { let f = try!(File::create("foo.txt")); Ok(()) } ``` This is cleaner than doing this: ```rust,no_run use std::fs::File; fn foo() -> std::io::Result<()> { let f = File::create("foo.txt"); let f = match f { Ok(t) => t, Err(e) => return Err(e), }; Ok(()) } ``` ## unreachable! This macro is used when you think some code should never execute: ```rust if false { unreachable!(); } ``` Sometimes, the compiler may make you have a different branch that you know will never, ever run. In these cases, use this macro, so that if you end up wrong, you’ll get a `panic!` about it. ```rust let x: Option<i32> = None; match x { Some(_) => unreachable!(), None => println!("I know x is None!"), } ``` ## unimplemented! The `unimplemented!` macro can be used when you’re trying to get your functions to typecheck, and don’t want to worry about writing out the body of the function. One example of this situation is implementing a trait with multiple required methods, where you want to tackle one at a time. Define the others as `unimplemented!` until you’re ready to write them. </ins> # Procedural macros If Rust's macro system can't do what you need, you may want to write a


/// Strip items marked `#[doc(hidden)]` pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult { <del> struct Stripper; impl fold::DocFolder for Stripper { fn fold_item(&mut self, i: Item) -> Option<Item> { for attr in i.attrs.iter() { match attr { &clean::List(~"doc", ref l) => { for innerattr in l.iter() { match innerattr { &clean::Word(ref s) if "hidden" == *s => { debug!("found one in strip_hidden; removing"); return None; }, _ => (), </del> <ins> let mut stripped = HashSet::new(); // strip all #[doc(hidden)] items let krate = { struct Stripper<'a> { stripped: &'a mut HashSet<ast::NodeId> }; impl<'a> fold::DocFolder for Stripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { for attr in i.attrs.iter() { match attr { &clean::List(~"doc", ref l) => { for innerattr in l.iter() { match innerattr { &clean::Word(ref s) if "hidden" == *s => { debug!("found one in strip_hidden; removing"); self.stripped.insert(i.id); return None; }, _ => (), } </ins> } <ins> }, _ => () } } self.fold_item_recur(i) } } let mut stripper = Stripper{ stripped: &mut stripped }; stripper.fold_crate(krate) }; // strip any traits implemented on stripped items let krate = { struct ImplStripper<'a> { stripped: &'a mut HashSet<ast::NodeId> }; impl<'a> fold::DocFolder for ImplStripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { match i.inner { clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: for_id, .. }, .. }) => { if self.stripped.contains(&for_id) { return None; </ins> } <del> }, _ => () </del> <ins> } _ => {} </ins> } <ins> self.fold_item_recur(i) </ins> } <del> self.fold_item_recur(i) </del> } <del> } let mut stripper = Stripper; let krate = stripper.fold_crate(krate); </del> <ins> let mut stripper = ImplStripper{ stripped: &mut stripped }; stripper.fold_crate(krate) }; </ins> (krate, None) }


self_expr: &'tcx hir::Expr<'tcx>, call_expr: &'tcx hir::Expr<'tcx>, ) -> ConfirmContext<'a, 'tcx> { <del> ConfirmContext { fcx, span, self_expr, call_expr } </del> <ins> ConfirmContext { fcx, span, self_expr, call_expr, skip_record_for_diagnostics: false } </ins> } fn confirm(


// can just use the tcx as the typer. // // FIXME(stage0): the :'t here is probably only important for stage0 <del> pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d+'t> { </del> <ins> pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> { </ins> typer: &'t infer::InferCtxt<'a, 'tcx>, mc: mc::MemCategorizationContext<'t, 'a, 'tcx>, delegate: &'d mut Delegate<'tcx>,


#[rustc_on_unimplemented = "the type {Self} contains interior mutability  and a reference may not be safely transferrable  across a recover boundary"] <del> pub trait NoUnsafeCell {} </del> <ins> pub trait RefRecoverSafe {} </ins> /// A simple wrapper around a type to assert that it is panic safe. ///


impl FromStr for Ipv4Addr { type Err = AddrParseError; fn from_str(s: &str) -> Result<Ipv4Addr, AddrParseError> { <del> Parser::new(s).parse_with(|p| p.read_ipv4_addr()) </del> <ins> // don't try to parse if too long if s.len() > 15 { Err(AddrParseError(())) } else { Parser::new(s).parse_with(|p| p.read_ipv4_addr()) } </ins> } }


_ => {} } } <del> if arg.layout.is_aggregate() && (int_regs < needed_int || sse_regs < needed_sse) { cls_or_mem = Err(Memory); </del> <ins> match (int_regs.checked_sub(needed_int), sse_regs.checked_sub(needed_sse)) { (Some(left_int), Some(left_sse)) => { int_regs = left_int; sse_regs = left_sse; } _ => { // Not enough registers for this argument, so it will be // passed on the stack, but we only mark aggregates // explicitly as indirect `byval` arguments, as LLVM will // automatically put immediates on the stack itself. if arg.layout.is_aggregate() { cls_or_mem = Err(Memory); } } </ins> } } }


<ins> fn foo() { match 0 { _ => {} } if foo } } //~ ERROR unexpected closing delimiter: `}` fn main() {} </ins>


/// use std::sync::Arc; /// use std::task::{Context, Poll, Wake}; /// use std::thread::{self, Thread}; <ins> /// use core::pin::pin; </ins> /// /// /// A waker that wakes up the current thread when called. /// struct ThreadWaker(Thread);


<ins> // check-pass // revisions: legacy v0 //[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib //[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib #![feature(min_const_generics)] pub struct Bar<const F: bool>; impl Bar<true> { pub fn foo() {} } impl<const F: bool> Bar<F> { pub fn bar() {} } fn main() {} </ins>


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


<ins> use std::marker::PhantomData; struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) where Foo<'short, 'out, T>: Convert<'a, 'b>; //~^ ERROR mismatched types //~^^ ERROR mismatched types //~^^^ ERROR use of undeclared lifetime name //~| ERROR use of undeclared lifetime name `'out` trait Convert<'a, 'b>: Sized { fn cast(&'a self) -> &'b Self; } impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { //~^ ERROR use of undeclared lifetime name //~^^ ERROR use of undeclared lifetime name `'out` //~| ERROR cannot infer an appropriate lifetime for lifetime parameter fn cast(&'long self) -> &'short Foo<'short, 'out, T> { //~^ ERROR use of undeclared lifetime name //~| ERROR cannot infer an appropriate lifetime for lifetime parameter self } } fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { //~^ ERROR use of undeclared lifetime name //~^^ ERROR incompatible lifetime on type //~| ERROR `x` has lifetime `'in_` but it needs to satisfy a `'static` lifetime requirement sadness.cast() } fn main() {} </ins>


/// assert!(weak.upgrade().is_none()); /// ``` /// <del> /// Unaligned values cannot be dropped in place, they must be copied to an aligned /// location first: /// ``` /// use std::ptr; /// use std::mem::{self, MaybeUninit}; /// /// unsafe fn drop_after_copy<T>(to_drop: *mut T) { ///     let mut copy: MaybeUninit<T> = MaybeUninit::uninit(); ///     ptr::copy(to_drop, copy.as_mut_ptr(), 1); ///     drop(copy.assume_init()); /// } /// /// #[repr(packed, C)] /// struct Packed { ///     _padding: u8, ///     unaligned: Vec<i32>, /// } /// /// let mut p = Packed { _padding: 0, unaligned: vec![42] }; /// unsafe { ///     drop_after_copy(&mut p.unaligned as *mut _); ///     mem::forget(p); /// } /// ``` /// </del> /// Notice that the compiler performs this copy automatically when dropping packed structs, /// i.e., you do not usually have to worry about such issues unless you call `drop_in_place` /// manually.


} } <del> /// If a tool does not pass its tests, don't ship it. /// Right now, we do this only for Miri. fn check_toolstate(&mut self) { // Get the toolstate for this rust revision. let rev = self.rust_git_commit_hash.as_ref().expect("failed to determine rust git hash"); let toolstates = reqwest::get(TOOLSTATE).expect("failed to get toolstates"); let toolstates = BufReader::new(toolstates); let toolstate = toolstates.lines() .find_map(|line| { let line = line.expect("failed to read toolstate lines"); let mut pieces = line.splitn(2, 't'); let commit = pieces.next().expect("malformed toolstate line"); if commit != rev { // Not the right commit. return None; } // Return the 2nd piece, the JSON. Some(pieces.next().expect("malformed toolstate line").to_owned()) }) .expect("failed to find toolstate for rust commit"); let toolstate: HashMap<String, String> = serde_json::from_str(&toolstate).expect("toolstate is malformed JSON"); // Mark some tools as missing based on toolstate. if toolstate.get("miri").map(|s| &*s as &str) != Some("test-pass") { println!("Miri tests are not passing, removing component"); self.miri_version = None; self.miri_git_commit_hash = None; } } /// Hash all files, compute their signatures, and collect the hashes in `self.digests`. </del> fn digest_and_sign(&mut self) { for file in t!(self.input.read_dir()).map(|e| t!(e).path()) { let filename = file.file_name().unwrap().to_str().unwrap();


} } <ins> impl Allocation<()> { /// Add Tag and Extra fields pub fn retag<T, E>( self, mut tagger: impl FnMut(AllocId) -> T, extra: E, ) -> Allocation<T, E> { Allocation { bytes: self.bytes, size: self.size, relocations: Relocations::from_presorted( self.relocations.iter() // The allocations in the relocations (pointers stored *inside* this allocation) // all get the base pointer tag. .map(|&(offset, ((), alloc))| { let tag = tagger(alloc); (offset, (tag, alloc)) }) .collect() ), undef_mask: self.undef_mask, align: self.align, mutability: self.mutability, extra, } } } </ins> /// Raw accessors. Provide access to otherwise private bytes. impl<Tag, Extra> Allocation<Tag, Extra> { pub fn len(&self) -> usize {


<ins> #![feature(const_fn_trait_bound)] // Regression test for issue 88434 const _CONST: &[u8] = &f(&[], |_| {}); const fn f<F>(_: &[u8], _: F) -> &[u8] where F: FnMut(&u8), { panic!() //~ ERROR evaluation of constant value failed } fn main() { } </ins>


use crate::ffi::CStr; use crate::mem; <del> use crate::os::raw::{c_char, c_int, c_long, c_longlong, c_uint, c_ulong, c_ushort}; </del> <ins> use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort}; </ins> use crate::os::windows::io::{BorrowedHandle, HandleOrInvalid, HandleOrNull}; use crate::ptr; use core::ffi::NonZero_c_ulong; use libc::{c_void, size_t, wchar_t}; <ins> pub use crate::os::raw::c_int; </ins> #[path = "c/errors.rs"] // c.rs is included from two places so we need to specify this mod errors; pub use errors::*;


let md_content = fs::read_to_string(entry.path()).unwrap(); fs::write(&out_dir.join(entry.file_name()), &md_content).unwrap(); } <del> let mut all = String::new(); all.push_str( r###" fn register_all() -> Vec<(&'static str, Option<&'static str>)> { let mut long_codes: Vec<(&'static str, Option<&'static str>)> = Vec::new(); macro_rules! register_diagnostics { ($($ecode:ident: $message:expr,)*) => ( register_diagnostics!{$($ecode:$message,)* ;} ); ($($ecode:ident: $message:expr,)* ; $($code:ident,)*) => ( $( {long_codes.extend([ (stringify!($ecode), Some($message)), ].iter());} )* $( {long_codes.extend([ stringify!($code), ].iter().cloned().map(|s| (s, None)).collect::<Vec<_>>());} )* ) } "###, ); all.push_str(r#"include!(concat!(env!("OUT_DIR"), "/all_error_codes.rs"));"#); all.push_str("nlong_codesn"); all.push_str("}n"); fs::write(&dest, all).unwrap(); </del> }


} } <ins> fn visit_generic_args(&mut self, args: &'a ast::GenericArgs) { // This check needs to happen here because the never type can be returned from a function, // but cannot be used in any other context. If this check was in `visit_fn_ret_ty`, it // include both functions and generics like `impl Fn() -> !`. if let ast::GenericArgs::Parenthesized(generic_args) = args && let ast::FnRetTy::Ty(ref ty) = generic_args.output && matches!(ty.kind, ast::TyKind::Never) { gate!(&self, never_type, ty.span, "the `!` type is experimental"); } visit::walk_generic_args(self, args); } </ins> fn visit_expr(&mut self, e: &'a ast::Expr) { match e.kind { ast::ExprKind::TryBlock(_) => {


static WAKER: Waker = unsafe { Waker::from_raw(VOID_WAKER) }; <del> static CONTEXT: Context<'static> = Context::from_waker(&WAKER); static WAKER_REF: &'static Waker = CONTEXT.waker(); WAKER_REF.wake_by_ref(); </del> <ins> WAKER.wake_by_ref(); </ins> }


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


} } <ins> fn check_rustc_layout_scalar_valid_range( &self, attr: &Attribute, span: &Span, target: Target, ) -> bool { if target != Target::Struct { self.tcx .sess .struct_span_err(attr.span, "attribute should be applied to a struct") .span_label(*span, "not a struct") .emit(); return false; } let list = match attr.meta_item_list() { None => return false, Some(it) => it, }; if matches!(&list[..], &[NestedMetaItem::Literal(Lit { kind: LitKind::Int(..), .. })]) { true } else { self.tcx .sess .struct_span_err(attr.span, "expected exactly one integer literal argument") .emit(); false } } </ins> /// Checks if `#[rustc_legacy_const_generics]` is applied to a function and has a valid argument. fn check_rustc_legacy_const_generics( &self,


use llvm::BasicBlockRef; use rustc::mir::repr as mir; <ins> use trans::adt; </ins> use trans::base; use trans::build; use trans::common::Block;


!preds.is_empty() && { let ty_empty_region = cx.tcx.mk_imm_ref(cx.tcx.lifetimes.re_root_empty, ty); preds.iter().all(|t| { <del> let ty_params = &t.skip_binder().trait_ref.substs.iter().skip(1).collect::<Vec<_>>(); </del> <ins> let ty_params = &t .skip_binder() .trait_ref .substs .iter() .skip(1) .collect::<Vec<_>>(); </ins> implements_trait(cx, ty_empty_region, t.def_id(), ty_params) }) },


<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. // #39665 #![feature(conservative_impl_trait)] fn batches(n: &u32) -> impl Iterator<Item=&u32> { std::iter::once(n) } fn main() {} </ins>


index::Index::from_buf(index.data, index.start, index.end) } <ins> pub fn crate_rustc_version(data: &[u8]) -> Option<String> { let doc = rbml::Doc::new(data); reader::maybe_get_doc(doc, tag_rustc_version).map(|s| s.as_str()) } </ins> #[derive(Debug, PartialEq)] enum Family { ImmStatic,             // c


//! Validates the MIR to ensure that invariants are upheld. use rustc_data_structures::fx::{FxHashMap, FxHashSet}; <ins> use rustc_hir as hir; </ins> use rustc_hir::LangItem; use rustc_index::bit_set::BitSet; use rustc_index::IndexVec;


#[inline] #[stable(feature = "char_from_unchecked", since = "1.5.0")] pub unsafe fn from_u32_unchecked(i: u32) -> char { <del> transmute(i) </del> <ins> if cfg!(debug_assertions) { char::from_u32(i).unwrap() } else { transmute(i) } </ins> } #[stable(feature = "char_convert", since = "1.13.0")]


<del> #![feature(const_trait_impl)] </del> <ins> #![feature(const_trait_impl, effects)] </ins> // edition: 2021 #[const_trait]


fn avg<T=i32>(_: T) {} //~^ ERROR defaults for type parameters are only allowed //~| WARNING hard error <ins> struct S<T>(T); impl<T=i32> S<T> {} //~^ ERROR defaults for type parameters are only allowed //~| WARNING hard error </ins> fn main() {}


hir::ItemKind::Fn(..) | hir::ItemKind::Ty(..) | hir::ItemKind::Static(..) <ins> | hir::ItemKind::Existential(..) </ins> | hir::ItemKind::Const(..) => { intravisit::walk_item(self, &item); }


self.primitive_locations.insert(prim, def_id); } <del> self.stack.push(krate.name.to_string()); </del> krate = CacheBuilder { tcx, cache: self, empty_cache: Cache::default() }.fold_crate(krate); for (trait_did, dids, impl_) in self.orphan_trait_impls.drain(..) {


/// /// # Example /// ``` <del> /// #![feature(io_into_inner_error_parts)] </del> /// use std::io::{BufWriter, ErrorKind, Write}; /// /// let mut not_enough_space = [0u8; 10];


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


| LL |     async fn foo() {} |     ^^^^^^^^^^^^^^^^^ <ins> | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait </ins> error: aborting due to 10 previous errors <del> For more information about this error, try `rustc --explain E0670`. </del> <ins> Some errors have detailed explanations: E0670, E0706. For more information about an error, try `rustc --explain E0670`. </ins>


<del> Subproject commit 7c06679f93df53f83bbf61b197f2e5c39f5d7633 </del> <ins> Subproject commit ae9e9cb47c7b79d8bb29fab90929bd9b3606348a </ins>


<ins> error: allocator `MyAllocatorWhichMustNotSuspend` held across a suspend point, but should not be --> $DIR/allocator.rs:24:9 | LL |     let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); |         ^ LL | LL |     suspend().await; |               ----- the value is held across this suspend point | help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point --> $DIR/allocator.rs:24:9 | LL |     let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); |         ^ note: the lint level is defined here --> $DIR/allocator.rs:4:9 | LL | #![deny(must_not_suspend)] |         ^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error </ins>


across a recover boundary"] pub trait RecoverSafe {} <del> /// A marker trait representing types which do not contain an `UnsafeCell` by /// value internally. </del> <ins> /// A marker trait representing types where a shared reference is considered /// recover safe. /// /// This trait is namely not implemented by `UnsafeCell`, the root of all /// interior mutability. </ins> /// /// This is a "helper marker trait" used to provide impl blocks for the /// `RecoverSafe` trait, for more information see that documentation.


// tokens like `<<` from `rustc_lexer`, and then add fancier error recovery to it, // as there will be less overall work to do this way. let token = unicode_chars::check_for_substitution(self, start, c, &mut err); <ins> if c == 'x00' { err.help("source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used"); } </ins> err.emit(); token? }


} for child in self.resolver.module_children_or_reexports(module_id) { <del> if child.vis == Visibility::Public { </del> <ins> if child.vis == Visibility::Public || self.document_private_items { </ins> if let Some(def_id) = child.res.opt_def_id() { self.add_traits_in_parent_scope(def_id); }


fn read_scope_id(&mut self) -> Option<u32> { self.read_atomically(|p| { p.read_given_char('%')?; <del> p.read_number(10, None) </del> <ins> p.read_number(10, None, true) </ins> }) }


<del> Subproject commit c8e3cfbdd997839c771ca32c7ac860fe95149a04 </del> <ins> Subproject commit 3abdd2f1ced4cf3a44c7de88c5e39b3bb5037c4d </ins>


cd .. rm -rf curl-build rm -rf curl-$VERSION <del> yum erase -y curl </del>


<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. #![crate_name = "foo"] #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", issue = "0")] #![feature(rustc_const_unstable, const_fn, foo, foo2)] #![feature(min_const_unsafe_fn)] #![feature(staged_api)] // @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature="foo")] pub const unsafe fn foo() -> u32 { 42 } // @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32' #[unstable(feature = "humans", issue="0")] pub const fn foo2() -> u32 { 42 } // @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' #[stable(feature = "rust1", since = "1.0.0")] pub const fn bar2() -> u32 { 42 } // @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32' #[unstable(feature = "foo2", issue="0")] pub const unsafe fn foo2_gated() -> u32 { 42 } // @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' #[stable(feature = "rust1", since = "1.0.0")] pub const unsafe fn bar2_gated() -> u32 { 42 } // @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32' pub const unsafe fn bar_not_gated() -> u32 { 42 } </ins>


// Consistency checks, analogous to `finalize_macro_resolutions`. if let Some(initial_module) = import.imported_module.get() { if !ModuleOrUniformRoot::same_def(module, initial_module) && no_ambiguity { <del> span_bug!(import.span, "inconsistent resolution for an import"); </del> <ins> let msg = "inconsistent resolution for an import"; self.r.session.span_err(import.span, msg); </ins> } } else { if self.r.privacy_errors.is_empty() {


source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", <del> "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ]


#[unstable(feature = "scoped_tls", reason = "scoped TLS has yet to have wide enough use to fully  consider stabilizing its interface")] <del> pub use self::scoped::ScopedKey; </del> <ins> pub use self::scoped_tls::ScopedKey; </ins> #[doc(hidden)] pub use self::local::__impl as __local; <del> #[doc(hidden)] pub use self::scoped::__impl as __scoped; </del> <ins> #[doc(hidden)] pub use self::scoped_tls::__impl as __scoped; </ins> //////////////////////////////////////////////////////////////////////////////// // Builder


self.register_predicates(autoderef.into_obligations()); // Write out the final adjustments. <del> self.apply_adjustments(self.self_expr, adjustments); </del> <ins> if !self.skip_record_for_diagnostics { self.apply_adjustments(self.self_expr, adjustments); } </ins> target }


<ins> // check-pass // effects ice https://github.com/rust-lang/rust/issues/113375 index out of bounds #![allow(incomplete_features, unused)] #![feature(effects, adt_const_params)] struct Bar<T>(T); impl<T> Bar<T> { const fn value() -> usize { 42 } } struct Foo<const N: [u8; Bar::<u32>::value()]>; pub fn main() {} </ins>


"you may want to use a bool value instead", format!("{}", item_typo), )) <ins> // FIXME(vicnenzopalazzo): make the check smarter, // and maybe expand with levenshtein distance checks } else if item_str.as_str() == "printf" { Some(( item_span, "you may have meant to use the `print` macro", "print!".to_owned(), )) </ins> } else { suggestion };


/// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn lock(&self) -> StderrLock<'_> { <ins> self.lock_any() } // Locks this handle with any lifetime. This depends on the // implementation detail that the underlying `ReentrantMutex` is // static. fn lock_any<'a>(&self) -> StderrLock<'a> { </ins> StderrLock { inner: self.inner.lock() } } <ins> /// Locks and consumes this handle to the standard error stream, /// returning a writable guard. /// /// The lock is released when the returned guard goes out of scope. The /// returned guard also implements the [`Write`] trait for writing /// data. /// /// # Examples /// /// ``` /// #![feature(stdio_locked)] /// use std::io::{self, Write}; /// /// fn foo() -> io::Result<()> { ///     let stderr = io::stderr(); ///     let mut handle = stderr.into_locked(); /// ///     handle.write_all(b"hello world")?; /// ///     Ok(()) /// } /// ``` #[unstable(feature = "stdio_locked", issue = "none")] pub fn into_locked(self) -> StderrLock<'static> { self.lock_any() } </ins> } #[stable(feature = "std_debug", since = "1.16.0")]


<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. #[allow(unreachable_code)] fn main() { loop { break while continue { //~ ERROR E0590 } } } </ins>


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"); <del> self.check_toolstate(); </del> self.digest_and_sign(); let manifest = self.build_manifest(); self.write_channel_files(&self.rust_release, &manifest);


cd .. rm -rf gcc-build rm -rf gcc-$GCC <del> yum erase -y gcc gcc-c++ binutils </del>


tp!(r"?A:xy", "/foo", r"?A:foo"); tp!(r"?A:", r"..foo.", r"?A:foo"); tp!(r"?A:xy", r".foo.", r"?A:xyfoo"); <ins> tp!(r"?A:xy", r"", r"?A:xy"); </ins> } }


[[package]] name = "phf" <del> version = "0.7.22" </del> <ins> version = "0.7.24" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ <del> "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> ] [[package]] name = "phf_codegen" <del> version = "0.7.22" </del> <ins> version = "0.7.24" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ <del> "phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> ] [[package]] name = "phf_generator" <del> version = "0.7.22" </del> <ins> version = "0.7.24" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ <del> "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", </ins> ] [[package]] name = "phf_shared" <del> version = "0.7.22" </del> <ins> version = "0.7.24" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",


<del> error[E0720]: cannot resolve opaque type --> $DIR/default-body-with-rpit.rs:10:28 | LL |     async fn baz(&self) -> impl Debug { |                            ^^^^^^^^^^ cannot resolve opaque type | = note: these returned values have a concrete "never" type = help: this error will resolve once the item's body returns a concrete type error: aborting due to previous error For more information about this error, try `rustc --explain E0720`. </del>


<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(rustc_attrs)] enum Abc { A(u8), B(i8), C, D, } #[rustc_mir] fn foo(x: Abc) -> i32 { match x { Abc::C => 3, Abc::D => 4, Abc::B(_) => 2, Abc::A(_) => 1, } } #[rustc_mir] fn foo2(x: Abc) -> bool { match x { Abc::D => true, _ => false } } fn main() { assert_eq!(1, foo(Abc::A(42))); assert_eq!(2, foo(Abc::B(-100))); assert_eq!(3, foo(Abc::C)); assert_eq!(4, foo(Abc::D)); assert_eq!(false, foo2(Abc::A(1))); assert_eq!(false, foo2(Abc::B(2))); assert_eq!(false, foo2(Abc::C)); assert_eq!(true, foo2(Abc::D)); } </ins>


<del> // Regression test for <https://github.com/rust-lang/rust/issues/100529>. #![no_core] #![feature(no_core)] // @has "$.index[*][?(@.name=='ParseError')]" // @has "$.index[*][?(@.name=='UnexpectedEndTag')]" // @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_kind" '"tuple"' // @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_inner" [] pub enum ParseError { UnexpectedEndTag(#[doc(hidden)] u32), } </del>


Ok(result.callee) } <ins> pub fn lookup_method_for_diagnostic( &self, self_ty: Ty<'tcx>, segment: &hir::PathSegment<'_>, span: Span, call_expr: &'tcx hir::Expr<'tcx>, self_expr: &'tcx hir::Expr<'tcx>, ) -> Result<MethodCallee<'tcx>, MethodError<'tcx>> { let pick = self.lookup_probe_for_diagnostic( segment.ident, self_ty, call_expr, ProbeScope::TraitsInScope, None, )?; Ok(self .confirm_method_for_diagnostic(span, self_expr, call_expr, self_ty, &pick, segment) .callee) } </ins> #[instrument(level = "debug", skip(self, call_expr))] pub fn lookup_probe( &self,


/// uniquely determined by `t` (see RFC 447). If it is true, return the list /// of parameters whose values are needed in order to constrain `ty` - these /// differ, with the latter being a superset, in the presence of projections. <del> pub fn parameters_for<'tcx, T>(t: &T, include_nonconstraining: bool) -> Vec<Parameter> where T: TypeFoldable<'tcx> { </del> <ins> pub fn parameters_for<'tcx>( t: &impl TypeFoldable<'tcx>, include_nonconstraining: bool, ) -> Vec<Parameter> { </ins> let mut collector = ParameterCollector { parameters: vec![], include_nonconstraining,


impl Foo for Bar { // ok! // functions implementation } <ins> fn baz<T: Foo>(t: T) {} // ok! </ins> ``` <del> or: </del> <ins> Alternatively, you could introduce a new trait with your desired restrictions as a super trait: </ins> ``` <del> trait Foo { // some functions } </del> <ins> # trait Foo {} # struct Bar; # impl Foo for Bar {} trait Qux: Foo {} // Anything that implements Qux also needs to implement Foo fn baz<T: Qux>(t: T) {} // also ok! ``` Finally, if you are on nightly and want to use a trait alias instead of a type alias, you should use `#![feature(trait_alias)]`: ``` #![feature(trait_alias)] trait Foo = Iterator<Item=String>; </ins> fn bar<T: Foo>(t: T) {} // ok! ```


name = "build-manifest" version = "0.1.0" dependencies = [ <del> "reqwest", </del> "serde", <del> "serde_json", </del> "toml", ]


} } <ins> // FIXME(#10432) </ins> impl Seek for MemWriter { fn tell(&self) -> u64 { self.pos as u64 } fn seek(&mut self, pos: i64, style: SeekStyle) { <del> match style { SeekSet => { self.pos = pos as uint; } SeekEnd => { self.pos = self.buf.len() + pos as uint; } SeekCur => { self.pos += pos as uint; } } </del> <ins> // compute offset as signed and clamp to prevent overflow let offset = match style { SeekSet => { 0 } SeekEnd => { self.buf.len() } SeekCur => { self.pos } } as i64; self.pos = max(0, offset+pos) as uint; </ins> } }


pub type SuccessorsMut<'a> = iter::Chain<option::IntoIter<&'a mut BasicBlock>, slice::IterMut<'a, BasicBlock>>; <del> impl<'tcx> Terminator<'tcx> { pub fn successors(&self) -> Successors<'_> { self.kind.successors() } pub fn successors_mut(&mut self) -> SuccessorsMut<'_> { self.kind.successors_mut() } pub fn unwind(&self) -> Option<&Option<BasicBlock>> { self.kind.unwind() } pub fn unwind_mut(&mut self) -> Option<&mut Option<BasicBlock>> { self.kind.unwind_mut() } } impl<'tcx> TerminatorKind<'tcx> { pub fn if_( tcx: TyCtxt<'tcx>, cond: Operand<'tcx>, t: BasicBlock, f: BasicBlock, ) -> TerminatorKind<'tcx> { static BOOL_SWITCH_FALSE: &[u128] = &[0]; TerminatorKind::SwitchInt { discr: cond, switch_ty: tcx.types.bool, values: From::from(BOOL_SWITCH_FALSE), targets: vec![f, t], } } pub fn successors(&self) -> Successors<'_> { use self::TerminatorKind::*; match *self { Resume | Abort | GeneratorDrop | Return | Unreachable | Call { destination: None, cleanup: None, .. } | InlineAsm { destination: None, .. } => None.into_iter().chain(&[]), Goto { target: ref t } | Call { destination: None, cleanup: Some(ref t), .. } | Call { destination: Some((_, ref t)), cleanup: None, .. } | Yield { resume: ref t, drop: None, .. } | DropAndReplace { target: ref t, unwind: None, .. } | Drop { target: ref t, unwind: None, .. } | Assert { target: ref t, cleanup: None, .. } | FalseUnwind { real_target: ref t, unwind: None } | InlineAsm { destination: Some(ref t), .. } => Some(t).into_iter().chain(&[]), Call { destination: Some((_, ref t)), cleanup: Some(ref u), .. } | Yield { resume: ref t, drop: Some(ref u), .. } | DropAndReplace { target: ref t, unwind: Some(ref u), .. } | Drop { target: ref t, unwind: Some(ref u), .. } | Assert { target: ref t, cleanup: Some(ref u), .. } | FalseUnwind { real_target: ref t, unwind: Some(ref u) } => { Some(t).into_iter().chain(slice::from_ref(u)) } SwitchInt { ref targets, .. } => None.into_iter().chain(&targets[..]), FalseEdge { ref real_target, ref imaginary_target } => { Some(real_target).into_iter().chain(slice::from_ref(imaginary_target)) } } } pub fn successors_mut(&mut self) -> SuccessorsMut<'_> { use self::TerminatorKind::*; match *self { Resume | Abort | GeneratorDrop | Return | Unreachable | Call { destination: None, cleanup: None, .. } | InlineAsm { destination: None, .. } => None.into_iter().chain(&mut []), Goto { target: ref mut t } | Call { destination: None, cleanup: Some(ref mut t), .. } | Call { destination: Some((_, ref mut t)), cleanup: None, .. } | Yield { resume: ref mut t, drop: None, .. } | DropAndReplace { target: ref mut t, unwind: None, .. } | Drop { target: ref mut t, unwind: None, .. } | Assert { target: ref mut t, cleanup: None, .. } | FalseUnwind { real_target: ref mut t, unwind: None } | InlineAsm { destination: Some(ref mut t), .. } => Some(t).into_iter().chain(&mut []), Call { destination: Some((_, ref mut t)), cleanup: Some(ref mut u), .. } | Yield { resume: ref mut t, drop: Some(ref mut u), .. } | DropAndReplace { target: ref mut t, unwind: Some(ref mut u), .. } | Drop { target: ref mut t, unwind: Some(ref mut u), .. } | Assert { target: ref mut t, cleanup: Some(ref mut u), .. } | FalseUnwind { real_target: ref mut t, unwind: Some(ref mut u) } => { Some(t).into_iter().chain(slice::from_mut(u)) } SwitchInt { ref mut targets, .. } => None.into_iter().chain(&mut targets[..]), FalseEdge { ref mut real_target, ref mut imaginary_target } => { Some(real_target).into_iter().chain(slice::from_mut(imaginary_target)) } } } pub fn unwind(&self) -> Option<&Option<BasicBlock>> { match *self { TerminatorKind::Goto { .. } | TerminatorKind::Resume | TerminatorKind::Abort | TerminatorKind::Return | TerminatorKind::Unreachable | TerminatorKind::GeneratorDrop | TerminatorKind::Yield { .. } | TerminatorKind::SwitchInt { .. } | TerminatorKind::FalseEdge { .. } | TerminatorKind::InlineAsm { .. } => None, TerminatorKind::Call { cleanup: ref unwind, .. } | TerminatorKind::Assert { cleanup: ref unwind, .. } | TerminatorKind::DropAndReplace { ref unwind, .. } | TerminatorKind::Drop { ref unwind, .. } | TerminatorKind::FalseUnwind { ref unwind, .. } => Some(unwind), } } pub fn unwind_mut(&mut self) -> Option<&mut Option<BasicBlock>> { match *self { TerminatorKind::Goto { .. } | TerminatorKind::Resume | TerminatorKind::Abort | TerminatorKind::Return | TerminatorKind::Unreachable | TerminatorKind::GeneratorDrop | TerminatorKind::Yield { .. } | TerminatorKind::SwitchInt { .. } | TerminatorKind::FalseEdge { .. } | TerminatorKind::InlineAsm { .. } => None, TerminatorKind::Call { cleanup: ref mut unwind, .. } | TerminatorKind::Assert { cleanup: ref mut unwind, .. } | TerminatorKind::DropAndReplace { ref mut unwind, .. } | TerminatorKind::Drop { ref mut unwind, .. } | TerminatorKind::FalseUnwind { ref mut unwind, .. } => Some(unwind), } } } </del> impl<'tcx> BasicBlockData<'tcx> { pub fn new(terminator: Option<Terminator<'tcx>>) -> BasicBlockData<'tcx> { BasicBlockData { statements: vec![], terminator, is_cleanup: false }


<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 foo(_s: i16) { } fn bar(_s: u32) { } fn main() { foo(1*(1 as int)); //~^ ERROR: mismatched types: expected `i16`, found `int` (expected `i16`, found `int`) bar(1*(1 as uint)); //~^ ERROR: mismatched types: expected `u32`, found `uint` (expected `u32`, found `uint`) } </ins>


<ins> fn main() { &{[1, 2, 3][4]}; //~^ ERROR index out of bounds //~| ERROR reaching this expression at runtime will panic or abort //~| ERROR this expression will panic at runtime } </ins>


version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ <del> "phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",


LL | #![deny(dead_code)] |         ^^^^^^^^^ <del> error: aborting due to 1 previous error </del> <ins> error: variant `Variant1` is never constructed --> $DIR/unused-variant.rs:11:5 | LL | enum TupleVariant { |      ------------ variant in this enum LL |     Variant1(i32), |     ^^^^^^^^ | = note: `TupleVariant` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis error: variant `Variant1` is never constructed --> $DIR/unused-variant.rs:17:5 | LL | enum StructVariant { |      ------------- variant in this enum LL |     Variant1 { id: i32 }, |     ^^^^^^^^ | = note: `StructVariant` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis error: aborting due to 3 previous errors </ins>


fn visit_lifetime(&mut self, _: &hir::Lifetime) { // Unneeded. } <ins> fn visit_body(&mut self, b: &'tcx hir::Body<'tcx>) { let prev = mem::replace(&mut self.inside_body, true); walk_body(self, b); self.inside_body = prev; } </ins> }


let const_data = self.encode_rendered_const_for_body(body_id); let qualifs = self.tcx.mir_const_qualif(def_id); <del> record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::Const(qualifs, const_data)); </del> <ins> record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::AnonConst(qualifs, const_data)); </ins> record!(self.tables.visibility[def_id.to_def_id()] <- ty::Visibility::Public); record!(self.tables.span[def_id.to_def_id()] <- self.tcx.def_span(def_id)); self.encode_item_type(def_id.to_def_id());


version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ <del> "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", </del> <ins> "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", </ins> "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",


= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` help: try using `=` instead | <del> LL -     B == 2 LL +     B = 2 | </del> <ins> LL |     B = 2 |       ~ </ins> error: expected item, found `==` --> $DIR/issue-101477-enum.rs:6:7


<ins> error[E0277]: the size for values of type `[usize]` cannot be known at compilation time --> $DIR/issue-36122-accessing-externed-dst.rs:3:24 | LL |         static symbol: [usize]; |                        ^^^^^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `[usize]` = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>


LL |     arg.map(|v| &**v) |        ++++++++++++++ <del> error: aborting due to 1 previous error </del> <ins> error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:9:19 | LL |     arg.unwrap_or(&[]) |         --------- ^^^ expected `&Vec<i32>`, found `&[_; 0]` |         | |         arguments to this method are incorrect | = note: expected reference `&Vec<i32>` found reference `&[_; 0]` help: the return type of this call is `&[_; 0]` due to the type of the argument passed --> $DIR/transforming-option-ref-issue-127545.rs:9:5 | LL |     arg.unwrap_or(&[]) |     ^^^^^^^^^^^^^^---^ |                   | |                   this argument influences the return type of `unwrap_or` note: method defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: use `Option::map_or` to deref inner value of `Option` | LL |     arg.map_or(&[], |v| v) |         ~~~~~~    +++++++ error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:13:19 | LL |     arg.unwrap_or(v) |         --------- ^ expected `&Vec<i32>`, found `&[i32]` |         | |         arguments to this method are incorrect | = note: expected reference `&Vec<i32>` found reference `&'a [i32]` help: the return type of this call is `&'a [i32]` due to the type of the argument passed --> $DIR/transforming-option-ref-issue-127545.rs:13:5 | LL |     arg.unwrap_or(v) |     ^^^^^^^^^^^^^^-^ |                   | |                   this argument influences the return type of `unwrap_or` note: method defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: use `Option::map_or` to deref inner value of `Option` | LL |     arg.map_or(v, |v| v) |         ~~~~~~  +++++++ error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:17:19 | LL |     arg.unwrap_or(&[]) |         --------- ^^^ expected `&Vec<i32>`, found `&[_; 0]` |         | |         arguments to this method are incorrect | = note: expected reference `&Vec<i32>` found reference `&[_; 0]` help: the return type of this call is `&[_; 0]` due to the type of the argument passed --> $DIR/transforming-option-ref-issue-127545.rs:17:5 | LL |     arg.unwrap_or(&[]) |     ^^^^^^^^^^^^^^---^ |                   | |                   this argument influences the return type of `unwrap_or` note: method defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: use `Result::map_or` to deref inner value of `Result` | LL |     arg.map_or(&[], |v| v) |         ~~~~~~    +++++++ error: aborting due to 4 previous errors </ins> For more information about this error, try `rustc --explain E0308`.


<ins> // check-pass // compile-flags: -Z validate-mir #![feature(let_chains)] fn let_chains(entry: std::io::Result<std::fs::DirEntry>) { if let Ok(entry) = entry && let Some(s) = entry.file_name().to_str() && s.contains("") {} } fn main() {} </ins>


= help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date <del> error: aborting due to 3 previous errors </del> <ins> error: aborting due to 2 previous errors </ins> For more information about this error, try `rustc --explain E0658`.


[[package]] name = "git2" <del> version = "0.11.0" </del> <ins> version = "0.12.0" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "77519ef7c5beee314d0804d4534f01e0f9e8d9acdee2b7a48627e590b27e0ec4" </del> <ins> checksum = "26e07ef27260a78f7e8d218ebac2c72f2c4db50493741b190b6e8eade1da7c68" </ins> dependencies = [ "bitflags", "libc",


declare_lint!(OVERFLOWING_LITERALS, Warn, "literal out of range for its type") <ins> declare_lint!(EXCEEDING_BITSHIFTS, Deny, "shift exceeds the type's number of bits") </ins> pub struct TypeLimits { /// Id of the last visited negated expression negated_expr_id: ast::NodeId,


<ins> error: `enum` and `struct` are mutually exclusive --> $DIR/issue-99625-enum-struct-mutually-exclusive.rs:3:5 | LL | pub enum struct Range { |     ^^^^^^^^^^^ help: replace `enum struct` with: `enum` error: aborting due to previous error </ins>


} /// Returns the set of parameters constrained by the impl header. <del> pub fn parameters_for_impl<'tcx>(impl_self_ty: Ty<'tcx>, impl_trait_ref: Option<ty::TraitRef<'tcx>>) -> FxHashSet<Parameter> { </del> <ins> pub fn parameters_for_impl<'tcx>( impl_self_ty: Ty<'tcx>, impl_trait_ref: Option<ty::TraitRef<'tcx>>, ) -> FxHashSet<Parameter> { </ins> let vec = match impl_trait_ref { Some(tr) => parameters_for(&tr, false), None => parameters_for(&impl_self_ty, false),


<ins> error: unexpected closing delimiter: `)` --> $DIR/issue-98601-delimiter-error-unexpected-close.rs:5:17 | LL | fn main() { |           - this opening brace... LL |     todo!(); LL | } | - ...matches this closing brace LL | LL | fn other(_: i32)) {} |                 ^ unexpected closing delimiter error: aborting due to previous error </ins>


// Float => does not implement iterator. for i in 0f32..42f32 {} <del> //~^ ERROR `core::iter::Iterator` is not implemented for the type `core::ops::Range<f32>` //~^^ ERROR //~^^^ ERROR // FIXME(#21528) not fulfilled obligation error should be reported once, not thrice </del> <ins> //~^ ERROR the trait `core::num::Int` is not implemented for the type `f32` </ins> // Unsized type. let arr: &[_] = &[1us, 2, 3];


/// [`Metadata`]: struct.Metadata.html /// [`fs::metadata`]: fn.metadata.html /// [`fs::symlink_metadata`]: fn.symlink_metadata.html <ins> /// [`is_dir`]: struct.FileType.html#method.is_dir /// [`is_file`]: struct.FileType.html#method.is_file </ins> /// [`is_symlink`]: struct.FileType.html#method.is_symlink /// /// # Examples


unsafe { Box::from_raw(Box::into_raw(v) as *mut str) } } <del> /// Converts the bytes while the bytes are still ascii. </del> <ins> /// Converts leading ascii bytes in `s` by calling the `convert` function. /// </ins> /// For better average performance, this happens in chunks of `2*size_of::<usize>()`. <del> /// Returns a vec with the converted bytes. </del> <ins> /// /// Returns a tuple of the converted prefix and the remainder starting from /// the first non-ascii character. /// /// This function is only public so that it can be verified in a codegen test, /// see `issue-123712-str-to-lower-autovectorization.rs`. #[unstable(feature = "str_internals", issue = "none")] #[doc(hidden)] </ins> #[inline] #[cfg(not(test))] #[cfg(not(no_global_oom_handling))] <del> fn convert_while_ascii(b: &[u8], convert: fn(&u8) -> u8) -> Vec<u8> { let mut out = Vec::with_capacity(b.len()); </del> <ins> pub fn convert_while_ascii(s: &str, convert: fn(&u8) -> u8) -> (String, &str) { // Process the input in chunks of 16 bytes to enable auto-vectorization. // Previously the chunk size depended on the size of `usize`, // but on 32-bit platforms with sse or neon is also the better choice. // The only downside on other platforms would be a bit more loop-unrolling. const N: usize = 16; let mut slice = s.as_bytes(); let mut out = Vec::with_capacity(slice.len()); let mut out_slice = out.spare_capacity_mut(); let mut ascii_prefix_len = 0_usize; let mut is_ascii = [false; N]; while slice.len() >= N { // SAFETY: checked in loop condition let chunk = unsafe { slice.get_unchecked(..N) }; // SAFETY: out_slice has at least same length as input slice and gets sliced with the same offsets let out_chunk = unsafe { out_slice.get_unchecked_mut(..N) }; for j in 0..N { is_ascii[j] = chunk[j] <= 127; } </ins> <del> const USIZE_SIZE: usize = mem::size_of::<usize>(); const MAGIC_UNROLL: usize = 2; const N: usize = USIZE_SIZE * MAGIC_UNROLL; const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; USIZE_SIZE]); </del> <ins> // Auto-vectorization for this check is a bit fragile, sum and comparing against the chunk // size gives the best result, specifically a pmovmsk instruction on x86. // See https://github.com/llvm/llvm-project/issues/96395 for why llvm currently does not // currently recognize other similar idioms. if is_ascii.iter().map(|x| *x as u8).sum::<u8>() as usize != N { break; } </ins> <del> let mut i = 0; unsafe { while i + N <= b.len() { // Safety: we have checks the sizes `b` and `out` to know that our let in_chunk = b.get_unchecked(i..i + N); let out_chunk = out.spare_capacity_mut().get_unchecked_mut(i..i + N); let mut bits = 0; for j in 0..MAGIC_UNROLL { // read the bytes 1 usize at a time (unaligned since we haven't checked the alignment) // safety: in_chunk is valid bytes in the range bits |= in_chunk.as_ptr().cast::<usize>().add(j).read_unaligned(); } // if our chunks aren't ascii, then return only the prior bytes as init if bits & NONASCII_MASK != 0 { break; } </del> <ins> for j in 0..N { out_chunk[j] = MaybeUninit::new(convert(&chunk[j])); } </ins> <del> // perform the case conversions on N bytes (gets heavily autovec'd) for j in 0..N { // safety: in_chunk and out_chunk is valid bytes in the range let out = out_chunk.get_unchecked_mut(j); out.write(convert(in_chunk.get_unchecked(j))); } </del> <ins> ascii_prefix_len += N; slice = unsafe { slice.get_unchecked(N..) }; out_slice = unsafe { out_slice.get_unchecked_mut(N..) }; } </ins> <del> // mark these bytes as initialised i += N; </del> <ins> // handle the remainder as individual bytes while slice.len() > 0 { let byte = slice[0]; if byte > 127 { break; } // SAFETY: out_slice has at least same length as input slice unsafe { *out_slice.get_unchecked_mut(0) = MaybeUninit::new(convert(&byte)); </ins> } <del> out.set_len(i); </del> <ins> ascii_prefix_len += 1; slice = unsafe { slice.get_unchecked(1..) }; out_slice = unsafe { out_slice.get_unchecked_mut(1..) }; </ins> } <del> out </del> <ins> unsafe { // SAFETY: ascii_prefix_len bytes have been initialized above out.set_len(ascii_prefix_len); // SAFETY: We have written only valid ascii to the output vec let ascii_string = String::from_utf8_unchecked(out); // SAFETY: we know this is a valid char boundary // since we only skipped over leading ascii bytes let rest = core::str::from_utf8_unchecked(slice); (ascii_string, rest) } </ins> }


let addr = builder.config.dist_upload_addr.as_ref().unwrap_or_else(|| { panic!("nnfailed to specify `dist.upload-addr` in `config.toml`nn") }); <del> let pass = if env::var("BUILD_MANIFEST_DISABLE_SIGNING").is_err() { let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| { panic!("nnfailed to specify `dist.gpg-password-file` in `config.toml`nn") }); t!(fs::read_to_string(&file)) } else { String::new() }; </del> <ins> let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| { panic!("nnfailed to specify `dist.gpg-password-file` in `config.toml`nn") }); let pass = t!(fs::read_to_string(&file)); </ins> let today = output(Command::new("date").arg("+%Y-%m-%d"));