{"_id":"q-en-rust-000b59b247fe72240ce2ced6fe809c3f2182e217a66df18b14c5e9d0c1ab5a24","text":" // build-pass // compile-flags:-Zmir-opt-level=3 struct D; trait Tr { type It; fn foo(self) -> Option; } impl<'a> Tr for &'a D { type It = (); fn foo(self) -> Option<()> { None } } fn run(f: F) where for<'a> &'a D: Tr, F: Fn(<&D as Tr>::It), { let d = &D; while let Some(i) = d.foo() { f(i); } } fn main() { run(|_| {}); } "} {"_id":"q-en-rust-000c2406674e4044c9e19b75240b92706e8f483e4aababcee5ec6195563cf982","text":" // edition:2021 #![allow(incomplete_features)] #![feature(async_fn_in_trait)] pub trait Foo { async fn woopsie_async(&self) -> String { 42 //~^ ERROR mismatched types } } fn main() {} "} {"_id":"q-en-rust-0017db5581aa46c8b0c0fe879064730dd5bb916643b06adec2109a7c8186c92b","text":"E0782: include_str!(\"./error_codes/E0782.md\"), E0783: include_str!(\"./error_codes/E0783.md\"), E0784: include_str!(\"./error_codes/E0784.md\"), E0785: include_str!(\"./error_codes/E0785.md\"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard"} {"_id":"q-en-rust-002de4c29bca3dc5fd86c5cd6db3720205251d29db448b71d7ae63c489fdb85d","text":" error: `..` can only be used once per slice pattern --> $DIR/issue-69103-extra-binding-subslice.rs:6:22 | LL | let [a @ .., b @ ..] = &mut [1, 2]; | -- ^^ can only be used once per slice pattern | | | previously used here error: `..` can only be used once per slice pattern --> $DIR/issue-69103-extra-binding-subslice.rs:10:18 | LL | let [.., c @ ..] = [1, 2]; | -- ^^ can only be used once per slice pattern | | | previously used here error: `..` patterns are not allowed here --> $DIR/issue-69103-extra-binding-subslice.rs:15:18 | LL | let (.., d @ ..) = (1, 2); | ^^ | = note: only allowed in tuple, tuple struct, and slice patterns error: aborting due to 3 previous errors "} {"_id":"q-en-rust-0045e7b39278999745b8bc4588c2868c6d059de079599ab20f233f68fe74573b","text":"type_param_def.space, type_param_def.index, ty.repr(cx.tcx)); check_typaram_bounds(cx, e.span, ty, type_param_def) } // Check the vtable. let vtable_map = cx.tcx.vtable_map.borrow(); let vtable_res = match vtable_map.find(&method_call) { None => return, Some(vtable_res) => vtable_res, }; check_type_parameter_bounds_in_vtable_result(cx, e.span, vtable_res); } fn check_type_parameter_bounds_in_vtable_result("} {"_id":"q-en-rust-005fa47b99f2fe2aeded13570c931e8ff853fd2064001c664b5d4bc07bf8575d","text":"} }).peekable(); if fields.peek().is_some() { write!(w, \"

Fields

\")?;
write!(w, \"

Fields

\")?;
for (field, ty) in fields { write!(w, \"{name}: {ty} \","} {"_id":"q-en-rust-009305f76969313311a135309eb681ea35c0b3de903c6c7f8a218038f07476ec","text":" error[E0590]: `break` or `continue` with no label in the condition of a `while` loop --> $DIR/issue-50802.rs:15:21 | LL | break while continue { //~ ERROR E0590 | ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop error: aborting due to previous error For more information about this error, try `rustc --explain E0590`. "} {"_id":"q-en-rust-0101595a15b45d15c4ac268147c85c447b7a886b27496c38e1fb31ffad0c74f8","text":"used_trait_imports.extend(imports.iter()); } for id in tcx.hir().items() { if matches!(tcx.def_kind(id.def_id), DefKind::Use) { if tcx.visibility(id.def_id).is_public() { continue; } let item = tcx.hir().item(id); if item.span.is_dummy() { continue; } if let hir::ItemKind::Use(path, _) = item.kind { check_import(tcx, &mut used_trait_imports, item.item_id(), path.span); } for &id in tcx.maybe_unused_trait_imports(()) { debug_assert_eq!(tcx.def_kind(id), DefKind::Use); if tcx.visibility(id).is_public() { continue; } if used_trait_imports.contains(&id) { continue; } let item = tcx.hir().expect_item(id); if item.span.is_dummy() { continue; } let hir::ItemKind::Use(path, _) = item.kind else { unreachable!() }; tcx.struct_span_lint_hir(lint::builtin::UNUSED_IMPORTS, item.hir_id(), path.span, |lint| { let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(path.span) { format!(\"unused import: `{}`\", snippet) } else { \"unused import\".to_owned() }; lint.build(&msg).emit(); }); } unused_crates_lint(tcx); } fn check_import<'tcx>( tcx: TyCtxt<'tcx>, used_trait_imports: &mut FxHashSet, item_id: hir::ItemId, span: Span, ) { if !tcx.maybe_unused_trait_import(item_id.def_id) { return; } if used_trait_imports.contains(&item_id.def_id) { return; } tcx.struct_span_lint_hir(lint::builtin::UNUSED_IMPORTS, item_id.hir_id(), span, |lint| { let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(span) { format!(\"unused import: `{}`\", snippet) } else { \"unused import\".to_owned() }; lint.build(&msg).emit(); }); } fn unused_crates_lint(tcx: TyCtxt<'_>) { let lint = lint::builtin::UNUSED_EXTERN_CRATES;"} {"_id":"q-en-rust-010a7dda86dbc7d94aff92302d4fd01089656e021988847660ef6a4996612f9f","text":"None } /// This function checks if the specified expression is a built-in range literal. /// (See: `LoweringContext::lower_expr()` in `src/librustc/hir/lowering.rs`). fn is_range_literal(&self, expr: &hir::Expr) -> bool { use hir::{Path, QPath, ExprKind, TyKind}; // We support `::std::ops::Range` and `::core::ops::Range` prefixes let is_range_path = |path: &Path| { let mut segs = path.segments.iter() .map(|seg| seg.ident.as_str()); if let (Some(root), Some(std_core), Some(ops), Some(range), None) = (segs.next(), segs.next(), segs.next(), segs.next(), segs.next()) { // \"{{root}}\" is the equivalent of `::` prefix in Path root == \"{{root}}\" && (std_core == \"std\" || std_core == \"core\") && ops == \"ops\" && range.starts_with(\"Range\") } else { false } }; let span_is_range_literal = |span: &Span| { // Check whether a span corresponding to a range expression // is a range literal, rather than an explicit struct or `new()` call. let source_map = self.tcx.sess.source_map(); let end_point = source_map.end_point(*span); if let Ok(end_string) = source_map.span_to_snippet(end_point) { !(end_string.ends_with(\"}\") || end_string.ends_with(\")\")) } else { false } }; match expr.node { // All built-in range literals but `..=` and `..` desugar to Structs ExprKind::Struct(QPath::Resolved(None, ref path), _, _) | // `..` desugars to its struct path ExprKind::Path(QPath::Resolved(None, ref path)) => { return is_range_path(&path) && span_is_range_literal(&expr.span); } // `..=` desugars into `::std::ops::RangeInclusive::new(...)` ExprKind::Call(ref func, _) => { if let ExprKind::Path(QPath::TypeRelative(ref ty, ref segment)) = func.node { if let TyKind::Path(QPath::Resolved(None, ref path)) = ty.node { let call_to_new = segment.ident.as_str() == \"new\"; return is_range_path(&path) && span_is_range_literal(&expr.span) && call_to_new; } } } _ => {} } false } pub fn check_for_cast(&self, err: &mut DiagnosticBuilder<'tcx>, expr: &hir::Expr,"} {"_id":"q-en-rust-0121ceaad090ad80a68516f216651f671f2e6297b8e8884fea78ab5467748b03","text":"ENV TARGETS=$TARGETS,wasm32-wasi ENV TARGETS=$TARGETS,sparcv9-sun-solaris ENV TARGETS=$TARGETS,x86_64-pc-solaris ENV TARGETS=$TARGETS,x86_64-sun-solaris ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32 ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda"} {"_id":"q-en-rust-01423a2d7f2e4e799d7e8db660b55b2ed6b246469ee5da6f72b09a66a58ee8ff","text":") => { // For shortcircuiting operators, mark the RHS as a terminating // scope since it only executes conditionally. terminating(r.hir_id.local_id); } // `Let` expressions (in a let-chain) shouldn't be terminating, as their temporaries // should live beyond the immediate expression if !matches!(r.kind, hir::ExprKind::Let(_)) { terminating(r.hir_id.local_id); } } hir::ExprKind::If(_, ref then, Some(ref otherwise)) => { terminating(then.hir_id.local_id); terminating(otherwise.hir_id.local_id);"} {"_id":"q-en-rust-0156cc5cd56ac885cbbc7d4368094ba5cc684ca78f2805bb8ad1cdfc096e2187","text":"} pub enum timezone {} pub type sighandler_t = size_t; } pub mod bsd44 {"} {"_id":"q-en-rust-016685476a62622310251de040610fe56e03ebee04acd84b80532bca1cbca340","text":"BorrowViolation(euv::OverloadedOperator) | BorrowViolation(euv::AddrOf) | BorrowViolation(euv::AutoRef) | BorrowViolation(euv::RefBinding) => { BorrowViolation(euv::RefBinding) | BorrowViolation(euv::MatchDiscriminant) => { \"cannot borrow data mutably\" }"} {"_id":"q-en-rust-0170da7efd658b9ef237beaee07021577ba0a8ea25fef80cfb198efe31151c0a","text":"fn suggest_moving_args_from_assoc_fn_to_trait_for_method_call( &self, err: &mut Diagnostic, trait_: DefId, trait_def_id: DefId, expr: &'tcx hir::Expr<'tcx>, msg: String, num_assoc_fn_excess_args: usize, num_trait_generics_except_self: usize, ) { if let hir::ExprKind::MethodCall(_, receiver, args, ..) = expr.kind { assert_eq!(args.len(), 0); if num_assoc_fn_excess_args == num_trait_generics_except_self { if let Some(gen_args) = self.gen_args.span_ext() && let Ok(gen_args) = self.tcx.sess.source_map().span_to_snippet(gen_args) && let Ok(receiver) = self.tcx.sess.source_map().span_to_snippet(receiver.span) { let sugg = format!(\"{}::{}::{}({})\", self.tcx.item_name(trait_), gen_args, self.tcx.item_name(self.def_id), receiver); err.span_suggestion(expr.span, msg, sugg, Applicability::MaybeIncorrect); } } let sm = self.tcx.sess.source_map(); let hir::ExprKind::MethodCall(_, rcvr, args, _) = expr.kind else { return; }; if num_assoc_fn_excess_args != num_trait_generics_except_self { return; } let Some(gen_args) = self.gen_args.span_ext() else { return; }; let Ok(generics) = sm.span_to_snippet(gen_args) else { return; }; let Ok(rcvr) = sm.span_to_snippet( rcvr.span.find_ancestor_inside(expr.span).unwrap_or(rcvr.span) ) else { return; }; let Ok(rest) = (match args { [] => Ok(String::new()), [arg] => sm.span_to_snippet( arg.span.find_ancestor_inside(expr.span).unwrap_or(arg.span), ), [first, .., last] => { let first_span = first.span.find_ancestor_inside(expr.span).unwrap_or(first.span); let last_span = last.span.find_ancestor_inside(expr.span).unwrap_or(last.span); sm.span_to_snippet(first_span.to(last_span)) } }) else { return; }; let comma = if args.len() > 0 { \", \" } else { \"\" }; let trait_path = self.tcx.def_path_str(trait_def_id); let method_name = self.tcx.item_name(self.def_id); err.span_suggestion( expr.span, msg, format!(\"{trait_path}::{generics}::{method_name}({rcvr}{comma}{rest})\"), Applicability::MaybeIncorrect, ); } /// Suggests to remove redundant argument(s):"} {"_id":"q-en-rust-0171650462e4b54ca96211827890dfed43585caa9d06c87d9b38aa84282859f0","text":" // aux-build: issue_67893.rs // edition:2018 // dont-check-compiler-stderr // FIXME(#71222): Add above flag because of the difference of stderrs on some env. extern crate issue_67893; fn g(_: impl Send) {} fn main() { g(issue_67893::run()) //~^ ERROR: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely } "} {"_id":"q-en-rust-01b442ed645a89986e9a6a8e6db711505701346f192c00a865c0904d3daf4ccd","text":" error[E0594]: cannot assign to `*foo` which is behind a `&` reference --> $DIR/issue-51515.rs:17:5 | LL | let foo = &16; | --- help: consider changing this to be a mutable reference: `&mut 16` ... LL | *foo = 32; | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*bar` which is behind a `&` reference --> $DIR/issue-51515.rs:22:5 | LL | let bar = foo; | --- help: consider changing this to be a mutable reference: `&mut i32` ... LL | *bar = 64; | ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0594`. "} {"_id":"q-en-rust-01e4d028e684deab1c37ae62b5a65e1cf4fe041c325ce62c61a43561689b7c30","text":"use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc::infer::InferCtxt; use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::adjustment::{Adjust, Adjustment}; use rustc::ty::fold::{TypeFoldable, TypeFolder}; use rustc::util::nodemap::DefIdSet; use syntax::ast;"} {"_id":"q-en-rust-0209c8f3cc58a2d0888214e4ae0bde83a3e96692e08d3f46c98ec5d3ad080f88","text":"if is_fn { ty_to_fn .entry(ty.clone()) .and_modify(|e| *e = (Some(poly_trait.clone()), e.1.clone())) .or_insert(((Some(poly_trait.clone())), None)); .and_modify(|e| *e = (poly_trait.clone(), e.1.clone())) .or_insert(((poly_trait.clone()), None)); ty_to_bounds.entry(ty.clone()).or_default(); } else {"} {"_id":"q-en-rust-020a68f1aa5049a8f9b4e2d6b14bed831f8e2a6b20685f8ab5067efcfda9ad28","text":"//! found or is otherwise invalid. use crate::check::FnCtxt; use crate::errors; use rustc_ast::ast::Mutability; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::{"} {"_id":"q-en-rust-020af17902d05fd7d367825e21f5cbbb4758c60af749209bd84a1d60e1697bfa","text":" //! Build a dist manifest, hash and sign everything. //! This gets called by `promote-release` //! (https://github.com/rust-lang/rust-central-station/tree/master/promote-release) //! via `x.py dist hash-and-sign`; the cmdline arguments are set up //! by rustbuild (in `src/bootstrap/dist.rs`). use toml; use serde::Serialize; use std::collections::BTreeMap; use std::env; use std::fs; use std::io::{self, Read, Write, BufRead, BufReader}; use std::io::{self, Read, Write}; use std::path::{PathBuf, Path}; use std::process::{Command, Stdio}; use std::collections::HashMap; static HOSTS: &[&str] = &[ \"aarch64-unknown-linux-gnu\","} {"_id":"q-en-rust-021f77a423b75699f5dfb5380a21055183077b5c6a75d21c17cae75f56c922a9","text":"| ^^^ type aliases cannot be used as traits | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias --> $DIR/two_files_data.rs:5:1 | LL | type Bar = dyn Foo; | ^^^^^^^^^^^^^^^^^^^ LL | trait Bar = dyn Foo; | error: aborting due to previous error"} {"_id":"q-en-rust-02374f0d4708135d578419c352d2a5357dfb969d242efd00eaf4e874b841123a","text":"use std::rc::Rc; use syntax::ast; use syntax::codemap::Span; use util::common::ErrorReported; use util::ppaux::{UserString, Repr, ty_to_string}; pub fn check_object_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,"} {"_id":"q-en-rust-02487e83bc8755547f39575e30543e56ae320dc6c30eda69627ead3d11734f83","text":"} } if digit_count == 0 { None } else { Some(result) } if digit_count == 0 { None } else if !allow_zero_prefix && has_leading_zero && digit_count > 1 { None } else { Some(result) } }) }"} {"_id":"q-en-rust-024fa20b175c6b3e4f8ef0de7a3976df60c39cc33c90c2bc9c14ef2051cdb484","text":"lpFilePart: *mut LPWSTR, ) -> DWORD; pub fn GetFileAttributesW(lpFileName: LPCWSTR) -> DWORD; pub fn MultiByteToWideChar( CodePage: UINT, dwFlags: DWORD, lpMultiByteStr: LPCCH, cbMultiByte: c_int, lpWideCharStr: LPWSTR, cchWideChar: c_int, ) -> c_int; pub fn WideCharToMultiByte( CodePage: UINT, dwFlags: DWORD, lpWideCharStr: LPCWCH, cchWideChar: c_int, lpMultiByteStr: LPSTR, cbMultiByte: c_int, lpDefaultChar: LPCCH, lpUsedDefaultChar: LPBOOL, ) -> c_int; } #[link(name = \"ws2_32\")]"} {"_id":"q-en-rust-025ea29ae28d0f61d51fa340f73be015bb70250f64c6cc9918cdc5fcf715779f","text":"let mut result = match self.source_map().span_to_unmapped_path(callsite) { FileName::Real(path) => path, FileName::DocTest(path, _) => path, other => panic!(\"cannot resolve relative path in non-file source `{}`\", other), other => return Err(self.struct_span_err( span, &format!(\"cannot resolve relative path in non-file source `{}`\", other), )), }; result.pop(); result.push(path); result Ok(result) } else { path Ok(path) } } }"} {"_id":"q-en-rust-026e2505d5dd76a72cbb3865496e6698a295043b3cdd23f62c0e5188cbd5e0c9","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { extern crate libc; //~ ERROR use of unstable use libc::*; //~ ERROR unresolved import } "} {"_id":"q-en-rust-0276d8dac2b7f88c5249cd99a3cf76c2ca4f922345994bf841c2225de8821661","text":" // check-pass // edition:2021 #![deny(opaque_hidden_inferred_bound)] trait Repository /* : ?Sized */ { async fn new() -> Self; } struct MyRepository {} impl Repository for MyRepository { async fn new() -> Self { todo!() } } fn main() {} "} {"_id":"q-en-rust-027bb79db20f1f6ddcc01c9e216457c78c38a0e75215fc5e4a5299d8d084b59c","text":" const fn f() -> usize { //~^ ERROR mismatched types const FIELD: usize = loop { 0 //~^ ERROR mismatched types }; } fn main() {} "} {"_id":"q-en-rust-028bfc317c36ba40abc737e2b51e52642dd34194b4f9320fe508749df35982d2","text":") -> Option> { let param_env = ParamEnv::empty(); let repr_type = self.repr.discr_type(); let bit_size = layout::Integer::from_attr(tcx, repr_type).size().bits(); let substs = Substs::identity_for_item(tcx.global_tcx(), expr_did); let instance = ty::Instance::new(expr_did, substs); let cid = GlobalId {"} {"_id":"q-en-rust-02fb1cd8ecae2bbe15a514b21616029b61347d7d221957f82d815b741e6897f9","text":" // Test that existential types are allowed to contain late-bound regions. // compile-pass // edition:2018 #![feature(async_await, existential_type)] use std::future::Future; pub existential type Func: Sized; // Late bound region should be allowed to escape the function, since it's bound // in the type. fn null_function_ptr() -> Func { None:: fn(&'a ())> } async fn async_nop(_: &u8) {} pub existential type ServeFut: Future; // Late bound regions occur in the generator witness type here. fn serve() -> ServeFut { async move { let x = 5; async_nop(&x).await } } fn main() {} "} {"_id":"q-en-rust-0306ed9a5bf03b13233720211661c7e793c0c70982404382779829c357ea2721","text":"let is_anonymous = item.ident.name == kw::Empty; let repr = if is_anonymous { tcx.adt_def(tcx.local_parent(def_id)).repr() let parent = tcx.local_parent(def_id); if let Node::Item(item) = tcx.hir_node_by_def_id(parent) && item.is_struct_or_union() { tcx.adt_def(parent).repr() } else { tcx.dcx().span_delayed_bug(item.span, \"anonymous field inside non struct/union\"); ty::ReprOptions::default() } } else { tcx.repr_options_of_def(def_id.to_def_id()) };"} {"_id":"q-en-rust-03422920e7bb6eda1ae94b33bd6bcede3ed1e297eff08cd7afe3c500c4fdc09f","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Trait<'a> { type A; type B; } fn foo<'a, T: Trait<'a>>(value: T::A) { let new: T::B = unsafe { std::mem::transmute(value) }; //~^ ERROR: cannot transmute to or from a type that contains type parameters in its interior [E0139] } fn main() { } "} {"_id":"q-en-rust-03691cbb739e01aaa529e796485fdab0a918922d3d0c34e95b4ae5bac7fde485","text":"declare_clippy_lint! { /// **What it does:** This lint warns when you use `print!()` with a format /// string that ends in a newline. /// string that /// ends in a newline. /// /// **Why is this bad?** You should use `println!()` instead, which appends the /// newline."} {"_id":"q-en-rust-0376a56141d464e279991d74f19c046f9e34688a6a2c569642dd742c6abf76b2","text":"// Only inline impl if the implementing type is // reachable in rustdoc generated documentation if !did.is_local() { if let Some(did) = for_.def_id(&cx.cache) { if !cx.cache.effective_visibilities.is_directly_public(tcx, did) { return; } if !tcx.features().rustc_private && !cx.render_options.force_unstable_if_unmarked { if let Some(stab) = tcx.lookup_stability(did) && stab.is_unstable() && stab.feature == sym::rustc_private { return; } } } if !did.is_local() && let Some(did) = for_.def_id(&cx.cache) && !is_directly_public(cx, did) { return; } let document_hidden = cx.render_options.document_hidden;"} {"_id":"q-en-rust-038317c06ec33f8d8023c6978fb4f0fd7c0e1ee6252b6a4aff5049eaf68ba6e3","text":"Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | UniqueBorrow | AddressOf | Projection, ) => ty::Covariant, PlaceContext::NonUse(AscribeUserTy) => ty::Covariant, PlaceContext::NonUse(AscribeUserTy(variance)) => variance, } }"} {"_id":"q-en-rust-03a9cd51a6229b4ada8eca395fe1007a26d01c74198f33006f8b6ef7a4ebd4fd","text":"#![doc(html_root_url = \"https://doc.rust-lang.org/nightly/nightly-rustc/\")] #![feature(lazy_cell)] #![feature(decl_macro)] #![feature(ice_to_disk)] #![feature(panic_update_hook)] #![feature(let_chains)] #![recursion_limit = \"256\"] #![allow(rustc::potential_query_instability)]"} {"_id":"q-en-rust-04318686e73abf45f991f67bdb42f8b9948c9a827564146ab0cb3c89cbae925a","text":"pub has_pub_restricted: bool, pub access_levels: AccessLevels, pub extern_crate_map: FxHashMap, pub maybe_unused_trait_imports: FxHashSet, pub maybe_unused_trait_imports: FxIndexSet, pub maybe_unused_extern_crates: Vec<(LocalDefId, Span)>, pub reexport_map: FxHashMap>, pub glob_map: FxHashMap>,"} {"_id":"q-en-rust-0440909e1e72289fc26744bc626f8d668347b04c26a55fdc64b796bff058369c","text":" // aux-build:issue-61963.rs // aux-build:issue-61963-1.rs #![deny(bare_trait_objects)] #[macro_use] extern crate issue_61963; #[macro_use] extern crate issue_61963_1; // This test checks that the bare trait object lint does not trigger on macro attributes that // generate code which would trigger the lint. pub struct Baz; pub trait Bar { } pub struct Qux(T); #[dom_struct] pub struct Foo { qux: Qux>, bar: Box, //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects] } fn main() {} "} {"_id":"q-en-rust-04778e0273cbb25a45f6e5c3f6694dafa24fbcf967b0c6218198a6ae38fb172c","text":"} } // PGO does not work reliably with panic=unwind on Windows. Let's make it // an error to combine the two for now. It always runs into an assertions // if LLVM is built with assertions, but without assertions it sometimes // does not crash and will probably generate a corrupted binary. // We should only display this error if we're actually going to run PGO. // If we're just supposed to print out some data, don't show the error (#61002). if sess.opts.cg.profile_generate.enabled() && sess.target.is_like_msvc && sess.panic_strategy() == PanicStrategy::Unwind && sess.opts.prints.iter().all(|&p| p == PrintRequest::NativeStaticLibs) { sess.err( \"Profile-guided optimization does not yet work in conjunction with `-Cpanic=unwind` on Windows when targeting MSVC. See issue #61002 for more information.\", ); } // Sanitizers can only be used on platforms that we know have working sanitizer codegen. let supported_sanitizers = sess.target.options.supported_sanitizers; let unsupported_sanitizers = sess.opts.debugging_opts.sanitizer - supported_sanitizers;"} {"_id":"q-en-rust-049ee7c06d8c91af91704040d1f986d31347066cf5391b437caabef5b67b5e8a","text":"LL | | LL | | |x| println!(\"doubling {}\", x); LL | | Some(x * 2) | | ----------- | | ----------- this tail expression is of type `std::option::Option<_>` LL | | LL | | }); | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`"} {"_id":"q-en-rust-04a945ffcf7259709651152864ab26090d5beb101fa2f87d08c19f0c4bd78f8e","text":"query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap> { desc { |tcx| \"collecting upvars mentioned in `{}`\", tcx.def_path_str(def_id) } } query maybe_unused_trait_import(def_id: LocalDefId) -> bool { desc { |tcx| \"maybe_unused_trait_import for `{}`\", tcx.def_path_str(def_id.to_def_id()) } query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet { desc { \"fetching potentially unused trait imports\" } } query maybe_unused_extern_crates(_: ()) -> &'tcx [(LocalDefId, Span)] { desc { \"looking up all possibly unused extern crates\" }"} {"_id":"q-en-rust-04b7b125047e8759f35793882d12acc676e524565f6d35a1edc942067005b887","text":"let out = p.wait_with_output().unwrap(); assert!(!out.status.success()); let s = str::from_utf8(&out.stderr).unwrap(); assert!(s.contains(\"stack backtrace\") && s.contains(\"foo::h\"), assert!(s.contains(\"stack backtrace\") && s.contains(\" - foo\"), \"bad output: {}\", s); // Make sure the stack trace is *not* printed"} {"_id":"q-en-rust-04c64768fdcf1fcca84851d142ce4d9e3e5dbe654f007d4310a7cd4918f64ae5","text":"if let ObligationCauseCode::WhereClause(_, span) | ObligationCauseCode::WhereClauseInExpr(_, span, ..) = &trace.cause.code().peel_derives() && !span.is_dummy() { let span = *span; self.report_concrete_failure(generic_param_scope, placeholder_origin, sub, sup) .with_span_note(span, \"the lifetime requirement is introduced here\") let mut err = self.report_concrete_failure( generic_param_scope, placeholder_origin, sub, sup, ); if !span.is_dummy() { err = err.with_span_note(span, \"the lifetime requirement is introduced here\"); } err } else { unreachable!( \"control flow ensures we have a `BindingObligation` or `WhereClauseInExpr` here...\""} {"_id":"q-en-rust-04d1d0806d1d16cab2ab4dc68892cd14bbd90c50a6003bebae0b0beb46cb850d","text":" mod machine { pub struct A { pub b: B, } pub struct B {} impl B { pub fn f(&self) {} } } pub struct Context { pub a: machine::A, } pub fn ctx() -> Context { todo!(); } "} {"_id":"q-en-rust-04d6001b7ed9f321de40799c1baadfc3a915d3e5f9abe9198feee0b08527ec28","text":"ns: Namespace, binding: &'a NameBinding<'a>) -> Result<(), &'a NameBinding<'a>> { let ident = ident.unhygienize(); self.update_resolution(module, ident, ns, |this, resolution| { if let Some(old_binding) = resolution.binding { if binding.is_glob_import() {"} {"_id":"q-en-rust-0505ef8f5972c0a1615236150a282f0909650b6e45a4ed5d41b83b0342f5823e","text":"let cloned_shared = Rc::clone(&cx.shared); let cache = &cloned_shared.cache; let mut extern_crates = FxHashSet::default(); if !t.is_object_safe(cx.tcx()) { write_small_section_header( w, \"object-safety\", \"Object Safety\", &format!( \"
This trait is not object safe.
\", base = crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL ), ); }
if let Some(implementors) = cache.implementors.get(&it.item_id.expect_def_id()) { // The DefId is for the first Type found with that name. The bool is // if any Types with the same name but different DefId have been found."} {"_id":"q-en-rust-05504e3dc179da753bc32429f249ec4f814a9b7ffedee5ad8e9078f3ce08c0d0","text":"node_to_hir_id: IndexVec::new(), macro_def_scopes: FxHashMap(), expansions: FxHashMap(), keys_created: FxHashSet(), next_disambiguator: FxHashMap(), } }"} {"_id":"q-en-rust-059292bf71e7c2c37efe9deef8479e255e6b9845def86772fb4eafb5203e3c7a","text":"v.iter().any(|&x| x == 0) } #[inline(always)] fn from_utf8_with_replacement(mut v: &[u8]) -> ~str { // FIXME (#9516): Don't decode utf-8 manually here once we have a good way to do it in str // This is a truly horrifically bad implementation, done as a functionality stopgap until // we have a proper utf-8 decoder. I don't really want to write one here. static REPLACEMENT_CHAR: char = 'uFFFD'; let mut s = str::with_capacity(v.len()); while !v.is_empty() { let w = str::utf8_char_width(v[0]); if w == 0u { s.push_char(REPLACEMENT_CHAR); v = v.slice_from(1); } else if v.len() < w || !str::is_utf8(v.slice_to(w)) { s.push_char(REPLACEMENT_CHAR); v = v.slice_from(1); } else { s.push_str(unsafe { ::cast::transmute(v.slice_to(w)) }); v = v.slice_from(w); } } s } #[cfg(test)] mod tests { use prelude::*;"} {"_id":"q-en-rust-0596629883c6e6d03fc031390ed75132ca7a1ad6f9344fc827dada40dc906f75","text":".map(|(item, renamed)| clean_maybe_renamed_foreign_item(cx, item, *renamed)), ); items.extend(self.mods.iter().map(|x| x.clean(cx))); items.extend( self.items .iter() .flat_map(|(item, renamed)| clean_maybe_renamed_item(cx, item, *renamed)), ); // Split up imports from all other items. // // This covers the case where somebody does an import which should pull in an item, // but there's already an item with the same namespace and same name. Rust gives // priority to the not-imported one, so we should, too. let mut inserted = FxHashSet::default(); items.extend(self.items.iter().flat_map(|(item, renamed)| { // First, lower everything other than imports. if matches!(item.kind, hir::ItemKind::Use(..)) { return Vec::new(); } let v = clean_maybe_renamed_item(cx, item, *renamed); for item in &v { if let Some(name) = item.name { inserted.insert((item.type_(), name)); } } v })); items.extend(self.items.iter().flat_map(|(item, renamed)| { // Now we actually lower the imports, skipping everything else. if !matches!(item.kind, hir::ItemKind::Use(..)) { return Vec::new(); } let mut v = clean_maybe_renamed_item(cx, item, *renamed); v.drain_filter(|item| { if let Some(name) = item.name { // If an item with the same type and name already exists, // it takes priority over the inlined stuff. !inserted.insert((item.type_(), name)) } else { false } }); v })); // determine if we should display the inner contents or // the outer `mod` item for the source code."} {"_id":"q-en-rust-05b89db50f5a519eb3fa9a4096583c2da9026144b5069fcc8c4e45e7ee096631","text":"cargo.arg(\"--release\"); } if mode != Mode::Libstd && // FIXME(#45320) mode != Mode::Libtest && // FIXME(#45511) self.config.rust_codegen_units.is_none() && if self.config.rust_codegen_units.is_none() && self.build.is_rust_llvm(compiler.host) { cargo.env(\"RUSTC_THINLTO\", \"1\");"} {"_id":"q-en-rust-05e11ec0954551b622fbeee9b634c6275d8a2d59ac8853f8aac915f7d0fc9886","text":"} impl Attribute { /// Returns `true` if the attribute's path matches the argument. If it matches, then the /// attribute is marked as used. /// /// To check the attribute name without marking it used, use the `path` field directly. pub fn check_name(&self, name: &str) -> bool { let matches = self.path == name; if matches {"} {"_id":"q-en-rust-0615114be5d2a4b1e068ccae956222570a7b1c14a6fa621181e624a3a93cd4cf","text":"#![feature(const_fn)] #![feature(const_fn_union)] #![feature(const_generics)] #![cfg_attr(not(bootstrap), feature(const_ptr_offset_from))] #![cfg_attr(not(bootstrap), feature(const_type_name))] #![feature(custom_inner_attributes)] #![feature(decl_macro)] #![feature(doc_cfg)]"} {"_id":"q-en-rust-0624b60cba69892b0c0495e8e1c9e34ab79b14c07a166bc0188f0f74bf2f07d8","text":"fn visit_foreign_item(&mut self, fi: &'tcx hir::ForeignItem) { if self.should_warn_about_foreign_item(fi) { self.warn_dead_code(fi.id, fi.span, fi.name, fi.node.descriptive_variant()); self.warn_dead_code(fi.id, fi.span, fi.name, fi.node.descriptive_variant(), \"used\"); } intravisit::walk_foreign_item(self, fi); } fn visit_struct_field(&mut self, field: &'tcx hir::StructField) { if self.should_warn_about_field(&field) { self.warn_dead_code(field.id, field.span, field.name, \"field\"); self.warn_dead_code(field.id, field.span, field.name, \"field\", \"used\"); } intravisit::walk_struct_field(self, field); }"} {"_id":"q-en-rust-062fb5111e8ce5585c237619d90aad3785fec0d490349fcf6d01a7c21cbd72ce","text":"} _ => { let tt = TokenTree::Token(self.token.take()); let is_joint = self.bump(); let mut is_joint = self.bump(); if !self.token.is_op() { is_joint = NonJoint; } Ok((tt, is_joint)) } }"} {"_id":"q-en-rust-064cb92de7efe8859fb5035f9bc2fa0b464e76363a03d3a3f96b7012eaee46a1","text":"version = \"0.6.0\" dependencies = [ \"clippy_lints\", \"env_logger 0.6.2\", \"env_logger 0.7.0\", \"failure\", \"futures\", \"log\", \"rand 0.6.1\", \"rand 0.7.0\", \"rls-data\", \"rls-ipc\", \"serde\","} {"_id":"q-en-rust-06acc0079b7fb7643ba9febdd1c5e81d7b200f0187da700d3be6d2520c4e7042","text":"use std::env; use std::ffi::OsString; use std::fmt::Write as _; use std::fs; use std::fs::{self, File}; use std::io::{self, IsTerminal, Read, Write}; use std::panic::{self, catch_unwind}; use std::panic::{self, catch_unwind, PanicInfo}; use std::path::PathBuf; use std::process::{self, Command, Stdio}; use std::str;"} {"_id":"q-en-rust-0765fa8c30e10c65e7558509253bfccc0766bf737f6d9125adf1c04379b5c12b","text":"/// } /// ``` #[stable(feature = \"io_error_inner\", since = \"1.3.0\")] #[inline] pub fn get_mut(&mut self) -> Option<&mut (dyn error::Error + Send + Sync + 'static)> { match self.repr { Repr::Os(..) => None,"} {"_id":"q-en-rust-077a14bdb96c38330901dbaf11a6c307152ed97d6f108f73dda05329dea690a3","text":"} } /// 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) { let toolstates: Option> = File::open(self.input.join(\"toolstates-linux.json\")).ok() .and_then(|f| serde_json::from_reader(&f).ok()); let toolstates = toolstates.unwrap_or_else(|| { println!(\"WARNING: `toolstates-linux.json` missing/malformed; assuming all tools failed\"); HashMap::default() // Use empty map if anything went wrong. }); // Mark some tools as missing based on toolstate. if toolstates.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`. fn digest_and_sign(&mut self) { for file in t!(self.input.read_dir()).map(|e| t!(e).path()) {"} {"_id":"q-en-rust-0781237e70abe4f915ba8863a241155d5f0989b5fae8683778a3fe0931c54bcd","text":" //@ edition: 2021 #![feature(must_not_suspend, allocator_api)] #![deny(must_not_suspend)] use std::alloc::*; use std::ptr::NonNull; #[must_not_suspend] struct MyAllocatorWhichMustNotSuspend; unsafe impl Allocator for MyAllocatorWhichMustNotSuspend { fn allocate(&self, l: Layout) -> Result, AllocError> { Global.allocate(l) } unsafe fn deallocate(&self, p: NonNull, l: Layout) { Global.deallocate(p, l) } } async fn suspend() {} async fn foo() { let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); //~^ ERROR allocator `MyAllocatorWhichMustNotSuspend` held across a suspend point, but should not be suspend().await; drop(x); } fn main() {} "} {"_id":"q-en-rust-078f3efcf1bc6f3c2f04c809d865f5fdd83b72cef11a62132e8524418e5f3925","text":"self.with_context(LabeledBlock, |v| v.visit_block(&b)); } hir::ExprBreak(label, ref opt_expr) => { opt_expr.as_ref().map(|e| self.visit_expr(e)); if self.require_label_in_labeled_block(e.span, &label, \"break\") { // If we emitted an error about an unlabeled break in a labeled // block, we don't need any further checking for this break any more"} {"_id":"q-en-rust-07dc4d41da5e9893b4da20461609b0d56f954171a5277c294e1396c6ef352b78","text":" // error-pattern: aborting due to 6 previous errors fn i(n{...,f # "} {"_id":"q-en-rust-07fab6a97850f94513361b895fb993e91d2f714ee35eed75f69215cafbef0278","text":" error[E0425]: cannot find function `missing` in this scope --> $DIR/error-body.rs:5:5 | LL | missing(); | ^^^^^^^ not found in this scope error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. "} {"_id":"q-en-rust-080ad75c526d9e8464188361ed2f495a3024da27fb3e2f8c70636502b0637fe1","text":"let msg = \"asm template must be a string literal\"; let template_sp = template_expr.span; let template_is_mac_call = matches!(template_expr.kind, ast::ExprKind::MacCall(_)); let (template_str, template_style, template_span) = { let ExpandResult::Ready(mac) = expr_to_spanned_string(ecx, template_expr, msg) else { return ExpandResult::Retry(());"} {"_id":"q-en-rust-08397d50ba5f576c8d4a89de62fd440c43b75b074c0d4e0230f1d5f85568c977","text":"return } // Package save-analysis from stage1 if not doing a full bootstrap, as the // stage2 artifacts is simply copied from stage1 in that case. let compiler = if build.force_use_stage1(compiler, target) { Compiler::new(1, compiler.host) } else { compiler.clone() }; let name = format!(\"rust-analysis-{}\", package_vers(build)); let image = tmpdir(build).join(format!(\"{}-{}-image\", name, target)); let src = build.stage_out(compiler, Mode::Libstd).join(target).join(\"release\").join(\"deps\"); let src = build.stage_out(&compiler, Mode::Libstd).join(target).join(\"release\").join(\"deps\"); let image_src = src.join(\"save-analysis\"); let dst = image.join(\"lib/rustlib\").join(target).join(\"analysis\");"} {"_id":"q-en-rust-083bf167cf591079cbc271a482354c67235865023b2c0f8ab3ec704be1dbe720","text":"version = \"0.11.0\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"backtrace 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)\", \"backtrace 0.3.29 (registry+https://github.com/rust-lang/crates.io-index)\", ] [[package]]"} {"_id":"q-en-rust-087d406d62d6bd7140f6aeaf0ab01673cb0527fe2065e7ef826a31ae59569cbc","text":"[[package]] name = \"rand\" version = \"0.4.6\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)\", \"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)\", \"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)\", ] [[package]] name = \"rand\" version = \"0.6.1\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = ["} {"_id":"q-en-rust-08c526bfe1021f72717ddd00139c19a01b3f83d2562772f42f15631bc88da929","text":"return value else: return \"'\" + value + \"'\" elif isinstance(value, dict): return \"{\" + \", \".join(map(lambda a: \"{} = {}\".format(to_toml(a[0]), to_toml(a[1])), value.items())) + \"}\" else: raise RuntimeError('no toml')"} {"_id":"q-en-rust-08c6d5830c8f622f87f1fcc397ae55a9b761b4f03e2f39d7a4653d41225c318a","text":"adjusted_ty, index_ty); // First, try built-in indexing. match (adjusted_ty.builtin_index(), &index_ty.sty) { (Some(ty), &ty::TyUint(ast::UintTy::Usize)) | (Some(ty), &ty::TyInfer(ty::IntVar(_))) => { debug!(\"try_index_step: success, using built-in indexing\"); let adjustments = autoderef.adjust_steps(lvalue_pref); self.apply_adjustments(base_expr, adjustments); return Some((self.tcx.types.usize, ty)); } _ => {} } for &unsize in &[false, true] { let mut self_ty = adjusted_ty; if unsize {"} {"_id":"q-en-rust-0907a819d5b5b932331d275422b7652cf44e913ef819d550218f99ee5469ebfe","text":"} fn parse_borrowed_pointee(&mut self) -> PResult<'a, TyKind> { let opt_lifetime = if self.check_lifetime() { Some(self.expect_lifetime()) } else { None }; let and_span = self.prev_token.span; let mut opt_lifetime = if self.check_lifetime() { Some(self.expect_lifetime()) } else { None }; let mutbl = self.parse_mutability(); if self.token.is_lifetime() && mutbl == Mutability::Mut && opt_lifetime.is_none() { // A lifetime is invalid here: it would be part of a bare trait bound, which requires // it to be followed by a plus, but we disallow plus in the pointee type. // So we can handle this case as an error here, and suggest `'a mut`. // If there *is* a plus next though, handling the error later provides better suggestions // (like adding parentheses) if !self.look_ahead(1, |t| t.is_like_plus()) { let lifetime_span = self.token.span; let span = and_span.to(lifetime_span); let mut err = self.struct_span_err(span, \"lifetime must precede `mut`\"); if let Ok(lifetime_src) = self.span_to_snippet(lifetime_span) { err.span_suggestion( span, \"place the lifetime before `mut`\", format!(\"&{} mut\", lifetime_src), Applicability::MaybeIncorrect, ); } err.emit(); opt_lifetime = Some(self.expect_lifetime()); } } let ty = self.parse_ty_no_plus()?; Ok(TyKind::Rptr(opt_lifetime, MutTy { ty, mutbl })) }"} {"_id":"q-en-rust-091465819d50f49a135edc714329c86d718d36f1bd14fd5574ea5e5a5cd59c80","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // #39872, #39553 #![feature(conservative_impl_trait)] fn will_ice(something: &u32) -> impl Iterator { //~^ ERROR the trait bound `(): std::iter::Iterator` is not satisfied [E0277] } fn main() {} "} {"_id":"q-en-rust-091bd2f6db1be4329ae9cbb098be49b8d0bf3457d068eda330ef69c0f6f28a4d","text":"# (to avoid spending a lot of time cloning llvm) if [ \"$EXTERNAL_LLVM\" = \"\" ]; then RUST_CONFIGURE_ARGS=\"$RUST_CONFIGURE_ARGS --set build.optimized-compiler-builtins\" # Likewise, only demand we test all LLVM components if we know we built LLVM with them export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1 elif [ \"$DEPLOY$DEPLOY_ALT\" = \"1\" ]; then echo \"error: dist builds should always use optimized compiler-rt!\" >&2 exit 1"} {"_id":"q-en-rust-092600fc6f5fddd99db1cc81a104b101cb94a10d82e6aa581d69d6d9edbf441c","text":"[true] `{$param_name}` *[false] `fn` parameter } has {$lifetime_kind -> [named] lifetime `{$lifetime}` *[anon] an anonymous lifetime `'_` } but calling `{assoc_item}` introduces an implicit `'static` lifetime requirement [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` } but calling `{$assoc_item}` introduces an implicit `'static` lifetime requirement .label1 = {$has_lifetime -> [named] lifetime `{$lifetime}` *[anon] an anonymous lifetime `'_` [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` } .label2 = ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the {$has_impl_path -> [named] `impl` of `{$impl_path}` *[anon] inherent `impl` [true] `impl` of `{$impl_path}` *[false] inherent `impl` } infer_but_needs_to_satisfy = {$has_param_name -> [true] `{$param_name}` *[false] `fn` parameter } has {$has_lifetime -> [named] lifetime `{$lifetime}` *[anon] an anonymous lifetime `'_` [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` } but it needs to satisfy a `'static` lifetime requirement .influencer = this data with {$has_lifetime -> [named] lifetime `{$lifetime}` *[anon] an anonymous lifetime `'_` [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` }... .require = {$spans_empty -> *[true] ...is used and required to live as long as `'static` here"} {"_id":"q-en-rust-093841aec65603bf55a91a1a8ac41b41dcd134fdd770cfdd543b83860cc338d3","text":"} } const LOADERS: &Vec<&'static u8> = &Vec::new(); pub fn break_code() -> Option<&'static u8> { for loader in &*LOADERS { //~ ERROR cannot move out of a shared reference return Some(loader); } None } fn main() {}"} {"_id":"q-en-rust-093eedd162ee5fabd981670a0e9cc5258ca7f63790303d923af732852ed50946","text":"ArenaSet(vec![], &Z) } unsafe { use std::sync::{Once, ONCE_INIT}; use std::sync::Once; fn require_sync(_: &T) { } unsafe fn __stability() -> &'static ArenaSet> { use std::mem::transmute; static mut DATA: *const ArenaSet> = 0 as *const ArenaSet>; static mut ONCE: Once = ONCE_INIT; static mut ONCE: Once = Once::new(); ONCE.call_once(|| { DATA = transmute ::>>, *const ArenaSet>>"} {"_id":"q-en-rust-09695ce653b585dfdf5a7dad776fc273a16991f3365db78a1664b059b40a64b5","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that we don't ICE due to encountering unsubstituted type // parameters when untupling FnOnce parameters during translation of // an unboxing shim. #![feature(unboxed_closures)] fn main() { let _: Box> = box move |&mut:| {}; } "} {"_id":"q-en-rust-09a06697fbc4231a846de2c13d7cd29f61f5b8aad2cfd53cf82133cd865a5f3e","text":" error: `#[panic_handler]` function required, but not found error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:28:16 | LL | take_range(0..1); | ^^^^ | | | expected reference, found struct `core::ops::Range` | help: consider borrowing here: `&(0..1)` | = note: expected type `&_` found type `core::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:33:16 | LL | take_range(1..); | ^^^ | | | expected reference, found struct `core::ops::RangeFrom` | help: consider borrowing here: `&(1..)` | = note: expected type `&_` found type `core::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:38:16 | LL | take_range(..); | ^^ | | | expected reference, found struct `core::ops::RangeFull` | help: consider borrowing here: `&(..)` | = note: expected type `&_` found type `core::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:43:16 | LL | take_range(0..=1); | ^^^^^ | | | expected reference, found struct `core::ops::RangeInclusive` | help: consider borrowing here: `&(0..=1)` | = note: expected type `&_` found type `core::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:48:16 | LL | take_range(..5); | ^^^ | | | expected reference, found struct `core::ops::RangeTo` | help: consider borrowing here: `&(..5)` | = note: expected type `&_` found type `core::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:53:16 | LL | take_range(..=42); | ^^^^^ | | | expected reference, found struct `core::ops::RangeToInclusive` | help: consider borrowing here: `&(..=42)` | = note: expected type `&_` found type `core::ops::RangeToInclusive<{integer}>` error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-09a49dd53445ec08d475fd66091d3e0171b903d15e6a928bd220dd113f79f998","text":"/// # Examples /// /// ```no_run /// # #![feature(bufreader_buffer)] /// use std::io::BufWriter; /// use std::net::TcpStream; ///"} {"_id":"q-en-rust-09b2d11ff31be2bcaa15fd59b396afbf7e06c12a242bc34ed970e09824eabba0","text":"exact_paths: DefIdMap>, modules: Vec>, is_importable_from_parent: bool, inside_body: bool, } impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {"} {"_id":"q-en-rust-09c468ee097af6484eb74f0285d64f671ec6328274bb0253f927da9288fa6a4a","text":" // Copyright 2012 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // xfail-test fn function() -> &mut [int] { let mut x: &'static mut [int] = &[1,2,3]; x[0] = 12345; x //~ ERROR bad } fn main() { let x = function(); error!(\"%?\", x); } "} {"_id":"q-en-rust-09c53182b7266b440ece70652e9fe24ced85919fe8fa43270aed3180ef6bb6b7","text":"crate mod sidebar { /// File script to handle sidebar. crate static SOURCE_SCRIPT: &str = include_str!(\"static/source-script.js\"); /// Top Level sidebar items script which will load a sidebar without items. crate static ITEMS: &str = include_str!(\"static/sidebar-items.js\"); }"} {"_id":"q-en-rust-0a57ba1d10f0ca9155f1ade2bd26cf6c8fda813dbcac26b54f111be4cbac32ee","text":" // run-pass // compile-flags: --edition 2018 #![feature(try_blocks)] fn main() { match try { false } { _ => {} } //~ ERROR expected expression, found reserved keyword `try` match try { } { Err(()) => (), Ok(()) => (), } }"} {"_id":"q-en-rust-0a67a51a1604f9d6961997930abf0e1110377934e322c3fe1f0ee026f7b0b269","text":"GenericArgs::Parenthesized { inputs, output } => (inputs, output), }; let output = output.as_ref().cloned().map(Box::new); if old_output.is_some() && old_output != output { panic!(\"Output mismatch for {:?} {:?} {:?}\", ty, old_output, data.1); panic!(\"Output mismatch for {:?} {:?} {:?}\", ty, old_output, output); } let new_params = GenericArgs::Parenthesized { inputs: old_input, output };"} {"_id":"q-en-rust-0a6b4bc2cd5befec0820b67418aa0d9e993588b8bd86097b74f427359bc74eb6","text":" error[E0597]: borrowed value does not live long enough --> $DIR/issue-52049.rs:16:10 | LL | foo(&unpromotable(5u32)); | ^^^^^^^^^^^^^^^^^^ temporary value does not live long enough LL | } | - temporary value only lives until here | = 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`. "} {"_id":"q-en-rust-0a879985da1f6513a75e1b27672012468ee0dda4c115afc5cd9778180230fa15","text":"}; use crate::traits::{Obligation, PredicateObligations}; use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation}; use rustc_middle::ty::relate::{ relate_args_invariantly, relate_args_with_variances, Relate, RelateResult, TypeRelation, }; use rustc_middle::ty::TyVar; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_span::Span;"} {"_id":"q-en-rust-0ac7c305aa238a34a8fc5c3339a6a8c6346f7394507e02190bf08a46ed434e5a","text":" // edition:2021 #![feature(rustc_attrs)] // Test that we can't move out of struct that impls `Drop`. use std::rc::Rc; // Test that we restrict precision when moving not-`Copy` types, if any of the parent paths // implement `Drop`. This is to ensure that we don't move out of a type that implements Drop. pub fn test1() { struct Foo(Rc); impl Drop for Foo { fn drop(self: &mut Foo) {} } let f = Foo(Rc::new(1)); let x = #[rustc_capture_analysis] move || { //~^ ERROR: attributes on expressions are experimental //~| NOTE: see issue #15701 //~| ERROR: First Pass analysis includes: //~| ERROR: Min Capture analysis includes: println!(\"{:?}\", f.0); //~^ NOTE: Capturing f[(0, 0)] -> ImmBorrow //~| NOTE: Min Capture f[] -> ByValue }; x(); } // Test that we don't restrict precision when moving `Copy` types(i.e. when copying), // even if any of the parent paths implement `Drop`. fn test2() { struct Character { hp: u32, name: String, } impl Drop for Character { fn drop(&mut self) {} } let character = Character { hp: 100, name: format!(\"A\") }; let c = #[rustc_capture_analysis] move || { //~^ ERROR: attributes on expressions are experimental //~| NOTE: see issue #15701 //~| ERROR: First Pass analysis includes: //~| ERROR: Min Capture analysis includes: println!(\"{}\", character.hp) //~^ NOTE: Capturing character[(0, 0)] -> ImmBorrow //~| NOTE: Min Capture character[(0, 0)] -> ByValue }; c(); println!(\"{}\", character.name); } fn main() {} "} {"_id":"q-en-rust-0ad5eeea7dcd8a526da01faa2450157331942b276da72e5b9406bd3e9010da58","text":" // check-pass // Minimized case from #62767. mod m { pub enum Same { Same,"} {"_id":"q-en-rust-0ae3cf940eed91e0d0d0c5203da5116132ab14d770d30ee277eba03f2aa69e02","text":"/// \"self-confirming\" import resolutions during import validation. unusable_binding: Option<&'a NameBinding<'a>>, // Spans for local variables found during pattern resolution. // Used for suggestions during error reporting. pat_span_map: NodeMap, /// Resolutions for nodes that have a single resolution. partial_res_map: NodeMap, /// Resolutions for import nodes, which have multiple resolutions in different namespaces."} {"_id":"q-en-rust-0ae9b987c6ead91333d36653976a71c8a3fc9c3b905fc83f9a20110316c5a1ed","text":"Some(e) => e, }; let mut bytes = Vec::new(); let mut err = false; for expr in exprs.iter() { match expr.node {"} {"_id":"q-en-rust-0af8a55d375784e0dccdc08f4cc746fe4638b252fa298683317a0a1fba3b696f","text":" error[E0599]: no method named `some_function` found for struct `SmallVec` in the current scope --> $DIR/hash-tyvid-regression-3.rs:17:19 | LL | node.keys.some_function(); | ^^^^^^^^^^^^^ method not found in `SmallVec<{ D * 2 }>` ... LL | struct SmallVec {} | ------------------------------- method `some_function` not found for this error: aborting due to previous error For more information about this error, try `rustc --explain E0599`. "} {"_id":"q-en-rust-0b124ffdfd14fdd479733156f37704b83c4439b5d787891d344f9e382cf66566","text":" warning: unnecessary parentheses around function argument --> $DIR/try-block-unused-delims.rs:10:13 | LL | consume((try {})); | ^^^^^^^^ help: remove these parentheses | note: the lint level is defined here --> $DIR/try-block-unused-delims.rs:5:9 | LL | #![warn(unused_parens, unused_braces)] | ^^^^^^^^^^^^^ warning: unnecessary braces around function argument --> $DIR/try-block-unused-delims.rs:13:13 | LL | consume({ try {} }); | ^^^^^^^^^^ help: remove these braces | note: the lint level is defined here --> $DIR/try-block-unused-delims.rs:5:24 | LL | #![warn(unused_parens, unused_braces)] | ^^^^^^^^^^^^^ warning: unnecessary parentheses around `match` scrutinee expression --> $DIR/try-block-unused-delims.rs:16:11 | LL | match (try {}) { | ^^^^^^^^ help: remove these parentheses warning: unnecessary parentheses around `let` scrutinee expression --> $DIR/try-block-unused-delims.rs:21:22 | LL | if let Err(()) = (try {}) {} | ^^^^^^^^ help: remove these parentheses warning: unnecessary parentheses around `match` scrutinee expression --> $DIR/try-block-unused-delims.rs:24:11 | LL | match (try {}) { | ^^^^^^^^ help: remove these parentheses warning: 5 warnings emitted "} {"_id":"q-en-rust-0b12e8a0d5147776d82fc88e8a27269ed861e56da23423747d75251805b2e8bc","text":"} // Visit everything except for private impl items. 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); } } if item_level.is_some() { self.reach(item.def_id, item_level).generics().predicates().ty().trait_ref();"} {"_id":"q-en-rust-0b12f2e045aec4116645066fe2376d9be2db657f13320869e8e6c2329f31a7a7","text":"pub(crate) no_emit_shared: bool, /// If `true`, HTML source code pages won't be generated. pub(crate) html_no_source: bool, /// Whether `-Zforce-unstable-if-unmarked` unstable option is set pub(crate) force_unstable_if_unmarked: bool, } #[derive(Copy, Clone, Debug, PartialEq, Eq)]"} {"_id":"q-en-rust-0b24c7d3674feecb6fc764eba08f99f7b7926edee270140f7a19d8b606506c66","text":".collect::>() .into(), id: fld.new_id(id), ident: ident, ident: fld.fold_ident(ident), bounds: fld.fold_bounds(bounds), default: default.map(|x| fld.fold_ty(x)), span: span"} {"_id":"q-en-rust-0b97621eaf84db45156579ddbd2abced90b73a9a50d43bc1a5913a014d6fcf82","text":"match tcx.const_eval(param_env.and(cid)) { Ok(&ty::Const { val: ConstVal::Value(Value::ByVal(PrimVal::Bytes(b))), .. ty, }) => { trace!(\"discriminants: {} ({:?})\", b, repr_type); let ty = repr_type.to_ty(tcx); if repr_type.is_signed() { let val = b as i128; // sign extend to i128 let amt = 128 - bit_size; let val = (val << amt) >> amt; Some(Discr { val: val as u128, ty, }) } else { Some(Discr { val: b, ty, }) } Some(Discr { val: b, ty, }) }, Ok(&ty::Const { val: ConstVal::Value(other),"} {"_id":"q-en-rust-0c60e8026ddb3ee674f7ef3215f1834dddc429734d480118eedc35c1689dd396","text":"\"once_cell\", \"opener\", \"pretty_assertions\", \"semver\", \"serde\", \"serde_derive\", \"serde_json\","} {"_id":"q-en-rust-0cd44c1d5ea03b892da9374ca764bba3ef3193f34a7ba503fb8aadacde3cd691","text":"use abi::Abi; use ast::{self, Ident, Generics, Expr, BlockCheckMode, UnOp, PatKind}; use attr; use syntax_pos::{Span, DUMMY_SP, Pos}; use syntax_pos::{Span, DUMMY_SP}; use codemap::{dummy_spanned, respan, Spanned}; use ext::base::ExtCtxt; use ptr::P;"} {"_id":"q-en-rust-0cf9911a94939ae63db7fb8ee64f46fe4be4a993da914d80b8bce8f5014ba25f","text":" // run-pass #![feature(backtrace)] #[derive(Clone, Copy)] struct Foo { array: [u64; 10240], } impl Foo { const fn new() -> Self { Self { array: [0x1122_3344_5566_7788; 10240] } } } static BAR: [Foo; 10240] = [Foo::new(); 10240]; fn main() { let bt = std::backtrace::Backtrace::force_capture(); println!(\"Hello, world! {:?}\", bt); println!(\"{:x}\", BAR[0].array[0]); } "} {"_id":"q-en-rust-0cffb512b092c8f87a6a8c837ecba6362a56465baa85ca60dd8f4eaaca2bd514","text":"impl LintPass for TypeLimits { fn get_lints(&self) -> LintArray { lint_array!(UNSIGNED_NEGATION, UNUSED_COMPARISONS, OVERFLOWING_LITERALS) lint_array!(UNSIGNED_NEGATION, UNUSED_COMPARISONS, OVERFLOWING_LITERALS, EXCEEDING_BITSHIFTS) } fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {"} {"_id":"q-en-rust-0d1e5604b0a135ab2153e948f4f058e03fb8669756d026394e44e75005d0275a","text":"trait Foo { type Bar<'a>: Deref::Bar>; //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied //~| ERROR associated type bindings are not allowed here //~| HELP add missing }"} {"_id":"q-en-rust-0d40d92a20d6d58b6f2ace737ae19a16f1bc90e0a3f411bda0f7e250d4edc612","text":"fn main() { let _: &dyn const Trait; //~ ERROR const trait bounds are not allowed in trait object types let _: &dyn ~const Trait; //~ ERROR `~const` is not allowed here } // Regression test for issue #119525. trait NonConst {} const fn handle(_: &dyn const NonConst) {} //~^ ERROR const trait bounds are not allowed in trait object types const fn take(_: &dyn ~const NonConst) {} //~^ ERROR `~const` is not allowed here "} {"_id":"q-en-rust-0d593c183b59a3680335d739bbcae553f14c42bfbdd565da8982685411755be1","text":"\"checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)\" = \"63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646\" \"checksum pest_meta 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)\" = \"f5a3492a4ed208ffc247adcdcc7ba2a95be3104f58877d0d02f0df39bf3efb5e\" \"checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)\" = \"9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f\" \"checksum phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\" = \"7d37a244c75a9748e049225155f56dbcb98fe71b192fd25fd23cb914b5ad62f2\" \"checksum phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\" = \"4e4048fe7dd7a06b8127ecd6d3803149126e9b33c7558879846da3a63f734f2b\" \"checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\" = \"05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998\" \"checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\" = \"c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930\" \"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\" = \"b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18\" \"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\" = \"b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e\" \"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\" = \"09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662\" \"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\" = \"234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0\" \"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)\" = \"676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c\" \"checksum polonius-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)\" = \"8b24942fee141ea45628484a453762bb7e515099c3ec05fbeb76b7bf57b1aeed\" \"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)\" = \"925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c\""} {"_id":"q-en-rust-0d5d2ab69064cdbd025c4c5d2270adaaa5ef7a590f858771f82c16b6062bd972","text":"ty::TraitContainer(_) => self.defaultness.has_value() }; if provided { let constness = if cx.tcx.is_const_fn(self.def_id) { let constness = if cx.tcx.is_min_const_fn(self.def_id) { hir::Constness::Const } else { hir::Constness::NotConst"} {"_id":"q-en-rust-0d7a72d871636e51fc349786c4f6f28aec22acd790411e7806823ce95560878a","text":" // check-pass #![feature(const_fn)] #![feature(type_alias_impl_trait)] type Foo = impl Fn() -> usize; const fn bar() -> Foo { || 0usize } const BAZR: Foo = bar(); fn main() {} "} {"_id":"q-en-rust-0d7b1e199626ef25e771cbb39a590020bc0b5b836b6fc5abc85e8e179df80898","text":"error: repetition matches empty token tree --> $DIR/issue-5067.rs:4:8 --> $DIR/issue-5067.rs:9:8 | LL | ( $()* ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:6:8 --> $DIR/issue-5067.rs:11:8 | LL | ( $()+ ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:12:9 --> $DIR/issue-5067.rs:13:8 | LL | ( $()? ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:18:9 | LL | ( [$()*] ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:14:9 --> $DIR/issue-5067.rs:20:9 | LL | ( [$()+] ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:20:8 --> $DIR/issue-5067.rs:22:9 | LL | ( [$()?] ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:27:8 | LL | ( $($()* $(),* $(a)* $(a),* )* ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:22:8 --> $DIR/issue-5067.rs:29:8 | LL | ( $($()* $(),* $(a)* $(a),* )+ ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:28:12 --> $DIR/issue-5067.rs:31:8 | LL | ( $($()* $(),* $(a)* $(a),* )? ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:33:8 | LL | ( $($()? $(),* $(a)? $(a),* )* ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:35:8 | LL | ( $($()? $(),* $(a)? $(a),* )+ ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:37:8 | LL | ( $($()? $(),* $(a)? $(a),* )? ) => {}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:47:12 | LL | ( $(a $()+)* ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:30:12 --> $DIR/issue-5067.rs:49:12 | LL | ( $(a $()*)+ ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:38:18 --> $DIR/issue-5067.rs:51:12 | LL | ( $(a $()+)? ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:53:12 | LL | ( $(a $()?)+ ) => {}; | ^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:60:18 | LL | (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]); | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-5067.rs:50:8 --> $DIR/issue-5067.rs:71:8 | LL | ( $()* ) => {} LL | ( $()* ) => {}; | ^^ error: aborting due to 10 previous errors error: aborting due to 18 previous errors "} {"_id":"q-en-rust-0dd6be5c9f16f74bf1a6c6da6236f0916245febcfb33ea12cbb9815fab824779","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let a = if true { 0 } else if false { //~^ ERROR if may be missing an else clause: expected `()`, found `` 1 }; } "} {"_id":"q-en-rust-0df8e653ed055651c4371f93c833b2f4b415d168fcda8bb9b24acc150cdd97c7","text":"let incr_comp_session_dir: PathBuf = sess.incr_comp_session_dir().clone(); if sess.has_errors() { if sess.has_errors_or_delayed_span_bugs() { // If there have been any errors during compilation, we don't want to // publish this session directory. Rather, we'll just delete it."} {"_id":"q-en-rust-0e1daf20db5ddd1a8c1aa8a12381bc407ee8e15553d1c66df5c588b161c946c1","text":"if (InstrProfileOutput) { Options.InstrProfileOutput = InstrProfileOutput; } // cargo run tests in multhreading mode by default // so use atomics for coverage counters Options.Atomic = true; MPM.addPass(InstrProfiling(Options, false)); } );"} {"_id":"q-en-rust-0e2bdf9c568619ebcb3a86f6c4045d0b8d2dae6e66ef092c18fcf513c16b534c","text":" Subproject commit 99faef833f890fe89f1a959d89b951954118828b Subproject commit e9da96eb452aa65e79e2342be700544afe509440 "} {"_id":"q-en-rust-0e48566a2fa392bb252a8e69feeafeca0c9a0a472aa82ac40c7df95a8d723477","text":"ty::TypeScheme { ty: ty, generics: ty_generics } } hir::ItemTy(ref t, ref generics) => { let ty_generics = ty_generics_for_type_or_impl(ccx, generics); let ty_generics = ty_generics_for_type(ccx, generics); let ty = ccx.icx(generics).to_ty(&ExplicitRscope, &t); ty::TypeScheme { ty: ty, generics: ty_generics } } hir::ItemEnum(ref ei, ref generics) => { let ty_generics = ty_generics_for_type_or_impl(ccx, generics); let ty_generics = ty_generics_for_type(ccx, generics); let substs = mk_item_substs(ccx, &ty_generics); let def = convert_enum_def(tcx, it, ei); let t = tcx.mk_enum(def, tcx.mk_substs(substs)); ty::TypeScheme { ty: t, generics: ty_generics } } hir::ItemStruct(ref si, ref generics) => { let ty_generics = ty_generics_for_type_or_impl(ccx, generics); let ty_generics = ty_generics_for_type(ccx, generics); let substs = mk_item_substs(ccx, &ty_generics); let def = convert_struct_def(tcx, it, si); let t = tcx.mk_struct(def, tcx.mk_substs(substs));"} {"_id":"q-en-rust-0e4bd91afd4a6feaead9d227b5c1e23565d2a531269b389d1df5760b5c406da8","text":" error: character literal may only contain one codepoint --> $DIR/issue-64732.rs:3:17 | LL | let _foo = b'hello0'; | ^^^^^^^^^ help: if you meant to write a byte string literal, use double quotes | LL | let _foo = b\"hello0\"; | ^^^^^^^^^ error: character literal may only contain one codepoint --> $DIR/issue-64732.rs:6:16 | LL | let _bar = 'hello'; | ^^^^^^^ help: if you meant to write a `str` literal, use double quotes | LL | let _bar = \"hello\"; | ^^^^^^^ error: aborting due to 2 previous errors "} {"_id":"q-en-rust-0e7c6b875fc10908f9bf27ef496355624e3d5f4b0b97583f2294c5e7fe2d41a6","text":"// aux-build:sepcomp_lib.rs // compile-flags: -C lto // no-prefer-dynamic // ignore-android FIXME #18800 extern crate sepcomp_lib; use sepcomp_lib::a::one;"} {"_id":"q-en-rust-0e887d838764a1972c15e9173615c3375730d6031076ad8963f24d7847ba97c4","text":"path.push(id); } let path = ast::Path { span: mk_sp(lo, self.span.hi), span: mk_sp(path_lo, self.span.hi), global: false, segments: path.move_iter().map(|identifier| { ast::PathSegment {"} {"_id":"q-en-rust-0e8b07fa7b6c296f02159fe3a2fbc61462cf3148b27994f9e3d5f88f217063d0","text":"--lldb-python $$(CFG_LLDB_PYTHON) --gdb-version=\"$(CFG_GDB_VERSION)\" --lldb-version=\"$(CFG_LLDB_VERSION)\" --llvm-version=\"$$(LLVM_VERSION_$(3))\" --android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) --adb-path=$(CFG_ADB) --adb-test-dir=$(CFG_ADB_TEST_DIR) "} {"_id":"q-en-rust-0ed6abe0721448ed2dca502272afd31dd2418eed9c89abfe3ca51ea3f96e43d3","text":" // Regression test of #43913. // run-rustfix #![feature(trait_alias)] #![allow(bare_trait_objects, dead_code)] type Strings = Iterator; struct Struct(S); //~^ ERROR: expected trait, found type alias `Strings` fn main() {} "} {"_id":"q-en-rust-0ed7d23ee46fa0e21547952b20d93dd9d21b16aeb052ef2ca248bcb7f46671ae","text":"buffer: String, } impl core::fmt::Write for Buffer { #[inline] fn write_str(&mut self, s: &str) -> fmt::Result { self.buffer.write_str(s) } #[inline] fn write_char(&mut self, c: char) -> fmt::Result { self.buffer.write_char(c) } #[inline] fn write_fmt(self: &mut Self, args: fmt::Arguments<'_>) -> fmt::Result { self.buffer.write_fmt(args) } } impl Buffer { crate fn empty_from(v: &Buffer) -> Buffer { Buffer { for_html: v.for_html, buffer: String::new() }"} {"_id":"q-en-rust-0eef5edc5c916fe9203164412354a33b1f201b27df6a21274fd64a76e911ec8e","text":" // compile-pass // edition:2018 // // Tests that we properly handle StorageDead/StorageLives for temporaries // created in async loop bodies. #![feature(async_await)] async fn bar() -> Option<()> { Some(()) } async fn listen() { while let Some(_) = bar().await { String::new(); } } fn main() { listen(); } "} {"_id":"q-en-rust-0ef8414ffc3284932838bf1044ad28f01855be326d1d6d22e53341117bf59bdd","text":"enum Enum1 { Variant1(isize), Variant2 //~ ERROR: variant is never used Variant2 //~ ERROR: variant is never constructed } enum Enum2 { Variant3(bool), #[allow(dead_code)] Variant4(isize), Variant5 { _x: isize }, //~ ERROR: variant is never used: `Variant5` Variant6(isize), //~ ERROR: variant is never used: `Variant6` Variant5 { _x: isize }, //~ ERROR: variant is never constructed: `Variant5` Variant6(isize), //~ ERROR: variant is never constructed: `Variant6` _Variant7, }"} {"_id":"q-en-rust-0f1969ccea2bc6f79dacef9394c7cb524472df090530ce94f76790a27d768461","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that type IDs correctly account for higher-rank lifetimes // Also acts as a regression test for an ICE (issue #19791) #![feature(unboxed_closures)] use std::intrinsics::TypeId; fn main() { // Bare fns { let a = TypeId::of::(); let b = TypeId::of:: fn(&'static int, &'a int)>(); let c = TypeId::of:: fn(&'a int, &'b int)>(); let d = TypeId::of:: fn(&'b int, &'a int)>(); assert!(a != b); assert!(a != c); assert!(a != d); assert!(b != c); assert!(b != d); assert_eq!(c, d); // Make sure De Bruijn indices are handled correctly let e = TypeId::of:: fn(fn(&'a int) -> &'a int)>(); let f = TypeId::of:: fn(&'a int) -> &'a int)>(); assert!(e != f); } // Stack closures { let a = TypeId::of::<|&'static int, &'static int|>(); let b = TypeId::of:: |&'static int, &'a int|>(); let c = TypeId::of:: |&'a int, &'b int|>(); let d = TypeId::of:: |&'b int, &'a int|>(); assert!(a != b); assert!(a != c); assert!(a != d); assert!(b != c); assert!(b != d); assert_eq!(c, d); // Make sure De Bruijn indices are handled correctly let e = TypeId::of:: |(|&'a int| -> &'a int)|>(); let f = TypeId::of::<|for<'a> |&'a int| -> &'a int|>(); assert!(e != f); } // Boxed unboxed closures { let a = TypeId::of::>(); let b = TypeId::of:: Fn(&'static int, &'a int)>>(); let c = TypeId::of:: Fn(&'a int, &'b int)>>(); let d = TypeId::of:: Fn(&'b int, &'a int)>>(); assert!(a != b); assert!(a != c); assert!(a != d); assert!(b != c); assert!(b != d); assert_eq!(c, d); // Make sure De Bruijn indices are handled correctly let e = TypeId::of:: Fn(Box &'a int>)>>(); let f = TypeId::of:: Fn(&'a int) -> &'a int>)>>(); assert!(e != f); } // Raw unboxed closures // Note that every unboxed closure has its own anonymous type, // so no two IDs should equal each other, even when compatible { let a = id(|&: _: &int, _: &int| {}); let b = id(|&: _: &int, _: &int| {}); assert!(a != b); } fn id(_: T) -> TypeId { TypeId::of::() } } "} {"_id":"q-en-rust-0f27be22c7aac66b89414555878e434ae5d9333abb5cd26af29cda6fcb3299e2","text":"if !non_trait.is_empty() { let render_mode = match what { AssocItemRender::All => { write!(w, \"

Methods

\")?;
write!(w, \"

Methods

\")?;
RenderMode::Normal } AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => { write!(w, \"

Methods from {}<Target = {}>

\", trait_, type_)?;
write!(w, \"

Methods from {}<Target = {}>

\", trait_, type_)?;
RenderMode::ForDeref { mut_: deref_mut_ } } };"} {"_id":"q-en-rust-0f27cf39a30889d5b3ba5a26739aa2078914e5fe187fb03943c45adeaca5442a","text":" Subproject commit 7799d03de85bcc1a7437f65d4f7adfbb267d2acb Subproject commit 79d659e5699fbf7db5b4819e9a442fb3f550472a "} {"_id":"q-en-rust-0f27d73249838a969672d1064e2e10663cf117e600ad8880468f3c67f4aa6289","text":"_ => {} } } // Similar to operators, indexing is always assumed to be overloaded // Here, correct cases where an indexing expression can be simplified // to use builtin indexing because the index type is known to be // usize-ish fn fix_index_builtin_expr(&mut self, e: &hir::Expr) { if let hir::ExprIndex(ref base, ref index) = e.node { let mut tables = self.fcx.tables.borrow_mut(); match tables.expr_ty_adjusted(&base).sty { // All valid indexing looks like this ty::TyRef(_, ty::TypeAndMut { ty: ref base_ty, .. }) => { let index_ty = tables.expr_ty_adjusted(&index); let index_ty = self.fcx.resolve_type_vars_if_possible(&index_ty); if base_ty.builtin_index().is_some() && index_ty == self.fcx.tcx.types.usize { // Remove the method call record tables.type_dependent_defs_mut().remove(e.hir_id); tables.node_substs_mut().remove(e.hir_id); tables.adjustments_mut().get_mut(base.hir_id).map(|a| { // Discard the need for a mutable borrow match a.pop() { // Extra adjustment made when indexing causes a drop // of size information - we need to get rid of it // Since this is \"after\" the other adjustment to be // discarded, we do an extra `pop()` Some(Adjustment { kind: Adjust::Unsize, .. }) => { // So the borrow discard actually happens here a.pop(); }, _ => {} } }); } }, // Might encounter non-valid indexes at this point, so there // has to be a fall-through _ => {}, } } } } /////////////////////////////////////////////////////////////////////////// // Impl of Visitor for Resolver //"} {"_id":"q-en-rust-0f7ef2f19c87a1e13193f68f8dda09f9b59027131fe892c8096285ff2d9f6578","text":"Err(err) } /// Try to recover from an unbraced const argument whose first token [could begin a type][ty]. /// /// [ty]: token::Token::can_begin_type pub(crate) fn recover_unbraced_const_arg_that_can_begin_ty( &mut self, mut snapshot: SnapshotParser<'a>, ) -> Option> { match snapshot.parse_expr_res(Restrictions::CONST_EXPR, None) { // Since we don't know the exact reason why we failed to parse the type or the // expression, employ a simple heuristic to weed out some pathological cases. Ok(expr) if let token::Comma | token::Gt = snapshot.token.kind => { self.restore_snapshot(snapshot); Some(expr) } Ok(_) => None, Err(err) => { err.cancel(); None } } } /// Creates a dummy const argument, and reports that the expression must be enclosed in braces pub fn dummy_const_arg_needs_braces( &self,"} {"_id":"q-en-rust-0f89bea2e0ede6909132881d4cb2efcddef67ede39002fa633a75604972c32e4","text":"referent_ty: Ty<'tcx>) -> Rc> { // We can only make objects from sized types. let sized_obligation = traits::obligation_for_builtin_bound( fcx.tcx(), traits::ObligationCause::new(span, traits::ObjectSized), referent_ty, ty::BoundSized); match sized_obligation { Ok(sized_obligation) => { fcx.register_obligation(sized_obligation); } Err(ErrorReported) => { } } // This is just for better error reporting. Kinda goofy. The object type stuff // needs some refactoring so there is a more convenient type to pass around. let object_trait_ty ="} {"_id":"q-en-rust-0f9fe503e1cf0dee4cdf1742fda38749a96419dc5649ab1ff2c5b87c7ff06e3f","text":"))), ) } ty::CoroutineClosure(did, _args) => { // FIXME(async_closures): Recover the proper error signature let inputs = tcx .closure_user_provided_sig(did.expect_local()) .value .skip_binder() .inputs(); let err = Ty::new_error(tcx, guar); (inputs.iter().map(|_| err).collect(), err, None) ty::CoroutineClosure(did, args) => { let args = args.as_coroutine_closure(); let sig = tcx.liberate_late_bound_regions( def_id.to_def_id(), args.coroutine_closure_sig(), ); let self_ty = match args.kind() { ty::ClosureKind::Fn => { Ty::new_imm_ref(tcx, tcx.lifetimes.re_erased, closure_ty) } ty::ClosureKind::FnMut => { Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, closure_ty) } ty::ClosureKind::FnOnce => closure_ty, }; ( [self_ty].into_iter().chain(sig.tupled_inputs_ty.tuple_fields()).collect(), sig.to_coroutine( tcx, args.parent_args(), args.kind_ty(), tcx.coroutine_for_closure(*did), Ty::new_error(tcx, guar), ), None, ) } ty::Error(_) => (vec![closure_ty, closure_ty], closure_ty, None), kind => {"} {"_id":"q-en-rust-0fc234de1be245d65e370a388bc3268963e313a82160710b34c4928846428086","text":"pub is_cleanup: bool, } #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)] pub struct Terminator<'tcx> { pub source_info: SourceInfo, pub kind: TerminatorKind<'tcx>, } #[derive(Clone, RustcEncodable, RustcDecodable, HashStable, PartialEq)] pub enum TerminatorKind<'tcx> { /// Block should have one successor in the graph; we jump there. Goto { target: BasicBlock }, /// Operand evaluates to an integer; jump depending on its value /// to one of the targets, and otherwise fallback to `otherwise`. SwitchInt { /// The discriminant value being tested. discr: Operand<'tcx>, /// The type of value being tested. /// This is always the same as the type of `discr`. /// FIXME: remove this redundant information. Currently, it is relied on by pretty-printing. switch_ty: Ty<'tcx>, /// Possible values. The locations to branch to in each case /// are found in the corresponding indices from the `targets` vector. values: Cow<'tcx, [u128]>, /// Possible branch sites. The last element of this vector is used /// for the otherwise branch, so targets.len() == values.len() + 1 /// should hold. // // This invariant is quite non-obvious and also could be improved. // One way to make this invariant is to have something like this instead: // // branches: Vec<(ConstInt, BasicBlock)>, // otherwise: Option // exhaustive if None // // However we’ve decided to keep this as-is until we figure a case // where some other approach seems to be strictly better than other. targets: Vec, }, /// Indicates that the landing pad is finished and unwinding should /// continue. Emitted by `build::scope::diverge_cleanup`. Resume, /// Indicates that the landing pad is finished and that the process /// should abort. Used to prevent unwinding for foreign items. Abort, /// Indicates a normal return. The return place should have /// been filled in before this executes. This can occur multiple times /// in different basic blocks. Return, /// Indicates a terminator that can never be reached. Unreachable, /// Drop the `Place`. Drop { place: Place<'tcx>, target: BasicBlock, unwind: Option }, /// Drop the `Place` and assign the new value over it. This ensures /// that the assignment to `P` occurs *even if* the destructor for /// place unwinds. Its semantics are best explained by the /// elaboration: /// /// ``` /// BB0 { /// DropAndReplace(P <- V, goto BB1, unwind BB2) /// } /// ``` /// /// becomes /// /// ``` /// BB0 { /// Drop(P, goto BB1, unwind BB2) /// } /// BB1 { /// // P is now uninitialized /// P <- V /// } /// BB2 { /// // P is now uninitialized -- its dtor panicked /// P <- V /// } /// ``` DropAndReplace { place: Place<'tcx>, value: Operand<'tcx>, target: BasicBlock, unwind: Option, }, /// Block ends with a call of a converging function. Call { /// The function that’s being called. func: Operand<'tcx>, /// Arguments the function is called with. /// These are owned by the callee, which is free to modify them. /// This allows the memory occupied by \"by-value\" arguments to be /// reused across function calls without duplicating the contents. args: Vec>, /// Destination for the return value. If some, the call is converging. destination: Option<(Place<'tcx>, BasicBlock)>, /// Cleanups to be done if the call unwinds. cleanup: Option, /// `true` if this is from a call in HIR rather than from an overloaded /// operator. True for overloaded function call. from_hir_call: bool, /// This `Span` is the span of the function, without the dot and receiver /// (e.g. `foo(a, b)` in `x.foo(a, b)` fn_span: Span, }, /// Jump to the target if the condition has the expected value, /// otherwise panic with a message and a cleanup target. Assert { cond: Operand<'tcx>, expected: bool, msg: AssertMessage<'tcx>, target: BasicBlock, cleanup: Option, }, /// A suspend point. Yield { /// The value to return. value: Operand<'tcx>, /// Where to resume to. resume: BasicBlock, /// The place to store the resume argument in. resume_arg: Place<'tcx>, /// Cleanup to be done if the generator is dropped at this suspend point. drop: Option, }, /// Indicates the end of the dropping of a generator. GeneratorDrop, /// A block where control flow only ever takes one real path, but borrowck /// needs to be more conservative. FalseEdge { /// The target normal control flow will take. real_target: BasicBlock, /// A block control flow could conceptually jump to, but won't in /// practice. imaginary_target: BasicBlock, }, /// A terminator for blocks that only take one path in reality, but where we /// reserve the right to unwind in borrowck, even if it won't happen in practice. /// This can arise in infinite loops with no function calls for example. FalseUnwind { /// The target normal control flow will take. real_target: BasicBlock, /// The imaginary cleanup block link. This particular path will never be taken /// in practice, but in order to avoid fragility we want to always /// consider it in borrowck. We don't want to accept programs which /// pass borrowck only when `panic=abort` or some assertions are disabled /// due to release vs. debug mode builds. This needs to be an `Option` because /// of the `remove_noop_landing_pads` and `no_landing_pads` passes. unwind: Option, }, /// Block ends with an inline assembly block. This is a terminator since /// inline assembly is allowed to diverge. InlineAsm { /// The template for the inline assembly, with placeholders. template: &'tcx [InlineAsmTemplatePiece], /// The operands for the inline assembly, as `Operand`s or `Place`s. operands: Vec>, /// Miscellaneous options for the inline assembly. options: InlineAsmOptions, /// Source spans for each line of the inline assembly code. These are /// used to map assembler errors back to the line in the source code. line_spans: &'tcx [Span], /// Destination block after the inline assembly returns, unless it is /// diverging (InlineAsmOptions::NORETURN). destination: Option, }, } /// Information about an assertion failure. #[derive(Clone, RustcEncodable, RustcDecodable, HashStable, PartialEq)] pub enum AssertKind {"} {"_id":"q-en-rust-0fcb0a09168a90a7ca4f2103a2d4ddf39e47f105b6ee3f125bf512cff9649aab","text":"}; (respan(self.prev_span, Constness::NotConst), unsafety, abi) }; self.expect_keyword(keywords::Fn)?; if !self.eat_keyword(keywords::Fn) { // It is possible for `expect_one_of` to recover given the contents of // `self.expected_tokens`, therefore, do not use `self.unexpected()` which doesn't // account for this. if !self.expect_one_of(&[], &[])? { unreachable!() } } Ok((constness, unsafety, asyncness, abi)) }"} {"_id":"q-en-rust-0fff251219050a5e87dad457ac585ea2a0d5b5357fdfea18880730a34256bdf7","text":" // build-pass pub trait Foo { type FooAssoc; } pub struct Bar { id: F::FooAssoc } pub struct Baz; impl Foo for Baz { type FooAssoc = usize; } static mut MY_FOO: Bar = Bar { id: 0 }; fn main() {} "} {"_id":"q-en-rust-10025d3d8da87d3d0015a51ca7681e6fd4b40eb3fe3a35328793a380abfcacfa","text":" #![feature(fn_traits, unboxed_closures)] fn test FnOnce<(&'x str,)>>(_: F) {} struct Compose(F,G); impl FnOnce<(T,)> for Compose where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> { type Output = G::Output; extern \"rust-call\" fn call_once(self, (x,): (T,)) -> G::Output { (self.1)((self.0)(x)) } } struct Str<'a>(&'a str); fn mk_str<'a>(s: &'a str) -> Str<'a> { Str(s) } fn main() { let _: for<'a> fn(&'a str) -> Str<'a> = mk_str; // expected concrete lifetime, found bound lifetime parameter 'a let _: for<'a> fn(&'a str) -> Str<'a> = Str; //~^ ERROR: mismatched types test(|_: &str| {}); test(mk_str); // expected concrete lifetime, found bound lifetime parameter 'x test(Str); //~ ERROR: type mismatch in function arguments test(Compose(|_: &str| {}, |_| {})); test(Compose(mk_str, |_| {})); // internal compiler error: cannot relate bound region: // ReLateBound(DebruijnIndex { depth: 2 }, // BrNamed(DefId { krate: 0, node: DefIndex(6) => test::'x }, 'x(65))) //<= ReSkolemized(0, // BrNamed(DefId { krate: 0, node: DefIndex(6) => test::'x }, 'x(65))) test(Compose(Str, |_| {})); } "} {"_id":"q-en-rust-100807ac89f6ee5b6869deb643870650a93c24a1e6707cc8d8fcdbd14659b494","text":"impl EntryKind { fn def_kind(&self) -> DefKind { match *self { EntryKind::AnonConst(..) => DefKind::AnonConst, EntryKind::Const(..) => DefKind::Const, EntryKind::AssocConst(..) => DefKind::AssocConst, EntryKind::ImmStatic"} {"_id":"q-en-rust-1049c3aa82411c5176a6165571a9a17adb00bed2d66819c26269c16eee686c31","text":"// These cases don't actually need a destination ExprKind::Assign { .. } | ExprKind::AssignOp { .. } | ExprKind::Continue { .. } | ExprKind::Break { .. } | ExprKind::LlvmInlineAsm { .. } | ExprKind::Return { .. } => { | ExprKind::LlvmInlineAsm { .. } => { unpack!(block = this.stmt_expr(block, expr, None)); this.cfg.push_assign_unit(block, source_info, destination, this.hir.tcx()); block.unit() } ExprKind::Continue { .. } | ExprKind::Break { .. } | ExprKind::Return { .. } => { unpack!(block = this.stmt_expr(block, expr, None)); // No assign, as these have type `!`. block.unit() } // Avoid creating a temporary ExprKind::VarRef { .. } | ExprKind::SelfRef"} {"_id":"q-en-rust-105073e15a0a25908cd437601f619994ed0bb0aee5efa52dbbb862f7da9485f9","text":"call_locations, no_emit_shared: false, html_no_source, force_unstable_if_unmarked, }; Some((options, render_options)) }"} {"_id":"q-en-rust-105fee5e8cff6ca966c8e7276a2157c592068a11adf4dd26a5bbd829cba828a2","text":"COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/ RUN ./build-binutils.sh # libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS # only has 2.6.4, so build our own COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/ RUN ./build-cmake.sh # Build a version of gcc capable of building LLVM 6 # Need at least GCC 5.1 to compile LLVM nowadays COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/ RUN ./build-gcc.sh RUN ./build-gcc.sh && apt-get remove -y gcc g++ # CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+ # Debian 6 has Python 2.6 by default, but LLVM needs 2.7+ COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/ RUN ./build-python.sh # Now build LLVM+Clang 7, afterwards configuring further compilations to use the # LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4. COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/ RUN ./build-cmake.sh # Now build LLVM+Clang, afterwards configuring further compilations to use the # clang/clang++ compilers. COPY host-x86_64/dist-x86_64-linux/build-clang.sh host-x86_64/dist-x86_64-linux/llvm-project-centos.patch /tmp/ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ RUN ./build-clang.sh ENV CC=clang CXX=clang++ # Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for # cloning, so download and build it here. COPY host-x86_64/dist-x86_64-linux/build-git.sh /tmp/ RUN ./build-git.sh # for sanitizers, we need kernel headers files newer than the ones CentOS ships # with so we install newer ones here COPY host-x86_64/dist-x86_64-linux/build-headers.sh /tmp/ RUN ./build-headers.sh # OpenSSL requires a more recent version of perl # with so we install newer ones here COPY host-x86_64/dist-x86_64-linux/build-perl.sh /tmp/ RUN ./build-perl.sh COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh"} {"_id":"q-en-rust-106177426ea9b8d2d6e29126acbd5818d4c82b572cb2284a15b0ef340ee9db3e","text":"return f.c; } struct quad_floats { float a; float b; float c; float d; }; float get_c_exhaust_sysv64_ints( void *a, void *b, void *c, void *d, void *e, void *f, // `f` used the last integer register, so `g` goes on the stack. // It also used to bring the \"count of available integer registers\" down to // `-1` which broke the next SSE-only aggregate argument (`h`) - see #62350. void *g, struct quad_floats h ) { return h.c; } // Calculates the average of `(x + y) / n` where x: i64, y: f64. There must be exactly n pairs // passed as variadic arguments. There are two versions of this function: the // variadic one, and the one that takes a `va_list`."} {"_id":"q-en-rust-1084c75c59da6446ca30f5b408c1b6db79df7c0615b1690244d3dc2ce7f218da","text":"\"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)\" = \"7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a\" \"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)\" = \"faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db\" \"checksum racer 2.1.23 (registry+https://github.com/rust-lang/crates.io-index)\" = \"94dbdea3d959d8f76a2e303b3eadf107fd76da886b231291e649168613d432fb\" \"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)\" = \"552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293\" \"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)\" = \"ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a\" \"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)\" = \"771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a\" \"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)\" = \"0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db\""} {"_id":"q-en-rust-10d10602b04a3ef145ccc2259ed47f38aa819e08630c3be92d7d8cd4fb17d92f","text":" error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:29:5 | LL | #[doc(hidden)] | ^^^^^^^^^^^^^^ help: remove this attribute | note: the lint level is defined here --> $DIR/unused-attr-doc-hidden.rs:4:9 | LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:34:5 | LL | #[doc(hidden)] | ^^^^^^^^^^^^^^ help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:39:11 | LL | #[doc(hidden, alias = \"aka\")] | ^^^^^^-- | | | help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:44:27 | LL | #[doc(alias = \"this\", hidden,)] | ^^^^^^- | | | help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:49:11 | LL | #[doc(hidden, hidden)] | ^^^^^^-- | | | help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:49:19 | LL | #[doc(hidden, hidden)] | ^^^^^^ help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: aborting due to 6 previous errors "} {"_id":"q-en-rust-110741c6b5677bb67eda59812bd0aafcb890919d102f39238e5c95969a5b756b","text":"target_family: Some(\"windows\".to_string()), is_like_windows: true, is_like_msvc: true, // set VSLANG to 1033 can prevent link.exe from using // language packs, and avoid generating Non-UTF-8 error // messages if a link error occurred. link_env: vec![(\"VSLANG\".to_string(), \"1033\".to_string())], pre_link_args: args, crt_static_allows_dylibs: true, crt_static_respected: true,"} {"_id":"q-en-rust-11243c62c9a4c30fe352906f58d969c203106793ba93bd6e3165739950d08453","text":"python2.7 \"$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py\" \"$(git rev-parse HEAD)\" \"$(git log --format=%s -n1 HEAD)\" \"\" \"\" cd .. rm -rf rust-toolstate condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check')) condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check')) displayName: Verify the publish_toolstate script works - bash: |"} {"_id":"q-en-rust-113ac596f1a902840ef1a41ade27791428e565026fd1d1a4f85ce2cffa04f2a6","text":"#![crate_name = \"foo\"] // The goal of this test is to answer that it won't be generated as a list because // The goal of this test is to ensure that it won't be generated as a list because // block doc comments can have their lines starting with a star. // @has foo/fn.foo.html"} {"_id":"q-en-rust-117ead81c5c5a12b2cc0a204e022a8c2aa81e16d804408a33d1ca50e958d83dc","text":" error[E0271]: type mismatch resolving ` as Stream>::Item == Repr` --> $DIR/issue-89008.rs:38:43 | LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving ` as Stream>::Item == Repr` | | | this type parameter | note: expected this to be `()` --> $DIR/issue-89008.rs:17:17 | LL | type Item = (); | ^^ = note: expected unit type `()` found type parameter `Repr` error: aborting due to previous error For more information about this error, try `rustc --explain E0271`. "} {"_id":"q-en-rust-117eebd8751e91a66e57d85f498c7eb7e01a6acce7f7b33c0a0e8899276e292e","text":"}).is_some(); render_deref_methods(w, cx, impl_, containing_item, has_deref_mut)?; } write!(w, \"

Trait Implementations

\")?;
write!(w, \"

Trait Implementations

\")?;
for i in &traits { let did = i.trait_did().unwrap(); let assoc_link = AssocItemLink::GotoSource(did, &i.inner_impl().provided_trait_methods);"} {"_id":"q-en-rust-11944b91a421c181de55055f1ac46ae3182ed97e575e6d5b0934cc99bcbc2a0b","text":"let externs = options.externs.clone(); let render_options = options.render_options.clone(); let scrape_examples_options = options.scrape_examples_options.clone(); let document_private = options.render_options.document_private; let config = core::create_config(options); interface::create_compiler_and_run(config, |compiler| {"} {"_id":"q-en-rust-11b01c667be70424468853892b4ccc6adf321ab2d9b8085908d5c6c5fc8fbfbf","text":" PRINT-ATTR INPUT (DISPLAY): fn foo < T > () where T : Copy + { } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: \"fn\", span: $DIR/trailing-plus.rs:11:1: 11:3 (#0), }, Ident { ident: \"foo\", span: $DIR/trailing-plus.rs:11:4: 11:7 (#0), }, Punct { ch: '<', spacing: Alone, span: $DIR/trailing-plus.rs:11:7: 11:8 (#0), }, Ident { ident: \"T\", span: $DIR/trailing-plus.rs:11:8: 11:9 (#0), }, Punct { ch: '>', spacing: Alone, span: $DIR/trailing-plus.rs:11:9: 11:10 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/trailing-plus.rs:11:10: 11:12 (#0), }, Ident { ident: \"where\", span: $DIR/trailing-plus.rs:11:13: 11:18 (#0), }, Ident { ident: \"T\", span: $DIR/trailing-plus.rs:11:19: 11:20 (#0), }, Punct { ch: ':', spacing: Alone, span: $DIR/trailing-plus.rs:11:20: 11:21 (#0), }, Ident { ident: \"Copy\", span: $DIR/trailing-plus.rs:11:22: 11:26 (#0), }, Punct { ch: '+', spacing: Alone, span: $DIR/trailing-plus.rs:11:27: 11:28 (#0), }, Group { delimiter: Brace, stream: TokenStream [], span: $DIR/trailing-plus.rs:11:29: 12:2 (#0), }, ] "} {"_id":"q-en-rust-11c5af70f5255ad93610927202ab6cbfa928c1815d89357cace1a535af551950","text":"} #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn exit_reported_right() { let p = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"exit 1\"]).spawn() } else { Command::new(\"false\").spawn() shell_cmd().arg(\"-c\").arg(\"false\").spawn() }; assert!(p.is_ok()); let mut p = p.unwrap();"} {"_id":"q-en-rust-11f674b93e650bd09eb718ee1935aa4cf0ddf92a907f6132a40ffb333eadfc6f","text":"is_valid = false; } sym::hidden if !self.check_doc_hidden(attr, meta_index, meta, hir_id, target, ) => { is_valid = false; } // no_default_passes: deprecated // passes: deprecated // plugins: removed, but rustdoc warns about it itself"} {"_id":"q-en-rust-11fec1de0fe6ffa4ec36df220522ccce1d09b37c48b2d6d93810b65601eb9e03","text":"if let Ok(snippet) = self.infcx.tcx.sess.source_map().span_to_snippet(span) { let is_option = move_ty.starts_with(\"std::option::Option\"); let is_result = move_ty.starts_with(\"std::result::Result\"); if is_option || is_result { if (is_option || is_result) && use_spans.map_or(true, |v| !v.for_closure()) { err.span_suggestion( span, &format!(\"consider borrowing the `{}`'s content\", if is_option {"} {"_id":"q-en-rust-124ae1d0d60ea6c4ed12e8cc4e8029ddb2e68c62bcbd6b226f0a095956db3c94","text":" // test for `doc(hidden)` with impl parameters in the same crate. #![crate_name = \"foo\"] #[doc(hidden)] pub enum HiddenType {} #[doc(hidden)] pub trait HiddenTrait {} pub enum MyLibType {} // @!has foo/enum.MyLibType.html '//*[@id=\"impl-From%3CHiddenType%3E\"]' 'impl From for MyLibType' impl From for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} } } pub struct T(T); // @!has foo/enum.MyLibType.html '//*[@id=\"impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E\"]' 'impl From>>>> for MyLibType' impl From>>>> for MyLibType { fn from(it: T>>>) -> 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 for T>>>' impl From for T>>> { fn from(it: MyLibType) -> T>>> { match it {} } } "} {"_id":"q-en-rust-12523b24b38378b1aaa0011d5b2e3dbb2829fb3327421e8eab73aaa6d70926ea","text":"return; } if !ensure_stage1_toolchain_placeholder_exists(stage_path) { println!( \"Failed to create a template for stage 1 toolchain or confirm that it already exists\" ); return; } if try_link_toolchain(&stage_path[..]) { println!( \"Added `stage1` rustup toolchain; try `cargo +stage1 build` on a separate rust project to run a newly-built toolchain\""} {"_id":"q-en-rust-1261c7af83a613c7255ffa495f65fea0f00a8c942e011345f8411fa1c81342e7","text":"legacy_imports: LegacyMacroImports, allow_shadowing: bool) { let import_macro = |this: &mut Self, name, ext: Rc<_>, span| { this.used_crates.insert(module.def_id().unwrap().krate); if let SyntaxExtension::NormalTT(..) = *ext { this.macro_names.insert(name); }"} {"_id":"q-en-rust-129123802837bbca9194f2dcb6878411b1732e96a8fee60da4c0fa70e2d8e983","text":"use crate::mir::*; use crate::ty::subst::SubstsRef; use crate::ty::{CanonicalUserTypeAnnotation, Ty}; use crate::ty::{self, CanonicalUserTypeAnnotation, Ty}; use rustc_span::Span; macro_rules! make_mir_visitor {"} {"_id":"q-en-rust-129e6bb2a16baf33d442f0791e8075bad593a4e3c6b9d62b12067b7eb0d35b82","text":"self.lookup_and_handle_method(expr.hir_id); } hir::ExprKind::Assign(ref left, ref right, ..) => { // Ignore write to field self.visit_expr(base_expr(left)); self.handle_assign(left); self.visit_expr(right); return; }"} {"_id":"q-en-rust-12cb7f158005d219d5bd66fd18ea214f6610f184244e62839db92b6b9fc31370","text":"if let Some(ref dir) = build.lldb_python_dir { cmd.arg(\"--lldb-python-dir\").arg(dir); } let llvm_config = build.llvm_config(target); let llvm_version = output(Command::new(&llvm_config).arg(\"--version\")); cmd.arg(\"--llvm-version\").arg(llvm_version); cmd.args(&build.flags.args);"} {"_id":"q-en-rust-137818e8154a6d83d16198c5048574dc886b09f01ebefcdaf33d5d5dd47d89b7","text":"} } fn collect_predicates_for_types(&mut self, obligation: &TraitObligation<'tcx>, trait_def_id: ast::DefId, types: Vec>) -> Vec> { let derived_cause = match self.tcx().lang_items.to_builtin_kind(trait_def_id) { Some(_) => { self.derived_cause(obligation, BuiltinDerivedObligation) }, None => { self.derived_cause(obligation, ImplDerivedObligation) } }; let normalized = project::normalize_with_depth(self, obligation.cause.clone(), obligation.recursion_depth + 1, &types); let obligations = normalized.value.iter().map(|&nested_ty| { // the obligation might be higher-ranked, e.g. for<'a> &'a // int : Copy. In that case, we will wind up with // late-bound regions in the `nested` vector. So for each // one we instantiate to a skolemized region, do our work // to produce something like `&'0 int : Copy`, and then // re-bind it. This is a bit of busy-work but preserves // the invariant that we only manipulate free regions, not // bound ones. self.infcx.try(|snapshot| { let (skol_ty, skol_map) = self.infcx().skolemize_late_bound_regions(&ty::Binder(nested_ty), snapshot); let skol_predicate = util::predicate_for_trait_def( self.tcx(), derived_cause.clone(), trait_def_id, obligation.recursion_depth + 1, skol_ty); match skol_predicate { Ok(skol_predicate) => Ok(self.infcx().plug_leaks(skol_map, snapshot, &skol_predicate)), Err(ErrorReported) => Err(ErrorReported) } }) }).collect::>, _>>(); match obligations { Ok(mut obls) => { obls.push_all(normalized.obligations.as_slice()); obls }, Err(ErrorReported) => Vec::new() } } /////////////////////////////////////////////////////////////////////////// // CONFIRMATION //"} {"_id":"q-en-rust-1394bb016615f14e9711772c107035b40ab0b9af9f59792e471af641c7d69a08","text":"#[primary_span] pub span: Span, } #[derive(Diagnostic)] #[diag(hir_analysis::missing_parentheses_in_range, code = \"E0689\")] pub struct MissingParentheseInRange { #[primary_span] #[label(hir_analysis::missing_parentheses_in_range)] pub span: Span, pub ty_str: String, pub method_name: String, #[subdiagnostic] pub add_missing_parentheses: Option, } #[derive(Subdiagnostic)] #[multipart_suggestion_verbose( hir_analysis::add_missing_parentheses_in_range, applicability = \"maybe-incorrect\" )] pub struct AddMissingParenthesesInRange { pub func_name: String, #[suggestion_part(code = \"(\")] pub left: Span, #[suggestion_part(code = \")\")] pub right: Span, } "} {"_id":"q-en-rust-13b5603afcb898f293a062a855402b885c3f9721fac1fbe82f16b8794ff81ca4","text":"(config.mode == common::Pretty && parse_name_directive(ln, \"ignore-pretty\")) || (config.target != config.host && parse_name_directive(ln, \"ignore-cross-compile\")) || ignore_gdb(config, ln) || ignore_lldb(config, ln); ignore_gdb(config, ln) || ignore_lldb(config, ln) || ignore_llvm(config, ln); props.should_fail = props.should_fail || parse_name_directive(ln, \"should-fail\"); });"} {"_id":"q-en-rust-13c8449b72d935996ecdb93e0e36281099f72f9bcfdaaf9e20f8246f4e881e79","text":"| ^^^ type aliases cannot be used as traits | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias --> $DIR/issue-3907.rs:5:1 | LL | type Foo = dyn issue_3907::Foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | trait Foo = dyn issue_3907::Foo; | help: consider importing this trait instead | LL | use issue_3907::Foo;"} {"_id":"q-en-rust-13ccc30dca59000fe2f5b84f957e43d38761ed620e67902e89c50c95ffcd5a56","text":"// `public_items` map, so we can skip inserting into the // paths map if there was already an entry present and we're // not a public item. if !self.cache.paths.contains_key(&item.item_id.expect_def_id()) let item_def_id = item.item_id.expect_def_id(); if !self.cache.paths.contains_key(&item_def_id) || self .cache .effective_visibilities .is_directly_public(self.tcx, item.item_id.expect_def_id()) .is_directly_public(self.tcx, item_def_id) { self.cache.paths.insert( item.item_id.expect_def_id(), (self.cache.stack.clone(), item.type_()), ); self.cache .paths .insert(item_def_id, (self.cache.stack.clone(), item.type_())); } } }"} {"_id":"q-en-rust-13d80c7d2b66c4a10eaf927088224400fe5942bc1a480eb9bec85ce896b2e96b","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct Foo; impl Foo { fn putc(&self, b: u8) { } fn puts(&self, s: &str) { for byte in s.bytes() { self.putc(byte) } } } fn main() {} "} {"_id":"q-en-rust-13d9467847b1fabbd5159243dead28df3fa7d831945e992e280136d55bcfd8f2","text":" // check-pass // aux-build:test-macros.rs // compile-flags: -Z span-debug #![no_std] // Don't load unnecessary hygiene information from std extern crate std; #[macro_use] extern crate test_macros; macro_rules! empty_stmt { ($s:stmt) => { print_bang!($s); // Currently, all attributes are ignored // on an empty statement #[print_attr] #[rustc_dummy(first)] #[rustc_dummy(second)] $s } } fn main() { empty_stmt!(;); } "} {"_id":"q-en-rust-13ddc92944b64a8c0ff9340c269286f2b556e94680bc56e27e4abd4b75c04f85","text":" #!/bin/sh CARGO_TARGET_DIR=$(pwd)/target/ export CARGO_TARGET_DIR echo 'Deprecated! `util/dev` usage is deprecated, please use `cargo dev` instead.' cd clippy_dev && cargo run -- \"$@\" "} {"_id":"q-en-rust-13e4a92f6d2c0dd1625c678ce538da02f7fdc7024f2225f9b28680fdda3ffc9a","text":"id: AllocId, liveness: AllocCheck, ) -> InterpResult<'static, (Size, Align)> { // 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)); // 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) }, } } _ => {} } // 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) } }"} {"_id":"q-en-rust-142f0cf17e4e9f9909838a614522c35e244acd08ebef51fc9a4e35bbc263aded","text":" // 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; } "} {"_id":"q-en-rust-1476952c0e31f4d798aba2a64caf6b80cd9dc9449c5bbee1b353525a93565783","text":"replace_late_bound_regions(tcx, value, |_, _| ty::ReStatic).0 } /// 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 } /// 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>,"} {"_id":"q-en-rust-147951eaa9bd7cfba78e9f8c8d45cd93951bc1476e28afc0795f5c7e403b33d4","text":"set -ex source shared.sh curl https://cmake.org/files/v3.6/cmake-3.6.3.tar.gz | tar xzf - CMAKE=3.13.4 curl -L https://github.com/Kitware/CMake/releases/download/v$CMAKE/cmake-$CMAKE.tar.gz | tar xzf - mkdir cmake-build cd cmake-build hide_output ../cmake-3.6.3/configure --prefix=/rustroot hide_output ../cmake-$CMAKE/configure --prefix=/rustroot hide_output make -j10 hide_output make install cd .. rm -rf cmake-build rm -rf cmake-3.6.3 rm -rf cmake-$CMAKE "} {"_id":"q-en-rust-147dffc943fd49ae271f8afec684d54454d52cf25b0b8aca666df73ad7a875d7","text":"// preventing the latter from being formatted. ignore_fmt.add(&format!(\"!/{}\", untracked_path)).expect(&untracked_path); } 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); } } } } else { println!(\"Not in git tree. Skipping git-aware format checks\"); }"} {"_id":"q-en-rust-14c52b8e629e72772ca4dc2b044a38c2f15599465e9284f3147d3cdce9402c86","text":"LL | #[deprecated(since(b), note = \"a\")] //~ ERROR incorrect meta item | ^^^^^^^^ 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 | ^^^^^^ error[E0550]: multiple deprecated attributes --> $DIR/deprecation-sanity.rs:22:1 --> $DIR/deprecation-sanity.rs:28:1 | LL | fn multiple1() { } //~ ERROR multiple deprecated attributes | ^^^^^^^^^^^^^^^^^^ error[E0538]: multiple 'since' items --> $DIR/deprecation-sanity.rs:24:27 --> $DIR/deprecation-sanity.rs:30:27 | LL | #[deprecated(since = \"a\", since = \"b\", note = \"c\")] //~ ERROR multiple 'since' items | ^^^^^^^^^^^ error: aborting due to 7 previous errors error: aborting due to 9 previous errors Some errors occurred: E0538, E0541, E0550, E0551. Some errors occurred: E0538, E0541, E0550, E0551, E0565. For more information about an error, try `rustc --explain E0538`."} {"_id":"q-en-rust-14cf61dbcc35a90cdf855f783fa77785d7ead83d62a6529ee884578029d5070d","text":"// ensure that we issue lints in a repeatable order def_ids.sort_by_cached_key(|&def_id| self.tcx.def_path_hash(def_id)); for def_id in def_ids { 'lifetimes: for def_id in def_ids { debug!(\"check_uses_for_lifetimes_defined_by_scope: def_id = {:?}\", def_id); let lifetimeuseset = self.lifetime_uses.remove(&def_id);"} {"_id":"q-en-rust-15052fd3d471f2621a63ec2189436b98de1596d1d3cc34eb16ec9e211036424c","text":"_ => self.get(item.def_id), }; // 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(..) => {} } // Mark all items in interfaces of reachable items as reachable. match item.kind { // The interface is empty. hir::ItemKind::ExternCrate(..) => {} hir::ItemKind::Macro(..) | hir::ItemKind::ExternCrate(..) => {} // All nested items are checked by `visit_item`. hir::ItemKind::Mod(..) => {} // Handled in the access level of in rustc_resolve hir::ItemKind::Use(..) => {} // The interface is empty. hir::ItemKind::GlobalAsm(..) => {}"} {"_id":"q-en-rust-15089504226b79a5c4300aa64f93c6ac382a52ff85c27bc06f8b6ade9fa45739","text":"\"rls-rustc\", \"rls-span\", \"rls-vfs\", \"rustc-serialize\", \"rustc-workspace-hack\", \"rustc_tools_util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"rustfmt-nightly\","} {"_id":"q-en-rust-150ea12ccafcc8157808cb267a308a756fbddc843199d19f0fffd9a80defae87","text":"ByteStr(_) | ByteStrRaw(..) => \"byte string\" } } // 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) } } pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {"} {"_id":"q-en-rust-151ac6c88f7b9404df2e4be8d434aad6413bbc0409ce38e0fa63d69db71ba992","text":"impl Scalar { pub fn is_bool(&self) -> bool { if let Int(I8, _) = self.value { self.valid_range == (0..=1) } else { false } matches!(self.value, Int(I8, false)) && self.valid_range == (0..=1) } /// Returns the valid range as a `x..y` range."} {"_id":"q-en-rust-151ff45c4b2d52ed12a15b8d93a7cc65ee3d42ef2cbb0d27eb79e2da6975d9fc","text":" // check-pass struct Sqlite {} trait HasArguments<'q> { type Arguments; } impl<'q> HasArguments<'q> for Sqlite { type Arguments = std::marker::PhantomData<&'q ()>; } fn foo() { let _ = ::Arguments::default(); } fn main() {} "} {"_id":"q-en-rust-15277cc96da04b9002d17734570ab6610639f7b0e928fe7eda3bd3add7d5ba31","text":"// 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. let mut has_bounds = None; let mut impl_trait = false; if let Node::GenericParam(ref param) = hir.get(id) { let kind = ¶m.kind; if let hir::GenericParamKind::Type { synthetic: Some(_), .. } = kind { // We've found `fn foo(x: impl Trait)` instead of // `fn foo(x: T)`. We want to suggest the correct // `fn foo(x: impl Trait + TraitBound)` instead of // `fn foo(x: T)`. (See #63706.) impl_trait = true; has_bounds = param.bounds.get(1); } else { has_bounds = param.bounds.get(0); match hir.get(id) { Node::GenericParam(ref param) => { let mut impl_trait = false; let has_bounds = if let hir::GenericParamKind::Type { synthetic: Some(_), .. } = ¶m.kind { // We've found `fn foo(x: impl Trait)` instead of // `fn foo(x: T)`. We want to suggest the correct // `fn foo(x: impl Trait + TraitBound)` instead of // `fn foo(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; } _ => {} } 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; } }; } if !suggested { let mut msg = message(if let Some(param) = param_type { format!(\"restrict type parameter `{}` with\", param) } else { \"implement\".to_string() }); for (i, trait_info) in candidates.iter().enumerate() { msg.push_str(&format!( \"ncandidate #{}: `{}`\","} {"_id":"q-en-rust-152ef0dcbdfa79e97039bc66e1cc534b38b8269d3609048baba769b6a75ed39b","text":"fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, ast_generics: &hir::Generics, space: ParamSpace, index: u32) index: u32, allow_defaults: bool) -> ty::TypeParameterDef<'tcx> { let param = &ast_generics.ty_params[index as usize];"} {"_id":"q-en-rust-15613aaa604b2e22e3f5063e5932b8f32f55441ac433ba0e9459635296c5057b","text":" Subproject commit f5532b22b5d741f3ea207b5b07e3e1ca63476f9b Subproject commit 02b3734a5ba6de984eb5a02c50860cc014e58d56 "} {"_id":"q-en-rust-15a3e0493b22d74b467ea924aa2b604cfb8cc83de7db00d663dd49fada6fb35c","text":"/// # Examples /// /// ``` /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_nanos(), 5730023852); /// ``` #[unstable(feature = \"duration_as_u128\", issue = \"50202\")] #[stable(feature = \"duration_as_u128\", since = \"1.33.0\")] #[inline] pub const fn as_nanos(&self) -> u128 { self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128"} {"_id":"q-en-rust-15b3ec5ff926166b8a62fd2080f512600ea2bfb7ec0569c25d793d4eb9c01846","text":"// 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)); debug!(\"`: sorted_path={:#?}\", categorized_path); debug!(\"best_blame_constraint: sorted_path={:#?}\", categorized_path); categorized_path.remove(0) }"} {"_id":"q-en-rust-15c96de8dbc9c5bc132db48d90227a00a55932ad8be34db4328577150f956a45","text":" // 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() {} } "} {"_id":"q-en-rust-15d527b7f4321c8e8fc999a87b297ed9b24425594e910c879326e853d3736f57","text":" //@ 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{{.*}} } "} {"_id":"q-en-rust-15d5a57c183b64aa9ccf88c9a530a20d6dff2d534343621378492cdb89380f5f","text":"use syntax::ast; use syntax::source_map::Spanned; use syntax::ptr::P; use syntax::util::lev_distance::find_best_match_for_name; use syntax_pos::Span; impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {"} {"_id":"q-en-rust-15deeb8ee15aac73134bd0925d5880113562dce69872a43b72c071ff7e786ef5","text":" 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`. "} {"_id":"q-en-rust-15f0d6d5fc2a59f13c73d92e9baf5e30f7a7941331bf977cf3132e9ff65dc9bd","text":"for attr in &data.attrs { match attr.style { crate::AttrStyle::Outer => { assert!( inner_attrs.len() == 0, \"Found outer attribute {:?} after inner attrs {:?}\", attr, inner_attrs ); outer_attrs.push(attr); } crate::AttrStyle::Inner => {"} {"_id":"q-en-rust-1649de114e0184f26680540e5a7b84646d406e873497c922a37c0208153e26de","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // compile-flags:--no-defaults --passes \"collapse-docs\" --passes \"unindent-comments\" // compile-flags:--no-defaults --passes collapse-docs --passes unindent-comments // @has issue_15347/fn.foo.html #[doc(hidden)]"} {"_id":"q-en-rust-16655e1b66b04d4ea8eab2e01e78493177e16bbabf6080fec191548dc7724e81","text":"E0495, // cannot infer an appropriate lifetime due to conflicting requirements E0496, // .. name `..` shadows a .. name that is already in scope E0498, // malformed plugin attribute E0514, // metadata version mismatch }"} {"_id":"q-en-rust-16908103d656a7e8caafc360c3a03e40f2e2802b8e6cb8b19fdd64574447602a","text":"} fn build_free<'tcx>(tcx: &ty::ctxt<'tcx>, cfg: &mut CFG<'tcx>, unit_temp: Lvalue<'tcx>, data: &FreeData<'tcx>, target: BasicBlock) -> BasicBlock { target: BasicBlock) -> Terminator<'tcx> { 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![]) )); let block = cfg.start_new_cleanup_block(); cfg.terminate(block, Terminator::Call { Terminator::Call { func: Operand::Constant(Constant { span: data.span, ty: tcx.lookup_item_type(free_func).ty.subst(tcx, substs),"} {"_id":"q-en-rust-16bb75bbb26b749ad23ffb8ea05165527fd9ab9b1f2a9885ed2e34ea094e4b71","text":"LL | type Bar<'a>: Deref::Bar<'a, Target = Self>>; | +++ error: aborting due to previous error error[E0229]: associated type bindings are not allowed here --> $DIR/issue-85347.rs:3:46 | LL | type Bar<'a>: Deref::Bar>; | ^^^^^^^^^^^^^ associated type not allowed here error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. Some errors have detailed explanations: E0107, E0229. For more information about an error, try `rustc --explain E0107`. "} {"_id":"q-en-rust-16d68052fd2cb310025b7a41095218d4545ffda9d7c0f567a1460ed6733fdbb7","text":"fn in_call( cx: &ConstCx<'_, 'tcx>, callee: &Operand<'tcx>, _args: &[Operand<'tcx>], args: &[Operand<'tcx>], _return_ty: Ty<'tcx>, ) -> bool { if cx.mode == Mode::Fn {"} {"_id":"q-en-rust-1706519923258630ab29825dfc58c657f904a5fc8074f5c50a62d046d97db7fe","text":"} fn is_try_block(&self) -> bool { 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) self.token.is_keyword(kw::Try) && self.look_ahead(1, |t| *t == token::OpenDelim(token::Brace)) && self.token.uninterpolated_span().rust_2018() } /// Parses an `async move? {...}` expression."} {"_id":"q-en-rust-1739ad79d5d5978d156c5e0a786c4d82c814831d4e0e7b97c395af95e72f9739","text":"[submodule \"src/llvm-project\"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git branch = rustc/16.0-2023-03-06 branch = rustc/16.0-2023-04-05 [submodule \"src/doc/embedded-book\"] path = src/doc/embedded-book url = https://github.com/rust-embedded/book.git"} {"_id":"q-en-rust-1756ab34c2b79b6b0c758d9918ed5c37801e4ce9be3908823ec059127275d5dc","text":"/// # Examples /// /// ``` /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_millis(), 5730); /// ``` #[unstable(feature = \"duration_as_u128\", issue = \"50202\")] #[stable(feature = \"duration_as_u128\", since = \"1.33.0\")] #[inline] pub const fn as_millis(&self) -> u128 { self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128"} {"_id":"q-en-rust-176315d5a0122161d9680572e4e585423c07b3dc98ca1407ded8e6bfa369b2e8","text":" // 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 or the MIT license // , 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, &'static str>) { } fn main() { test(Ok(())); } //~^ mismatched types "} {"_id":"q-en-rust-176ea369b80c081c7a7aef44a2f65211c6f9f61b4ebbcf66458acde2791897ed","text":"#[license = \"MIT/ASL2\"]; #[crate_type = \"dylib\"]; #[crate_type = \"rlib\"]; #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk.png\", #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png\", html_favicon_url = \"http://www.rust-lang.org/favicon.ico\", html_root_url = \"http://static.rust-lang.org/doc/master\")];"} {"_id":"q-en-rust-1774f0e8eb76e0ef4d3d05a580363baeba5227e1f7acc557015ad64d8a1cf378","text":"verbose_help); } 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. \"); } fn describe_lints(sess: &Session, lint_store: &lint::LintStore, loaded_plugins: bool) { println!(\" Available lint options:"} {"_id":"q-en-rust-17aeeb92dc3ce347f2a985e84acbd978e2e9e71098e23984634d54617886b14c","text":"Command::new(\"mkdir\").arg(\"./\").output().unwrap() }; assert!(status.code() == Some(1)); assert!(status.code().is_some()); assert!(status.code() != Some(0)); assert_eq!(stdout, Vec::new()); assert!(!stderr.is_empty()); } #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn test_finish_once() { let mut prog = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"exit 1\"]).spawn().unwrap() } else { Command::new(\"false\").spawn().unwrap() shell_cmd().arg(\"-c\").arg(\"false\").spawn().unwrap() }; assert!(prog.wait().unwrap().code() == Some(1)); } #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn test_finish_twice() { let mut prog = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"exit 1\"]).spawn().unwrap() } else { Command::new(\"false\").spawn().unwrap() shell_cmd().arg(\"-c\").arg(\"false\").spawn().unwrap() }; assert!(prog.wait().unwrap().code() == Some(1)); assert!(prog.wait().unwrap().code() == Some(1)); } #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] 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 { Command::new(\"echo\").arg(\"hello\").stdout(Stdio::piped()).spawn().unwrap() shell_cmd().arg(\"-c\").arg(\"echo hello\").stdout(Stdio::piped()).spawn().unwrap() }; let Output { status, stdout, stderr } = prog.wait_with_output().unwrap();"} {"_id":"q-en-rust-17bc4b8f3ab8a001fd1556625ffd51ad22a96a5ca5393992630f5079e00aa84a","text":"expanded_cache: FxHashMap::default(), primary_def_id: Some(def_id), found_recursion: false, found_any_recursion: false, check_recursion: true, tcx: self, };"} {"_id":"q-en-rust-17c781cacd66802b6112c5021f0409d0d7ff700eee6d076b1be18bfe870f8f80","text":"Box::new(MaybeUninit::uninit()) } // FIXME: add a test for a bigger box. Currently broken, see // https://github.com/rust-lang/rust/issues/58201. // https://github.com/rust-lang/rust/issues/58201 #[no_mangle] pub fn box_uninitialized2() -> Box> { // CHECK-LABEL: @box_uninitialized2 // CHECK-NOT: store // CHECK-NOT: alloca // CHECK-NOT: memcpy // CHECK-NOT: memset Box::new(MaybeUninit::uninit()) } // Hide the `allocalign` attribute in the declaration of __rust_alloc // from the CHECK-NOT above, and also verify the attributes got set reasonably."} {"_id":"q-en-rust-17cba66c086a608ea782497353ac4c704963876abe047a2af2af4ebb3be2ed69","text":"use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, LocalDefIdSet}; use rustc_hir::intravisit::{walk_item, Visitor}; use rustc_hir::intravisit::{walk_body, walk_item, Visitor}; use rustc_hir::{Node, CRATE_HIR_ID}; use rustc_middle::hir::nested_filter; use rustc_middle::ty::TyCtxt;"} {"_id":"q-en-rust-18575ed8a646e637032032dd22fa1b343e35bca79efc8013ae4c1e2c392e4709","text":" 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`. "} {"_id":"q-en-rust-186ca344dba3bfacc4908c2dd054957e62834d1a84b64e4e3cb1f871fde4cd6d","text":"} fn run(self, builder: &Builder<'_>) { // This gets called by `promote-release` // (https://github.com/rust-lang/rust-central-station/tree/master/promote-release). let mut cmd = builder.tool_cmd(Tool::BuildManifest); if builder.config.dry_run { return;"} {"_id":"q-en-rust-187831d0df53994235b5dda27398760a1c1b64a1bb1e8d6bd450fc1986b5ab69","text":"impl ErrorIndex { pub fn command(builder: &Builder<'_>) -> Command { // 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); // 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); let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); add_dylib_path( vec![ PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)), builder.rustc_libdir(compiler), ], &mut cmd, ); 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); cmd } }"} {"_id":"q-en-rust-1879d9353e28d89365ff22524b348e7686623c83dfa09b40943d1dc074622cb2","text":" #![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 } } "} {"_id":"q-en-rust-1899d88e199059e4dfc1c5a74ecc48ec62edff95212be03291def0c29a041a26","text":"fn test1() { let a: i32 = \"foo\"; //~^ ERROR: mismatched types let b: i32 = \"f'oo\"; //~^ ERROR: mismatched types } fn test2() {"} {"_id":"q-en-rust-18cb5ae81a91e786478b316ef08cf11f396ccc8cd86051a698f861c24e622132","text":"fn after_krate(&mut self) -> Result<(), Error> { debug!(\"Done with crate\"); debug!(\"Adding Primitive impls\"); for primitive in Rc::clone(&self.cache).primitive_locations.values() { self.get_impls(*primitive); } let e = ExternalCrate { crate_num: LOCAL_CRATE }; let index = (*self.index).clone().into_inner(); debug!(\"Constructing Output\");"} {"_id":"q-en-rust-18cdf94a4b4635600ae292d0b6e413874ee5be12bde942e92fec9fcf2050c6c6","text":" // 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 or the MIT license // , 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 { #[doc(hidden)] pub inner: __impl::KeyInner } /// 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 ScopedKey { /// 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(&'static self, t: &T, cb: F) -> R where F: FnOnce() -> R, { struct Reset<'a, T: 'a> { key: &'a __impl::KeyInner, 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(&'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 { pub inner: UnsafeCell<*mut T> } unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { #[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 { pub inner: OsStaticKey, pub marker: marker::PhantomData>, } unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { #[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); 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()); } } "} {"_id":"q-en-rust-19132f39ad0b17482a29a93b782085ce185ed2f81ffd344a3c0e0b52d7c4638a","text":" use core::fmt; use core::iter::FusedIterator; use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; use core::ptr::{self, NonNull}; use core::{fmt, mem}; use crate::alloc::{Allocator, Global}; use super::{count, Iter, VecDeque}; use super::{count, wrap_index, VecDeque}; /// A draining iterator over the elements of a `VecDeque`. ///"} {"_id":"q-en-rust-1933ff121029b9db30d32892fee907b3a0eba6c1919037afb0fff0e6ff0825f9","text":"use std::collections::BTreeMap; use std::env; use std::fs; use std::fs::{self, File}; use std::io::{self, Read, Write}; use std::path::{PathBuf, Path}; use std::process::{Command, Stdio}; use std::collections::HashMap; static HOSTS: &[&str] = &[ \"aarch64-unknown-linux-gnu\","} {"_id":"q-en-rust-1948251ca4c842fbf2a15dc6203a506bc70505a3abc15fa8fe1703788d19d12d","text":"pub mod fun_treemap; pub mod list; pub mod priority_queue; pub mod rope; pub mod smallintmap; pub mod sort;"} {"_id":"q-en-rust-194a6d9038fa05289cce313e2bccb2a420f8b7309d84bbe0f03923c76ec186c2","text":"[`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- [task list extension]: https://github.github.com/gfm/#task-list-items-extension- "} {"_id":"q-en-rust-196447890a229aadfe80a9584eab4477a66f1c91c8bab06251280c25f5155d92","text":"} else { // `sret` parameter thus one less integer register available arg.make_indirect(); // NOTE(eddyb) return is handled first, so no registers // should've been used yet. assert_eq!(int_regs, MAX_INT_REGS); int_regs -= 1; } } Ok(ref cls) => { // split into sized chunks passed individually int_regs -= needed_int; sse_regs -= needed_sse; if arg.layout.is_aggregate() { let size = arg.layout.size; arg.cast_to(cast_target(cls, size))"} {"_id":"q-en-rust-19858e05d9e0b80dffff5a1bc5c3404fe5cb0b102de5ebbbb5cc6f723d2fc526","text":"Err(CharTryFromError(())) } else { // SAFETY: checked that it's a legal unicode value Ok(unsafe { from_u32_unchecked(i) }) Ok(unsafe { transmute(i) }) } } }"} {"_id":"q-en-rust-19a25cb7546a38869ea883763103fd382bf503f8d4c9a86fe7097c9bd7dd7155","text":"} fn run_ui_cargo(config: &mut compiletest::Config) { if cargo::is_rustc_test_suite() { return; } fn run_tests( config: &compiletest::Config, filter: &Option,"} {"_id":"q-en-rust-1a00d8c4bfea1de316291798da6e1ce51de72fba4dd35aa4e55fd015dff2dad5","text":"#[rustc_doc_primitive = \"f64\"] #[doc(alias = \"double\")] /// A 64-bit floating point type (specifically, the \"binary64\" type defined in IEEE 754-2008). /// A 64-bit floating-point type (specifically, the \"binary64\" type defined in IEEE 754-2008). /// /// 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"} {"_id":"q-en-rust-1a1161b7ce6350c3983e6d83cf960c55f8d1e54eb1af8ee22e6cecbf3c1bade3","text":"/// 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> { 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, }; // Flatten items that recursively store other items // 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()); } item.kind.inner_items().for_each(|i| self.item(i.clone()).unwrap()); let id = item.def_id; if let Some(mut new_item) = self.convert_item(item) {"} {"_id":"q-en-rust-1a1a2dec9a3b57696477d66b133fcbfce224980370c37681df41fef5b65fedb6","text":"// '👎 Deprecated since 1.0.0: deprecated' // @has issue_32374/struct.U.html '//*[@class=\"stab unstable\"]' // '🔬 This is a nightly-only experimental API. (test #32374)' // @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' #[rustc_deprecated(since = \"1.0.0\", reason = \"deprecated\")] #[unstable(feature = \"test\", issue = \"32374\", reason = \"unstable\")] pub struct U;"} {"_id":"q-en-rust-1a4ffcb7cf29dcff2ccc2935a45e9c3400da8c5a4eaf93487be6f396b014f1d5","text":"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(); (krate, analysis) }), &sess) Some((krate, analysis)) }), &sess); krate_and_analysis.unwrap() }"} {"_id":"q-en-rust-1a71604bfd57d1faa92388168017a0cc276e044e362016071949636b49a601c1","text":" // 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 or the MIT license // , 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()); } "} {"_id":"q-en-rust-1aa636be8b244eaed326c98686e4bfff7ed8e08a462ba18f4faf82138e9a264b","text":"fn main() { let _x = \"test\" as &::std::any::Any; //~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `str` //~^^ NOTE the trait `core::kinds::Sized` must be implemented for the cast to the object type //~^^ ERROR the trait `core::kinds::Sized` is not implemented for the type `str` }"} {"_id":"q-en-rust-1abc7a62e989d3c01508beee233a66931ed17bac072aff90414e317899f9df73","text":" Subproject commit 8485d40a3264b15b92d391e99cb3d1abf8f25025 Subproject commit 23549a8c362a403026432f65a6cb398cb10d44b7 "} {"_id":"q-en-rust-1abf5a9a099038738be52ce6afb877cdfb4970daa2d44396595391a95456ad4e","text":"use foo::self; //~ ERROR unresolved import `foo::self` //~^ ERROR `self` imports are only allowed within a { } list use std::mem::self; //~^ ERROR `self` imports are only allowed within a { } list fn main() {}"} {"_id":"q-en-rust-1ac50255539b3d8913d6292f2c4a7c1f9632950764f450655d5f1d9f32d44a96","text":"/// println!(\"{:?}\", Foo(vec![10, 11])); /// ``` #[stable(feature = \"debug_builders\", since = \"1.2.0\")] #[inline] pub fn debug_list<'b>(&'b mut self) -> DebugList<'b, 'a> { builders::debug_list_new(self) }"} {"_id":"q-en-rust-1acbb513c2262d09ca6e1af60e1acef6f533be019f4d3309a946e853db4aab42","text":" error[E0119]: conflicting implementations of trait `Bar` for type `()` --> $DIR/dont-drop-upcast-candidate.rs:10:1 | LL | impl Bar for T where dyn Foo: Unsize {} | ------------------------------------------------ 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`. "} {"_id":"q-en-rust-1b0193d5328c8ac74a597c20c564211a88f63b7efdf27abf3ca61c59d93c99fb","text":"fn check_trait_fn_not_async(&self, span: Span, asyncness: IsAsync) { if asyncness.is_async() { struct_span_err!(self.session, span, E0706, \"trait fns cannot be declared `async`\").emit() 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(); } }"} {"_id":"q-en-rust-1b08d68d378918586f925cc40298666aeacf00241b84f38c5afda79f4cdbaf7f","text":"// 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. 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, ); 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, ); } } } }"} {"_id":"q-en-rust-1b22ef3a47795ade4957a2f858457eab959e80682fdb5896ed9b44666fbd8ff0","text":" // 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 or the MIT license // , 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 } "} {"_id":"q-en-rust-1b2334a5b6a03cf8a7d155e3753307f32b2e04c63c3c6f4b4f1ceb2a88c56851","text":"| help: replace `_` with the correct type: `i32` error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $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 --> $DIR/typeck_type_placeholder_item.rs:40:24 | LL | fn test9(&self) -> _ { () }"} {"_id":"q-en-rust-1b692043bf57b8b75df39c7ea704bb4fcac55fbed2e668cfb50f94cc68e3014f","text":" // 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(); } "} {"_id":"q-en-rust-1b9de160c954b28d122a0d937c3ecb1c21f6afb14b0cb9ba4bc99a60e58d8931","text":"/// } /// ``` #[stable(feature = \"io_error_inner\", since = \"1.3.0\")] #[inline] pub fn into_inner(self) -> Option> { match self.repr { Repr::Os(..) => None,"} {"_id":"q-en-rust-1bc6d485bcab4deadb19de23dd6f11a5c83c4318e84ec74712df47e324969d38","text":" // 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 or the MIT license // , 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 ()) {} }; } "} {"_id":"q-en-rust-1c02cfa45a99df2ede8c126f14f38d21a27eac2420d63367f5ccf09e1196fb83","text":"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\"); let legacy_rustfmt = self.initial_rustc.with_file_name(exe(\"rustfmt\", host)); if !legacy_rustfmt.exists() { t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt)); } if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) { return Some(rustfmt_path); }"} {"_id":"q-en-rust-1c2abc276333d5fb11821999c6c2e4f56d556f2421270d9acf9f93aaead1d3dd","text":"// except according to those terms. // aux-build:attr-on-trait.rs // ignore-stage1 #![feature(proc_macro)]"} {"_id":"q-en-rust-1c3c86032b6d4b0b3010040adbddb11e9a6342a38fabd6635a02d317a36a9b44","text":"let host_libs = builder .stage_out(compiler, Mode::ToolRustc) .join(builder.cargo_dir()); let target_libs = builder .stage_out(compiler, Mode::ToolRustc) .join(&self.host) .join(builder.cargo_dir()); cargo.env(\"HOST_LIBS\", host_libs); cargo.env(\"TARGET_LIBS\", target_libs); // clippy tests need to find the driver cargo.env(\"CLIPPY_DRIVER_PATH\", clippy);"} {"_id":"q-en-rust-1c3f42a92a75b84ae62a565ac834798d447d9652a2c996cd7e40daf3b5c1539f","text":"pub fn get_linker(sess: &Session) -> (String, Command, Vec<(OsString, OsString)>) { let envs = vec![(\"PATH\".into(), command_path(sess))]; // 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) } }; if let Some(ref linker) = sess.opts.cg.linker { (linker.clone(), Command::new(linker), envs) (linker.clone(), cmd(linker), envs) } 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; (linker.clone(), Command::new(&linker), envs) (linker.clone(), cmd(linker), envs) } }"} {"_id":"q-en-rust-1c9182b3020da5b9e9c95397b9dc371921adfe7d68fc690f51e2e4a3a7b6b0a5","text":" // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #77650 struct C([T; N.get()]) where [T; N.get()]: Sized; impl<'a, const N: core::num::NonZeroUsize, A, B: PartialEq> PartialEq<&'a [A]> for C where [B; N.get()]: Sized, { fn eq(&self, other: &&'a [A]) -> bool { self.0 == other //~^ error: can't compare } } fn main() {} "} {"_id":"q-en-rust-1ce10baa949a26c58b1cd8af26cbf806499cae26fe1e59fb786b58b9d6b9e8da","text":"retry pip3 install awscli --upgrade --user echo \"##vso[task.prependpath]$HOME/.local/bin\" displayName: Install awscli (Linux) condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux')) - script: pip install awscli displayName: Install awscli (non-Linux) condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux')) condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Linux')) # Configure our CI_JOB_NAME variable which log analyzers can use for the main # step to see what's going on."} {"_id":"q-en-rust-1d1e5a17691a0410b33ff7bd6b7ff8c9ee8c8b0a9af9a51b7c312d4fcf3c04d8","text":" Subproject commit 941968db2fd9c85788a4f971c8e425d46b4cb734 Subproject commit 75a5f9236c689a547fe207a10854f0775bce7937 "} {"_id":"q-en-rust-1d2d5fafeaa6e20b598aac1d87be98776ec174e3df6e52ec5f5b3fdfffdc1676","text":"|| 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) || self.suggest_coercing_result_via_try_operator(err, expr, expected, expr_ty) || self.suggest_missing_unwrap_expect(err, expr, expected, expr_ty); || self.suggest_coercing_result_via_try_operator(err, expr, expected, expr_ty); if !suggested { self.note_source_of_type_mismatch_constraint("} {"_id":"q-en-rust-1d2f25a34c4d865b1d9eed7d4ff667a8324effc948f10bdb491886539247a2e9","text":"/// 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(); 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\") 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\") } } } }; 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); }; 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); 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); } 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); }; 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); } } fn_sig(state, &c.sig); return false; } } 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); } } }); 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); } state.result() 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 }); } } impl Variance {"} {"_id":"q-en-rust-1d3450039f0d14b6e1c079ac1cec417dde081838d47d8cc98fe087b5cb4b423b","text":" 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`. "} {"_id":"q-en-rust-1d6d423b53dbe5cef576e2541957c540176808e71d43c181ab62710d2c95aad2","text":" #[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() {} "} {"_id":"q-en-rust-1d89a26cc507119d46e22ddec86a6ce890906ead166c03a8d6776beb0ac1b7de","text":" 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`. "} {"_id":"q-en-rust-1d998adc3448d96d2171fc5eed79a03c6ed0210d492e3607800844217278bcf4","text":"impl Step for RustcDocs { type Output = Option; const DEFAULT: bool = true; const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder;"} {"_id":"q-en-rust-1d99fb1300f77ef10a84d2f924b6c92597e0852b22f045430b5e9b63a87bb795","text":" 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`. "} {"_id":"q-en-rust-1d9ed2d556f6f3723a9c495ddfb4083726dde618afa0c3fa68ac6ec3b2ee1e82","text":"euv::AutoRef(..) | euv::ClosureInvocation(..) | euv::ForLoop(..) | euv::RefBinding(..) => { euv::RefBinding(..) | euv::MatchDiscriminant(..) => { format!(\"previous borrow of `{}` occurs here\", self.bccx.loan_path_to_string(&*old_loan.loan_path)) }"} {"_id":"q-en-rust-1db5248d1b2c0eddd506850c57ab4cf866769951e402eb7abe526cc8afc2c11c","text":" 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`. "} {"_id":"q-en-rust-1e19b26604193a5af0c9d04320e06294b061e4f7d3e4a55dd919cd2fd0ae4f46","text":"fn fmt(&self, f: &mut Formatter) -> Result { try!(write!(f, \"\"\")); for c in self.chars().flat_map(|c| c.escape_default()) { try!(write!(f, \"{}\", c)); try!(f.write_char(c)) } write!(f, \"\"\") }"} {"_id":"q-en-rust-1e1c8ffde5f297e643b3b2820bbf4758d443e6cbeda978b216926b73a488e148","text":" //@ check-pass #![feature(inherent_associated_types)] //~^ WARN the feature `inherent_associated_types` is incomplete struct D { a: T } impl D { type Item = T; fn next() -> Self::Item { Self::Item::default() } } fn main() { } "} {"_id":"q-en-rust-1e1d93fced3d9fbeda6dcb30bc66fc7460f9a8f7eec94281c1a68ecef942346f","text":"/// println!(\"{:?}\", Foo(vec![(\"A\".to_string(), 10), (\"B\".to_string(), 11)])); /// ``` #[stable(feature = \"debug_builders\", since = \"1.2.0\")] #[inline] pub fn debug_map<'b>(&'b mut self) -> DebugMap<'b, 'a> { builders::debug_map_new(self) }"} {"_id":"q-en-rust-1e1dfbad1ab9acf8abb0446035681f29f8b6d050640f182b063c4836daa91a62","text":" 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 } "} {"_id":"q-en-rust-1e304a191f883320a578ead565526b4ddae3dbfabfcea8ccdd43e4488366a897","text":"); } 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\", ); } // Try to report a help message if !trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)"} {"_id":"q-en-rust-1e60024065413774d177c03d8686b6e52bfa887f244b9b144df6ce58edfd99b4","text":"ty ); // Fast path: if this is a primitive simple `==` will work let saw_impl = impl_type == ty; // 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 (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, }; if saw_impl { Some(trait_) } else { None } })"} {"_id":"q-en-rust-1e7339c9126e45f6605253a1a31533cd24bf614c5f258eab8775f754a3d3ca1a","text":"#[derive(Clone)] enum Enum { Variant1, //~ ERROR: variant is never used Variant1, //~ ERROR: variant is never constructed Variant2, }"} {"_id":"q-en-rust-1ea7516811c0ff542fdb5bfc172b0a063c4edfe9284fe598374f817d01542562","text":"/// of the type. fn in_any_value_of_ty(_cx: &ConstCx<'_, 'tcx>, _ty: Ty<'tcx>) -> bool; 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)) } fn in_projection_structurally( cx: &ConstCx<'_, 'tcx>, per_local: &impl Fn(Local) -> bool,"} {"_id":"q-en-rust-1f2e610c11917a6ac13e3e454a908e6135e22a65e7c57b844a08053e6bc6ce35","text":"/// with this error. /// /// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked /// [`&str`]: ../../std/primitive.str.html /// [`String`]: struct.String.html /// [`u8`]: ../../std/primitive.u8.html /// [`Vec`]: ../../std/vec/struct.Vec.html /// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html /// [`as_bytes`]: struct.String.html#method.as_bytes /// [`into_bytes`]: struct.String.html#method.into_bytes /// [`FromUtf8Error`]: struct.FromUtf8Error.html /// [`Err`]: ../../std/result/enum.Result.html#variant.Err #[inline]"} {"_id":"q-en-rust-1f50f54a4c7eb90226c91b194d0ee08ee91a375235a768154cfb384c984b6a30","text":"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\"); self.check_toolstate(); self.digest_and_sign(); let manifest = self.build_manifest(); self.write_channel_files(&self.rust_release, &manifest);"} {"_id":"q-en-rust-1f7ebf3e662e6a4bff0390b7828a999c027163c69979321b56fe80f93ea4c41d","text":"} TokenTree::Token(t) => { // 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) { // 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) { item.idx += 1; self.next_items.push(item); }"} {"_id":"q-en-rust-1ff59c8648948705813d425bcf6e310212b37cdaef37d3cc18609e1417725269","text":"}; use rustc_hir::def_id::DefId; use rustc_macros::{LintDiagnostic, Subdiagnostic}; use rustc_middle::ty::{Predicate, Ty, TyCtxt}; use rustc_middle::ty::{PolyExistentialTraitRef, Predicate, Ty, TyCtxt}; use rustc_session::parse::ParseSess; use rustc_span::{edition::Edition, sym, symbol::Ident, Span, Symbol};"} {"_id":"q-en-rust-201518e7a471880d5de4cd30ff7430e898742a384e17de9f515cb3581c89cd67","text":" // 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 } "} {"_id":"q-en-rust-202dbb5a3b56371ffcf484bed5c5ada3f5cd99e346b369e1995a890d93aaa5b3","text":"/// /// assert_eq!(actual, expected); /// ``` #[unstable(feature = \"ptr_hash\", reason = \"newly added\", issue = \"56286\")] #[stable(feature = \"ptr_hash\", since = \"1.35.0\")] pub fn hash(hashee: *const T, into: &mut S) { use hash::Hash; hashee.hash(into);"} {"_id":"q-en-rust-202e9ea6234d49e9486be204a086864d103beab5082f8d88e01a67303e59d194","text":"ENV TARGETS=$TARGETS,aarch64-fuchsia ENV TARGETS=$TARGETS,wasm32-unknown-unknown ENV TARGETS=$TARGETS,wasm32-wasi # FIXME(#61022) - reenable solaris # ENV TARGETS=$TARGETS,sparcv9-sun-solaris # ENV TARGETS=$TARGETS,x86_64-sun-solaris ENV TARGETS=$TARGETS,sparcv9-sun-solaris ENV TARGETS=$TARGETS,x86_64-sun-solaris ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32 ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx"} {"_id":"q-en-rust-2030b41956f1ac39fb2b551ebc6c5c90f2952cc30e33b3eb995a31630c9caf97","text":" // 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 or the MIT license // , 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(); } "} {"_id":"q-en-rust-2037244389db9b9a3b19065e9f0fc3977f53a954ba992e7461e6900e46fbd0c8","text":"if w > 2 { val = utf8_acc_cont_byte!(val, s[i + 2]); } if w > 3 { val = utf8_acc_cont_byte!(val, s[i + 3]); } return CharRange {ch: unsafe { transmute(val as u32) }, next: i}; return CharRange {ch: unsafe { transmute(val) }, next: i}; } return multibyte_char_range_at_reverse(*self, prev);"} {"_id":"q-en-rust-2038c89d7fc3b100fb60ca8b395199478d023a7c8ee89db8d0e63148e8d87f37","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(fn_traits)] fn main() { ::call; //~^ ERROR associated type bindings are not allowed here [E0229] } "} {"_id":"q-en-rust-206fb8d110eaa902a892754da50270ec46650f4096261fec039e6f165747aec6","text":"| sym::default_lib_allocator | sym::start | sym::custom_mir, .. ] => {} [name, ..] => { match BUILTIN_ATTRIBUTE_MAP.get(name) { // checked below Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {} Some(_) => { // 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. // 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. if !name.as_str().starts_with(\"rustc_\") { span_bug!( attr.span,"} {"_id":"q-en-rust-2090e57d0624a1568785c284618483d213821ec3385063743ba70736df9c22f8","text":"repr_packed, repr_simd, repr_transparent, require, residual, result, rhs,"} {"_id":"q-en-rust-21165f414a854d15c1935be77df9d1388f0a8704d2e2322f28a550a1ce11e680","text":" 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\"}) "} {"_id":"q-en-rust-212cc0932fb4e8631e7cf4471985e746c4d784b37055ad54a03265f444bf96ac","text":"} 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.
"} {"_id":"q-en-rust-2139544592d01b88cf097e70c80b38daf4c57bc6f663f52aec2228bb898f8a95","text":" // 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; } "} {"_id":"q-en-rust-214e132c49b265cedd29b99033be89db0bddf44e3ba013806046b6f06b09995d","text":" 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 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)); | ~ ~ 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, 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`. "} {"_id":"q-en-rust-217f3555e35d74e60ea6b9a32d25835584f1964c109f36bba74e805304f965a0","text":"// Multibyte case is a fn to allow char_range_at to inline cleanly fn multibyte_char_range_at(s: &str, i: uint) -> CharRange { let mut val = s[i] as uint; let mut val = s[i] as u32; let w = UTF8_CHAR_WIDTH[val] as uint; assert!((w != 0));"} {"_id":"q-en-rust-2185c11d719580ae6a96bf23adb79035c9d3125dbd763d73071a729c1a03be63","text":"let crate_types = if options.proc_macro_crate { vec![config::CrateType::ProcMacro] } else { vec![config::CrateType::Dylib] vec![config::CrateType::Rlib] }; let sessopts = config::Options {"} {"_id":"q-en-rust-21c1a25f20443dc0f5f80d4b56059c6b2af3768650669a2eedf50375d0cb78a8","text":"#![feature(ptr_offset_from)] #![feature(rustc_attrs)] #![feature(receiver_trait)] #![feature(slice_from_raw_parts)] #![feature(specialization)] #![feature(staged_api)] #![feature(std_internals)]"} {"_id":"q-en-rust-21e613c3b1faf714a8b18ba641183acce7f8376d10a99067558b8cb537b55083","text":"#[doc(keyword = \"struct\")] // /// The `struct` keyword. /// The keyword used to define structs. /// /// The `struct` keyword is used to define a struct type. /// Structs in Rust come in three flavours: Regular structs, tuple structs, /// and empty structs. /// /// Example: /// ```rust /// struct Regular { /// field1: f32, /// field2: String, /// pub field3: bool /// } /// /// struct Tuple(u32, String); /// /// struct Empty; /// ``` /// struct Foo { /// field1: u32, /// field2: String, /// /// 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, /// } /// /// 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 /// }; /// ``` /// /// There are different kinds of structs. For more information, take a look at the /// [Rust Book][book]. /// 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]. /// /// [`PhantomData`]: marker/struct.PhantomData.html /// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html /// [reference]: https://doc.rust-lang.org/reference/items/structs.html mod struct_keyword { }"} {"_id":"q-en-rust-22b172c85ea0f880cac595f835737979c74284275326a223ff9b0da0810e1885","text":"let mut _0: *const &u8; let mut _2: *const &u8; let mut _3: *const &u8; let mut _4: *const &u8; scope 1 (inlined generic_cast::<&u8, &u8>) { debug x => _3; let mut _4: *const &u8; debug x => _4; let mut _5: *const &u8; } bb0: { StorageLive(_2); StorageLive(_3); _3 = _1; StorageLive(_4); _4 = _3; - _2 = move _4 as *const &u8 (PtrToPtr); + _2 = move _4; _4 = _1; StorageLive(_5); _5 = _4; - _3 = move _5 as *const &u8 (PtrToPtr); + _3 = move _5; StorageDead(_5); StorageDead(_4); StorageDead(_3); - _2 = move _3 as *const &u8 (PtrToPtr); + _2 = move _3; _0 = _2; StorageDead(_3); StorageDead(_2); return; }"} {"_id":"q-en-rust-22c8b826dc1759574aed457e25d6a569168c4ac05932b876fbb1262d6dba6511","text":"// extern-return-TwoU64s // foreign-fn-with-byval // issue-28676 // issue-62350-sysv-neg-reg-counts // struct-return // ignore-android"} {"_id":"q-en-rust-232115002819804541bca4b9ca369167bda6a4ecfb4dfb35cc6435b6aa9bf328","text":"} // Determine if a node with the given attributes should be included in this configuation. fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool { pub fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool { 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) {"} {"_id":"q-en-rust-235f3ce6fd3365a857a117f30c0a12690726a1aef3783508005c55dbc99fc383","text":" // 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 or the MIT license // , 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); } "} {"_id":"q-en-rust-23b8a63dbb5cf1492a3b8721f7b56b6e42e4b3e6cad48284093b46d4ca1128b9","text":"There’s just one line of this first example left: ```rust,ignore println!(\"You guessed: {}\", input); println!(\"You guessed: {}\", guess); } ``` This prints out the string we saved our input in. The `{}`s are a placeholder, and so we pass it `input` as an argument. If we had multiple `{}`s, we would and so we pass it `guess` as an argument. If we had multiple `{}`s, we would pass multiple arguments: ```rust"} {"_id":"q-en-rust-23d90071ecaa24e475f6121790b95a7e6097e22eb7e26e4b7ff65b9222ad5743","text":" // compile-flags: -Zsave-analysis // only-x86_64 // Also test for #72960 #![feature(asm)]"} {"_id":"q-en-rust-24273e92ffa86722e033fad957ab7e07b321364454cdda7964847f949bd6fefd","text":"}; ``` 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`. At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden inside a `const`, `static`, or `const fn`. 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. 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`. [conditionals]: https://github.com/rust-lang/rust/issues/49146 [loops]: https://github.com/rust-lang/rust/issues/52000 [`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 "} {"_id":"q-en-rust-243b21ac619c9029c3bc517719f0e59b6d0acd468feac2459e0479267652a915","text":" 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`. "} {"_id":"q-en-rust-2451b88c0cc752a6725a450675fa35cb2eef911c05c4b3a722e5d7a29d0e6ec9","text":"id, expr_ty.repr(self.tcx()), def); match def { def::DefStruct(..) | def::DefVariant(..) => { def::DefStruct(..) | def::DefVariant(..) | def::DefFn(..) | def::DefStaticMethod(..) => { Ok(self.cat_rvalue_node(id, span, expr_ty)) } def::DefFn(..) | def::DefStaticMethod(..) | def::DefMod(_) | def::DefForeignMod(_) | def::DefStatic(_, false) | def::DefMod(_) | def::DefForeignMod(_) | def::DefStatic(_, false) | def::DefUse(_) | def::DefTrait(_) | def::DefTy(_) | def::DefPrimTy(_) | def::DefTyParam(..) | def::DefTyParamBinder(..) | def::DefRegion(_) | def::DefLabel(_) | def::DefSelfTy(..) | def::DefMethod(..) => {"} {"_id":"q-en-rust-2473453dbc575b939318490d6f89d2b5eb5746cd74658826cc1b9404039f5e44","text":" // 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 or the MIT license // , 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 } "} {"_id":"q-en-rust-2483d863943b6aa71d4fa027394680bd88fb2d6e978e117ae611e32d2f7eb360","text":"#[diag(parse_use_eq_instead)] pub(crate) struct UseEqInstead { #[primary_span] #[suggestion(style = \"verbose\", applicability = \"machine-applicable\", code = \"=\")] pub span: Span, #[suggestion(style = \"verbose\", applicability = \"machine-applicable\", code = \"\")] pub suggestion: Span, } #[derive(Diagnostic)]"} {"_id":"q-en-rust-24a20abf51cce5104541d084ba7b16884f5909a3eb5dc88fc1df74841398e6be","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Foo { const AMT: usize; } enum Bar { First(A), Second(B), } impl Foo for Bar { 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!(\"{}\", as Foo>::AMT); } "} {"_id":"q-en-rust-24bef5309ff4893abd597dd15b6d1f941a011815e7ab0fd7ee836726cb11fc3d","text":"use crate::build::{BlockAnd, BlockAndExtension, Builder}; use crate::build::{GuardFrame, GuardFrameLocal, LocalsForNode}; use crate::hair::{self, *}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::{fx::{FxHashMap, FxHashSet}, stack::ensure_sufficient_stack}; use rustc_hir::HirId; use rustc_index::bit_set::BitSet; use rustc_middle::middle::region;"} {"_id":"q-en-rust-24cf365c5a570063ffc44044fcfc4dd13486fd9136ec93191eb1746b996dba13","text":" //@ 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(operation: impl Fn() -> Fut) { operation().await; } pub async fn orchestrate_simple_crud() { test(async || async {}.await).await; } fn main() {} "} {"_id":"q-en-rust-24e05572bc32be741f57a94cd225572b6bb9c6933f06334c60cc34d6718e6031","text":" //@ aux-build:implied-predicates.rs //@ check-pass extern crate implied_predicates; use implied_predicates::Bar; fn bar() {} fn main() {} "} {"_id":"q-en-rust-24fd671a6e92215aa5f15fc7c36c00d6cd02bc668c2f9d59b6d69b6955e32a3e","text":"} code, pre, h1.fqn { font-family: Menlo, Monaco, Consolas, \"Inconsolata\", \"Courier New\", monospace; font-family: \"Inconsolata\", Menlo, Monaco, Consolas, \"DejaVu Sans Mono\", monospace; } code, pre { color: #333;"} {"_id":"q-en-rust-24ff8d628c6040a1839cb428d533408539c0e0affbece0ef561915d222934519","text":" // 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 or the MIT license // , 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() {} "} {"_id":"q-en-rust-25216c979b5d60ec2c09044aae0c023aa2587c352cccba461cb948a43e24a918","text":"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)); }"} {"_id":"q-en-rust-2537b17f4d84b6f7b33527d39d7b4238f0db2b2044a98accf3ef4f10325bd8cd","text":"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) { let leading_whitespace = source_string.chars().take_while(|c| c.is_whitespace()).count(); 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(); if source_string.chars().any(|c| !c.is_whitespace()) { whitespace_margin = min(whitespace_margin, leading_whitespace); }"} {"_id":"q-en-rust-258e3fdc479ae2342449d856fec0518e14fad0fdd23f2f49f98f8a4c0462813d","text":"candidates.ambiguous = true; // Could wind up being a fn() type. } // Provide an impl, but only for suitable `fn` pointers. ty::FnDef(..) | ty::FnPtr(_) => { ty::FnPtr(_) => { if let ty::FnSig { unsafety: hir::Unsafety::Normal, abi: Abi::Rust,"} {"_id":"q-en-rust-259772f739ec95d2a3c94131978ec55e853585730317b553df06a55d7ecd2dd3","text":"traits_in_scope: Default::default(), all_traits: Default::default(), all_trait_impls: Default::default(), document_private_items, }; // Because of the `crate::` prefix, any doc comment can reference"} {"_id":"q-en-rust-25dd76d98bad1d92511143fb7a70649fdbb8c99815f50b87f46234dd59cffd4b","text":" // 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()` } } "} {"_id":"q-en-rust-25f4e6ade0b3c8083df4e12f9d4919cd7c6d70b389e7632a3cba0acef8e7b680","text":"/// 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 /// NaN-producing floating point operation is a stable bit pattern (looking at these bits multiple /// NaN-producing floating-point operation is a stable bit pattern (looking at these bits multiple /// times will yield consistent results), but running the same operation twice with the same inputs /// can produce different results. ///"} {"_id":"q-en-rust-2600f6d77fd8753946b597076f2240036951454145902538f47e1f1a32bc6e6f","text":"#[stable(feature = \"unicode_version\", since = \"1.45.0\")] pub use crate::unicode::UNICODE_VERSION; // 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; use crate::fmt::{self, Write}; use crate::iter::FusedIterator;"} {"_id":"q-en-rust-2607f660ffef6b242674cd4e237e47506c4500b0796b82171075a4f8d9bf5730","text":"))] mod imp { use super::Handler; use crate::io; use crate::mem; use crate::ptr;"} {"_id":"q-en-rust-2625c7e16728c8a0ca323c0f2bb626eaf8f0939beb232921619cb3dc9273a09b","text":"} else { val + n }; // zero the upper bits let val = val as u128; let val = (val << amt) >> amt; (Self { val: val as u128, ty: self.ty, }, oflo) } else { 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()), }; let max = u128::max_value() >> amt; let val = self.val; let oflo = val > max - n; let val = if oflo { min + (n - (max - val) - 1) n - (max - val) - 1 } else { val + n };"} {"_id":"q-en-rust-26505605ebe0721308d904e640ffd219627b5fd419c46969ebb48fe9ed503d4f","text":"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; self.cx.current_expansion.depth = 0; // Collect all macro invocations and replace them with placeholders. let (mut fragment_with_placeholders, mut invocations) ="} {"_id":"q-en-rust-265e0178b3d6b8da030e87c22d167887e1f629d864ee738d0099263256c4eca5","text":".RE .TP fB-lfR [fIKINDfR=]fINAMEfR Link the generated crate(s) to the specified native library fINAMEfR. Link the generated crate(s) to the specified library fINAMEfR. The optional fIKINDfR can be one of fIstaticfR, fIdylibfR, or fIframeworkfR. If omitted, fIdylibfR is assumed."} {"_id":"q-en-rust-267178c1ee6b5f3eb90de3c4f96bc6a79991c1fcf235d89566ddb330f7a8a9d9","text":"/// let localhost = Ipv4Addr::new(127, 0, 0, 1); /// assert_eq!(\"127.0.0.1\".parse(), Ok(localhost)); /// assert_eq!(localhost.is_loopback(), true); /// assert!(\"012.004.002.000\".parse::().is_err()); // all octets are in octal /// assert!(\"0000000.0.0.0\".parse::().is_err()); // first octet is a zero in octal /// assert!(\"0xcb.0x0.0x71.0x00\".parse::().is_err()); // all octets are in hex /// ``` #[derive(Copy)] #[stable(feature = \"rust1\", since = \"1.0.0\")]"} {"_id":"q-en-rust-268303e4ae6a3b5270d7511a8e956ef6fcd1ffc1f3b19ab30bd3f444d0f91ba8","text":".collect(), _ => Vec::new(), }; candidates.retain(|candidate| *candidate != self.tcx.parent(result.callee.def_id)); return Err(IllegalSizedBound(candidates, needs_mut, span)); }"} {"_id":"q-en-rust-2685211d7a9cac923a0c603cae472ee4269a41d6ed3b4d0f3d220ad8090303d8","text":"/// /// Note that this call does not perform any actual network communication, /// because UDP is a datagram protocol. #[deprecated = \"`UdpStream` has been deprecated\"] #[allow(deprecated)] pub fn connect(self, other: SocketAddr) -> UdpStream { UdpStream { socket: self,"} {"_id":"q-en-rust-269b5b3df4dc1dea80271fd6694b747e495f54a389f9a892987fbdc08036afec","text":" // 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; } "} {"_id":"q-en-rust-26a527f2ce582dd1ea35b248df0ce5c64dc026f8fdc052b516954be85338f400","text":"fn has_errors(&self) -> bool { self.err_count() > 0 } fn has_errors_or_delayed_span_bugs(&self) -> bool { self.has_errors() || !self.delayed_span_bugs.is_empty() } fn abort_if_errors_and_should_abort(&mut self) { self.emit_stashed_diagnostics();"} {"_id":"q-en-rust-26d4c51732e08f7bf7c5e7cd4d27b558ab7d4598d5371447f4d73e8cec6c0c57","text":"/// 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. pub fn resolve_path(&self, path: impl Into, span: Span) -> PathBuf { pub fn resolve_path( &self, path: impl Into, span: Span, ) -> Result> { let path = path.into(); // Relative paths are resolved relative to the file in which they are found"} {"_id":"q-en-rust-274829340f6bf4d0830a6e54879840480bc4141308a2b8e5367245bbfec991ca","text":"// The root node must be created with create_root_def() assert!(data != DefPathData::CrateRoot); // Find a unique DefKey. This basically means incrementing the disambiguator // until we get no match. let mut key = DefKey { // 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 { parent: Some(parent), disambiguated_data: DisambiguatedDefPathData { data, disambiguator: 0 data, disambiguator } }; while self.keys_created.contains(&key) { key.disambiguated_data.disambiguator += 1; } self.keys_created.insert(key.clone()); let parent_hash = self.table.def_path_hash(parent); let def_path_hash = key.compute_stable_hash(parent_hash);"} {"_id":"q-en-rust-2760faaeabc1bfffa90d5aec6f09820666e7f80e1e3364f1c9b3620bd7a34a5d","text":" // 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() {} "} {"_id":"q-en-rust-276a51299151cf06ac77a38694f4309c68ef6bd0ee9fd477132d9bd62cb8d0df","text":"let lib_llvm = out_dir.join(\"build\").join(\"lib\").join(lib_name); if !lib_llvm.exists() { t!(builder.symlink_file(\"libLLVM.dylib\", &lib_llvm)); t!(builder.build.config.symlink_file(\"libLLVM.dylib\", &lib_llvm)); } }"} {"_id":"q-en-rust-2782c47b5ac722cf97c57720a810c0619139cd0080f7faff1698f5898b45fc9c","text":"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)); record!(self.tables.implied_predicates_of[def_id] <- self.tcx.implied_predicates_of(def_id)); let module_children = self.tcx.module_children_local(local_id); record_array!(self.tables.module_children_non_reexports[def_id] <-"} {"_id":"q-en-rust-2817b2d2b5341e92b51bb73fe73a8a56273c3448ca7a9a1373cecd6aceea77c5","text":"// 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\" { let llvm_config = build.llvm_config(target); 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))"} {"_id":"q-en-rust-28858d2d686b7e5d46c9366ab157d89d824493d0ffdcca159eb83e28f7528684","text":"| help: replace with the correct return type: `main::FnTest9` error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:199:14 --> $DIR/typeck_type_placeholder_item.rs:201:14 | LL | type A = _; | ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:201:14 --> $DIR/typeck_type_placeholder_item.rs:203:14 | LL | type B = _; | ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:203:14 --> $DIR/typeck_type_placeholder_item.rs:205:14 | LL | const C: _; | ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:206:14 --> $DIR/typeck_type_placeholder_item.rs:208:14 | LL | const D: _ = 42; | ^"} {"_id":"q-en-rust-288de0beb712496a5ce473b849eb6e23b69a65e5183ee4df2ad17773e1743d87","text":"pub fn is_file(&self) -> bool { self.0.is_file() } /// Test whether this file type represents a symbolic link. /// The result is mutually exclusive to the results of /// [`is_dir`] and [`is_file`]; only zero or one of these /// tests may pass. /// /// The underlying [`Metadata`] struct needs to be retrieved /// with the [`fs::symlink_metadata`] function and not the"} {"_id":"q-en-rust-28ceae6a505a799cb0cdfda0ad0c5386fd09df6ae4ecf8fd1edc31793959f86b","text":"f.write_str(\" \")?; if let Some(ref ty) = self.trait_ { match self.polarity { ty::ImplPolarity::Positive | ty::ImplPolarity::Reservation => {} ty::ImplPolarity::Negative => write!(f, \"!\")?, if self.is_negative_trait_impl() { write!(f, \"!\")?; } ty.print(cx).fmt(f)?; write!(f, \" for \")?;"} {"_id":"q-en-rust-28d97051604a7bd90121d939192bc67378cc12375251b65afb33ab3cacfe6f38","text":"use rustc_hir::Node; use rustc_middle::dep_graph::DepContext; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::relate::{self, RelateResult, TypeRelation}; use rustc_middle::ty::{ self, error::TypeError, Binder, List, Region, Subst, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable, TypeVisitable,"} {"_id":"q-en-rust-290adaaea08ce867f35f0515b1b800b7733551e1a92e00a68652683bb0b70fa2","text":"return; } // FIXME(#99978) hide #[no_mangle] symbols for proc-macros let is_windows = self.sess.target.is_like_windows; let path = tmpdir.join(if is_windows { \"list.def\" } else { \"list\" });"} {"_id":"q-en-rust-295eba40831de44f4ff108ee8ec97d6820997a51b20fb40448d512de324dfe88","text":"self.as_mut_vec().truncate(0); // verbatim paths need . and .. removed } else if comps.prefix_verbatim() { } else if comps.prefix_verbatim() && !path.inner.is_empty() { let mut buf: Vec<_> = comps.collect(); for c in path.components() { match c {"} {"_id":"q-en-rust-29800fedf683c26d33171651277bef4d925f428e8d59a37d4774e44aa4cbd857","text":"split_or_candidate |= self.simplify_candidate(candidate); } if split_or_candidate { // At least one of the candidates has been split into subcandidates. // We need to change the candidate list to include those. let mut new_candidates = Vec::new(); ensure_sufficient_stack(|| { if split_or_candidate { // At least one of the candidates has been split into subcandidates. // We need to change the candidate list to include those. let mut new_candidates = Vec::new(); for candidate in candidates { candidate.visit_leaves(|leaf_candidate| new_candidates.push(leaf_candidate)); for candidate in candidates { candidate.visit_leaves(|leaf_candidate| new_candidates.push(leaf_candidate)); } self.match_simplified_candidates( span, start_block, otherwise_block, &mut *new_candidates, fake_borrows, ); } else { self.match_simplified_candidates( span, start_block, otherwise_block, candidates, fake_borrows, ); } self.match_simplified_candidates( span, start_block, otherwise_block, &mut *new_candidates, fake_borrows, ); } else { self.match_simplified_candidates( span, start_block, otherwise_block, candidates, fake_borrows, ); }; }); } fn match_simplified_candidates("} {"_id":"q-en-rust-29b1d091d91bc890b93a551c41ccfedcc3854aefa1b44caf192bf617149ecb59","text":"} } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Seek for File { impl Seek for &File { fn seek(&mut self, pos: SeekFrom) -> io::Result { self.inner.seek(pos) } } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Read for &File { impl Read for File { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.inner.read(buf) (&*self).read(buf) } fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { (&*self).read_vectored(bufs) } fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { self.inner.read_buf(cursor) (&*self).read_buf(cursor) } #[inline] fn is_read_vectored(&self) -> bool { (&&*self).is_read_vectored() } fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { (&*self).read_to_end(buf) } fn read_to_string(&mut self, buf: &mut String) -> io::Result { (&*self).read_to_string(buf) } } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Write for File { fn write(&mut self, buf: &[u8]) -> io::Result { (&*self).write(buf) } fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { (&*self).write_vectored(bufs) } #[inline] fn is_write_vectored(&self) -> bool { (&&*self).is_write_vectored() } fn flush(&mut self) -> io::Result<()> { (&*self).flush() } } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Seek for File { fn seek(&mut self, pos: SeekFrom) -> io::Result { (&*self).seek(pos) } } #[stable(feature = \"io_traits_arc\", since = \"CURRENT_RUSTC_VERSION\")] impl Read for Arc { fn read(&mut self, buf: &mut [u8]) -> io::Result { (&**self).read(buf) } fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { self.inner.read_vectored(bufs) (&**self).read_vectored(bufs) } fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { (&**self).read_buf(cursor) } #[inline] fn is_read_vectored(&self) -> bool { self.inner.is_read_vectored() (&**self).is_read_vectored() } // Reserves space in the buffer based on the file size when available. fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { let size = buffer_capacity_required(self); buf.reserve(size.unwrap_or(0)); io::default_read_to_end(self, buf, size) (&**self).read_to_end(buf) } // Reserves space in the buffer based on the file size when available. fn read_to_string(&mut self, buf: &mut String) -> io::Result { let size = buffer_capacity_required(self); buf.reserve(size.unwrap_or(0)); io::default_read_to_string(self, buf, size) (&**self).read_to_string(buf) } } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Write for &File { #[stable(feature = \"io_traits_arc\", since = \"CURRENT_RUSTC_VERSION\")] impl Write for Arc { fn write(&mut self, buf: &[u8]) -> io::Result { self.inner.write(buf) (&**self).write(buf) } fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { self.inner.write_vectored(bufs) (&**self).write_vectored(bufs) } #[inline] fn is_write_vectored(&self) -> bool { self.inner.is_write_vectored() (&**self).is_write_vectored() } fn flush(&mut self) -> io::Result<()> { self.inner.flush() (&**self).flush() } } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Seek for &File { #[stable(feature = \"io_traits_arc\", since = \"CURRENT_RUSTC_VERSION\")] impl Seek for Arc { fn seek(&mut self, pos: SeekFrom) -> io::Result { self.inner.seek(pos) (&**self).seek(pos) } }"} {"_id":"q-en-rust-29b210d7b129725099942add3f5c16ab63c953068e59754410e2cf13d573c49c","text":"const D: _ = 42; //~^ ERROR the type placeholder `_` is not allowed within types on item signatures // type E: _; // FIXME: make the parser propagate the existence of `B` type F: std::ops::Fn(_); //~^ ERROR the type placeholder `_` is not allowed within types on item signatures } impl Qux for Struct { type A = _;"} {"_id":"q-en-rust-29b54cc1c5ab7694902a71ce647ec20de1c13371d067f270af4f31eeb4d9d94b","text":"target } const MAX_INT_REGS: usize = 6; // RDI, RSI, RDX, RCX, R8, R9 const MAX_SSE_REGS: usize = 8; // XMM0-7 pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>) where Ty: TyLayoutMethods<'a, C> + Copy, C: LayoutOf> + HasDataLayout { let mut int_regs = 6; // RDI, RSI, RDX, RCX, R8, R9 let mut sse_regs = 8; // XMM0-7 let mut int_regs = MAX_INT_REGS; let mut sse_regs = MAX_SSE_REGS; let mut x86_64_ty = |arg: &mut ArgType<'a, Ty>, is_arg: bool| { let mut cls_or_mem = classify_arg(cx, arg); let mut needed_int = 0; let mut needed_sse = 0; if is_arg { if let Ok(cls) = cls_or_mem { let mut needed_int = 0; let mut needed_sse = 0; for &c in &cls { match c { Some(Class::Int) => needed_int += 1,"} {"_id":"q-en-rust-29ed1a55cccf3c47678204bfa5e64c5ec66d8eac5259f55f47545780ad95fa75","text":"err.help(\"the semantics of slice patterns changed recently; see issue #62254\"); } else if self.autoderef(span, expected_ty) .any(|(ty, _)| matches!(ty.kind(), ty::Slice(..) | ty::Array(..))) && let (Some(span), true) = (ti.span, ti.origin_expr) && let Some(span) = ti.span && let Some(_) = ti.origin_expr && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) { let ty = self.resolve_vars_if_possible(ti.expected);"} {"_id":"q-en-rust-2a1860437e89293804a134231695bc016a781a1749ab3feea0be321f64f63f0c","text":"use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::Node; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc_middle::middle::privacy::{self, Level}; use rustc_middle::mir::interpret::{ConstAllocation, ErrorHandled, GlobalAlloc}; use rustc_middle::query::Providers;"} {"_id":"q-en-rust-2a374c56b9000ab72b4a260baeba6e57a8674fc18712967e4f5e37e039a7bbd4","text":"} } #[cfg(any(target_arch = \"x86_64\", target_arch = \"arm\"))] #[cfg(not(target_arch = \"x86\"))] #[macro_use] mod imp { pub type ptr_t = u32;"} {"_id":"q-en-rust-2a53bb0d741d7d7ddc1aa99861ff9c72c387c89196286c85177160427bc2162a","text":"/// } /// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] #[inline] pub fn raw_os_error(&self) -> Option { match self.repr { Repr::Os(i) => Some(i),"} {"_id":"q-en-rust-2a53f47872b5faf3f06de960a432c6713fcc2cf96aeb3fc59731d5da4dad45b1","text":" // revisions: current next //[next] compile-flags: -Znext-solver // check-pass #![feature(non_lifetime_binders)] //~^ WARN the feature `non_lifetime_binders` is incomplete pub trait Foo { type Bar: ?Sized; } impl Foo for () { type Bar = K; } pub fn f(a: T1, b: T2) where T1: for Foo = T>, T2: for Foo = >::Bar>, { } fn it_works() { f((), ()); } fn main() {} "} {"_id":"q-en-rust-2a6d4ebccddc1ed6485ffea932a91eb7a0e9d78b7b391e258872ebf00f9adaed","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // aux-build:plugin.rs #![feature(proc_macro)] #[macro_use] extern crate plugin; #[derive(Foo, Bar)] struct Baz { a: i32, b: i32, } fn main() {} "} {"_id":"q-en-rust-2abc916f9ed8d3ffb3fd11dff8c146d2cf3351ff1b78341f9f3a7b121f0fb1f3","text":"/// \"successfully written\" (by returning nonzero success values from /// `write`), any 0-length writes from `inner` must be reported as i/o /// errors from this method. pub(super) fn flush_buf(&mut self) -> io::Result<()> { pub(in crate::io) fn flush_buf(&mut self) -> io::Result<()> { /// Helper struct to ensure the buffer is updated after all the writes /// are complete. It tracks the number of written bytes and drains them /// all from the front of the buffer when dropped."} {"_id":"q-en-rust-2b1169fabaf0cb25b15e841df0299c5f04c8c6c3cc575bab1a9d458970a79587","text":"} let size = ret.layout.size; let bits = size.bits(); if bits <= 128 { if bits <= 256 { let unit = if bits <= 8 { Reg::i8() } else if bits <= 16 {"} {"_id":"q-en-rust-2b7e710d393a0d89ee0e30ff1721928c67a861677c5ca505c332dbc0c9060fbd","text":" error: missing `in` in `for` loop --> $DIR/issue-40782.rs:12:10 | 12 | for i 0..2 { | ^ help: try adding `in` here error: aborting due to previous error "} {"_id":"q-en-rust-2bb42eaaec1ddbf8e02820917a8769cd5e44f6e54a632fef193fc2bfd8ce0f79","text":"if !types.is_empty() { write!(w, \"

Associated Types

Associated Types

\")?; for t in &types {"} {"_id":"q-en-rust-2bddce07701efe9faa35189b8bbed92ef2a7d209e8147aafd0a51d046a237502","text":"|| found_assoc(tcx.types.u64) || found_assoc(tcx.types.u128) || found_assoc(tcx.types.f32) || found_assoc(tcx.types.f32); || found_assoc(tcx.types.f64); if found_candidate && actual.is_numeric() && !actual.has_concrete_skeleton()"} {"_id":"q-en-rust-2bfc2196185800a6fe60bedf67ce0a45d377e423b332419977293acd065e45af","text":"if v.is_ascii() { bytes.push(cx.expr_u8(expr.span, v as u8)); } else { cx.span_err(expr.span, \"non-ascii char literal in bytes!\") cx.span_err(expr.span, \"non-ascii char literal in bytes!\"); err = true; } } _ => cx.span_err(expr.span, \"unsupported literal in bytes!\") _ => { cx.span_err(expr.span, \"unsupported literal in bytes!\"); err = true; } }, _ => cx.span_err(expr.span, \"non-literal in bytes!\") _ => { cx.span_err(expr.span, \"non-literal in bytes!\"); err = true; } } } // For some reason using quote_expr!() here aborts if we threw an error. // I'm assuming that the end of the recursive parse tricks the compiler // into thinking this is a good time to stop. But we'd rather keep going. if err { // Since the compiler will stop after the macro expansion phase anyway, we // don't need type info, so we can just return a DummyResult return DummyResult::expr(sp); } let e = cx.expr_vec_slice(sp, bytes); let e = quote_expr!(cx, { static BYTES: &'static [u8] = $e; BYTES}); MacExpr::new(e) }"} {"_id":"q-en-rust-2c3514289967299a9cafdd1a66fcbde0f5bd1db6627654cd464ffb8d57ce2982","text":"let fs = fields.move_map(|f| { Spanned { span: folder.new_span(f.span), node: ast::FieldPat { ident: f.node.ident, ident: folder.fold_ident(f.node.ident), pat: folder.fold_pat(f.node.pat), is_shorthand: f.node.is_shorthand, }}"} {"_id":"q-en-rust-2c49ea1c7fb65e05ed29cad5d520ca74a73c24e6da01fdbde5737c384b543e77","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // aux-build:import_crate_var.rs // error-pattern: `$crate` may not be imported // error-pattern: `use $crate;` was erroneously allowed and will become a hard error #![feature(rustc_attrs)] #[macro_use] extern crate import_crate_var; m!(); #[rustc_error] fn main() {} "} {"_id":"q-en-rust-2c6b3ff7c8e0a6ab1f7711826f1636eca0fb2e350bfae336d0350448efc26408","text":"self.points.contains(row, index) } /// Returns an iterator of all the elements contained by the region `r` crate fn get_elements(&self, row: N) -> impl Iterator + '_ { self.points .row(row) .into_iter() .flat_map(|set| set.iter()) .take_while(move |&p| self.elements.point_in_range(p)) .map(move |p| self.elements.to_location(p)) } /// Returns a \"pretty\" string value of the region. Meant for debugging. crate fn region_value_str(&self, r: N) -> String { region_value_str( self.points .row(r) .into_iter() .flat_map(|set| set.iter()) .take_while(|&p| self.elements.point_in_range(p)) .map(|p| self.elements.to_location(p)) .map(RegionElement::Location), ) region_value_str(self.get_elements(r).map(RegionElement::Location)) } }"} {"_id":"q-en-rust-2c72eb6938f2b052372e1be6482eee0ba64d9f302bc538ad6397381d9efbc63a","text":"/// (e.g. `min`, `minimum`, `max`, `maximum`); other aspects of their semantics and which IEEE 754 /// operation they correspond to are documented with the respective functions. /// /// When a floating-point operation is executed in `const` context, the same rules apply: no /// guarantee is made about which of the NaN bit patterns described above will be returned. The /// result does not have to match what happens when executing the same code at runtime, and the /// result can vary depending on factors such as compiler version and flags. /// When an arithmetic floating-point operation is executed in `const` context, the same rules /// apply: no guarantee is made about which of the NaN bit patterns described above will be /// returned. The result does not have to match what happens when executing the same code at /// runtime, and the result can vary depending on factors such as compiler version and flags. /// /// ### Target-specific \"extra\" NaN values // FIXME: Is there a better place to put this?"} {"_id":"q-en-rust-2c827f087847c5da4c28c9440db65fe3d3f2bf93ac65d657ca9cf4f264a9ff75","text":"use clean::Variant::*; match variant { CLike(disr) => Variant::Plain(disr.map(|disr| disr.into_tcx(tcx))), Tuple(fields) => Variant::Tuple( fields .into_iter() .filter_map(|f| match *f.kind { clean::StructFieldItem(ty) => Some(ty.into_tcx(tcx)), clean::StrippedItem(_) => None, _ => unreachable!(), }) .collect(), ), Struct(s) => Variant::Struct(ids(s.fields, tcx)), Tuple(fields) => Variant::Tuple(ids_keeping_stripped(fields, tcx)), Struct(s) => Variant::Struct { fields_stripped: s.has_stripped_entries(), fields: ids(s.fields, tcx), }, } } }"} {"_id":"q-en-rust-2c9b7e731b7fd070882cc9cee8f6a4f8ca96a89f479edcdb5a4e7f1ffe6229b6","text":"self.check_export_name(hir_id, &attr, span, target) } else if self.tcx.sess.check_name(attr, sym::rustc_args_required_const) { self.check_rustc_args_required_const(&attr, span, target, item) } else if self.tcx.sess.check_name(attr, sym::rustc_layout_scalar_valid_range_start) { self.check_rustc_layout_scalar_valid_range(&attr, span, target) } else if self.tcx.sess.check_name(attr, sym::rustc_layout_scalar_valid_range_end) { self.check_rustc_layout_scalar_valid_range(&attr, span, target) } else if self.tcx.sess.check_name(attr, sym::allow_internal_unstable) { self.check_allow_internal_unstable(hir_id, &attr, span, target, &attrs) } else if self.tcx.sess.check_name(attr, sym::rustc_allow_const_fn_unstable) {"} {"_id":"q-en-rust-2ca30154175281794f8a22e6e31cbaf4b123372aee89d2414562144e01178200","text":"/// Returns a map from a sufficiently visible external item (i.e. an external item that is /// visible from at least one local module) to a sufficiently visible parent (considering /// modules that re-export the external item to be parents). fn visible_parent_map<'a>(&'a self) -> ::std::cell::RefMut<'a, DefIdMap> { let mut visible_parent_map = self.visible_parent_map.borrow_mut(); if !visible_parent_map.is_empty() { return visible_parent_map; } fn visible_parent_map<'a>(&'a self) -> ::std::cell::Ref<'a, DefIdMap> { { let visible_parent_map = self.visible_parent_map.borrow(); if !visible_parent_map.is_empty() { return visible_parent_map; } } use std::collections::vec_deque::VecDeque; use std::collections::hash_map::Entry; let mut visible_parent_map = self.visible_parent_map.borrow_mut(); for cnum in (1 .. self.next_crate_num().as_usize()).map(CrateNum::new) { let cdata = self.get_crate_data(cnum);"} {"_id":"q-en-rust-2cac947f723ba2fc469c53a700a882a5249281538a4e49be48cdb46ba884de2a","text":"without modifying the original\"] #[stable(feature = \"unicode_case_mapping\", since = \"1.2.0\")] pub fn to_lowercase(&self) -> String { let out = convert_while_ascii(self.as_bytes(), u8::to_ascii_lowercase); let (mut s, rest) = convert_while_ascii(self, u8::to_ascii_lowercase); // Safety: we know this is a valid char boundary since // out.len() is only progressed if ascii bytes are found let rest = unsafe { self.get_unchecked(out.len()..) }; // Safety: We have written only valid ASCII to our vec let mut s = unsafe { String::from_utf8_unchecked(out) }; let prefix_len = s.len(); for (i, c) in rest.char_indices() { if c == 'Σ' {"} {"_id":"q-en-rust-2cb32c5306f300fd5daf8bfefe142274e624f37cbf226254fbd0b5306eecefd2","text":"#[rustc_doc_primitive = \"f16\"] #[doc(alias = \"half\")] /// A 16-bit floating point type (specifically, the \"binary16\" type defined in IEEE 754-2008). /// A 16-bit floating-point type (specifically, the \"binary16\" type defined in IEEE 754-2008). /// /// This type is very similar to [`prim@f32`] but has decreased precision because it uses half as many /// bits. Please see [the documentation for `f32`](prim@f32) or [Wikipedia on half-precision"} {"_id":"q-en-rust-2cb36f77df2b1b8c96c390a1becae160fef1ce3dffb9c97a6da2891d4ba4b8cb","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn f(x: &mut u32) {} fn main() { let x = Box::new(3); f(&mut *x); } "} {"_id":"q-en-rust-2cb8a81acb2ccf2f0cb46bb8883a0f121a97afc52ff48bc3519300d52962aac8","text":"node_to_hir_id: self.node_to_hir_id.clone(), macro_def_scopes: self.macro_def_scopes.clone(), expansions: self.expansions.clone(), keys_created: self.keys_created.clone(), next_disambiguator: self.next_disambiguator.clone(), } } }"} {"_id":"q-en-rust-2cc08db4569cda8563bfae0123e3188452cc62dd2d54b4ab30ced48bc50242db","text":"} if self.index < self.len { self.len -= 1; self.a_len -= 1; let i = self.len; // SAFETY: `i` is smaller than the previous value of `self.len`, // which is also smaller than or equal to `self.a.len()` and `self.b.len()`"} {"_id":"q-en-rust-2ce9e68d77702a3977bff9ae6ca25474cc3db469e476b8218b390656a6f7e168","text":" error: this file contains an un-closed delimiter --> $DIR/issue-63135.rs:3:16 | LL | fn i(n{...,f # | - - ^ | | | | | un-closed delimiter | un-closed delimiter error: expected field pattern, found `...` --> $DIR/issue-63135.rs:3:8 | LL | fn i(n{...,f # | ^^^ help: to omit remaining fields, use one fewer `.`: `..` error: expected `}`, found `,` --> $DIR/issue-63135.rs:3:11 | LL | fn i(n{...,f # | ---^ | | | | | expected `}` | `..` must be at the end and cannot have a trailing comma error: expected `[`, found `}` --> $DIR/issue-63135.rs:3:15 | LL | fn i(n{...,f # | ^ expected `[` error: expected `:`, found `)` --> $DIR/issue-63135.rs:3:15 | LL | fn i(n{...,f # | ^ expected `:` error: expected one of `->`, `where`, or `{`, found `` --> $DIR/issue-63135.rs:3:15 | LL | fn i(n{...,f # | ^ expected one of `->`, `where`, or `{` here error: aborting due to 6 previous errors "} {"_id":"q-en-rust-2d04913175a532dae957de23db16c9bd7f12191fe26dda34a337a4d5fec64623","text":" PRINT-BANG INPUT (DISPLAY): ; PRINT-BANG INPUT (DEBUG): TokenStream [ Group { delimiter: None, stream: TokenStream [ Punct { ch: ';', spacing: Alone, span: $DIR/issue-80760-empty-stmt.rs:25:17: 25:18 (#0), }, ], span: $DIR/issue-80760-empty-stmt.rs:13:21: 13:23 (#4), }, ] "} {"_id":"q-en-rust-2d0aac5e0c890bbeb51bcc0a7b007b54b2971632292fe79d509705da1723be7e","text":" #![crate_type=\"lib\"] #[repr(i8)] pub enum Type { Type1 = 0, Type2 = 1 } // CHECK: define signext i8 @test() #[no_mangle] pub extern \"C\" fn test() -> Type { Type::Type1 } "} {"_id":"q-en-rust-2d160c63e6053f1422eb434106ecea94f5004727466568380059d3de309db222","text":"rc::Rc, }; require std::time::Duration; //~^ ERROR expected item, found `require` include std::time::Instant; //~^ ERROR expected item, found `include` pub using std::io; //~^ ERROR expected item, found `using` fn main() { let x = Rc::new(1); let _ = write!(io::stdout(), \"{:?}\", x); let _ = Duration::new(5, 0); let _ = Instant::now(); }"} {"_id":"q-en-rust-2d615bedb567f74fb48c5840d95fc571c7c7c9ed9df80341307e82a15ad54986","text":" error[E0594]: cannot assign to `self.foo`, which is behind a `&` reference --> $DIR/issue-93093.rs:8:9 | LL | async fn bar(&self) { | ----- help: consider changing this to be a mutable reference: `&mut self` LL | LL | self.foo += 1; | ^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written error: aborting due to previous error For more information about this error, try `rustc --explain E0594`. "} {"_id":"q-en-rust-2d6d0e084305f1635470585efd47147aa7de827e0abf0c165384833ee73d2d8f","text":"t!(read_byte(file)); // compensate for padding } let numbers_map: HashMap = t! { (0..numbers_count).filter_map(|i| match read_le_u16(file) { Ok(0xFFFF) => None, Ok(n) => Some(Ok((nnames[i].to_string(), n))), Err(e) => Some(Err(e)) let numbers_map: HashMap = t! { (0..numbers_count).filter_map(|i| { let number = if extended { read_le_u32(file) } else { read_le_u16(file).map(Into::into) }; match number { Ok(0xFFFF) => None, Ok(n) => Some(Ok((nnames[i].to_string(), n))), Err(e) => Some(Err(e)) } }).collect() };"} {"_id":"q-en-rust-2d957e8853b512cb293d28367f823514f973a6f9ed96daa90cfce7922b611606","text":" use crate::mir::interpret::Scalar; use crate::ty::{self, Ty, TyCtxt}; use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; use super::{ AssertMessage, BasicBlock, InlineAsmOperand, Operand, Place, SourceInfo, Successors, SuccessorsMut, }; pub use rustc_ast::ast::Mutability; use rustc_macros::HashStable; use rustc_span::Span; use std::borrow::Cow; use std::fmt::{self, Debug, Formatter, Write}; use std::iter; use std::slice; pub use super::query::*; #[derive(Clone, RustcEncodable, RustcDecodable, HashStable, PartialEq)] pub enum TerminatorKind<'tcx> { /// Block should have one successor in the graph; we jump there. Goto { target: BasicBlock }, /// Operand evaluates to an integer; jump depending on its value /// to one of the targets, and otherwise fallback to `otherwise`. SwitchInt { /// The discriminant value being tested. discr: Operand<'tcx>, /// The type of value being tested. /// This is always the same as the type of `discr`. /// FIXME: remove this redundant information. Currently, it is relied on by pretty-printing. switch_ty: Ty<'tcx>, /// Possible values. The locations to branch to in each case /// are found in the corresponding indices from the `targets` vector. values: Cow<'tcx, [u128]>, /// Possible branch sites. The last element of this vector is used /// for the otherwise branch, so targets.len() == values.len() + 1 /// should hold. // // This invariant is quite non-obvious and also could be improved. // One way to make this invariant is to have something like this instead: // // branches: Vec<(ConstInt, BasicBlock)>, // otherwise: Option // exhaustive if None // // However we’ve decided to keep this as-is until we figure a case // where some other approach seems to be strictly better than other. targets: Vec, }, /// Indicates that the landing pad is finished and unwinding should /// continue. Emitted by `build::scope::diverge_cleanup`. Resume, /// Indicates that the landing pad is finished and that the process /// should abort. Used to prevent unwinding for foreign items. Abort, /// Indicates a normal return. The return place should have /// been filled in before this executes. This can occur multiple times /// in different basic blocks. Return, /// Indicates a terminator that can never be reached. Unreachable, /// Drop the `Place`. Drop { place: Place<'tcx>, target: BasicBlock, unwind: Option }, /// Drop the `Place` and assign the new value over it. This ensures /// that the assignment to `P` occurs *even if* the destructor for /// place unwinds. Its semantics are best explained by the /// elaboration: /// /// ``` /// BB0 { /// DropAndReplace(P <- V, goto BB1, unwind BB2) /// } /// ``` /// /// becomes /// /// ``` /// BB0 { /// Drop(P, goto BB1, unwind BB2) /// } /// BB1 { /// // P is now uninitialized /// P <- V /// } /// BB2 { /// // P is now uninitialized -- its dtor panicked /// P <- V /// } /// ``` DropAndReplace { place: Place<'tcx>, value: Operand<'tcx>, target: BasicBlock, unwind: Option, }, /// Block ends with a call of a converging function. Call { /// The function that’s being called. func: Operand<'tcx>, /// Arguments the function is called with. /// These are owned by the callee, which is free to modify them. /// This allows the memory occupied by \"by-value\" arguments to be /// reused across function calls without duplicating the contents. args: Vec>, /// Destination for the return value. If some, the call is converging. destination: Option<(Place<'tcx>, BasicBlock)>, /// Cleanups to be done if the call unwinds. cleanup: Option, /// `true` if this is from a call in HIR rather than from an overloaded /// operator. True for overloaded function call. from_hir_call: bool, /// This `Span` is the span of the function, without the dot and receiver /// (e.g. `foo(a, b)` in `x.foo(a, b)` fn_span: Span, }, /// Jump to the target if the condition has the expected value, /// otherwise panic with a message and a cleanup target. Assert { cond: Operand<'tcx>, expected: bool, msg: AssertMessage<'tcx>, target: BasicBlock, cleanup: Option, }, /// A suspend point. Yield { /// The value to return. value: Operand<'tcx>, /// Where to resume to. resume: BasicBlock, /// The place to store the resume argument in. resume_arg: Place<'tcx>, /// Cleanup to be done if the generator is dropped at this suspend point. drop: Option, }, /// Indicates the end of the dropping of a generator. GeneratorDrop, /// A block where control flow only ever takes one real path, but borrowck /// needs to be more conservative. FalseEdge { /// The target normal control flow will take. real_target: BasicBlock, /// A block control flow could conceptually jump to, but won't in /// practice. imaginary_target: BasicBlock, }, /// A terminator for blocks that only take one path in reality, but where we /// reserve the right to unwind in borrowck, even if it won't happen in practice. /// This can arise in infinite loops with no function calls for example. FalseUnwind { /// The target normal control flow will take. real_target: BasicBlock, /// The imaginary cleanup block link. This particular path will never be taken /// in practice, but in order to avoid fragility we want to always /// consider it in borrowck. We don't want to accept programs which /// pass borrowck only when `panic=abort` or some assertions are disabled /// due to release vs. debug mode builds. This needs to be an `Option` because /// of the `remove_noop_landing_pads` and `no_landing_pads` passes. unwind: Option, }, /// Block ends with an inline assembly block. This is a terminator since /// inline assembly is allowed to diverge. InlineAsm { /// The template for the inline assembly, with placeholders. template: &'tcx [InlineAsmTemplatePiece], /// The operands for the inline assembly, as `Operand`s or `Place`s. operands: Vec>, /// Miscellaneous options for the inline assembly. options: InlineAsmOptions, /// Source spans for each line of the inline assembly code. These are /// used to map assembler errors back to the line in the source code. line_spans: &'tcx [Span], /// Destination block after the inline assembly returns, unless it is /// diverging (InlineAsmOptions::NORETURN). destination: Option, }, } #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)] pub struct Terminator<'tcx> { pub source_info: SourceInfo, pub kind: TerminatorKind<'tcx>, } 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> { self.kind.unwind() } pub fn unwind_mut(&mut self) -> Option<&mut Option> { 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> { 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> { 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), } } } impl<'tcx> Debug for TerminatorKind<'tcx> { fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result { self.fmt_head(fmt)?; let successor_count = self.successors().count(); let labels = self.fmt_successor_labels(); assert_eq!(successor_count, labels.len()); match successor_count { 0 => Ok(()), 1 => write!(fmt, \" -> {:?}\", self.successors().next().unwrap()), _ => { write!(fmt, \" -> [\")?; for (i, target) in self.successors().enumerate() { if i > 0 { write!(fmt, \", \")?; } write!(fmt, \"{}: {:?}\", labels[i], target)?; } write!(fmt, \"]\") } } } } impl<'tcx> TerminatorKind<'tcx> { /// Writes the \"head\" part of the terminator; that is, its name and the data it uses to pick the /// successor basic block, if any. The only information not included is the list of possible /// successors, which may be rendered differently between the text and the graphviz format. pub fn fmt_head(&self, fmt: &mut W) -> fmt::Result { use self::TerminatorKind::*; match self { Goto { .. } => write!(fmt, \"goto\"), SwitchInt { discr, .. } => write!(fmt, \"switchInt({:?})\", discr), Return => write!(fmt, \"return\"), GeneratorDrop => write!(fmt, \"generator_drop\"), Resume => write!(fmt, \"resume\"), Abort => write!(fmt, \"abort\"), Yield { value, resume_arg, .. } => write!(fmt, \"{:?} = yield({:?})\", resume_arg, value), Unreachable => write!(fmt, \"unreachable\"), Drop { place, .. } => write!(fmt, \"drop({:?})\", place), DropAndReplace { place, value, .. } => { write!(fmt, \"replace({:?} <- {:?})\", place, value) } Call { func, args, destination, .. } => { if let Some((destination, _)) = destination { write!(fmt, \"{:?} = \", destination)?; } write!(fmt, \"{:?}(\", func)?; for (index, arg) in args.iter().enumerate() { if index > 0 { write!(fmt, \", \")?; } write!(fmt, \"{:?}\", arg)?; } write!(fmt, \")\") } Assert { cond, expected, msg, .. } => { write!(fmt, \"assert(\")?; if !expected { write!(fmt, \"!\")?; } write!(fmt, \"{:?}, \", cond)?; msg.fmt_assert_args(fmt)?; write!(fmt, \")\") } FalseEdge { .. } => write!(fmt, \"falseEdge\"), FalseUnwind { .. } => write!(fmt, \"falseUnwind\"), InlineAsm { template, ref operands, options, .. } => { write!(fmt, \"asm!(\"{}\"\", InlineAsmTemplatePiece::to_string(template))?; for op in operands { write!(fmt, \", \")?; let print_late = |&late| if late { \"late\" } else { \"\" }; match op { InlineAsmOperand::In { reg, value } => { write!(fmt, \"in({}) {:?}\", reg, value)?; } InlineAsmOperand::Out { reg, late, place: Some(place) } => { write!(fmt, \"{}out({}) {:?}\", print_late(late), reg, place)?; } InlineAsmOperand::Out { reg, late, place: None } => { write!(fmt, \"{}out({}) _\", print_late(late), reg)?; } InlineAsmOperand::InOut { reg, late, in_value, out_place: Some(out_place), } => { write!( fmt, \"in{}out({}) {:?} => {:?}\", print_late(late), reg, in_value, out_place )?; } InlineAsmOperand::InOut { reg, late, in_value, out_place: None } => { write!(fmt, \"in{}out({}) {:?} => _\", print_late(late), reg, in_value)?; } InlineAsmOperand::Const { value } => { write!(fmt, \"const {:?}\", value)?; } InlineAsmOperand::SymFn { value } => { write!(fmt, \"sym_fn {:?}\", value)?; } InlineAsmOperand::SymStatic { def_id } => { write!(fmt, \"sym_static {:?}\", def_id)?; } } } write!(fmt, \", options({:?}))\", options) } } } /// Returns the list of labels for the edges to the successor basic blocks. pub fn fmt_successor_labels(&self) -> Vec> { use self::TerminatorKind::*; match *self { Return | Resume | Abort | Unreachable | GeneratorDrop => vec![], Goto { .. } => vec![\"\".into()], SwitchInt { ref values, switch_ty, .. } => ty::tls::with(|tcx| { let param_env = ty::ParamEnv::empty(); let switch_ty = tcx.lift(&switch_ty).unwrap(); let size = tcx.layout_of(param_env.and(switch_ty)).unwrap().size; values .iter() .map(|&u| { ty::Const::from_scalar(tcx, Scalar::from_uint(u, size), switch_ty) .to_string() .into() }) .chain(iter::once(\"otherwise\".into())) .collect() }), Call { destination: Some(_), cleanup: Some(_), .. } => { vec![\"return\".into(), \"unwind\".into()] } Call { destination: Some(_), cleanup: None, .. } => vec![\"return\".into()], Call { destination: None, cleanup: Some(_), .. } => vec![\"unwind\".into()], Call { destination: None, cleanup: None, .. } => vec![], Yield { drop: Some(_), .. } => vec![\"resume\".into(), \"drop\".into()], Yield { drop: None, .. } => vec![\"resume\".into()], DropAndReplace { unwind: None, .. } | Drop { unwind: None, .. } => { vec![\"return\".into()] } DropAndReplace { unwind: Some(_), .. } | Drop { unwind: Some(_), .. } => { vec![\"return\".into(), \"unwind\".into()] } Assert { cleanup: None, .. } => vec![\"\".into()], Assert { .. } => vec![\"success\".into(), \"unwind\".into()], FalseEdge { .. } => vec![\"real\".into(), \"imaginary\".into()], FalseUnwind { unwind: Some(_), .. } => vec![\"real\".into(), \"cleanup\".into()], FalseUnwind { unwind: None, .. } => vec![\"real\".into()], InlineAsm { destination: Some(_), .. } => vec![\"\".into()], InlineAsm { destination: None, .. } => vec![], } } } "} {"_id":"q-en-rust-2dd7c5780b5cf6ddcfa3e671d81a0b610429615db0337950062f1bb5e7dd4687","text":"//! //! * Should probably have something like this for strings. //! * Should they implement Closable? Would take extra state. use cmp::max; use cmp::min; use prelude::*; use super::*;"} {"_id":"q-en-rust-2ddf6c58ddf4b601141935c77f885ff7fc81a67e0a3f28728e31de8e60e347d2","text":" #![feature(intrinsics)] extern \"C\" { pub static FOO: extern \"rust-intrinsic\" fn(); } fn main() { FOO() //~ ERROR: use of extern static is unsafe } "} {"_id":"q-en-rust-2e09a448c19e90d4f6946df4a25a9cdd3446e0f8e18f7b7c713812b29b316860","text":" use std::iter; use either::Either; use hir::PatField; use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxIndexSet; use rustc_errors::{"} {"_id":"q-en-rust-2e1a14cd4d56dc6d49380fddd961ba230ec291dd14e59713838519368dfe0ab9","text":" error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:14:1 | LL | impl Marker1 for dyn Object + Marker2 { } //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:16:1 | LL | impl Marker2 for dyn Object + Marker2 { } //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` error[E0117]: only traits defined in the current crate can be implemented for arbitrary types --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:22:1 | LL | unsafe impl Send for dyn Marker2 {} //~ ERROR E0117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate | = note: the impl does not reference only types defined in this crate = note: define and implement a trait or new type instead error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:26:1 | LL | unsafe impl Send for dyn Object {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:27:1 | LL | unsafe impl Send for dyn Object + Marker2 {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error: aborting due to 5 previous errors Some errors occurred: E0117, E0321, E0371. For more information about an error, try `rustc --explain E0117`. "} {"_id":"q-en-rust-2e3002a0c380ad61b6a4059336640e1e678c6901f22a1f0141ef00524a132b6e","text":"E0696, // `continue` pointing to a labeled block // E0702, // replaced with a generic attribute input check E0703, // invalid ABI E0706, // `async fn` in trait // E0707, // multiple elided lifetimes used in arguments of `async fn` E0708, // `async` non-`move` closures with parameters are not currently // supported"} {"_id":"q-en-rust-2e41db7ecfa55e9d7859fd33f4eb397dc240165034ad3bfdf7178cf26a90d24a","text":"stride * field } layout::FieldPlacement::Union(count) => { // This is a narrow bug-fix for rust-lang/rust#69191: if we are // trying to access absent field of uninhabited variant, then // signal UB (but don't ICE the compiler). // FIXME temporary hack to work around incoherence between // layout computation and MIR building if field >= count as u64 && base.layout.abi == layout::Abi::Uninhabited { throw_ub!(Unreachable); } assert!( field < count as u64, \"Tried to access field {} of union {:#?} with {} fields\","} {"_id":"q-en-rust-2e90d062adf875ccf7257471443be2eaa03f3b1f6af92f11879b5f602d0ae660","text":"//! [`Iterator`]: trait.Iterator.html //! [`next`]: trait.Iterator.html#tymethod.next //! [`Option`]: ../../std/option/enum.Option.html //! [`TryIter`]: ../../std/sync/mpsc/struct.TryIter.html //! //! # The three forms of iteration //!"} {"_id":"q-en-rust-2ec55300b746ef486dbd815c3e3bdfd6fdda2fa40f43f03e62fb4da54c83bcd3","text":" error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-const.rs:4:17 | LL | type A: S = 34>; | ^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. "} {"_id":"q-en-rust-2ed2b69f17dce93d81c7a52b2f71965f8d4f1503d93b46234cc16df6ff9b9743","text":"If you’d like to dive into this topic in greater detail, [this paper][wilson] is a great introduction. [wilson]: http://www.cs.northwestern.edu/~pdinda/icsclass/doc/dsa.pdf [wilson]: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.143.4688 ## Semantic impact"} {"_id":"q-en-rust-2ee95bfe2a013b85a0bbbacbb8d9f9be332f6959bab06d607257453a4d55ba31","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // error-pattern:bad input fn main() { Some(\"foo\").unwrap_or(fail!(\"bad input\")).to_string(); } "} {"_id":"q-en-rust-2efaecc423373b5b3c7463a2012e19e4b4ba8817b247643f906d8694c5568456","text":"} #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn test_process_output_output() { let Output { status, stdout, stderr } = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"echo hello\"]).output().unwrap() } else { Command::new(\"echo\").arg(\"hello\").output().unwrap() shell_cmd().arg(\"-c\").arg(\"echo hello\").output().unwrap() }; let output_str = str::from_utf8(&stdout).unwrap();"} {"_id":"q-en-rust-2f1c70c6dfa40978ac3022f13e330fb7afdec45697fb65907b6997d54e4e891a","text":" #![feature(prelude_import)] #![no_std] // This test certify that we can mix attribute macros from Rust and external proc-macros. // For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(SmartPointer)]` uses // `#[pointee]`. // The scoping rule should allow the use of the said two attributes when external proc-macros // are in scope. //@ check-pass //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; #[macro_use] extern crate another_proc_macro; const _: () = { const POINTEE_MACRO_ATTR_DERIVED: () = (); }; const _: () = { const DEFAULT_MACRO_ATTR_DERIVED: () = (); }; "} {"_id":"q-en-rust-2f245b11f846beb7037c085ca8b6a127deaa4cd751ceb5f5254b07b5ca8a7e60","text":"} fn write_u16s(handle: c::HANDLE, data: &[u16]) -> io::Result { debug_assert!(data.len() < u32::MAX as usize); let mut written = 0; cvt(unsafe { c::WriteConsoleW("} {"_id":"q-en-rust-2f25ffd19044c08a25d883b1894d8130df5b4f28c8278fe2cf56668751143a80","text":"/// [`slice_from_raw_parts`]: fn.slice_from_raw_parts.html /// [`from_raw_parts_mut`]: ../../std/slice/fn.from_raw_parts_mut.html #[inline] #[unstable(feature = \"slice_from_raw_parts\", reason = \"recently added\", issue = \"36925\")] #[stable(feature = \"slice_from_raw_parts\", since = \"1.42.0\")] #[rustc_const_unstable(feature = \"const_slice_from_raw_parts\", issue = \"67456\")] pub const fn slice_from_raw_parts_mut(data: *mut T, len: usize) -> *mut [T] { unsafe { Repr { raw: FatPtr { data, len } }.rust_mut }"} {"_id":"q-en-rust-2f335fc8e52874740f8801f9f97343835d928fff8d837362d20d71b2a46197b9","text":" error: expected expression, found reserved keyword `try` --> $DIR/try-block-in-match.rs:6:11 | LL | match try { false } { _ => {} } | ----- ^^^ expected expression | | | while parsing this match expression error: aborting due to previous error "} {"_id":"q-en-rust-2f3ce9e644cee8f1089f6fb80c7cf452641843904b4c4984ec22afe2c749d435","text":"} #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn stdout_works() { if cfg!(target_os = \"windows\") { let mut cmd = Command::new(\"cmd\"); cmd.args(&[\"/C\", \"echo foobar\"]).stdout(Stdio::piped()); assert_eq!(run_output(cmd), \"foobarrn\"); } else { let mut cmd = Command::new(\"echo\"); cmd.arg(\"foobar\").stdout(Stdio::piped()); let mut cmd = shell_cmd(); cmd.arg(\"-c\").arg(\"echo foobar\").stdout(Stdio::piped()); assert_eq!(run_output(cmd), \"foobarn\"); } } #[test] #[cfg_attr(any(windows, target_os = \"android\", target_os = \"vxworks\"), ignore)] #[cfg_attr(any(windows, target_os = \"vxworks\"), ignore)] fn set_current_dir_works() { let mut cmd = Command::new(\"/bin/sh\"); let mut cmd = shell_cmd(); cmd.arg(\"-c\").arg(\"pwd\").current_dir(\"/\").stdout(Stdio::piped()); assert_eq!(run_output(cmd), \"/n\"); } #[test] #[cfg_attr(any(windows, target_os = \"android\", target_os = \"vxworks\"), ignore)] #[cfg_attr(any(windows, target_os = \"vxworks\"), ignore)] fn stdin_works() { let mut p = Command::new(\"/bin/sh\") let mut p = shell_cmd() .arg(\"-c\") .arg(\"read line; echo $line\") .stdin(Stdio::piped())"} {"_id":"q-en-rust-2f7d38fe58c2bfebf927d95a240b4815c6288769e4dd8c16c554f6603a91c6f6","text":" // Regression test for #81899. // The `panic!()` below is important to trigger the fixed ICE. const _CONST: &[u8] = &f(&[], |_| {}); const fn f(_: &[u8], _: F) -> &[u8] where F: FnMut(&u8), { panic!() //~ ERROR: evaluation of constant value failed } fn main() {} "} {"_id":"q-en-rust-2f90053f3fc34b398ce3d3ec5c506e7b967ac7d9b46a62bb931089c933447019","text":"use rustc_middle::ty::{ self, fold::BottomUpFolder, print::TraitPredPrintModifiersAndPath, Ty, TypeFoldable, }; use rustc_span::Span; use rustc_span::{symbol::kw, Span}; use rustc_trait_selection::traits; use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;"} {"_id":"q-en-rust-2f9cb41372f86ce0e25501f28387cd5f0da196978315a8e4e2ec474f5a89d8c4","text":"fn the(&self); } } #[cfg(any())] mod nonexistent_file; // Check that unconfigured non-inline modules are not loaded or parsed. "} {"_id":"q-en-rust-2fa2edbac1ac31bae1caa01af53c882bd72cf99cffed70f61117a95aad06fa4d","text":"(&TestKind::Range { .. }, _) => None, (&TestKind::Eq { .. } | &TestKind::Len { .. }, _) => { // The call to `self.test(&match_pair)` below is not actually used to generate any // MIR. Instead, we just want to compare with `test` (the parameter of the method) // to see if it is the same. // // However, at this point we can still encounter or-patterns that were extracted // from previous calls to `sort_candidate`, so we need to manually address that // case to avoid panicking in `self.test()`. if let PatKind::Or { .. } = &*match_pair.pattern.kind { return None; } // These are all binary tests. // // FIXME(#29623) we can be more clever here"} {"_id":"q-en-rust-2fb2fd2c43b6f173b8993b904e1a164ef1c139f29bb55f47e943949f042ecc68","text":" // 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 or the MIT license // , 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 { #[doc(hidden)] pub inner: __impl::KeyInner } /// 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 ScopedKey { /// 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(&'static self, t: &T, cb: F) -> R where F: FnOnce() -> R, { struct Reset<'a, T: 'a> { key: &'a __impl::KeyInner, 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(&'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 { pub inner: UnsafeCell<*mut T> } unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { #[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 { pub inner: OsStaticKey, pub marker: marker::PhantomData>, } unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { #[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); 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()); } } "} {"_id":"q-en-rust-2fc051868684b25834e540738f2861a5bb14194bc80cdaaf24f1df977d27a5e6","text":" error: this file contains an un-closed delimiter --> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 | LL | #[Ѕ | - ^ | | | un-closed delimiter error: expected item after attributes --> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 | LL | #[Ѕ | ^ error: aborting due to 2 previous errors "} {"_id":"q-en-rust-2fcc33c22176acb9ff874f5e2f995045d842da2528b3d9e4fa823714fba5d71d","text":"} } impl rustc_errors::IntoDiagnosticArg for PolyExistentialTraitRef<'_> { fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { self.to_string().into_diagnostic_arg() } } #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] #[derive(HashStable)] pub enum BoundVariableKind {"} {"_id":"q-en-rust-2fdf67d8019f8b3df9db8afb27e5e7cbf7ea05bf4c02f0f1808cede1383368ee","text":"} let sig = tcx.erase_late_bound_regions(sig); if !sig.output().is_unit() { let r = self.check_type_for_ffi(cache, sig.output()); match r { FfiSafe => {} _ => { return r; } } } for arg in sig.inputs() { let r = self.check_type_for_ffi(cache, *arg); match r { match self.check_type_for_ffi(cache, *arg) { FfiSafe => {} _ => { return r; } r => return r, } } FfiSafe let ret_ty = sig.output(); if ret_ty.is_unit() { return FfiSafe; } self.check_type_for_ffi(cache, ret_ty) } ty::Foreign(..) => FfiSafe,"} {"_id":"q-en-rust-2fe09a1d9b1ec9a3e35e4f857cd8b1e589f84a7826a10e539a13e18cafccce17","text":".filter_map(|lang_item| self.tcx.lang_items().require(*lang_item).ok()) .collect(); never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::Send).unwrap()); if let Some(def_id) = self.tcx.get_diagnostic_item(sym::Send) { never_suggest_borrow.push(def_id); } let param_env = obligation.param_env; let trait_ref = poly_trait_ref.skip_binder();"} {"_id":"q-en-rust-2feaaca3798d5a006236a32ea69546d101d90e76d865bbea4c5fd34fadc2e5d3","text":"continue; } let missing = match source { PathSource::Trait(..) | PathSource::TraitItem(..) | PathSource::Type => true, let node_ids = self.r.next_node_ids(expected_lifetimes); self.record_lifetime_res( segment_id, LifetimeRes::ElidedAnchor { start: node_ids.start, end: node_ids.end }, LifetimeElisionCandidate::Ignore, ); let inferred = match source { PathSource::Trait(..) | PathSource::TraitItem(..) | PathSource::Type => false, PathSource::Expr(..) | PathSource::Pat | PathSource::Struct | PathSource::TupleStruct(..) => false, | PathSource::TupleStruct(..) => true, }; if !missing && !segment.has_generic_args { if inferred { // Do not create a parameter for patterns and expressions: type checking can infer // the appropriate lifetime for us. for id in node_ids { self.record_lifetime_res( id, LifetimeRes::Infer, LifetimeElisionCandidate::Named, ); } continue; }"} {"_id":"q-en-rust-2ffcc7ae7daa266fb3270e7f6c09a630ae622e2753bfffe6a7e4b72de316ba37","text":"move_place: &Place<'tcx>, deref_target_place: &Place<'tcx>, span: Span, use_spans: Option, ) -> DiagnosticBuilder<'a> { // Inspect the type of the content behind the // borrow to provide feedback about why this"} {"_id":"q-en-rust-3014e8aa21dfd43ddbb5899bc3a7692ec4402f8523fe53a0cf7da729c0aacc98","text":" // compile-flags: -Znext-solver #![feature(lazy_type_alias)] //~^ WARN the feature `lazy_type_alias` is incomplete trait Foo {} type A = T; struct W(T); // For `W>` to be WF, `A: Sized` must hold. However, when assembling // alias bounds for `A`, we try to normalize it, but it doesn't hold because // `usize: Foo` doesn't hold. Therefore we ICE, because we don't expect to still // encounter weak types in `assemble_alias_bound_candidates_recur`. fn hello(_: W>) {} //~^ ERROR the type `W>` is not well-formed fn main() {} "} {"_id":"q-en-rust-3033ba76e479c58b80f460be40e580316762a63765a63214ad159013475cc53f","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let mut c = (1, \"\".to_owned()); match c { c2 => { c.0 = 2; assert_eq!(c2.0, 1); } } } "} {"_id":"q-en-rust-30a678fd034cef7e2b3d00f284dd1c23a608a12e8a186d9631180058db60b912","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. #[doc(keyword = \"as\")] // /// The type coercion keyword. /// /// `as` is most commonly used to turn primitive types into other primitive types, but it has other /// uses that include turning pointers into addresses, addresses into pointers, and pointers into /// other pointers. /// /// ```rust /// let thing1: u8 = 89.0 as u8; /// assert_eq!('B' as u32, 66); /// assert_eq!(thing1 as char, 'Y'); /// let thing2: f32 = thing1 as f32 + 10.5; /// assert_eq!(true as u8 + thing2 as u8, 100); /// ``` /// /// In general, any coercion that can be performed via writing out type hints can also be done /// using `as`, so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (Note: /// `let x = 123u32` would be best in that situation). The same is not true in the other direction, /// however, explicitly using `as` allows a few more coercions that aren't allowed implicitly, such /// as changing the type of a raw pointer or turning closures into raw pointers. /// /// For more information on what `as` is capable of, see the [Reference] /// /// [Reference]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions mod as_keyword { } #[doc(keyword = \"const\")] // /// The keyword for defining constants. /// /// Sometimes a certain value is used many times throughout a program, and it can become /// inconvenient to copy it over and over. What's more, it's not always possible or desirable to /// make it a variable that gets carried around to each function that needs it. In these cases, the /// `const` keyword provides a convenient alternative to code duplication. /// /// ```rust /// const THING: u32 = 0xABAD1DEA; /// /// let foo = 123 + THING; /// ``` /// /// Constants must be explicitly typed, unlike with `let` you can't ignore its type and let the /// compiler figure it out. Any constant value can be defined in a const, which in practice happens /// to be most things that would be reasonable to have a constant. For example, you can't have a /// File as a `const`. /// /// The only lifetime allowed in a constant is 'static, which is the lifetime that encompasses all /// others in a Rust program. For example, if you wanted to define a constant string, it would look /// like this: /// /// ```rust /// const WORDS: &'static str = \"hello rust!\"; /// ``` /// /// Thanks to static lifetime elision, you usually don't have to explicitly use 'static: /// /// ```rust /// const WORDS: &str = \"hello convenience!\"; /// ``` /// /// `const` items looks remarkably similar to [`static`] items, which introduces some confusion as /// to which one should be used at which times. To put it simply, constants are inlined wherever /// they're used, making using them identical to simply replacing the name of the const with its /// value. Static variables on the other hand point to a single location in memory, which all /// accesses share. This means that, unlike with constants, they can't have destructors, but it /// also means that (via unsafe code) they can be mutable, which is useful for the rare situations /// in which you can't avoid using global state. /// /// Constants, as with statics, should always be in SCREAMING_SNAKE_CASE. /// /// The `const` keyword is also used in raw pointers in combination with `mut`, as seen in `*const /// T` and `*mut T`. More about that can be read at the [pointer] primitive part of the Rust docs. /// /// For more detail on `const`, see the [Rust Book] or the [Reference] /// /// [`static`]: keyword.static.html /// [pointer]: primitive.pointer.html /// [Rust Book]: https://doc.rust-lang.org/stable/book/2018-edition/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants /// [Reference]: https://doc.rust-lang.org/reference/items/constant-items.html mod const_keyword { } #[doc(keyword = \"crate\")] // /// The `crate` keyword. /// /// The primary use of the `crate` keyword is as a part of `extern crate` declarations, which are /// used to specify a dependency on a crate external to the one it's declared in. Crates are the /// fundamental compilation unit of Rust code, and can be seen as libraries or projects. More can /// be read about crates in the [Reference]. /// /// ```rust ignore /// extern crate rand; /// extern crate my_crate as thing; /// extern crate std; // implicitly added to the root of every Rust project /// ``` /// /// The `as` keyword can be used to change what the crate is referred to as in your project. If a /// crate name includes a dash, it is implicitly imported with the dashes replaced by underscores. /// /// `crate` is also used as in conjunction with [`pub`] to signify that the item it's attached to /// is public only to other members of the same crate it's in. /// /// ```rust /// # #[allow(unused_imports)] /// pub(crate) use std::io::Error as IoError; /// pub(crate) enum CoolMarkerType { } /// pub struct PublicThing { /// pub(crate) semi_secret_thing: bool, /// } /// ``` /// /// [Reference]: https://doc.rust-lang.org/reference/items/extern-crates.html /// [`pub`]: keyword.pub.html mod crate_keyword { } #[doc(keyword = \"enum\")] // /// For defining enumerations. /// /// Enums in Rust are similar to those of other compiled languages like C, but have important /// differences that make them considerably more powerful. What Rust calls enums are more commonly /// known as Algebraic Data Types if you're coming from a functional programming background, but /// the important part is that data can go with the enum variants. /// /// ```rust /// # struct Coord; /// enum SimpleEnum { /// FirstVariant, /// SecondVariant, /// ThirdVariant, /// } /// /// enum Location { /// Unknown, /// Anonymous, /// Known(Coord), /// } /// /// enum ComplexEnum { /// Nothing, /// Something(u32), /// LotsOfThings { /// usual_struct_stuff: bool, /// blah: String, /// } /// } /// /// enum EmptyEnum { } /// ``` /// /// The first enum shown is the usual kind of enum you'd find in a C-style language. The second /// shows off a hypothetical example of something storing location data, with Coord being any other /// type that's needed, for example a struct. The third example demonstrates the kind of variant a /// variant can store, ranging from nothing, to a tuple, to an anonymous struct. /// /// Instantiating enum variants involves explicitly using the enum's name as its namespace, /// followed by one of its variants. `SimpleEnum::SecondVariant` would be an example from above. /// When data follows along with a variant, such as with rust's built-in [`Option`] type, the data /// is added as the type describes, for example `Option::Some(123)`. The same follows with /// struct-like variants, with things looking like `ComplexEnum::LotsOfThings { usual_struct_stuff: /// true, blah: \"hello!\".to_string(), }`. Empty Enums are similar to () in that they cannot be /// instantiated at all, and are used mainly to mess with the type system in interesting ways. /// /// For more information, take a look at the [Rust Book] or the [Reference] /// /// [`Option`]: option/enum.Option.html /// [Rust Book]: https://doc.rust-lang.org/book/second-edition/ch06-01-defining-an-enum.html /// [Reference]: https://doc.rust-lang.org/reference/items/enumerations.html mod enum_keyword { } #[doc(keyword = \"extern\")] // /// For external connections in Rust code. /// /// The `extern` keyword is used in two places in Rust. One is in conjunction with the [`crate`] /// keyword to make your Rust code aware of other Rust crates in your project, i.e. `extern crate /// lazy_static;`. The other use is in foreign function interfaces (FFI). /// /// `extern` is used in two different contexts within FFI. The first is in the form of external /// blcoks, for declaring function interfaces that Rust code can call foreign code by. /// /// ```rust ignore /// #[link(name = \"my_c_library\")] /// extern \"C\" { /// fn my_c_function(x: i32) -> bool; /// } /// ``` /// /// This code would attempt to link with libmy_c_library.so on unix-like systems and /// my_c_library.dll on Windows at runtime, and panic if it can't find something to link to. Rust /// code could then use `my_c_function` as if it were any other unsafe Rust function. Working with /// non-Rust languages and FFI is inherently unsafe, so wrappers are usually built around C APIs. /// /// The mirror use case of FFI is also done via the `extern` keyword: /// /// ```rust /// # #![allow(private_no_mangle_fns)] /// #[no_mangle] /// pub extern fn callable_from_c(x: i32) -> bool { /// x % 3 == 0 /// } /// ``` /// /// If compiled as a dylib, the resulting .so could then be linked to from a C library, and the /// function could be used as if it was from any other library. /// /// For more information on FFI, check the [Rust book] or the [Reference]. /// /// [Rust book]: https://doc.rust-lang.org/book/second-edition/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code /// [Reference]: https://doc.rust-lang.org/reference/items/external-blocks.html mod extern_keyword { } #[doc(keyword = \"fn\")] // /// The `fn` keyword. /// The keyword for defining functions. /// /// The `fn` keyword is used to declare a function. /// Functions are the primary way code is executed within Rust. Function blocks, usually just /// called functions, can be defined in a variety of different places and be assigned many /// different attributes and modifiers. /// /// Example: /// Standalone functions that just sit within a module not attached to anything else are common, /// but most functions will end up being inside [`impl`] blocks, either on another type itself, or /// as a trait impl for that type. /// /// ```rust /// fn some_function() { /// // code goes in here /// fn standalone_function() { /// // code /// } /// /// pub fn public_thing(argument: bool) -> String { /// // code /// # \"\".to_string() /// } /// /// struct Thing { /// foo: i32, /// } /// /// impl Thing { /// pub fn new() -> Self { /// Self { /// foo: 42, /// } /// } /// } /// ``` /// /// For more information about functions, take a look at the [Rust Book][book]. /// See docs on [`impl`] and [`self`] for relevant details on those. /// /// In addition to presenting fixed types in the form of `fn name(arg: type, ..) -> return_type`, /// functions can also declare a list of type parameters along with trait bounds that they fall /// into. /// /// ```rust /// fn generic_function(x: T) -> (T, T, T) { /// (x.clone(), x.clone(), x.clone()) /// } /// /// [book]: https://doc.rust-lang.org/book/second-edition/ch03-03-how-functions-work.html /// fn generic_where(x: T) -> T /// where T: std::ops::Add + Copy /// { /// x + x + x /// } /// ``` /// /// Declaring trait bounds in the angle brackets is functionally identical to using a [`where`] /// clause, but `where` is preferred due to it being easier to understand at a glance. /// /// Along with being made public via [`pub`], `fn` can also have an [`extern`] added for use in /// FFI. /// /// For more information on the various types of functions and how they're used, consult the [Rust /// book] or the [Reference]. /// /// [`impl`]: keyword.impl.html /// [`self`]: keyword.self.html /// [`where`]: keyword.where.html /// [`pub`]: keyword.pub.html /// [`extern`]: keyword.extern.html /// [Rust book]: https://doc.rust-lang.org/book/second-edition/ch03-03-how-functions-work.html /// [Reference]: https://doc.rust-lang.org/reference/items/functions.html mod fn_keyword { } #[doc(keyword = \"for\")] // /// The `for` keyword. /// /// `for` is primarily used in for-in-loops, but it has a few other pieces of syntactic uses such as /// `impl Trait for Type` (see [`impl`] for more info on that). for-in-loops, or to be more /// precise, iterator loops, are a simple syntactic sugar over an exceedingly common practice /// within Rust, which is to loop over an iterator until that iterator returns None (or [`break`] /// is called). /// /// ```rust /// for i in 0..5 { /// println!(\"{}\", i * 2); /// } /// /// for i in std::iter::repeat(5) { /// println!(\"turns out {} never stops being 5\", i); /// break; // would loop forever otherwise /// } /// /// 'outer: for x in 5..50 { /// for y in 0..10 { /// if x == y { /// break 'outer; /// } /// } /// } /// ``` /// /// As shown in the example above, `for` loops (along with all other loops) can be tagged, using /// similar syntax to lifetimes (only visually similar, entirely distinct in practice). Giving the /// same tag to `break` breaks the tagged loop, which is useful for inner loops. It is definitely /// not a goto. /// /// A `for` loop expands as shown: /// /// ```rust /// # fn code() { } /// # let iterator = 0..2; /// for loop_variable in iterator { /// code() /// } /// ``` /// /// ```rust /// # fn code() { } /// # let iterator = 0..2; /// { /// let mut _iter = std::iter::IntoIterator::into_iter(iterator); /// loop { /// match _iter.next() { /// Some(loop_variable) => { /// code() /// }, /// None => break, /// } /// } /// } /// ``` /// /// More details on the functionality shown can be seen at the [`IntoIterator`] docs. /// /// For more information on for-loops, see the [Rust book] or the [Reference]. /// /// [`impl`]: keyword.impl.html /// [`break`]: keyword.break.html /// [`IntoIterator`]: iter/trait.IntoIterator.html /// [Rust book]: https://doc.rust-lang.org/book/2018-edition/ch03-05-control-flow.html#looping-through-a-collection-with-for /// [Reference]: https://doc.rust-lang.org/reference/expressions/loop-expr.html#iterator-loops mod for_keyword { } #[doc(keyword = \"if\")] // /// If statements and expressions. /// /// `if` is a familiar construct to most programmers, and is the main way you'll often do logic in /// your code. However, unlike in most languages, `if` blocks can also act as expressions. /// /// ```rust /// # let rude = true; /// if 1 == 2 { /// println!(\"whoops, mathematics broke\"); /// } else { /// println!(\"everything's fine!\"); /// } /// /// let greeting = if rude { /// \"sup nerd.\" /// } else { /// \"hello, friend!\" /// }; /// /// if let Ok(x) = \"123\".parse::() { /// println!(\"{} double that and you get {}!\", greeting, x * 2); /// } /// ``` /// /// Shown above are the three typical forms an `if` block comes in. First is the usual kind of /// thing you'd see in many languages, with an optional `else` block. Second uses `if` as an /// expression, which is only possible if all branches return the same type. An `if` expression can /// be used everywhere you'd expect. The third kind of `if` block is an `if let` block, which /// behaves similarly to using a [`match`] expression: /// /// ```rust /// if let Some(x) = Some(123) { /// // code /// # let _ = x; /// } else { /// // something else /// } /// /// match Some(123) { /// Some(x) => { /// // code /// # let _ = x; /// }, /// _ => { /// // something else /// }, /// } /// ``` /// /// See [`let`] for more information on pattern bindings. /// /// Each kind of `if` expression can be mixed and matched as needed. /// /// ```rust /// if true == false { /// println!(\"oh no\"); /// } else if \"something\" == \"other thing\" { /// println!(\"oh dear\"); /// } else if let Some(200) = \"blarg\".parse::().ok() { /// println!(\"uh oh\"); /// } else { /// println!(\"phew, nothing's broken\"); /// } /// ``` /// /// The `if` keyword is used in one other place in Rust, namely as a part of pattern matching /// itself, allowing patterns such as `Some(x) if x > 200` to be used. /// /// For more information on `if` expressions, see the [Rust book] or the [Reference]. /// /// [`match`]: keyword.match.html /// [`let`]: keyword.let.html /// [Rust book]: https://doc.rust-lang.org/stable/book/2018-edition/ch03-05-control-flow.html#if-expressions /// [Reference]: https://doc.rust-lang.org/reference/expressions/if-expr.html mod if_keyword { } #[doc(keyword = \"let\")] // /// The `let` keyword."} {"_id":"q-en-rust-30b78a8222f6ad070f7a432648a0f066164e513def0d1be39dc74aa4dc241f1c","text":" error: expected expression, found reserved keyword `try` --> $DIR/try-block-in-while.rs:6:11 error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied --> $DIR/try-block-in-while.rs:6:15 | LL | while try { false } {} | ^^^ expected expression | ^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool` | = note: required by `std::ops::Try::from_ok` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-30cc380df81c9d9df32374599ff62b4c8fc8de82cd4a3e78d5ade151dae91399","text":".iter() .enumerate() .filter(|x| x.1.hir_id == *hir_id) .map(|(i, _)| init_tup.get(i).unwrap()) .next() .find_map(|(i, _)| init_tup.get(i)) { self.note_type_is_not_clone_inner_expr(init) } else {"} {"_id":"q-en-rust-30e3677b1f89e86c5797e061a9ca50cc281a58f0b30320568453d8b2f03731e8","text":" struct TestClient; impl TestClient { fn get_inner_ref(&self) -> &Vec { todo!() } } fn main() { let client = TestClient; let inner = client.get_inner_ref(); //~^ HELP consider changing this to be a mutable reference inner.clear(); //~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596] } "} {"_id":"q-en-rust-30f5ca6126caa876b0ec5db591637fe9c6316061f3c77bd8e3ea59ba78594e4f","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. "} {"_id":"q-en-rust-3134d794e867e83734815328645c6d1122a977d62a4f81dbbc2080e0c61bcd71","text":"let _: Wow; //~^ ERROR expected one of //~| HELP expressions must be enclosed in braces to be used as const generic arguments // FIXME(compiler-errors): This one is still unsatisfying, // and probably a case I could see someone typing by accident.. let _: Wow<[]>; //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<[12]>; //~^ ERROR expected type, found //~| ERROR type provided when a constant was expected //~^ ERROR expected type //~| ERROR invalid const generic expression //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<[0, 1, 3]>; //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<[0xff; 8]>; //~^ ERROR expected type //~| ERROR invalid const generic expression //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<[1, 2]>; // Regression test for issue #81698. //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<&0>; //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<(\"\", 0)>; //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments let _: Wow<(1 + 2) * 3>; //~^ ERROR expected type //~| HELP expressions must be enclosed in braces to be used as const generic arguments // FIXME(fmease): This one is pretty bad. let _: Wow; //~^ ERROR expected one of //~| HELP you might have meant to end the type parameters here }"} {"_id":"q-en-rust-316b566c0bc5bd7e7d33e9573a33cd11394c0c0ecb207ede1cf201332a9472e7","text":" // revisions:rpass1 rpass2 struct A; #[cfg(rpass2)] impl From for () { fn from(_: A) {} } fn main() {} "} {"_id":"q-en-rust-31b5df296b61db95d79ea6c8996d2cec62063ed22c714c59dc3bf35b7eee7934","text":"} /// Builds drops for pop_scope and exit_scope. fn build_scope_drops<'tcx>(mut block: BasicBlock, fn build_scope_drops<'tcx>(cfg: &mut CFG<'tcx>, scope: &Scope<'tcx>, earlier_scopes: &[Scope<'tcx>], cfg: &mut CFG<'tcx>) mut block: BasicBlock) -> BlockAnd<()> { let mut iter = scope.drops.iter().rev().peekable(); while let Some(drop_data) = iter.next() {"} {"_id":"q-en-rust-31bbae668e53afc6fa1c0de694e8a48d662dd7368cba9620cc37feb87840ea63","text":"DependencyType::TargetSelfContained, ); } let crt_path = builder.ensure(native::CrtBeginEnd { target }); for &obj in &[\"crtbegin.o\", \"crtbeginS.o\", \"crtend.o\", \"crtendS.o\"] { let src = compiler_file(builder, builder.cc(target), target, obj); let src = crt_path.join(obj); let target = libdir_self_contained.join(obj); builder.copy(&src, &target); target_deps.push((target, DependencyType::TargetSelfContained));"} {"_id":"q-en-rust-31c622facdc72b8fcd4e850ae1de7a1984f801da60ca944a7470b984e759ab8c","text":"cx.generated_synthetics.insert((ty, trait_def_id)); let hir_imp = impl_def_id.as_local() .map(|local| cx.tcx.hir().expect_item(local)) .and_then(|item| if let hir::ItemKind::Impl(i) = &item.kind { Some(i) } else { None }); let items = match hir_imp { Some(imp) => imp .items .iter() .map(|ii| cx.tcx.hir().impl_item(ii.id).clean(cx)) .collect::>(), None => cx.tcx .associated_items(impl_def_id) .in_definition_order() .map(|x| x.clean(cx)) .collect::>(), }; impls.push(Item { name: None, attrs: Default::default(),"} {"_id":"q-en-rust-31da9f7a7f9ca98537754e695ef3360787cc6bb7d77cd5fd57f165c1e9166b1d","text":" error: expected one of `(`, `,`, `=`, `{`, or `}`, found `#` --> $DIR/help-set-edition-ice-122130.rs:2:6 | LL | s#[c\"owned_box\"] | ^ expected one of `(`, `,`, `=`, `{`, or `}` | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected item, found `\"owned_box\"` --> $DIR/help-set-edition-ice-122130.rs:2:9 | LL | s#[c\"owned_box\"] | ^^^^^^^^^^^ expected item | = note: for a full list of items that can appear in modules, see error: aborting due to 2 previous errors "} {"_id":"q-en-rust-31ddd09d2289304963e559a60187ad9771a989e5ca74fc344e07938e16ddd24a","text":" // Suggest to a user to use the print macros // instead to use the printf. fn main() { let x = 4; printf(\"%d\", x); //~^ ERROR cannot find function `printf` in this scope //~| HELP you may have meant to use the `print` macro } "} {"_id":"q-en-rust-325bb8b6bcb7528645777c60928f565f8d70978fc8f9bf500aebabdeed8f6a5e","text":"#[subdiagnostic] pub req_introduces_loc: Option, pub has_param_name: bool, pub param_name: String, pub spans_empty: bool, pub has_lifetime: bool, pub lifetime: String,"} {"_id":"q-en-rust-329103a093abc78d56773f704b6e4e2088ee18996a44128f19d84bd3a57d5272","text":" // force-host // no-prefer-dynamic #![crate_type = \"proc-macro\"] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_attribute] pub fn vec_ice(_attr: TokenStream, input: TokenStream) -> TokenStream { // This redundant convert is necessary to reproduce ICE. input.into_iter().collect() } "} {"_id":"q-en-rust-32e989cba840da736cc43fd5cd32e19f97423db8e68cd3ef9341ab24eac1689d","text":"match view_path.node { ViewPathSimple(binding, ref full_path) => { let source_name = full_path.segments.last().unwrap().identifier.name; if source_name.as_str() == \"mod\" || source_name.as_str() == \"self\" { let mut source = full_path.segments.last().unwrap().identifier; let source_name = source.name.as_str(); if source_name == \"mod\" || source_name == \"self\" { resolve_error(self, view_path.span, ResolutionError::SelfImportsOnlyAllowedWithin); } else if source_name == \"$crate\" && full_path.segments.len() == 1 { let crate_root = self.resolve_crate_var(source.ctxt); let crate_name = match crate_root.kind { ModuleKind::Def(_, name) => name, ModuleKind::Block(..) => unreachable!(), }; source.name = crate_name; self.session.struct_span_warn(item.span, \"`$crate` may not be imported\") .note(\"`use $crate;` was erroneously allowed and will become a hard error in a future release\") .emit(); } let subclass = ImportDirectiveSubclass::single(binding.name, source_name); let subclass = ImportDirectiveSubclass::single(binding.name, source.name); let span = view_path.span; self.add_import_directive(module_path, subclass, span, item.id, vis); }"} {"_id":"q-en-rust-3313070ce5209085dac4a2d9c9778306f101430f354aea561aaa4dd2629e1ece","text":"//! //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/mir/index.html // ignore-tidy-filelength use crate::mir::interpret::{GlobalAlloc, Scalar}; use crate::mir::visit::MirVisitable; use crate::ty::adjustment::PointerCast;"} {"_id":"q-en-rust-332882707b0fbdda2ffe2717d67a097441a3508ad0f7bb738133c77f9e91fc49","text":"all( not(target_arch = \"aarch64\"), not(target_arch = \"powerpc\"), not(target_arch = \"s390x\"), not(target_arch = \"x86_64\") ), all(target_arch = \"aarch64\", any(target_os = \"macos\", target_os = \"ios\")),"} {"_id":"q-en-rust-335006f74cd1d0040d621f18a2be34376b8b946937906916914d18f4b568181d","text":"let hir_id = self.tcx().hir().as_local_hir_id(def_id).unwrap(); let instantiated_ty = self.resolve(&opaque_defn.concrete_ty, &hir_id); debug_assert!(!instantiated_ty.has_escaping_bound_vars()); let generics = self.tcx().generics_of(def_id); let definition_ty = if generics.parent.is_some() {"} {"_id":"q-en-rust-3368bb5bd8b029c59c31b30fc3fd852f381fad0face186ab3e58eea778a5d5a1","text":"src_href: src_href.as_deref(), }; let heading = item_vars.render().unwrap(); buf.write_str(&heading); item_vars.render_into(buf).unwrap(); match *item.kind { clean::ModuleItem(ref m) => item_module(buf, cx, item, &m.items),"} {"_id":"q-en-rust-337fdd9bfe88cf5729e75e58a4efb2fa462391c50aa54cd0cad8fe6996457a73","text":"expr: &hir::Expr<'_>, found: Ty<'tcx>, expected: Ty<'tcx>, mismatch_span: Span, ) -> bool { let map = self.tcx.hir();"} {"_id":"q-en-rust-3391dc28404db366c48f0fcc6916b733744b7c52bfe220d4f2ec0cadea625f7c","text":"&& adt.is_fundamental() { for ty in generics { if let Some(did) = ty.def_id(self.cache) { dids.insert(did); } dids.extend(ty.def_id(self.cache)); } } }"} {"_id":"q-en-rust-339bfca84b1d788d05b5318bd9b4c5dab834c666401e5c1a48e8be85347bfb7c","text":" error: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-61963.rs:20:14 | LL | bar: Box, | ^^^ help: use `dyn`: `dyn Bar` | note: lint level defined here --> $DIR/issue-61963.rs:3:9 | LL | #![deny(bare_trait_objects)] | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error "} {"_id":"q-en-rust-33beccab08511dcbaf85b08036652d487aeba0e3a4686e3ec8fcd0e16ea4717a","text":" // Note: this test is paired with logo-class.rs. // @has logo_class_default/struct.SomeStruct.html '//*[@class=\"logo-container\"]/img[@class=\"rust-logo\"]' '' // @has logo_class_default/struct.SomeStruct.html '//*[@class=\"sub-logo-container\"]/img[@class=\"rust-logo\"]' '' pub struct SomeStruct; "} {"_id":"q-en-rust-33cdb08f334a71c0e69ab4f51e02f2e1c6a34120a8f8de9ac762efd8958a740f","text":".and_modify(|e| { *e = (e.0.clone(), Some(rhs.ty().unwrap().clone())) }) .or_insert((None, Some(rhs.ty().unwrap().clone()))); .or_insert(( PolyTrait { trait_: trait_.clone(), generic_params: Vec::new(), }, Some(rhs.ty().unwrap().clone()), )); continue; }"} {"_id":"q-en-rust-33da468c3a2500d75564c7516d64a82a2cd88a2dd0a8ab0427b067290e6f77aa","text":"else_ty) } None => { check_block_no_value(fcx, then_blk); ty::mk_nil() infer::common_supertype(fcx.infcx(), infer::IfExpressionWithNoElse(sp), false, then_ty, ty::mk_nil()) } };"} {"_id":"q-en-rust-33eb9fba36a810b6afa71ca4f8ab2d469d12110766b83ced689dc2639a4c78b3","text":"if !self.any_library { // If we are building an executable, only explicitly extern // types need to be exported. if has_custom_linkage(self.tcx, search_item) { let codegen_attrs = if self.tcx.def_kind(search_item).has_codegen_attrs() { self.tcx.codegen_fn_attrs(search_item) } else { CodegenFnAttrs::EMPTY }; let is_extern = codegen_attrs.contains_extern_indicator(); let std_internal = codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL); if is_extern || std_internal { self.reachable_symbols.insert(search_item); } } else {"} {"_id":"q-en-rust-34740624ce78465ee50b9fddc3ec1fe55e851bfb7d105378f97205db170c73da","text":" error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String` --> $DIR/default-body-type-err.rs:7:22 | LL | fn lol(&self) -> impl Deref { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` LL | LL | &1i32 | ----- return type was inferred to be `&i32` here error: aborting due to previous error For more information about this error, try `rustc --explain E0271`. "} {"_id":"q-en-rust-34788456920d71883b72f1bb371883b1f75aee5b2cfd184d07f33d6d2aefc516","text":" trait Trait {} impl Trait for i32 {} // Since `Assoc` doesn't actually exist, it's \"stranded\", and won't show up in // the list of opaques that may be defined by the function. Make sure we don't // ICE in this case. fn produce() -> impl Trait { //~^ ERROR associated type `Assoc` not found for `Trait` 16 } fn main () {} "} {"_id":"q-en-rust-347db88b9583cffb99f514a6abdc7080778fc486bcce9801ef67e394bb032380","text":" error[E0133]: use of extern static is unsafe and requires unsafe function or block --> $DIR/issue-28575.rs:8:5 | LL | FOO() | ^^^ use of extern static | = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior error: aborting due to previous error For more information about this error, try `rustc --explain E0133`. "} {"_id":"q-en-rust-34856d4ceffe671d859ae3f2c9d41d45f5f5311c56f863e5a04717741bd4167c","text":"// *in Rust code* may unwind. Foreign items like `extern \"C\" { // fn foo(); }` are assumed not to unwind **unless** they have // a `#[unwind]` attribute. } else if !cx.tcx.is_foreign_item(id) { } else if id.map(|id| !cx.tcx.is_foreign_item(id)).unwrap_or(false) { Some(true) } else { None"} {"_id":"q-en-rust-34c1a30035a567b06342242ed6305a19e6f7ad8fe766c3e33e3f24db64428f03","text":"Box::new(MaybeUninit::uninit()) } // FIXME: add a test for a bigger box. Currently broken, see // https://github.com/rust-lang/rust/issues/58201. // https://github.com/rust-lang/rust/issues/58201 #[no_mangle] pub fn box_uninitialized2() -> Box> { // CHECK-LABEL: @box_uninitialized2 // CHECK-NOT: store // CHECK-NOT: alloca // CHECK-NOT: memcpy // CHECK-NOT: memset Box::new(MaybeUninit::uninit()) } // Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc // from the CHECK-NOT above. We don't check the attributes here because we can't rely"} {"_id":"q-en-rust-34e2179e87e44d531ab23142a444bbed8fb811809b8dc2e21b05fe43484e2f08","text":"addClass(search, \"hidden\"); removeClass(main, \"hidden\"); document.title = titleBeforeSearch; // We also remove the query parameter from the URL. if (browserSupportsHistoryApi()) { history.replaceState(\"\", window.currentCrate + \" - Rust\", getNakedUrl() + window.location.hash); } } // used for special search precedence"} {"_id":"q-en-rust-34e6f1ffad1d627e106766e0f2d20d33c41289f2f1d297e5fa1a39981b03a7e6","text":"self.parent_scope.module = old_module; } else { match &item.kind { ItemKind::Impl(box ast::Impl { of_trait: Some(..), .. }) => { ItemKind::Impl(box ast::Impl { of_trait: Some(trait_ref), .. }) => { if let Some(partial_res) = self.resolver.get_partial_res(trait_ref.ref_id) && let Some(res) = partial_res.full_res() && let Some(trait_def_id) = res.opt_def_id() && !trait_def_id.is_local() && self.visited_mods.insert(trait_def_id) { self.resolve_doc_links_extern_impl(trait_def_id, false); } self.all_trait_impls.push(self.resolver.local_def_id(item.id).to_def_id()); } ItemKind::MacroDef(macro_def) if macro_def.macro_rules => {"} {"_id":"q-en-rust-350b6c188e20f904c4cce4d11f4fb352dfa410456c87a954fadd9fa77c889d20","text":"var params = getQueryStringParams(); if (params && params.search) { var search = getSearchElement(); search.innerHTML = \"

Loading search results...

\";
search.innerHTML = \"

\" + getSearchLoadingText() + \"

\";
showSearchResults(search); }"} {"_id":"q-en-rust-350e274ef6e82a00ba99357a3982b6ed9d0b64494cf2da840510109239afbd59","text":"/// `&mut T` references can be freely coerced into `&T` references with the same referent type, and /// references with longer lifetimes can be freely coerced into references with shorter ones. /// /// Reference equality by address, instead of comparing the values pointed to, is accomplished via /// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while /// [`PartialEq`] compares values. /// /// [`ptr::eq`]: ptr/fn.eq.html /// [`PartialEq`]: cmp/trait.PartialEq.html /// /// ``` /// use std::ptr; /// /// let five = 5; /// let other_five = 5; /// let five_ref = &five; /// let same_five_ref = &five; /// let other_five_ref = &other_five; /// /// assert!(five_ref == same_five_ref); /// assert!(five_ref == other_five_ref); /// /// assert!(ptr::eq(five_ref, same_five_ref)); /// assert!(!ptr::eq(five_ref, other_five_ref)); /// ``` /// /// For more information on how to use references, see [the book's section on \"References and /// Borrowing\"][book-refs]. /// /// [book-refs]: ../book/second-edition/ch04-02-references-and-borrowing.html /// /// # Trait implementations /// /// The following traits are implemented for all `&T`, regardless of the type of its referent: /// /// * [`Copy`]"} {"_id":"q-en-rust-3562623152eb4f1f900c204659e0e0165d03898feb11d5bd35ad757c7dd1c7f7","text":"// Ensure that `libLLVM.so` ends up in the newly build compiler directory, // so that it can be found when the newly built `rustc` is run. dist::maybe_install_llvm_dylib(builder, target_compiler.host, &sysroot); dist::maybe_install_llvm_runtime(builder, target_compiler.host, &sysroot); dist::maybe_install_llvm_target(builder, target_compiler.host, &sysroot); // Link the compiler binary itself into place let out_dir = builder.cargo_out(build_compiler, Mode::Rustc, host);"} {"_id":"q-en-rust-3596632afcb363abe1804f83f4f9d01c1635068d3f51c444dca92bf02f72d022","text":"let mode = match tcx.hir().body_owner_kind(hir_id) { HirKind::Closure => return None, HirKind::Fn if tcx.is_const_fn(def_id) => ConstKind::ConstFn, // Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn` // checks take into account the `rustc_const_unstable` attribute combined with enabled // feature gates. Otherwise, const qualification would _not check_ whether this // function body follows the `const fn` rules, as an unstable `const fn` would // be considered \"not const\". More details are available in issue #67053. HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn, HirKind::Fn => return None, HirKind::Const => ConstKind::Const,"} {"_id":"q-en-rust-359ce110518f4dcf7ee91cbbd47f71476a6a0efcebab9c6cb3b37f947166dcde","text":"/// # Examples /// /// ``` /// #![feature(ptr_hash)] /// use std::collections::hash_map::DefaultHasher; /// use std::hash::{Hash, Hasher}; /// use std::ptr;"} {"_id":"q-en-rust-35ad80325bccd0931513fbd142737f4db00603b474839407738d9b3299cc8654","text":" use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetResult}; use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::windows_msvc_base::opts();"} {"_id":"q-en-rust-35eafdd4fe8a1b7e1706cfc2162a0385368852c9bdaec6f0cc44dbe6013bfead","text":"//~^ ERROR doesn't implement } pub fn main() { } trait Foo { const SIZE: usize = core::mem::size_of::(); //~^ ERROR the size for values of type `Self` cannot be known at compilation time } trait Bar: std::fmt::Display { const SIZE: usize = core::mem::size_of::(); //~^ ERROR the size for values of type `Self` cannot be known at compilation time } trait Baz where Self: std::fmt::Display { const SIZE: usize = core::mem::size_of::(); //~^ ERROR the size for values of type `Self` cannot be known at compilation time } trait Qux where Self: std::fmt::Display { const SIZE: usize = core::mem::size_of::(); //~^ ERROR the size for values of type `Self` cannot be known at compilation time } trait Bat: std::fmt::Display { const SIZE: usize = core::mem::size_of::(); //~^ ERROR the size for values of type `Self` cannot be known at compilation time } fn main() { } "} {"_id":"q-en-rust-35ebb959043a1df702c95597acf873c949122b97ee8b114652fd76c5e5e350f1","text":"AscribeUserTy, /// The data of a user variable, for debug info. VarDebugInfo, /// PlaceMention statement. PlaceMention, } #[derive(Copy, Clone, Debug, PartialEq, Eq)]"} {"_id":"q-en-rust-35f26f6c70075da353f91a6dc5159e024ba2dba8062dc5b2715abc149b048d30","text":"let node_id = scope.node_id(self.tcx, &self.region_scope_tree); match self.tcx.hir.find(node_id) { Some(hir_map::NodeStmt(_)) => { db.note(\"consider using a `let` binding to increase its lifetime\"); if *sub_scope != ty::ReStatic { db.note(\"consider using a `let` binding to increase its lifetime\"); } } _ => {} }"} {"_id":"q-en-rust-3649528ba598b8a6e72900bdf35539f64d05e0caefdc9503310d3b63a77d1413","text":" error[E0596]: cannot borrow immutable `Box` content `*x` as mutable --> $DIR/issue-36400.rs:15:12 | 14 | let x = Box::new(3); | - consider changing this to `mut x` 15 | f(&mut *x); | ^^ cannot borrow as mutable error: aborting due to previous error "} {"_id":"q-en-rust-3682b6ee88f5c7a3bca30b48d47a21cc26e9b44f8ba19876d34432f4a212a41d","text":"[[package]] name = \"ar_archive_writer\" version = \"0.4.0\" version = \"0.4.2\" source = \"registry+https://github.com/rust-lang/crates.io-index\" checksum = \"de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c\" checksum = \"01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4\" dependencies = [ \"object 0.36.2\", ]"} {"_id":"q-en-rust-36e124e3f02bec6f5dc8d47d7666f21b90483c5d8afdba78c68a66cead465744","text":"if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) { if fmt_str.symbol == Symbol::intern(\"\") { let mut applicability = Applicability::MachineApplicable; let suggestion = if let Some(e) = expr { snippet_with_applicability(cx, e.span, \"v\", &mut applicability) } else { applicability = Applicability::HasPlaceholders; Cow::Borrowed(\"v\") let suggestion = match expr { Some(expr) => snippet_with_applicability(cx, expr.span, \"v\", &mut applicability), None => { applicability = Applicability::HasPlaceholders; Cow::Borrowed(\"v\") }, }; span_lint_and_sugg("} {"_id":"q-en-rust-36f9325d69fd64e6dc9c2f2f927259746c874cd36210f4b1f948d0571580aee2","text":"fBopt-levelfR=fIVALfR Optimize with possible levels 0[en]3 .SH ENVIRONMENT VARIABLES Some of these affect the output of the compiler, while others affect programs which link to the standard library. .TP fBRUST_TEST_THREADSfR The test framework Rust provides executes tests in parallel. This variable sets the maximum number of threads used for this purpose. .TP fBRUST_TEST_NOCAPTUREfR A synonym for the --nocapture flag. .TP fBRUST_MIN_STACKfR Sets the minimum stack size for new threads. .TP fBRUST_BACKTRACEfR If set, produces a backtrace in the output of a program which panics. .SH \"EXAMPLES\" To build an executable from a source file with a main function: $ rustc -o hello hello.rs"} {"_id":"q-en-rust-3703476de2a433b067e9e5d1340076399cc6db1956fd8bb1793504d4804eda43","text":"self.tcx.struct_span_lint_hir( lint::builtin::RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES, closure_hir_id, closure_head_span, closure_head_span, |lint| { let mut diagnostics_builder = lint.build( format!("} {"_id":"q-en-rust-374f7e4ded3dfde98cc0d22bfcf2f3d97ea5bcd65c41685fda3b78dc9021f1cd","text":" Subproject commit 5399a24c66cb6164cf32280e7d300488c90d5765 Subproject commit b31c30a9bb4dbbd13c359d0e2bea7f65d20adf3f "} {"_id":"q-en-rust-3755f3304f4532c8a77407e85c1454024a8458be170ff5343a14cf323954a73c","text":" #![feature(unboxed_closures)] #![feature(fn_traits)] fn main() { let handlers: Option FnMut<&'a mut (), Output=()>>> = None; handlers.unwrap().as_mut().call_mut(&mut ()); //~ ERROR: `&mut ()` is not a tuple } "} {"_id":"q-en-rust-375dff0c7ed4845ee310ca8a172e319c6814830cdf76b816944c66f83e16192c","text":"#[cfg(test)] mod tests; #[doc(no_inline)] pub use hir::*; pub use hir_id::*; pub use lang_items::{LangItem, LanguageItems};"} {"_id":"q-en-rust-378cdea484745759f3db7e8a10f32572d4fb2a7bd19cf594b90fbd480ddeae15","text":"src = t!(fs::canonicalize(src)); } else { let link = t!(fs::read_link(src)); t!(self.symlink_file(link, dst)); t!(self.config.symlink_file(link, dst)); return; } }"} {"_id":"q-en-rust-37a55016b058c0271a10130298bf40bb94ceafb5ec74320883c4f0c5fd45a04d","text":" // Regression test for #100143 use std::iter::Peekable; pub struct Span { inner: Peekable>, } pub struct ConditionalIterator { f: F, } // @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class=\"code-header in-band\"]' 'impl Iterator for ConditionalIterator' impl Iterator for ConditionalIterator { type Item = (); fn next(&mut self) -> Option { todo!() } } "} {"_id":"q-en-rust-37c7bf3f65929fdbbb00da2b40e29c800797449881eb623beb4e79da85d5b5b4","text":"// Types of fields (other than the last) in a struct must be sized. FieldSized, // Only Sized types can be made into objects ObjectSized, } pub type Obligations<'tcx> = subst::VecPerParamSpace>;"} {"_id":"q-en-rust-37ce7a5cded8fa1a83cbaa541efa180fd2ca6d01ced7f3cf0d14b251e0fa7ab9","text":"pub fn read_line(&self, buf: &mut String) -> io::Result { self.lock().read_line(buf) } // Locks this handle with any lifetime. This depends on the // implementation detail that the underlying `Mutex` is static. fn lock_any<'a>(&self) -> StdinLock<'a> { StdinLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) } } /// Consumes this handle to the standard input stream, locking the /// shared global buffer associated with the stream and returning a /// readable guard. /// /// The lock is released when the returned guard goes out of scope. The /// returned guard also implements the [`Read`] and [`BufRead`] traits /// for accessing the underlying data. /// /// It is often simpler to directly get a locked handle using the /// [`stdin_locked`] function instead, unless nearby code also needs to /// use an unlocked handle. /// /// # Examples /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Read}; /// /// fn main() -> io::Result<()> { /// let mut buffer = String::new(); /// let mut handle = io::stdin().into_locked(); /// /// handle.read_to_string(&mut buffer)?; /// Ok(()) /// } /// ``` #[unstable(feature = \"stdio_locked\", issue = \"none\")] pub fn into_locked(self) -> StdinLock<'static> { self.lock_any() } } #[stable(feature = \"std_debug\", since = \"1.16.0\")]"} {"_id":"q-en-rust-37e07c6e8ec8b3e9489a0efd45b79b2e543e2644c2a6049f817c05ea0d8f9f34","text":" error[E0310]: the associated type `<&'a V as IntoIterator>::Item` may not live long enough --> $DIR/issue-71546.rs:12:27 | LL | let csv_str: String = value | ___________________________^ LL | | .into_iter() LL | | .map(|elem| elem.to_string()) | |_____________________________________^ | = help: consider adding an explicit lifetime bound `<&'a V as IntoIterator>::Item: 'static`... = note: ...so that the type `<&'a V as IntoIterator>::Item` will meet its required lifetime bounds... note: ...that is required by this bound --> $DIR/issue-71546.rs:10:55 | LL | for<'a> <&'a V as IntoIterator>::Item: ToString + 'static, | ^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0310`. "} {"_id":"q-en-rust-37ef005a0d5e1ff2b5fd6b0287bd243ab156c4c8c78eeab282ac933d977dfd25","text":"#![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] #![feature(char_error_internals)] #![feature(char_internals)] #![feature(clamp)] #![feature(concat_idents)] #![feature(const_cstr_unchecked)]"} {"_id":"q-en-rust-381c86e22eede4c19910636a9560f397ec9c98b858eec22247df5ff4d3b74f0e","text":"), .. }) => { let hir::Ty { span, .. } = inputs[local.index() - 1]; let hir::Ty { span, .. } = *inputs.get(local.index() - 1)?; Some(span) } _ => None,"} {"_id":"q-en-rust-3840dfcbc5ee1e4419c0e365cfc855000516ff5815884d1eb3f2abf7697d9df8","text":"true } // Suggest to change `Option<&Vec>::unwrap_or(&[])` to `Option::map_or(&[], |v| v)`. #[instrument(level = \"trace\", skip(self, err, provided_expr))] pub(crate) fn suggest_deref_unwrap_or( &self, err: &mut Diag<'_>, error_span: Span, callee_ty: Option>, call_ident: Option, expected_ty: Ty<'tcx>, provided_ty: Ty<'tcx>, provided_expr: &Expr<'tcx>, is_method: bool, ) { if !is_method { return; } let Some(callee_ty) = callee_ty else { return; }; let ty::Adt(callee_adt, _) = callee_ty.peel_refs().kind() else { return; }; let adt_name = if self.tcx.is_diagnostic_item(sym::Option, callee_adt.did()) { \"Option\" } else if self.tcx.is_diagnostic_item(sym::Result, callee_adt.did()) { \"Result\" } else { return; }; let Some(call_ident) = call_ident else { return; }; if call_ident.name != sym::unwrap_or { return; } let ty::Ref(_, peeled, _mutability) = provided_ty.kind() else { return; }; // NOTE: Can we reuse `suggest_deref_or_ref`? // Create an dummy type `&[_]` so that both &[] and `&Vec` can coerce to it. let dummy_ty = if let ty::Array(elem_ty, size) = peeled.kind() && let ty::Infer(_) = elem_ty.kind() && size.try_eval_target_usize(self.tcx, self.param_env) == Some(0) { let slice = Ty::new_slice(self.tcx, *elem_ty); Ty::new_imm_ref(self.tcx, self.tcx.lifetimes.re_static, slice) } else { provided_ty }; if !self.can_coerce(expected_ty, dummy_ty) { return; } let msg = format!(\"use `{adt_name}::map_or` to deref inner value of `{adt_name}`\"); err.multipart_suggestion_verbose( msg, vec![ (call_ident.span, \"map_or\".to_owned()), (provided_expr.span.shrink_to_hi(), \", |v| v\".to_owned()), ], Applicability::MachineApplicable, ); } /// Suggest wrapping the block in square brackets instead of curly braces /// in case the block was mistaken array syntax, e.g. `{ 1 }` -> `[ 1 ]`. pub(crate) fn suggest_block_to_brackets("} {"_id":"q-en-rust-38649e0aec17295d9e8e822f06c7ca6ab06291a13c4db93213eaea9030999d00","text":"/// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] pub fn lock(&self) -> StdinLock<'_> { StdinLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) } self.lock_any() } /// Locks this handle and reads a line of input, appending it to the specified buffer."} {"_id":"q-en-rust-38655975827e6779b36a5d46a21fa4555edcd7f0be4686e0f885b955afbe595b","text":"bug!(\"expected capture to be an upvar\"); }; assert!(child_capture.place.projections.len() >= parent_capture.place.projections.len()); parent_base.var_path.hir_id == child_base.var_path.hir_id && std::iter::zip(&child_capture.place.projections, &parent_capture.place.projections) .all(|(child, parent)| child.kind == parent.kind)"} {"_id":"q-en-rust-38acc9426095ef138b47954ff1a2a1ee23e2ffc3f284a4507f849241171b2408","text":"span: Span, self_expr: &'tcx hir::Expr<'tcx>, call_expr: &'tcx hir::Expr<'tcx>, skip_record_for_diagnostics: bool, } impl<'a, 'tcx> Deref for ConfirmContext<'a, 'tcx> {"} {"_id":"q-en-rust-38d022e19c6f1473fc7b8fd1bb90956b4fa6e32dae8394a1456d0ba32838b533","text":"rm_rf(&build.out.join(\"tmp\")); rm_rf(&build.out.join(\"dist\")); rm_rf(&build.out.join(\"bootstrap\")); rm_rf(&build.out.join(\"rustfmt.stamp\")); for host in &build.hosts { let entries = match build.out.join(host.triple).read_dir() {"} {"_id":"q-en-rust-38d707cc27cfe5001b059dcafbd71979fa92b0c524183475f6f3df64ba576791","text":"#[rustc_builtin_macro] #[macro_export] #[rustc_diagnostic_item = \"assert_macro\"] #[allow_internal_unstable(panic_internals, edition_panic, generic_assert_internals)] #[allow_internal_unstable( core_intrinsics, panic_internals, edition_panic, generic_assert_internals )] macro_rules! assert { ($cond:expr $(,)?) => {{ /* compiler built-in */ }}; ($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};"} {"_id":"q-en-rust-38ea093413814d3ccc8adcb42a471178c4d2cf80f290932216c9ced8333df094","text":"use syntax::visit; use syntax::visit::Visitor; // An error has already been reported to the user, so no need to continue checking. // Useful type to use with `Result<>` indicate that an error has already // been reported to the user, so no need to continue checking. #[deriving(Clone,Show)] pub struct ErrorReported;"} {"_id":"q-en-rust-391bf7ffdd79953c8689f97e2982e1cf22e40c1b25d926e40535f8d1eb1d19f8","text":" Subproject commit 01c8b654f9a01371414d1fd69cba38b289510a9e Subproject commit 2b9078f4afae82f60c5ac0fdb4af42d269e2f2f3 "} {"_id":"q-en-rust-3927c5d92901dbf1b2edff7220842e19bf3b79ff2a8b4d0f4557bfcaf555796a","text":"assert::>(); assert::>(); assert::>(); assert::>(); assert::<&AssertRecoverSafe>(); assert::>>(); assert::>>(); } }"} {"_id":"q-en-rust-3937befccddb58fa4371176614abea8e7a98d3b3e724af484a168849f34a4552","text":"rc::Rc, }; use std::time::Duration; //~^ ERROR expected item, found `require` use std::time::Instant; //~^ ERROR expected item, found `include` pub use std::io; //~^ ERROR expected item, found `using` fn main() { let x = Rc::new(1); let _ = write!(io::stdout(), \"{:?}\", x); let _ = Duration::new(5, 0); let _ = Instant::now(); }"} {"_id":"q-en-rust-39565ca976f806c69887d6f3d87a9c6020c82eaf6ee3bfada3837329bb8246de","text":"See the specification for the [GitHub Tables extension][tables] for more details on the exact syntax supported. ### Task lists Task lists can be used as a checklist of items that have been completed. Example: ```md - [x] Complete task - [ ] IncComplete task ``` This will render as
See the specification for the [task list extension] for more details.
[`backtrace`]: https://docs.rs/backtrace/0.3.50/backtrace/ [commonmark markdown specification]: https://commonmark.org/ [commonmark quick reference]: https://commonmark.org/help/"} {"_id":"q-en-rust-39693079c7326e06379c5944caceb2b202874a67d9b4c979d3cc1f49f7fe85e3","text":"// #[repr(simd)], even if we don't actually use this struct directly. // // FIXME repr(simd) broken on emscripten and redox // It's also broken on big-endian powerpc64 and s390x. #42778 #[cfg_attr(not(any(target_os = \"emscripten\", target_os = \"redox\", target_endian = \"big\")), repr(simd))] #[cfg_attr(not(any(target_os = \"emscripten\", target_os = \"redox\")), repr(simd))] struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64);"} {"_id":"q-en-rust-39899c70086bc86510586e010fcdcec15f2100ef8b9f49f9b38c574d91606186","text":"*slot = p.read_separator('.', i, |p| { // Disallow octal number in IP string. // https://tools.ietf.org/html/rfc6943#section-3.1.1 match (p.peek_char(), p.read_number(10, None)) { (Some('0'), Some(number)) if number != 0 => None, (_, number) => number, } p.read_number(10, Some(3), false) })?; }"} {"_id":"q-en-rust-3991974b2bebc4f58b7d32ea2c475c51268d2ffab06e8e9e525fd264e6825553","text":"key!(exe_suffix); key!(staticlib_prefix); key!(staticlib_suffix); key!(os_family = \"target_family\", optional); key!(os_family = \"target-family\", optional); key!(abi_return_struct_as_int, bool); key!(is_like_osx, bool); key!(is_like_solaris, bool);"} {"_id":"q-en-rust-399ad145ba6b7d3a6fcab5f19b46a663b60d5d9592ae16af8f9481dacd48c8b8","text":" error[E0277]: the trait bound `for<'a> &'a _: Trait` is not satisfied --> $DIR/issue-89333.rs:6:5 | LL | test(&|| 0); | ^^^^ the trait `for<'a> Trait` is not implemented for `&'a _` | note: required by a bound in `test` --> $DIR/issue-89333.rs:11:55 | LL | fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {} | ^^^^^ required by this bound in `test` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-39a08f976d9cf2ea042abefeb2e52efb3a54cd4bb85f03f44da638c54f7cfc2b","text":"/// ```rust /// # use std::fmt::Write; /// # let mut buf = String::new(); /// /// // Bad /// writeln!(buf, \"{}\", \"foo\"); /// /// // Good /// writeln!(buf, \"foo\"); /// ``` pub WRITE_LITERAL, style,"} {"_id":"q-en-rust-39cfaec0d2fbd441504c7b401a9cf6dbd1948d7e157379fc88934e375e7cfb63","text":" pub static TEST_STR: &'static str = \"Hello world\"; "} {"_id":"q-en-rust-39e954ae2dea9c5f5ef548b7fbfaf199302a19e9d899f907aefd95373c42bf9a","text":"} } #[derive(Copy, Clone, PartialEq, Decodable, Encodable, Hash, HashStable_Generic)] #[derive(Copy, Clone, PartialEq, Eq, Decodable, Encodable, Hash, HashStable_Generic)] #[rustc_pass_by_value] pub enum Variance { Covariant, // T
<: T iff A <: B -- e.g., function return type"} {"_id":"q-en-rust-3a2ffe6a9d68937818a7dfd06d06f3b93c0b5b766a19a1a849d239e7a3d0de9e","text":"display: table; } .stab { border-width: 1px; border-style: solid; padding: 3px; margin-bottom: 5px; font-size: 90%;"} {"_id":"q-en-rust-3a5d61f801f3db0a4287602de1a1f92c59c935df0c058eac6c909e425e50ebd1","text":" error[E0308]: mismatched types --> $DIR/dont-record-adjustments-when-pointing-at-arg.rs:26:37 | LL | ns_window.setFrame_display_(0); | ----------------- ^ expected `()`, found integer | | | arguments to this method are incorrect | note: method defined here --> $DIR/dont-record-adjustments-when-pointing-at-arg.rs:5:8 | LL | fn setFrame_display_(self, display: ()) {} | ^^^^^^^^^^^^^^^^^ ----------- error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-3aa3c0f610364c01b9394834965a33b7fa7a29863314527c2a6300ec07ddbb60","text":"let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:6:10: 6:18 let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:6:10: 6:18 scope 1 { - debug buf => _2; // in scope 1 at $DIR/simple.rs:5:9: 5:16 + debug buf => _0; // in scope 1 at $DIR/simple.rs:5:9: 5:16 debug buf => _2; // in scope 1 at $DIR/simple.rs:5:9: 5:16 } bb0: { - StorageLive(_2); // scope 0 at $DIR/simple.rs:5:9: 5:16 - _2 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 + nop; // scope 0 at $DIR/simple.rs:5:9: 5:16 + _0 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 StorageLive(_2); // scope 0 at $DIR/simple.rs:5:9: 5:16 _2 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 StorageLive(_3); // scope 1 at $DIR/simple.rs:6:5: 6:19 StorageLive(_4); // scope 1 at $DIR/simple.rs:6:5: 6:9 _4 = _1; // scope 1 at $DIR/simple.rs:6:5: 6:9 StorageLive(_5); // scope 1 at $DIR/simple.rs:6:10: 6:18 StorageLive(_6); // scope 1 at $DIR/simple.rs:6:10: 6:18 - _6 = &mut _2; // scope 1 at $DIR/simple.rs:6:10: 6:18 + _6 = &mut _0; // scope 1 at $DIR/simple.rs:6:10: 6:18 _6 = &mut _2; // scope 1 at $DIR/simple.rs:6:10: 6:18 _5 = &mut (*_6); // scope 1 at $DIR/simple.rs:6:10: 6:18 _3 = move _4(move _5) -> bb1; // scope 1 at $DIR/simple.rs:6:5: 6:19 }"} {"_id":"q-en-rust-3ac092c20cbd73722b3d76d0e45fcdd7a6556e502fe694765bba176bc9fe634f","text":"return None; } // Handle the special case of -Wall. let wall = matches.opt_strs(\"W\"); if wall.iter().any(|x| *x == \"all\") { print_wall_help(); return None; } // Don't handle -W help here, because we might first load plugins. let r = matches.opt_strs(\"Z\"); if r.iter().any(|x| *x == \"help\") {"} {"_id":"q-en-rust-3ac8b5f4da9840f35ee03bdc475aa3c0a6ca59a72d7ca9733f6948384b48839e","text":"} } } self.visit_ty(&typ); if let &Some(ref trait_ref) = trait_ref { self.process_path(trait_ref.ref_id, &trait_ref.path); } self.process_generic_params(generics, \"\", item.id); for impl_item in impl_items { let map = &self.tcx.hir(); self.process_impl_item(impl_item, map.local_def_id_from_node_id(item.id)); } let map = &self.tcx.hir(); self.nest_tables(item.id, |v| { v.visit_ty(&typ); if let &Some(ref trait_ref) = trait_ref { v.process_path(trait_ref.ref_id, &trait_ref.path); } v.process_generic_params(generics, \"\", item.id); for impl_item in impl_items { v.process_impl_item(impl_item, map.local_def_id_from_node_id(item.id)); } }); } fn process_trait("} {"_id":"q-en-rust-3ae956bb04527ab4943e70ca95b436031479249458426080c35b0ff19ccf7063","text":"base_generics: &ty::Generics<'tcx>) -> ty::Generics<'tcx> { ty_generics(ccx, FnSpace, generics, base_generics) ty_generics(ccx, FnSpace, generics, base_generics, false) } fn ty_generic_predicates_for_fn<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,"} {"_id":"q-en-rust-3af44e6df62457631b49de767b0fb70b0802b2d7eb6fc8747c1a53b2a686501a","text":"let thread = thread_info::current_thread(); let name = thread.as_ref().and_then(|t| t.name()).unwrap_or(\"\"); let write = |err: &mut dyn crate::io::Write, backtrace: Option| { let write = |err: &mut dyn crate::io::Write| { let _ = writeln!(err, \"thread '{name}' panicked at {location}:n{msg}\"); static FIRST_PANIC: AtomicBool = AtomicBool::new(true);"} {"_id":"q-en-rust-3b04e4d03cbaa336557e453bddec70aed5e261394e54f942b37f7390b552bedf","text":" // Fixed in #66054. // ignore-tidy-trailing-newlines // error-pattern: aborting due to 2 previous errors #[Ѕ No newline at end of file"} {"_id":"q-en-rust-3b14119ffe2e6ff5f1a280c0e70c65509ad7b09854c3af095a1e4ece69f961bc","text":"#![feature(staged_api)] #![doc(issue_tracker_base_url = \"https://issue_url/\")] #![unstable(feature=\"test\", issue = \"32374\")] #![unstable(feature = \"test\", issue = \"32374\")] // @matches issue_32374/index.html '//*[@class=\"item-left unstable deprecated module-item\"]/span[@class=\"stab deprecated\"]' // 'Deprecated'"} {"_id":"q-en-rust-3b770d651430312b532a4ef51e10f983a91315862e5d6fbaef227540ca259c35","text":" error[E0382]: use of moved value: `bar` --> $DIR/moved-value-on-as-ref-arg.rs:27:16 | LL | let bar = Bar; | --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait LL | foo(bar); | --- value moved here LL | let _baa = bar; | ^^^ value used here after move | help: borrow the value to avoid moving it | LL | foo(&bar); | + error[E0382]: use of moved value: `bar` --> $DIR/moved-value-on-as-ref-arg.rs:30:16 | LL | let mut bar = Bar; | ------- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait LL | qux(bar); | --- value moved here LL | let _baa = bar; | ^^^ value used here after move | note: if `Bar` implemented `Clone`, you could clone the value --> $DIR/moved-value-on-as-ref-arg.rs:5:1 | LL | struct Bar; | ^^^^^^^^^^ consider implementing `Clone` for this type ... LL | qux(bar); | --- you could clone this value help: borrow the value to avoid moving it | LL | qux(&mut bar); | ++++ error[E0382]: use of moved value: `bar` --> $DIR/moved-value-on-as-ref-arg.rs:33:16 | LL | let bar = Bar; | --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait LL | bat(bar); | --- value moved here LL | let _baa = bar; | ^^^ value used here after move | help: borrow the value to avoid moving it | LL | bat(&bar); | + error[E0382]: use of moved value: `bar` --> $DIR/moved-value-on-as-ref-arg.rs:36:16 | LL | let mut bar = Bar; | ------- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait LL | baz(bar); | --- value moved here LL | let _baa = bar; | ^^^ value used here after move | note: if `Bar` implemented `Clone`, you could clone the value --> $DIR/moved-value-on-as-ref-arg.rs:5:1 | LL | struct Bar; | ^^^^^^^^^^ consider implementing `Clone` for this type ... LL | baz(bar); | --- you could clone this value help: borrow the value to avoid moving it | LL | baz(&mut bar); | ++++ error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0382`. "} {"_id":"q-en-rust-3b82876b225192a9e4609e676aa7f1a4101f6f25a838030a4fe67414b8f28143","text":" // compile-flags: -Z unstable-options --document-hidden-items // test for trait methods with `doc(hidden)` with `--document-hidden-items` passed. #![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() {} } "} {"_id":"q-en-rust-3baacd69f982968077369219b41e3ff736e238265012ef8c810c2504406e6843","text":"token::EQ => { // x = foo::bar self.bump(); let path_lo = self.span.lo; path = ~[self.parse_ident()]; while self.token == token::MOD_SEP { self.bump();"} {"_id":"q-en-rust-3bcb264c8ff9f81a73065c4210ccd9c46849b7d65c69dc30997cb1307d1d978c","text":"\"
\"; var search = getSearchElement(); search.innerHTML = output; showSearchResults(search); var tds = search.getElementsByTagName(\"td\");"} {"_id":"q-en-rust-3c0ec9f8f159d529f9e284edf7da506df923395f2b0be7aa7ae3704bc8f41b48","text":"use std::rc::Rc; use std::{i8, i16, i32, i64}; use syntax::abi::{X86, X86_64, Arm, Mips, Mipsel, Rust, RustCall}; use syntax::abi::{RustIntrinsic, Abi}; use syntax::abi::{RustIntrinsic, Abi, OsWindows}; use syntax::ast_util::{local_def, is_local}; use syntax::attr::AttrMetaMethods; use syntax::attr;"} {"_id":"q-en-rust-3c2a07a887b78150e77ed30e87d9ec8676afa8f15c9fc36324cec2a5f66a1581","text":" //! Regression test for #![feature(no_core)] #![no_core] #![crate_name = \"export_extern_crate_as_self\"] // ignore-tidy-linelength // @is export_extern_crate_as_self.json \"$.index[*][?(@.kind=='module')].name\" \"export_extern_crate_as_self\" pub extern crate self as export_extern_crate_as_self; // Must be the same name as the crate already has "} {"_id":"q-en-rust-3c2e6e20ac2c33f651dedcc82cbb0a4b261ea8422447ecda6ad11b0427d48f32","text":" An inherent `impl` was written on a dyn auto trait. Erroneous code example: ```compile_fail,E0785 #![feature(auto_traits)] auto trait AutoTrait {} impl dyn AutoTrait {} ``` Dyn objects allow any number of auto traits, plus at most one non-auto trait. The non-auto trait becomes the \"principal trait\". When checking if an impl on a dyn trait is coherent, the principal trait is normally the only one considered. Since the erroneous code has no principal trait, it cannot be implemented at all. Working example: ``` #![feature(auto_traits)] trait PrincipalTrait {} auto trait AutoTrait {} impl dyn PrincipalTrait + AutoTrait + Send {} ``` "} {"_id":"q-en-rust-3c4637964e266535b4a68d554b201b5b72f18828eb09fc30bd7ba37110705045","text":"match context { PlaceContext::MutatingUse(_) => ty::Invariant, PlaceContext::NonUse(StorageDead | StorageLive | PlaceMention | VarDebugInfo) => { ty::Invariant } PlaceContext::NonUse(StorageDead | StorageLive | VarDebugInfo) => ty::Invariant, PlaceContext::NonMutatingUse( Inspect | Copy | Move | SharedBorrow | ShallowBorrow | UniqueBorrow | AddressOf | Projection, Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | UniqueBorrow | AddressOf | Projection, ) => ty::Covariant, PlaceContext::NonUse(AscribeUserTy) => ty::Covariant, }"} {"_id":"q-en-rust-3c4aa2bcc0f77b295fcfd52c2c7981bb97a505650564d31e2245293f3e412a46","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub struct X([u8]); pub static Y: &'static X = { const Y: &'static [u8] = b\"\"; &X(*Y) //~^ ERROR cannot move out //~^^ ERROR cannot move a //~^^^ ERROR cannot move a }; fn main() {} "} {"_id":"q-en-rust-3c635f7cda8927744817a50f9b0c989213ad3ae14864b6c4a80fef0b9db48d85","text":"// take the \"else\" branch if self.option_loud_drop(6).is_some() // 2 && self.option_loud_drop(5).is_some() // 1 && let None = self.option_loud_drop(7) { // 3 && let None = self.option_loud_drop(8) { // 4 unreachable!(); } else { self.print(8); // 4 self.print(7); // 3 } // let exprs interspersed"} {"_id":"q-en-rust-3c67f3d8a82571a493ab36d4fa849a23734985131cb4ed05fce9a11d9801d60c","text":" // This code (probably) _should_ compile, but it currently does not because we // are not smart enough about implied bounds. use std::io; fn real_dispatch(f: F) -> Result<(), io::Error> //~^ NOTE required by a bound in this where F: FnOnce(&mut UIView) -> Result<(), io::Error> + Send + 'static, //~^ NOTE required by this bound in `real_dispatch` //~| NOTE required by a bound in `real_dispatch` { todo!() } #[derive(Debug)] struct UIView<'a, T: 'a> { _phantom: std::marker::PhantomData<&'a mut T>, } trait Handle<'a, T: 'a, V, R> { fn dispatch(&self, f: F) -> Result<(), io::Error> where F: FnOnce(&mut V) -> R + Send + 'static; } #[derive(Debug, Clone)] struct TUIHandle { _phantom: std::marker::PhantomData, } impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandle { fn dispatch(&self, f: F) -> Result<(), io::Error> where F: FnOnce(&mut UIView<'a, T>) -> Result<(), io::Error> + Send + 'static, { real_dispatch(f) //~^ ERROR expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` //~| NOTE expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` //~| NOTE expected a closure with arguments //~| NOTE required by a bound introduced by this call } } fn main() {} "} {"_id":"q-en-rust-3c9e7c40229cbb08f05d3abfdfe6f77e55c887ac5591aeda4cbb8444a0a222de","text":"/// Parse a `mod { ... }` or `mod ;` item fn parse_item_mod(&mut self, outer_attrs: &[Attribute]) -> PResult<'a, ItemInfo> { let outer_attrs = ::config::StripUnconfigured { config: &self.cfg, sess: self.sess, should_test: false, // irrelevant features: None, // don't perform gated feature checking }.process_cfg_attrs(outer_attrs.to_owned()); let (in_cfg, outer_attrs) = { let mut strip_unconfigured = ::config::StripUnconfigured { config: &self.cfg, sess: self.sess, should_test: false, // irrelevant features: None, // don't perform gated feature checking }; let outer_attrs = strip_unconfigured.process_cfg_attrs(outer_attrs.to_owned()); (strip_unconfigured.in_cfg(&outer_attrs), outer_attrs) }; let id_span = self.span; let id = self.parse_ident()?; if self.check(&token::Semi) { self.bump(); // This mod is in an external file. Let's go get it! let (m, attrs) = self.eval_src_mod(id, &outer_attrs, id_span)?; Ok((id, m, Some(attrs))) if in_cfg { // This mod is in an external file. Let's go get it! let (m, attrs) = self.eval_src_mod(id, &outer_attrs, id_span)?; Ok((id, m, Some(attrs))) } else { let placeholder = ast::Mod { inner: syntax_pos::DUMMY_SP, items: Vec::new() }; Ok((id, ItemKind::Mod(placeholder), None)) } } else { let directory = self.directory.clone(); self.push_directory(id, &outer_attrs);"} {"_id":"q-en-rust-3cad91aecd4e16bc0bb4538bf9a7ff58711f49cbee591fbcdc318d148de348a8","text":"} function showResults(results) { if (results.others.length === 1 && getCurrentValue(\"rustdoc-go-to-only-result\") === \"true\") { var search = getSearchElement(); if (results.others.length === 1 && getCurrentValue(\"rustdoc-go-to-only-result\") === \"true\" // By default, the search DOM element is \"empty\" (meaning it has no children not // text content). Once a search has been run, it won't be empty, even if you press // ESC or empty the search input (which also \"cancels\" the search). && (!search.firstChild || search.firstChild.innerText !== getSearchLoadingText())) { var elem = document.createElement(\"a\"); elem.href = results.others[0].href; elem.style.display = \"none\"; // For firefox, we need the element to be in the DOM so it can be clicked. document.body.appendChild(elem); elem.click(); return; } var query = getQuery(search_input.value);"} {"_id":"q-en-rust-3ccaab2ef4b88e33980298293a34d1b040802d03268593f97983389147e1b0d2","text":"impl Encodable for Span { fn encode(&self, s: &mut S) -> Result<(), S::Error> { try!(s.emit_u32(self.lo.0)); s.emit_u32(self.hi.0) s.emit_struct(\"Span\", 2, |s| { try!(s.emit_struct_field(\"lo\", 0, |s| { self.lo.encode(s) })); s.emit_struct_field(\"hi\", 1, |s| { self.hi.encode(s) }) }) } } impl Decodable for Span { fn decode(d: &mut D) -> Result { let lo = BytePos(try! { d.read_u32() }); let hi = BytePos(try! { d.read_u32() }); Ok(mk_sp(lo, hi)) d.read_struct(\"Span\", 2, |d| { let lo = try!(d.read_struct_field(\"lo\", 0, |d| { BytePos::decode(d) })); let hi = try!(d.read_struct_field(\"hi\", 1, |d| { BytePos::decode(d) })); Ok(mk_sp(lo, hi)) }) } }"} {"_id":"q-en-rust-3ce3565dc94075dd25406b13013454791752addc274f11a27fc00f7193a1b264","text":"self.r .session .struct_span_warn(item.span, \"`$crate` may not be imported\") .note( \"`use $crate;` was erroneously allowed and will become a hard error in a future release\", ) .struct_span_err(item.span, \"`$crate` may not be imported\") .emit(); } }"} {"_id":"q-en-rust-3d34218f53f4568aaa5171d48936b3d2397882883114659a18c1397c45a6bd3a","text":"pub(crate) fn unsafety(&self, tcx: TyCtxt<'_>) -> hir::Unsafety { tcx.trait_def(self.def_id).unsafety } pub(crate) fn is_object_safe(&self, tcx: TyCtxt<'_>) -> bool { tcx.check_is_object_safe(self.def_id) } } #[derive(Clone, Debug)]"} {"_id":"q-en-rust-3d58f75c42cf639e7111c39af8eab1576b11b115c6a23420aee2d2b54a25eab5","text":"val.into() } Aggregate(ref kind, ref fields) => Value::Aggregate { fields: fields .iter() .map(|field| self.eval_operand(field).map_or(Value::Uninit, Value::Immediate)) .collect(), variant: match **kind { AggregateKind::Adt(_, variant, _, _, _) => variant, AggregateKind::Array(_) | AggregateKind::Tuple | AggregateKind::Closure(_, _) | AggregateKind::Coroutine(_, _) | AggregateKind::CoroutineClosure(_, _) => VariantIdx::new(0), }, }, Aggregate(ref kind, ref fields) => { // Do not const pop union fields as they can be // made to produce values that don't match their // underlying layout's type (see ICE #121534). // If the last element of the `Adt` tuple // is `Some` it indicates the ADT is a union if let AggregateKind::Adt(_, _, _, _, Some(_)) = **kind { return None; }; Value::Aggregate { fields: fields .iter() .map(|field| { self.eval_operand(field).map_or(Value::Uninit, Value::Immediate) }) .collect(), variant: match **kind { AggregateKind::Adt(_, variant, _, _, _) => variant, AggregateKind::Array(_) | AggregateKind::Tuple | AggregateKind::Closure(_, _) | AggregateKind::Coroutine(_, _) | AggregateKind::CoroutineClosure(_, _) => VariantIdx::new(0), }, } } Repeat(ref op, n) => { trace!(?op, ?n);"} {"_id":"q-en-rust-3d651afbd895ffa4b4c367de0760227a7166689f3d23a312d9ddd7006df90de9","text":"Some(x) => x, }; if local_tmp_s0 != local_tmp_s1 // The field-and-variant information match up. || vf_s0 != vf_s1 // Source and target locals have the same type. // FIXME(Centril | oli-obk): possibly relax to same layout? || local_decls[local_0].ty != local_decls[local_1].ty // We're setting the discriminant of `local_0` to this variant. || Some((local_0, vf_s0.var_idx)) != match_set_discr(s2) { continue;"} {"_id":"q-en-rust-3d7a462c364e8519fb0d9d19c83c3c3e8e9749ebf929ac56abae8fcdebaed149","text":"req_introduces_loc: subdiag, has_lifetime: sup_r.has_name(), lifetime: sup_r.to_string(), lifetime: lifetime_name.clone(), has_param_name: simple_ident.is_some(), param_name: simple_ident.map(|x| x.to_string()).unwrap_or_default(), spans_empty, bound, };"} {"_id":"q-en-rust-3da4ee4949f8586c82eec9279e4f211919b959c151c92fd2be5c098401363c3d","text":"pub use self::scoped_tls::ScopedKey; #[doc(hidden)] pub use self::local::__KeyInner as __LocalKeyInner; #[doc(hidden)] pub use self::scoped_tls::__KeyInner as __ScopedKeyInner; //////////////////////////////////////////////////////////////////////////////// // Builder"} {"_id":"q-en-rust-3e1d92c8ffc40aa82d752a257b29ea2abfe0bcdf3bad19633b08b741135b7677","text":" // run-rustfix // Regression test for #54505 - range borrowing suggestion had // incorrect syntax (missing parentheses). use std::ops::RangeBounds; // take a reference to any built-in range fn take_range(_r: &impl RangeBounds) {} fn main() { take_range(0..1); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..1) take_range(1..); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(1..) take_range(..); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..) take_range(0..=1); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(0..=1) take_range(..5); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..5) take_range(..=42); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &(..=42) } "} {"_id":"q-en-rust-3e2869a84f816d2ea3d9f1fd21a5cea1a75641aad366b5dcc17f6109e8aef1cd","text":" // Verify that lifetime resolution correctly accounts for `Fn` bare trait objects. // check-pass #![allow(bare_trait_objects)] // This should work as: fn next_u32(fill_buf: &mut dyn FnMut(&mut [u8])) fn next_u32(fill_buf: &mut FnMut(&mut [u8])) { let mut buf: [u8; 4] = [0; 4]; fill_buf(&mut buf); } fn explicit(fill_buf: &mut dyn FnMut(&mut [u8])) { let mut buf: [u8; 4] = [0; 4]; fill_buf(&mut buf); } fn main() { let _: fn(&mut FnMut(&mut [u8])) = next_u32; let _: &dyn Fn(&mut FnMut(&mut [u8])) = &next_u32; let _: fn(&mut FnMut(&mut [u8])) = explicit; let _: &dyn Fn(&mut FnMut(&mut [u8])) = &explicit; let _: fn(&mut dyn FnMut(&mut [u8])) = next_u32; let _: &dyn Fn(&mut dyn FnMut(&mut [u8])) = &next_u32; let _: fn(&mut dyn FnMut(&mut [u8])) = explicit; let _: &dyn Fn(&mut dyn FnMut(&mut [u8])) = &explicit; } "} {"_id":"q-en-rust-3e622b64796f2df9438daa5085efd645455088db88cf66cc380d6967de259bb0","text":"// components like the llvm tools and LLD. LLD is included below and // tools/LLDB come later, so let's just throw it in the rustc // component for now. maybe_install_llvm_dylib(builder, host, image); maybe_install_llvm_runtime(builder, host, image); // Copy over lld if it's there if builder.config.lld_enabled {"} {"_id":"q-en-rust-3ecc911466585e00e2f74f598c05e59e65995d63ca5ca849817d23323b7ffd07","text":" error: `impl Trait` can only mention lifetimes bound at the fn or impl level error: `impl Trait` can only mention lifetimes from an fn or impl --> $DIR/universal_wrong_hrtb.rs:5:73 | LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} | ^^ | note: lifetime declared here --> $DIR/universal_wrong_hrtb.rs:5:39 | LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} | ^^ | -- lifetime declared here ^^ error: aborting due to previous error"} {"_id":"q-en-rust-3ed4ca481a56e699b3fe64de75cf3d2b4fe2bac050fc432135ee4f9bab5b0776","text":"echo '{\"ipv6\":true,\"fixed-cidr-v6\":\"fd9a:8454:6789:13f7::/64\"}' | sudo tee /etc/docker/daemon.json sudo service docker restart displayName: Enable IPv6 condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux')) # Check out all our submodules, but more quickly than using git by using one of # our custom scripts"} {"_id":"q-en-rust-3ef4c0e38067e2aef641bf113e317d72efecdb738c14237cc1cc0cbff2b6ab60","text":"cx: &MatchCheckCtxt<'p, 'tcx>, column: &[&DeconstructedPat<'p, 'tcx>], ) -> Vec> { if column.is_empty() { return Vec::new(); } let ty = column[0].ty(); let pcx = &PatCtxt { cx, ty, span: DUMMY_SP, is_top_level: false };"} {"_id":"q-en-rust-3f0e9a6d5393396ee4158df3114ab8e5fc4930bd56ae8c99188f57577e0c3931","text":"// We use the *previous* span because if the type is known *here* it means // it was *evaluated earlier*. We don't do this for method calls because we // evaluate the method's self type eagerly, but not in any other case. err.span_label( span, with_forced_trimmed_paths!(format!( \"here the type of `{ident}` is inferred to be `{ty}`\", )), ); if !span.overlaps(mismatch_span) { err.span_label( span, with_forced_trimmed_paths!(format!( \"here the type of `{ident}` is inferred to be `{ty}`\", )), ); } break; } prev = ty;"} {"_id":"q-en-rust-3f2189e4afc63123acc822b72535fa9f141271f8fb7194fc4be8e17ffcc82fa3","text":"} 0 => {} _ => { // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look // for POLLHUP rather than read readiness if pollfd.revents & libc::POLLHUP != 0 { let e = self.take_error()?.unwrap_or_else(|| { io::const_io_error!( io::ErrorKind::Uncategorized, \"no error set after POLLHUP\", ) }); return Err(e); if cfg!(target_os = \"vxworks\") { // VxWorks poll does not return POLLHUP or POLLERR in revents. Check if the // connnection actually succeeded and return ok only when the socket is // ready and no errors were found. if let Some(e) = self.take_error()? { return Err(e); } } else { // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look // for POLLHUP or POLLERR rather than read readiness if pollfd.revents & (libc::POLLHUP | libc::POLLERR) != 0 { let e = self.take_error()?.unwrap_or_else(|| { io::const_io_error!( io::ErrorKind::Uncategorized, \"no error set after POLLHUP\", ) }); return Err(e); } } return Ok(());"} {"_id":"q-en-rust-3f371092a5563ab1f1ce31b708d09768f114e2d7c87282a56fedfad0a86fdf50","text":"impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity { fn run_pass(&self, _: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) { for bb in body.basic_blocks_mut() { let (basic_blocks, local_decls) = body.basic_blocks_and_local_decls_mut(); for bb in basic_blocks { // Need 3 statements: let (s0, s1, s2) = match &mut *bb.statements { [s0, s1, s2] => (s0, s1, s2),"} {"_id":"q-en-rust-3f5fed3ca494f56c57922995e36653ccb585fde7dffd940f5b85ad6caacc73df","text":"loop { let tree = iter.stack.pop().or_else(|| { let next = iter.cursor.next_with_joint()?; let lookahead = iter.cursor.look_ahead(0); Some(TokenTree::from_internal((next, lookahead, self.sess, &mut iter.stack))) Some(TokenTree::from_internal((next, self.sess, &mut iter.stack))) })?; // A hack used to pass AST fragments to attribute and derive macros // as a single nonterminal token instead of a token stream."} {"_id":"q-en-rust-3f694d36853a102dc2ba7648d051647fc3daac7d90584ec4b80653a294aef9f3","text":"#[license = \"MIT/ASL2\"]; #[crate_type = \"rlib\"]; #[crate_type = \"dylib\"]; #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk.png\", #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png\", html_favicon_url = \"http://www.rust-lang.org/favicon.ico\", html_root_url = \"http://static.rust-lang.org/doc/master\")];"} {"_id":"q-en-rust-3fdee19ac9208241370e709a476c18e58d68594e3df1e634e36c506d818e7756","text":"optopt(\"\", \"host\", \"the host to build for\", \"HOST\"), optopt(\"\", \"gdb-version\", \"the version of GDB used\", \"VERSION STRING\"), optopt(\"\", \"lldb-version\", \"the version of LLDB used\", \"VERSION STRING\"), optopt(\"\", \"llvm-version\", \"the version of LLVM used\", \"VERSION STRING\"), optopt(\"\", \"android-cross-path\", \"Android NDK standalone path\", \"PATH\"), optopt(\"\", \"adb-path\", \"path to the android debugger\", \"PATH\"), optopt(\"\", \"adb-test-dir\", \"path to tests for the android debugger\", \"PATH\"),"} {"_id":"q-en-rust-3ff26bdd798062f08cd4b9059753cd03abd3ccd65e61b01847fc159fd60806b4","text":"'{' => { let curr_last_brace = self.last_opening_brace; let byte_pos = self.to_span_index(pos); let lbrace_end = InnerOffset(byte_pos.0 + 1); let lbrace_end = self.to_span_index(pos + 1); self.last_opening_brace = Some(byte_pos.to(lbrace_end)); self.cur.next(); if self.consume('{') {"} {"_id":"q-en-rust-3fff1a5a87e1d25d5bb2b8e788aa4a3fea18ff9c258bdfa1763e89d8bc45f626","text":"} #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Read for File { impl Read for &File { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.inner.read(buf) }"} {"_id":"q-en-rust-40270ec2a030828a0f18fc0ca5c6822e18741ec5304d9b51ba1599fdb53445b8","text":" //@ run-rustfix // Check the `unused_parens` suggestion for paren_expr with attributes. // The suggestion should retain attributes in the front. #![feature(stmt_expr_attributes)] #![deny(unused_parens)] pub fn foo() -> impl Fn() { let _ = (#[inline] #[allow(dead_code)] || println!(\"Hello!\")); //~ERROR unnecessary parentheses (#[inline] #[allow(dead_code)] || println!(\"Hello!\")) //~ERROR unnecessary parentheses } fn main() { let _ = foo(); } "} {"_id":"q-en-rust-4046c081ea22421fed505940fd3e4a6b13fa2c26aec9cf7803b4a970d9049f4e","text":"lt_op: |_| self.tcx.lifetimes.re_erased, ct_op: |c| c, ty_op: |t| match *t.kind() { ty::Infer(ty::TyVar(vid)) => self.tcx.mk_ty_infer(ty::TyVar(self.root_var(vid))), ty::Infer(ty::TyVar(_)) => self.tcx.mk_ty_var(ty::TyVid::from_u32(0)), ty::Infer(ty::IntVar(_)) => { self.tcx.mk_ty_infer(ty::IntVar(ty::IntVid { index: 0 })) }"} {"_id":"q-en-rust-40d23a88bfac19015b570512fa64a89d4bcbf8d0021dbce3991f828d59bafffb","text":"fn report(&mut self, error: GroupedMoveError<'tcx>) { let (mut err, err_span) = { let (span, original_path, kind): (Span, &Place<'tcx>, &IllegalMoveOriginKind<'_>) = let (span, use_spans, original_path, kind,): ( Span, Option, &Place<'tcx>, &IllegalMoveOriginKind<'_>, ) = match error { GroupedMoveError::MovesFromPlace { span, ref original_path, ref kind, .. } | GroupedMoveError::MovesFromValue { span, ref original_path, ref kind, .. } => { (span, original_path, kind) (span, None, original_path, kind) } GroupedMoveError::OtherIllegalMove { use_spans, ref original_path, ref kind } => { (use_spans.args_or_use(), original_path, kind) (use_spans.args_or_use(), Some(use_spans), original_path, kind) }, }; debug!(\"report: original_path={:?} span={:?}, kind={:?} "} {"_id":"q-en-rust-40d657760ff7ef31649bac6241e45094e51b2d1342ec07320bfbbabb74499699","text":"0, ); if result != stackaddr || result == MAP_FAILED { panic!(\"failed to allocate a guard page\"); panic!(\"failed to allocate a guard page: {}\", io::Error::last_os_error()); } let result = mprotect(stackaddr, page_size, PROT_NONE); if result != 0 { panic!(\"failed to protect the guard page\"); panic!(\"failed to protect the guard page: {}\", io::Error::last_os_error()); } let guardaddr = stackaddr as usize;"} {"_id":"q-en-rust-412d7a59d478ac0ae1c22ef453aa06a8c8c9ab647fada861511be9b18bd08e64","text":"// no number between dots let none: Option = \"255.0..1\".parse().ok(); assert_eq!(None, none); // octal let none: Option = \"255.0.0.01\".parse().ok(); assert_eq!(None, none); // octal zero let none: Option = \"255.0.0.00\".parse().ok(); assert_eq!(None, none); let none: Option = \"255.0.00.0\".parse().ok(); assert_eq!(None, none); } #[test]"} {"_id":"q-en-rust-41396f09f31ee4ad3b6759a18710504407a874f360bd9cb5cf912304b2bb9f20","text":"r: A+'static } fn new_struct(r: A+'static) -> Struct { fn new_struct(r: A+'static) -> Struct { //~^ ERROR the trait `core::kinds::Sized` is not implemented //~^ ERROR the trait `core::kinds::Sized` is not implemented Struct { r: r } //~^ ERROR the trait `core::kinds::Sized` is not implemented"} {"_id":"q-en-rust-4139d2a522af7d6da54eba9c2b614589cc0e3471ee48200d5d069a0c7d75a6cf","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct GradFn usize>(F); fn main() { let GradFn(x_squared) : GradFn<_> = GradFn(|| -> usize { 2 }); let _ = x_squared(); } "} {"_id":"q-en-rust-413d97e62737bc7760ae359e2838d8c16860946923624eb511028bcbde9b5c38","text":"return exports.iter().map(ToString::to_string).collect(); } let mut symbols = Vec::new(); if let CrateType::ProcMacro = crate_type { exported_symbols_for_proc_macro_crate(tcx) } else { exported_symbols_for_non_proc_macro(tcx, crate_type) } } fn exported_symbols_for_non_proc_macro(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec { let mut symbols = Vec::new(); let export_threshold = symbol_export::crates_export_threshold(&[crate_type]); for_each_exported_symbols_include_dep(tcx, crate_type, |symbol, info, cnum| { if info.level.is_below_threshold(export_threshold) {"} {"_id":"q-en-rust-4145100ef47a2226af9a96f27f2b6b8ea22b57ec58f99012c5f105b59b01e533","text":"{ err.note(\"you may be trying to write a c-string literal\"); err.note(\"c-string literals require Rust 2021 or later\"); HelpUseLatestEdition::new().add_to_diagnostic(&mut err); err.subdiagnostic(self.dcx(), HelpUseLatestEdition::new()); } // `pub` may be used for an item or `pub(crate)`"} {"_id":"q-en-rust-415d44ca465098ed89900c939017379e995c3b0ac7561538ee879a39bb1699f2","text":"); } else if matches!(span.desugaring_kind(), Some(DesugaringKind::ForLoop(_))) { let suggest = match self.infcx.tcx.get_diagnostic_item(sym::IntoIterator) { Some(def_id) => type_known_to_meet_bound_modulo_regions( &self.infcx, self.param_env, self.infcx.tcx.mk_imm_ref(self.infcx.tcx.lifetimes.re_erased, ty), def_id, DUMMY_SP, ), Some(def_id) => self.infcx.tcx.infer_ctxt().enter(|infcx| { type_known_to_meet_bound_modulo_regions( &infcx, self.param_env, infcx .tcx .mk_imm_ref(infcx.tcx.lifetimes.re_erased, infcx.tcx.erase_regions(ty)), def_id, DUMMY_SP, ) }), _ => false, }; if suggest {"} {"_id":"q-en-rust-41676ff2faaadd10f46689cf19203ec9b27382ba6adcae49e46cbe92cdd40639","text":"symbols } fn exported_symbols_for_proc_macro_crate(tcx: TyCtxt<'_>) -> Vec { // `exported_symbols` will be empty when !should_codegen. if !tcx.sess.opts.output_types.should_codegen() { return Vec::new(); } let stable_crate_id = tcx.sess.local_stable_crate_id(); let proc_macro_decls_name = tcx.sess.generate_proc_macro_decls_symbol(stable_crate_id); let metadata_symbol_name = exported_symbols::metadata_symbol_name(tcx); vec![proc_macro_decls_name, metadata_symbol_name] } pub(crate) fn linked_symbols( tcx: TyCtxt<'_>, crate_type: CrateType,"} {"_id":"q-en-rust-41b925b7a5e6a36ab25e29fdd5717a1273be81d8bf620d47a354ebdc24774a62","text":" error: lifetime may not live long enough --> $DIR/issue-54779-anon-static-lifetime.rs:34:24 | LL | cx: &dyn DebugContext, | - let's call the lifetime of this reference `'1` ... LL | bar.debug_with(cx); | ^^ cast requires that `'1` must outlive `'static` error: aborting due to previous error "} {"_id":"q-en-rust-41d669167072ca0c51c9deced606ef1579a1ed87d798a3942ea57fb2085df1f3","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // forbid-output: &mut mut self struct Struct; impl Struct { fn foo(&mut self) { (&mut self).bar(); //~^ ERROR cannot borrow immutable argument `self` as mutable // ... and no SUGGESTION that suggests `&mut mut self` } // In this case we could keep the suggestion, but to distinguish the // two cases is pretty hard. It's an obscure case anyway. fn bar(self: &mut Self) { (&mut self).bar(); //~^ ERROR cannot borrow immutable argument `self` as mutable } } fn main () {} "} {"_id":"q-en-rust-41f5ec1ee96e019f47ca44ccd464b5624d9530dcfdc6badadbd085e5dcd3d1f2","text":".map_or(false, |output| output.status.success()) } fn ensure_stage1_toolchain_placeholder_exists(stage_path: &str) -> bool { let pathbuf = PathBuf::from(stage_path); if fs::create_dir_all(pathbuf.join(\"lib\")).is_err() { return false; }; let pathbuf = pathbuf.join(\"bin\"); if fs::create_dir_all(&pathbuf).is_err() { return false; }; let pathbuf = pathbuf.join(format!(\"rustc{}\", EXE_SUFFIX)); if pathbuf.exists() { return true; } // Take care not to overwrite the file let result = File::options().append(true).create(true).open(&pathbuf); if result.is_err() { return false; } return true; } // Used to get the path for `Subcommand::Setup` pub fn interactive_path() -> io::Result { fn abbrev_all() -> impl Iterator {"} {"_id":"q-en-rust-4206ed09b1a782ddf0928c3fa34e1ec577a59c6331f3aa925706580411e48c22","text":"} } impl<'tcx> Debug for TerminatorKind<'tcx> { fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result { self.fmt_head(fmt)?; let successor_count = self.successors().count(); let labels = self.fmt_successor_labels(); assert_eq!(successor_count, labels.len()); match successor_count { 0 => Ok(()), 1 => write!(fmt, \" -> {:?}\", self.successors().next().unwrap()), _ => { write!(fmt, \" -> [\")?; for (i, target) in self.successors().enumerate() { if i > 0 { write!(fmt, \", \")?; } write!(fmt, \"{}: {:?}\", labels[i], target)?; } write!(fmt, \"]\") } } } } impl<'tcx> TerminatorKind<'tcx> { /// Writes the \"head\" part of the terminator; that is, its name and the data it uses to pick the /// successor basic block, if any. The only information not included is the list of possible /// successors, which may be rendered differently between the text and the graphviz format. pub fn fmt_head(&self, fmt: &mut W) -> fmt::Result { use self::TerminatorKind::*; match self { Goto { .. } => write!(fmt, \"goto\"), SwitchInt { discr, .. } => write!(fmt, \"switchInt({:?})\", discr), Return => write!(fmt, \"return\"), GeneratorDrop => write!(fmt, \"generator_drop\"), Resume => write!(fmt, \"resume\"), Abort => write!(fmt, \"abort\"), Yield { value, resume_arg, .. } => write!(fmt, \"{:?} = yield({:?})\", resume_arg, value), Unreachable => write!(fmt, \"unreachable\"), Drop { place, .. } => write!(fmt, \"drop({:?})\", place), DropAndReplace { place, value, .. } => { write!(fmt, \"replace({:?} <- {:?})\", place, value) } Call { func, args, destination, .. } => { if let Some((destination, _)) = destination { write!(fmt, \"{:?} = \", destination)?; } write!(fmt, \"{:?}(\", func)?; for (index, arg) in args.iter().enumerate() { if index > 0 { write!(fmt, \", \")?; } write!(fmt, \"{:?}\", arg)?; } write!(fmt, \")\") } Assert { cond, expected, msg, .. } => { write!(fmt, \"assert(\")?; if !expected { write!(fmt, \"!\")?; } write!(fmt, \"{:?}, \", cond)?; msg.fmt_assert_args(fmt)?; write!(fmt, \")\") } FalseEdge { .. } => write!(fmt, \"falseEdge\"), FalseUnwind { .. } => write!(fmt, \"falseUnwind\"), InlineAsm { template, ref operands, options, .. } => { write!(fmt, \"asm!(\"{}\"\", InlineAsmTemplatePiece::to_string(template))?; for op in operands { write!(fmt, \", \")?; let print_late = |&late| if late { \"late\" } else { \"\" }; match op { InlineAsmOperand::In { reg, value } => { write!(fmt, \"in({}) {:?}\", reg, value)?; } InlineAsmOperand::Out { reg, late, place: Some(place) } => { write!(fmt, \"{}out({}) {:?}\", print_late(late), reg, place)?; } InlineAsmOperand::Out { reg, late, place: None } => { write!(fmt, \"{}out({}) _\", print_late(late), reg)?; } InlineAsmOperand::InOut { reg, late, in_value, out_place: Some(out_place), } => { write!( fmt, \"in{}out({}) {:?} => {:?}\", print_late(late), reg, in_value, out_place )?; } InlineAsmOperand::InOut { reg, late, in_value, out_place: None } => { write!(fmt, \"in{}out({}) {:?} => _\", print_late(late), reg, in_value)?; } InlineAsmOperand::Const { value } => { write!(fmt, \"const {:?}\", value)?; } InlineAsmOperand::SymFn { value } => { write!(fmt, \"sym_fn {:?}\", value)?; } InlineAsmOperand::SymStatic { def_id } => { write!(fmt, \"sym_static {:?}\", def_id)?; } } } write!(fmt, \", options({:?}))\", options) } } } /// Returns the list of labels for the edges to the successor basic blocks. pub fn fmt_successor_labels(&self) -> Vec> { use self::TerminatorKind::*; match *self { Return | Resume | Abort | Unreachable | GeneratorDrop => vec![], Goto { .. } => vec![\"\".into()], SwitchInt { ref values, switch_ty, .. } => ty::tls::with(|tcx| { let param_env = ty::ParamEnv::empty(); let switch_ty = tcx.lift(&switch_ty).unwrap(); let size = tcx.layout_of(param_env.and(switch_ty)).unwrap().size; values .iter() .map(|&u| { ty::Const::from_scalar(tcx, Scalar::from_uint(u, size), switch_ty) .to_string() .into() }) .chain(iter::once(\"otherwise\".into())) .collect() }), Call { destination: Some(_), cleanup: Some(_), .. } => { vec![\"return\".into(), \"unwind\".into()] } Call { destination: Some(_), cleanup: None, .. } => vec![\"return\".into()], Call { destination: None, cleanup: Some(_), .. } => vec![\"unwind\".into()], Call { destination: None, cleanup: None, .. } => vec![], Yield { drop: Some(_), .. } => vec![\"resume\".into(), \"drop\".into()], Yield { drop: None, .. } => vec![\"resume\".into()], DropAndReplace { unwind: None, .. } | Drop { unwind: None, .. } => { vec![\"return\".into()] } DropAndReplace { unwind: Some(_), .. } | Drop { unwind: Some(_), .. } => { vec![\"return\".into(), \"unwind\".into()] } Assert { cleanup: None, .. } => vec![\"\".into()], Assert { .. } => vec![\"success\".into(), \"unwind\".into()], FalseEdge { .. } => vec![\"real\".into(), \"imaginary\".into()], FalseUnwind { unwind: Some(_), .. } => vec![\"real\".into(), \"cleanup\".into()], FalseUnwind { unwind: None, .. } => vec![\"real\".into()], InlineAsm { destination: Some(_), .. } => vec![\"\".into()], InlineAsm { destination: None, .. } => vec![], } } } /////////////////////////////////////////////////////////////////////////// // Statements"} {"_id":"q-en-rust-4259335d70dc59775ed920b76dbcb64de0f70a8006dbfd47a99982c1812ba7ed","text":" #![deny(improper_ctypes_definitions)] #[repr(C)] pub struct Foo { a: u8, b: (), } extern \"C\" fn foo(x: Foo) -> Foo { todo!() } struct NotSafe(u32); #[repr(C)] pub struct Bar { a: u8, b: (), c: NotSafe, } extern \"C\" fn bar(x: Bar) -> Bar { //~^ ERROR `extern` fn uses type `NotSafe`, which is not FFI-safe //~^^ ERROR `extern` fn uses type `NotSafe`, which is not FFI-safe todo!() } fn main() {} "} {"_id":"q-en-rust-425b140502bb95495f5d2cb3cd4c710b1572231a617a7e224277c15bef657fd7","text":" #![warn(unused)] #![allow(dead_code)] #![deny(non_snake_case)] mod Impl {} //~^ ERROR module `Impl` should have a snake case name fn While() {} //~^ ERROR function `While` should have a snake case name fn main() { let Mod: usize = 0; //~^ ERROR variable `Mod` should have a snake case name //~^^ WARN unused variable: `Mod` let Super: usize = 0; //~^ ERROR variable `Super` should have a snake case name //~^^ WARN unused variable: `Super` } "} {"_id":"q-en-rust-429541631ecbc6391826bf0fa0fa03766272d4d3ffefda90f9e0d2eaf9ec8881","text":"} } fn record_pat_span(&mut self, node: NodeId, span: Span) { debug!(\"(recording pat) recording {:?} for {:?}\", node, span); self.pat_span_map.insert(node, span); } fn is_accessible_from(&self, vis: ty::Visibility, module: Module<'a>) -> bool { vis.is_accessible_from(module.nearest_parent_mod, self) }"} {"_id":"q-en-rust-42a66441552c00558ae31b5fb18f88e4860cae053fcae377d9004104e52b1923","text":"never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::send_trait).unwrap()); let param_env = obligation.param_env; let trait_ref = trait_ref.skip_binder(); let trait_ref = poly_trait_ref.skip_binder(); let found_ty = trait_ref.self_ty(); let found_ty_str = found_ty.to_string();"} {"_id":"q-en-rust-42dea4edb0f108b4a62037ef429eb3046c7cb70148f5e1c1a5f88fa71fd8f057","text":"return tcx.arena.alloc(IndexVec::new()); } let tainted_by_errors = tcx.mir_borrowck(def).tainted_by_errors; tcx.ensure_with_value().mir_borrowck(def); let mut promoted = tcx.mir_promoted(def).1.steal(); for body in &mut promoted { if let Some(error_reported) = tainted_by_errors { body.tainted_by_errors = Some(error_reported); } run_analysis_to_runtime_passes(tcx, body); }"} {"_id":"q-en-rust-4307849d65139f41fe99cd76847e681ab11c3626205325f3caccd7c8ae63c1cb","text":"Variant2, } #[derive(Debug)] enum TupleVariant { Variant1(i32), //~ ERROR: variant `Variant1` is never constructed Variant2, } #[derive(Debug)] enum StructVariant { Variant1 { id: i32 }, //~ ERROR: variant `Variant1` is never constructed Variant2, } fn main() { let e = Enum::Variant2; e.clone(); let _ = TupleVariant::Variant2; let _ = StructVariant::Variant2; }"} {"_id":"q-en-rust-4317c2b6f5e201c179427d5f74ddb77a69164ab8526b169c21c13a2aab0060f0","text":"tool::Rustfmt, tool::Miri, tool::CargoMiri, native::Lld native::Lld, native::CrtBeginEnd ), Kind::Check | Kind::Clippy { .. } | Kind::Fix | Kind::Format => describe!( check::Std,"} {"_id":"q-en-rust-431bcee076070adec1817fba05204727576e0301c72d668b3179f1dd53812c7d","text":"#[derive(Copy, Clone, RustcEncodable, RustcDecodable)] enum EntryKind { AnonConst(mir::ConstQualifs, Lazy), Const(mir::ConstQualifs, Lazy), ImmStatic, MutStatic,"} {"_id":"q-en-rust-431fe7339dd9dcbdf4ecae5336a17fe625bf820ac699dee046b93b3295423592","text":"}; // rhs has holes ( `$id` and `$(...)` that need filled) let tts = transcribe(&cx.parse_sess.span_diagnostic, Some(named_matches), rhs); if cx.trace_macros() { trace_macros_note(cx, sp, format!(\"to `{}`\", tts)); } let directory = Directory { path: cx.current_expansion.module.directory.clone(), ownership: cx.current_expansion.directory_ownership,"} {"_id":"q-en-rust-4359ffb0a9c65ad66132921add3af2a898ca8b1bc59639d3be3377c6618a1e44","text":"}); cx.emit_spanned_lint(DEREF_INTO_DYN_SUPERTRAIT, cx.tcx.def_span(item.owner_id.def_id), SupertraitAsDerefTarget { t, target_principal: target_principal.to_string(), target_principal, label, }); }"} {"_id":"q-en-rust-43662f92a6b73ed585ac2484c25073ec74ccab11e3cbbad6af729e23b9a48703","text":"return; }; let coroutine_ty = body.local_decls[ty::CAPTURE_STRUCT_LOCAL].ty; let ty::Coroutine(_, args) = *coroutine_ty.kind() else { bug!() }; if coroutine_ty.references_error() { return; } let ty::Coroutine(_, args) = *coroutine_ty.kind() else { bug!(\"{body:#?}\") }; let coroutine_kind = args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap(); if coroutine_kind == ty::ClosureKind::FnOnce {"} {"_id":"q-en-rust-436dac458f919ca6eb9e5719ef0c9eb3390e13092b2f3c2b52210ac6444f1ad4","text":"}; if let ObligationCauseCode::ImplDerivedObligation(obligation) = &*code { let expected_trait_ref = obligation.parent_trait_ref.skip_binder(); let new_imm_trait_ref = ty::TraitRef::new(obligation.parent_trait_ref.def_id(), imm_substs); let new_mut_trait_ref = ty::TraitRef::new(obligation.parent_trait_ref.def_id(), mut_substs); let expected_trait_ref = obligation.parent_trait_ref; let new_imm_trait_ref = poly_trait_ref .rebind(ty::TraitRef::new(obligation.parent_trait_ref.def_id(), imm_substs)); let new_mut_trait_ref = poly_trait_ref .rebind(ty::TraitRef::new(obligation.parent_trait_ref.def_id(), mut_substs)); return try_borrowing(new_imm_trait_ref, new_mut_trait_ref, expected_trait_ref, &[]); } else if let ObligationCauseCode::BindingObligation(_, _) | ObligationCauseCode::ItemObligation(_) = &*code { return try_borrowing( ty::TraitRef::new(trait_ref.def_id, imm_substs), ty::TraitRef::new(trait_ref.def_id, mut_substs), trait_ref, poly_trait_ref.rebind(ty::TraitRef::new(trait_ref.def_id, imm_substs)), poly_trait_ref.rebind(ty::TraitRef::new(trait_ref.def_id, mut_substs)), *poly_trait_ref, &never_suggest_borrow[..], ); } else {"} {"_id":"q-en-rust-43d5d818e48a5913b60d2d7ac0126a2a6291cb0de44f11cbb65617b328b3a2a8","text":"error: invalid register `invalid`: unknown register --> $DIR/issue-72570.rs:7:18 --> $DIR/issue-72570.rs:9:18 | LL | asm!(\"\", in(\"invalid\") \"\".len()); | ^^^^^^^^^^^^^^^^^^^^^^"} {"_id":"q-en-rust-43dc284e9e3f89d0e139760138b629f3acb9515e78999abb6aec56ae8150cff7","text":" error[E0004]: non-exhaustive patterns: `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more not covered --> $DIR/issue-72377.rs:8:11 | LL | match (x, y) { | ^^^^^^ patterns `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `(X, Option)` error: aborting due to previous error For more information about this error, try `rustc --explain E0004`. "} {"_id":"q-en-rust-43e5286036b784140f68ab93146a1b58fc99c5718889507d26b2dc4b4f5862f8","text":"#[test] #[cfg(unix)] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn signal_reported_right() { use crate::os::unix::process::ExitStatusExt; let mut p = Command::new(\"/bin/sh\").arg(\"-c\").arg(\"read a\").stdin(Stdio::piped()).spawn().unwrap(); let mut p = shell_cmd().arg(\"-c\").arg(\"read a\").stdin(Stdio::piped()).spawn().unwrap(); p.kill().unwrap(); match p.wait().unwrap().signal() { Some(9) => {}"} {"_id":"q-en-rust-444fe71db728ebb039b3e5b0b24eb0bafe1cc054e6e81fb8c2879ffd0a88fd8e","text":" // check-pass // https://github.com/rust-lang/rust/issues/113257 #![deny(trivial_casts)] // The casts here are not trivial. struct Foo<'a> { a: &'a () } fn extend_lifetime_very_very_safely<'a>(v: *const Foo<'a>) -> *const Foo<'static> { // This should pass because raw pointer casts can do anything they want. v as *const Foo<'static> } trait Trait {} fn assert_static<'a>(ptr: *mut (dyn Trait + 'a)) -> *mut (dyn Trait + 'static) { ptr as _ } fn main() { let unit = (); let foo = Foo { a: &unit }; let _long: *const Foo<'static> = extend_lifetime_very_very_safely(&foo); } "} {"_id":"q-en-rust-447810dc35ba00207d5579b2f97c2aed83adfb191076ee7e26cebbb7d97ecaf2","text":"// If this is a floating point literal that ends with '.', // get rid of it to stop this from becoming a member access. let snippet = snippet.strip_suffix('.').unwrap_or(&snippet); err.span_suggestion( lit.span, &format!("} {"_id":"q-en-rust-44d029639f0fd754793906f833bf935cde35c11025fc1707168403d4eeaf8859","text":"let _a = stderr(); let _a = _a.lock(); } #[test] #[cfg_attr(target_os = \"emscripten\", ignore)] fn test_lock_stderr() { test_lock(stderr, stderr_locked); } #[test] #[cfg_attr(target_os = \"emscripten\", ignore)] fn test_lock_stdin() { test_lock(stdin, stdin_locked); } #[test] #[cfg_attr(target_os = \"emscripten\", ignore)] fn test_lock_stdout() { test_lock(stdout, stdout_locked); } // Helper trait to make lock testing function generic. trait Stdio<'a>: 'static where Self::Lock: 'a, { type Lock; fn lock(&'a self) -> Self::Lock; } impl<'a> Stdio<'a> for Stderr { type Lock = StderrLock<'a>; fn lock(&'a self) -> StderrLock<'a> { self.lock() } } impl<'a> Stdio<'a> for Stdin { type Lock = StdinLock<'a>; fn lock(&'a self) -> StdinLock<'a> { self.lock() } } impl<'a> Stdio<'a> for Stdout { type Lock = StdoutLock<'a>; fn lock(&'a self) -> StdoutLock<'a> { self.lock() } } // Helper trait to make lock testing function generic. trait StdioOwnedLock: 'static {} impl StdioOwnedLock for StderrLock<'static> {} impl StdioOwnedLock for StdinLock<'static> {} impl StdioOwnedLock for StdoutLock<'static> {} // Tests locking on stdio handles by starting two threads and checking that // they block each other appropriately. fn test_lock(get_handle: fn() -> T, get_locked: fn() -> U) where T: for<'a> Stdio<'a>, U: StdioOwnedLock, { // State enum to track different phases of the test, primarily when // each lock is acquired and released. #[derive(Debug, PartialEq)] enum State { Start1, Acquire1, Start2, Release1, Acquire2, Release2, } use State::*; // Logging vector to be checked to make sure lock acquisitions and // releases happened in the correct order. let log = Arc::new(Mutex::new(Vec::new())); let ((tx1, rx1), (tx2, rx2)) = (sync_channel(0), sync_channel(0)); let th1 = { let (log, tx) = (Arc::clone(&log), tx1); thread::spawn(move || { log.lock().unwrap().push(Start1); let handle = get_handle(); { let locked = handle.lock(); log.lock().unwrap().push(Acquire1); tx.send(Acquire1).unwrap(); // notify of acquisition tx.send(Release1).unwrap(); // wait for release command log.lock().unwrap().push(Release1); } tx.send(Acquire1).unwrap(); // wait for th2 acquire { let locked = handle.lock(); log.lock().unwrap().push(Acquire1); } log.lock().unwrap().push(Release1); }) }; let th2 = { let (log, tx) = (Arc::clone(&log), tx2); thread::spawn(move || { tx.send(Start2).unwrap(); // wait for start command let locked = get_locked(); log.lock().unwrap().push(Acquire2); tx.send(Acquire2).unwrap(); // notify of acquisition tx.send(Release2).unwrap(); // wait for release command log.lock().unwrap().push(Release2); }) }; assert_eq!(rx1.recv().unwrap(), Acquire1); // wait for th1 acquire log.lock().unwrap().push(Start2); assert_eq!(rx2.recv().unwrap(), Start2); // block th2 assert_eq!(rx1.recv().unwrap(), Release1); // release th1 assert_eq!(rx2.recv().unwrap(), Acquire2); // wait for th2 acquire assert_eq!(rx1.recv().unwrap(), Acquire1); // block th1 assert_eq!(rx2.recv().unwrap(), Release2); // release th2 th2.join().unwrap(); th1.join().unwrap(); assert_eq!( *log.lock().unwrap(), [Start1, Acquire1, Start2, Release1, Acquire2, Release2, Acquire1, Release1] ); } "} {"_id":"q-en-rust-44e5bfbbafe9f01b86d20b8d8bc17367822fb73226e80a299ecf4ef64998e078","text":"use rustc_metadata::creader::{CStore, LoadedMacro}; use rustc_middle::ty::fast_reject::SimplifiedType; use rustc_middle::ty::{self, TyCtxt}; use rustc_span::def_id::LOCAL_CRATE; use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym, Symbol};"} {"_id":"q-en-rust-4513b3f27568368132aa9521b214883c6add324fa9377f256736b428f171d20a","text":"} } /// Suggest using `while let` for call `next` on an iterator in a for loop. /// /// For example: /// ```ignore (illustrative) /// /// for x in iter { /// ... /// iter.next() /// } /// ``` pub(crate) fn explain_iterator_advancement_in_for_loop_if_applicable( &self, err: &mut Diagnostic, span: Span, issued_spans: &UseSpans<'tcx>, ) { let issue_span = issued_spans.args_or_use(); let tcx = self.infcx.tcx; let hir = tcx.hir(); let Some(body_id) = hir.get(self.mir_hir_id()).body_id() else { return }; let typeck_results = tcx.typeck(self.mir_def_id()); struct ExprFinder<'hir> { issue_span: Span, expr_span: Span, body_expr: Option<&'hir hir::Expr<'hir>>, loop_bind: Option, } impl<'hir> Visitor<'hir> for ExprFinder<'hir> { fn visit_expr(&mut self, ex: &'hir hir::Expr<'hir>) { if let hir::ExprKind::Loop(hir::Block{ stmts: [stmt, ..], ..}, _, hir::LoopSource::ForLoop, _) = ex.kind && let hir::StmtKind::Expr(hir::Expr{ kind: hir::ExprKind::Match(call, [_, bind, ..], _), ..}) = stmt.kind && let hir::ExprKind::Call(path, _args) = call.kind && let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IteratorNext, _, _, )) = path.kind && let hir::PatKind::Struct(path, [field, ..], _) = bind.pat.kind && let hir::QPath::LangItem(LangItem::OptionSome, _, _) = path && let PatField { pat: hir::Pat{ kind: hir::PatKind::Binding(_, _, ident, ..), .. }, ..} = field && self.issue_span.source_equal(call.span) { self.loop_bind = Some(ident.name); } if let hir::ExprKind::MethodCall(body_call, _recv, ..) = ex.kind && body_call.ident.name == sym::next && ex.span.source_equal(self.expr_span) { self.body_expr = Some(ex); } hir::intravisit::walk_expr(self, ex); } } let mut finder = ExprFinder { expr_span: span, issue_span, loop_bind: None, body_expr: None }; finder.visit_expr(hir.body(body_id).value); if let Some(loop_bind) = finder.loop_bind && let Some(body_expr) = finder.body_expr && let Some(def_id) = typeck_results.type_dependent_def_id(body_expr.hir_id) && let Some(trait_did) = tcx.trait_of_item(def_id) && tcx.is_diagnostic_item(sym::Iterator, trait_did) { err.note(format!( \"a for loop advances the iterator for you, the result is stored in `{}`.\", loop_bind )); err.help(\"if you want to call `next` on a iterator within the loop, consider using `while let`.\"); } } /// Suggest using closure argument instead of capture. /// /// For example:"} {"_id":"q-en-rust-457d30e763d5cb3f464ad416df72b4d9952f6c4a4606b0ede4489624c7b6719a","text":"_ => false, } } fn is_local(&self) -> bool { self.normal_ancestor_id.is_some() } } impl<'a> fmt::Debug for ModuleS<'a> {"} {"_id":"q-en-rust-458097da950ec73b1580b21c6e2853992946e901d33970069de8e47ddd9f26b4","text":"[dependencies] core = { path = \"../core\" } compiler_builtins = { version = \"0.1.114\", features = ['rustc-dep-of-std'] } [target.'cfg(not(any(target_arch = \"aarch64\", target_arch = \"x86\", target_arch = \"x86_64\")))'.dependencies] compiler_builtins = { version = \"0.1.114\", features = [\"no-f16-f128\"] } compiler_builtins = { version = \"0.1.117\", features = ['rustc-dep-of-std'] } [dev-dependencies] rand = { version = \"0.8.5\", default-features = false, features = [\"alloc\"] }"} {"_id":"q-en-rust-45922678c6cd755ce6ecfaa0e30bc4c92cbbe26c66d7b2eec5bc0a0213c1a5c5","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub trait AbstractRenderer {} fn _create_render(_: &()) -> AbstractRenderer //~^ ERROR: the trait `core::kinds::Sized` is not implemented { match 0u { _ => unimplemented!() } } fn main() { } "} {"_id":"q-en-rust-45abac779ba62e64385d7b7c09408840139887910fc042d52bbf34c42bfc768f","text":" Subproject commit a416c5e0f7c4c9473069a58410d3ec3e86b1ac0d Subproject commit fc24fce73f878e641094b1802df1e748c5fe233a "} {"_id":"q-en-rust-460406f8aedb72cf7fa98dd1ecf366988a5e89fc483c4488b4773d9b0e08da77","text":" error[E0308]: mismatched types --> $DIR/issue-30904.rs:20:45 | LL | let _: for<'a> fn(&'a str) -> Str<'a> = Str; | ^^^ expected concrete lifetime, found bound lifetime parameter 'a | = note: expected type `for<'a> fn(&'a str) -> Str<'a>` found type `fn(&str) -> Str<'_> {Str::<'_>}` error[E0631]: type mismatch in function arguments --> $DIR/issue-30904.rs:26:10 | LL | fn test FnOnce<(&'x str,)>>(_: F) {} | ---- -------------------------- required by this bound in `test` ... LL | struct Str<'a>(&'a str); | ------------------------ found signature of `fn(&str) -> _` ... LL | test(Str); | ^^^ expected signature of `for<'x> fn(&'x str) -> _` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-460abba7299293c4c60b0a9bed6a278d2fd4f9d30413216aed4241d8ca606875","text":" // aux-build:issue-99221-aux.rs // build-aux-docs // ignore-cross-compile #![crate_name = \"foo\"] #[macro_use] extern crate issue_99221_aux; pub use issue_99221_aux::*; // @count foo/index.html '//a[@class=\"macro\"]' 1 #[macro_export] macro_rules! print { () => () } "} {"_id":"q-en-rust-460bc02f2906b536d6632564d5ff6d28d01bfadf95abf160699c1e959e435df6","text":"}) } pub fn predicate_for_default_trait_impl<'tcx>( pub fn predicate_for_trait_def<'tcx>( tcx: &ty::ctxt<'tcx>, cause: ObligationCause<'tcx>, trait_def_id: ast::DefId,"} {"_id":"q-en-rust-4617c87aa4cb7463e8024de9e528d9cc1b0ae8e05e0a738c718108a2b446c54f","text":"| ^ expected identifier, found reserved identifier error: associated constant in `impl` without body --> $DIR/typeck_type_placeholder_item.rs:203:5 --> $DIR/typeck_type_placeholder_item.rs:205:5 | LL | const C: _; | ^^^^^^^^^^-"} {"_id":"q-en-rust-46385bdfdfc6713809a49e57556dd4ca22b367884ca82beafac27918284a7470","text":"install_sh(builder, \"clippy\", self.compiler.stage, Some(self.target), &tarball); }; Miri, alias = \"miri\", Self::should_build(_config), only_hosts: true, { let tarball = builder .ensure(dist::Miri { compiler: self.compiler, target: self.target }) .expect(\"missing miri\"); install_sh(builder, \"miri\", self.compiler.stage, Some(self.target), &tarball); if let Some(tarball) = builder.ensure(dist::Miri { compiler: self.compiler, target: self.target }) { install_sh(builder, \"miri\", self.compiler.stage, Some(self.target), &tarball); } else { // Miri is only available on nightly builder.info( &format!(\"skipping Install miri stage{} ({})\", self.compiler.stage, self.target), ); } }; LlvmTools, alias = \"llvm-tools\", Self::should_build(_config), only_hosts: true, { let tarball = builder"} {"_id":"q-en-rust-465874c591121798bda7ed6e101f5fe43694be5c2bd7d5a505846f26b581ed1d","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that methods from shadowed traits cannot be used mod foo { pub trait T { fn f(&self) {} } impl T for () {} } mod bar { pub use foo::T; } fn main() { pub use bar::*; struct T; ().f() //~ ERROR no method } "} {"_id":"q-en-rust-4665f46eb0b8ad421c119012ea1b0e351258193696747b9f304649d5ba5c2436","text":" warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/nested-apit-mentioning-outer-bound-var.rs:1:12 | LL | #![feature(non_lifetime_binders)] | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #108185 for more information = note: `#[warn(incomplete_features)]` on by default error: `impl Trait` can only mention type parameters from an fn or impl --> $DIR/nested-apit-mentioning-outer-bound-var.rs:8:52 | LL | fn uwu(_: impl for Trait<(), Assoc = impl Trait>) {} | - type parameter declared here ^ error: aborting due to previous error; 1 warning emitted "} {"_id":"q-en-rust-46719821122b85a78f7448084df56ecd160704f5bf89f1539a55a2a5722c50f9","text":"// Once we're done with llvm 14 and earlier, this test can be deleted. #![crate_type=\"lib\"] #![crate_type = \"lib\"] use std::mem::MaybeUninit;"} {"_id":"q-en-rust-46a2f5337ca3948d757befb3b56c36a4d8b3d78d02dfa1196aaa1f9032005bab","text":"// and about 2 * (len1 + len2) comparisons in the worst case // while `extend` takes O(len2 * log(len1)) operations // and about 1 * len2 * log_2(len1) comparisons in the worst case, // assuming len1 >= len2. // assuming len1 >= len2. For larger heaps, the crossover point // no longer follows this reasoning and was determined empirically. #[inline] fn better_to_rebuild(len1: usize, len2: usize) -> bool { 2 * (len1 + len2) < len2 * log2_fast(len1) let tot_len = len1 + len2; if tot_len <= 2048 { 2 * tot_len < len2 * log2_fast(len1) } else { 2 * tot_len < len2 * 11 } } if better_to_rebuild(self.len(), other.len()) {"} {"_id":"q-en-rust-46b87280fdbbcb4b43e37584c4b92a35404f0cdeba3223fb84b6edfd59b06fa4","text":"} _ => token.span, }, Some(tree) => tree.span(), None => colon_span, // Invalid, return a nice source location _ => colon_span.with_lo(start_sp.lo()), } } Some(tree) => tree.span(), None => start_sp, // Whether it's none or some other tree, it doesn't belong to // the current meta variable, returning the original span. _ => start_sp, }; result.push(TokenTree::MetaVarDecl(span, ident, None));"} {"_id":"q-en-rust-470047959fbfebe645cdbb434c662d167811f1f74b5823b08b96ea0c30cba562","text":" #![feature(fn_traits, unboxed_closures)] fn test FnOnce<(&'x str,)>>(_: F) {} struct Compose(F,G); impl FnOnce<(T,)> for Compose where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> { type Output = G::Output; extern \"rust-call\" fn call_once(self, (x,): (T,)) -> G::Output { (self.1)((self.0)(x)) } } fn bad(f: fn(&'static str) -> T) { test(Compose(f, |_| {})); //~ ERROR: mismatched types } fn main() {} "} {"_id":"q-en-rust-47104bea46e135e0d9c604e79a1859f0561ff9fc06fe92c1cd46eb910d6f33d7","text":"/// A type that allows convenient usage of a UDP stream connected to one /// address via the `Reader` and `Writer` traits. /// /// # Note /// /// This structure has been deprecated because `Reader` is a stream-oriented API but UDP /// is a packet-oriented protocol. Every `Reader` method will read a whole packet and /// throw all superfluous bytes away so that they are no longer available for further /// method calls. #[deprecated] pub struct UdpStream { socket: UdpSocket, connected_to: SocketAddr"} {"_id":"q-en-rust-477897e687659744c894fe1aac9e3800ca4e0a0d8d655da2d9e7dbd6b511c7b1","text":"continue; } // HACK: `async fn() -> Self` in traits is \"ok\"... // This is not really that great, but it's similar to why the `-> Self` // return type is well-formed in traits even when `Self` isn't sized. if let ty::Param(param_ty) = *proj_term.kind() && param_ty.name == kw::SelfUpper && matches!(opaque.origin, hir::OpaqueTyOrigin::AsyncFn(_)) && opaque.in_trait { continue; } let proj_ty = Ty::new_projection(cx.tcx, proj.projection_ty.def_id, proj.projection_ty.args); // For every instance of the projection type in the bounds,"} {"_id":"q-en-rust-477f8fbd795faaff6d558dfa155d83ae0a8c438038479e4aedbd66438652063c","text":"// panicking thread consumes at least 2 bytes of address space. static GLOBAL_PANIC_COUNT: AtomicUsize = AtomicUsize::new(0); // Return the state of the ALWAYS_ABORT_FLAG and number of panics. // // If ALWAYS_ABORT_FLAG is not set, the number is determined on a per-thread // base (stored in LOCAL_PANIC_COUNT), i.e. it is the amount of recursive calls // of the calling thread. // If ALWAYS_ABORT_FLAG is set, the number equals the *global* number of panic // calls. See above why LOCAL_PANIC_COUNT is not used. pub fn increase() -> (bool, usize) { ( GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Relaxed) & ALWAYS_ABORT_FLAG != 0, let global_count = GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Relaxed); let must_abort = global_count & ALWAYS_ABORT_FLAG != 0; let panics = if must_abort { global_count & !ALWAYS_ABORT_FLAG } else { LOCAL_PANIC_COUNT.with(|c| { let next = c.get() + 1; c.set(next); next }), ) }) }; (must_abort, panics) } pub fn decrease() {"} {"_id":"q-en-rust-4792491bf44403791ab6ddef82010f9640fe8ddf85cf664b7cf12dca367bf439","text":" error[E0644]: closure/coroutine type that references itself --> $DIR/cyclic_type_ice.rs:3:7 | LL | f(f); | ^ cyclic type of infinite size | = note: closures cannot capture themselves or take themselves as argument; this error may be the result of a recent compiler bug-fix, see issue #46062 for more information error[E0057]: this function takes 2 arguments but 1 argument was supplied --> $DIR/cyclic_type_ice.rs:3:5 | LL | f(f); | ^--- an argument is missing | note: closure defined here --> $DIR/cyclic_type_ice.rs:2:13 | LL | let f = |_, _| (); | ^^^^^^ help: provide the argument | LL | f(/* */, /* */); | ~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors Some errors have detailed explanations: E0057, E0644. For more information about an error, try `rustc --explain E0057`. "} {"_id":"q-en-rust-47a5ff8b9c9b64b5bbc33cc06e8bcf785b7f91e698adedd610a6cc24e0727db0","text":"\"concatenates all document attributes into one document attribute\"), (\"strip-private\", passes::strip_private, \"strips all private items from a crate which cannot be seen externally\"), (\"strip-priv-imports\", passes::strip_priv_imports, \"strips all private import statements (`use`, `extern crate`) from a crate\"), ]; const DEFAULT_PASSES: &'static [&'static str] = &["} {"_id":"q-en-rust-47c1b4f8a083832b3041731aee1f828dcd153905dde6a5e7ef61db92a56aeefb","text":" # only-linux # ignore-32bit -include ../tools.mk all: $(RUSTC) eh_frame-terminator.rs $(call RUN,eh_frame-terminator) | $(CGREP) '1122334455667788' objdump --dwarf=frames $(TMPDIR)/eh_frame-terminator | $(CGREP) 'ZERO terminator' "} {"_id":"q-en-rust-47c44d7c6511699b5de95af0a39df5617cb64d3aaa5f64cc4006cec6b5ba24a7","text":" // check-fail // dont-check-compiler-stdout // dont-check-compiler-stderr fn�a(){fn�p(){e}} //~ ERROR unknown start of token: u{fffd} //~^ ERROR unknown start of token: u{fffd} //~^^ ERROR can't use generic parameters from outer function [E0401] //~^^^ WARN type parameter `e` should have an upper camel case name fn main(){} "} {"_id":"q-en-rust-47c9388906f9cd01ba6a1c417ae610ab2dffec6a1c1b94ea03b39f5982115642","text":" error[E0308]: mismatched types --> $DIR/suggest-call-on-pat-mismatch.rs:7:12 | LL | if let E::One(var1, var2) = var { | ^^^^^^^^^^^^^^^^^^ --- this expression has type `fn(i32, i32) -> E {E::One}` | | | expected enum constructor, found `E` | = note: expected enum constructor `fn(i32, i32) -> E {E::One}` found enum `E` help: use parentheses to construct this tuple variant | LL | if let E::One(var1, var2) = var(/* i32 */, /* i32 */) { | ++++++++++++++++++++++ error[E0308]: mismatched types --> $DIR/suggest-call-on-pat-mismatch.rs:13:9 | LL | let Some(x) = Some; | ^^^^^^^ ---- this expression has type `fn(_) -> Option<_> {Option::<_>::Some}` | | | expected enum constructor, found `Option<_>` | = note: expected enum constructor `fn(_) -> Option<_> {Option::<_>::Some}` found enum `Option<_>` help: use parentheses to construct this tuple variant | LL | let Some(x) = Some(/* value */); | +++++++++++++ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-480e4999eedf29a07ccb329cadfbac13342d259faafad324bb21afb178f54968","text":"/// /// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); }"} {"_id":"q-en-rust-4859dba805b4aedef0c5aaa685857e3d03391d958dd397bd3ec098acd6c0a7fe","text":"> { after_tail: usize, after_head: usize, iter: Iter<'a, T>, ring: NonNull<[T]>, tail: usize, head: usize, deque: NonNull>, _phantom: PhantomData<&'a T>, } impl<'a, T, A: Allocator> Drain<'a, T, A> { pub(super) unsafe fn new( after_tail: usize, after_head: usize, iter: Iter<'a, T>, ring: &'a [MaybeUninit], tail: usize, head: usize, deque: NonNull>, ) -> Self { Drain { after_tail, after_head, iter, deque } let ring = unsafe { NonNull::new_unchecked(ring as *const [MaybeUninit] as *mut _) }; Drain { after_tail, after_head, ring, tail, head, deque, _phantom: PhantomData } } }"} {"_id":"q-en-rust-485cef9d24680d2ce45c51072ac86201f707be02d53112990319d03af3d99ab8","text":"use crate::io::ErrorKind; use crate::str; // FIXME(#10380) these tests should not all be ignored on android. #[cfg(target_os = \"android\")] fn shell_cmd() -> Command { Command::new(\"/system/bin/sh\") } #[cfg(not(target_os = \"android\"))] fn shell_cmd() -> Command { Command::new(\"/bin/sh\") } #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn smoke() { let p = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"exit 0\"]).spawn() } else { Command::new(\"true\").spawn() shell_cmd().arg(\"-c\").arg(\"true\").spawn() }; assert!(p.is_ok()); let mut p = p.unwrap();"} {"_id":"q-en-rust-487988aa2fcabe0988b35c1577b6f68d164831619d684fea06b8a1c91ae26b53","text":"LL | | /// Some docs. LL | | ... | LL | | pub fn bar() {} LL | | } LL | | } | |_^ |"} {"_id":"q-en-rust-48bb7baad74252d6e43b5c7fb176c756d0ced926e45444df08180c6dde62d841","text":" // check-pass // Regression test for issue #55099 // Tests that we don't incorrectly consider a lifetime to part // of the concrete type #![feature(type_alias_impl_trait)] trait Future { } struct AndThen(F); impl Future for AndThen { } struct Foo<'a> { x: &'a mut (), } type F = impl Future; impl<'a> Foo<'a> { fn reply(&mut self) -> F { AndThen(|| ()) } } fn main() {} "} {"_id":"q-en-rust-48f3ca2d7004293ac665d412326679077c0f4660be775f5e0156481dd8af5931","text":" Subproject commit 20da8f45c601d0eec8af8c0897abd536ad57951f Subproject commit 71be6f62fa920c0bd10cdf3a29aeb8c6719a8075 "} {"_id":"q-en-rust-48f4a25ce59414d6101941a099113e3f9794d6ff3bb3586641b83d6f0a3879de","text":" warning: `extern` block uses type `TransparentCustomZst`, which is not FFI-safe --> $DIR/repr-transparent-issue-87496.rs:8:18 | LL | fn good17(p: TransparentCustomZst); | ^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = note: `#[warn(improper_ctypes)]` on by default = note: this struct contains only zero-sized fields note: the type is defined here --> $DIR/repr-transparent-issue-87496.rs:6:1 | LL | struct TransparentCustomZst(()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: 1 warning emitted "} {"_id":"q-en-rust-48fe015cef09fe09ef24fdc75e7368ce68531f91742b41d0774387485baa8b63","text":"| NonMutatingUseContext::Copy | NonMutatingUseContext::Inspect | NonMutatingUseContext::Move | NonMutatingUseContext::PlaceMention | NonMutatingUseContext::ShallowBorrow | NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::UniqueBorrow,"} {"_id":"q-en-rust-48ff830bba11678ea901c9ff0be96d9937fe6f6bc1a3e507bdf978d1fb435acd","text":"// Check whether a span corresponding to a range expression is a // range literal, rather than an explicit struct or `new()` call. fn is_lit(sm: &SourceMap, span: &Span) -> bool { let end_point = sm.end_point(*span); if let Ok(end_string) = sm.span_to_snippet(end_point) { !(end_string.ends_with('}') || end_string.ends_with(')')) } else { false } sm.span_to_snippet(*span).map(|range_src| range_src.contains(\"..\")).unwrap_or(false) }; match expr.kind {"} {"_id":"q-en-rust-4911a8bf87fd99b511f8624a3b3387ab21fb441f28cd25ff92d20b1d431f4ed6","text":"// @has blanket_with_local.json \"$.index[*][?(@.name=='Load')]\" pub trait Load { // @has - \"$.index[*][?(@.name=='load')]\" fn load() {} // @has - \"$.index[*][?(@.name=='write')]\" fn write(self) {} } impl

Implementors

Implementors

    \")?; if let Some(implementors) = cache.implementors.get(&it.def_id) {"} {"_id":"q-en-rust-565c398e1b858e5221ee0823cc71d44b86db4014e9b494325e847810e3b4d2a2","text":" // check-pass fn foo(t: T) -> usize where for<'a> &'a T: IntoIterator, for<'a> <&'a T as IntoIterator>::IntoIter: ExactSizeIterator, { t.into_iter().len() } fn main() { foo::>(vec![]); } "} {"_id":"q-en-rust-56a530739341a1364fbd368488e7eb90725b11a32efbaffd6a026a80849a8ee7","text":" //! Email me at . //! Email me at . //! Email me at (this warns but will still become a link). // @has email_address/index.html '//a[@href=\"mailto:hello@example.com\"]' 'hello@example.com' // @has email_address/index.html '//a[@href=\"mailto:hello-world@example.com\"]' 'hello-world@example.com' // @has email_address/index.html '//a[@href=\"mailto:hello@localhost\"]' 'hello@localhost' "} {"_id":"q-en-rust-56c862204eb34c73dd02563c858b6ba316a018ee050414eee09b1d2d21048ab6","text":" //@ check-pass // issue: rust-lang/rust#123824 // This test is a sanity check and does not enforce any stable API, so may be // removed at a future point. fn main() { let x = f32::from(3.14); let y = f64::from(3.14); } "} {"_id":"q-en-rust-56f18b03007b8196d10b065f858fac8d96a244f8a0aeb0c5074b46feaef4f525","text":" error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time --> $DIR/issue-61525.rs:14:33 | LL | 1.query::(\"\") | ----- ^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `dyn ToString` note: required by a bound in `Example::query` --> $DIR/issue-61525.rs:2:14 | LL | fn query(self, q: Q); | ^ required by this bound in `Example::query` help: consider relaxing the implicit `Sized` restriction | LL | fn query(self, q: Q); | ++++++++ error[E0308]: mismatched types --> $DIR/issue-61525.rs:14:33 | LL | 1.query::(\"\") | --------------------- ^^ expected trait object `dyn ToString`, found `&str` | | | arguments to this function are incorrect | = note: expected trait object `dyn ToString` found reference `&'static str` note: associated function defined here --> $DIR/issue-61525.rs:2:8 | LL | fn query(self, q: Q); | ^^^^^ error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-56f1b34cb9e1046b09c11c88d191e4a353f977a508c3e34a72d158e3428a6eaf","text":"use serde::{Deserialize, Serialize}; /// rustdoc format-version. pub const FORMAT_VERSION: u32 = 19; pub const FORMAT_VERSION: u32 = 20; /// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information /// about the language items in the local crate, as well as info about external items to allow"} {"_id":"q-en-rust-571520cd07c95bf31cb5b874371740ae5030ece66556e91f74f1297955cf0253","text":"opaque_type_key, self.fcx.infcx.tcx, true, decl.origin, ); self.typeck_results.concrete_opaque_types.insert(opaque_type_key.def_id, hidden_type);"} {"_id":"q-en-rust-5735e746f1bfe1898f2eaf37fd50f88ec8140ce1762df589ae23497cabdd7818","text":" {title} rel='stylesheet' type='text/css'> "} {"_id":"q-en-rust-5742860fb2f0c83c20be2f9912588149d9a77b2d0a506350d86ec27f8b87c8ef","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Trait<'a> { type A; type B; } fn foo<'a, T: Trait<'a>>(value: T::A) { let new: T::B = unsafe { std::mem::transmute_copy(&value) }; } fn main() { } "} {"_id":"q-en-rust-57de067e9ca54f40da2f44d0d961b89a7e6f50b27cf835b195cae6e76bda3582","text":"Err(ManuallyDrop::into_inner(data.p)) }; // Compatibility wrapper around the try intrinsic for bootstrap #[inline] // Compatibility wrapper around the try intrinsic for bootstrap. // // We also need to mark it #[inline(never)] to work around a bug on MinGW // targets: the unwinding implementation was relying on UB, but this only // becomes a problem in practice if inlining is involved. #[cfg(not(bootstrap))] use intrinsics::r#try as do_try; #[cfg(bootstrap)] #[inline(never)] unsafe fn do_try(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32 { #[cfg(not(bootstrap))] { intrinsics::r#try(try_fn, data, catch_fn) } #[cfg(bootstrap)] { use crate::mem::MaybeUninit; use crate::mem::MaybeUninit; #[cfg(target_env = \"msvc\")] type TryPayload = [u64; 2]; #[cfg(not(target_env = \"msvc\"))] type TryPayload = *mut u8; let mut payload: MaybeUninit = MaybeUninit::uninit(); let payload_ptr = payload.as_mut_ptr() as *mut u8; let r = intrinsics::r#try(try_fn, data, payload_ptr); if r != 0 { #[cfg(target_env = \"msvc\")] type TryPayload = [u64; 2]; { catch_fn(data, payload_ptr) } #[cfg(not(target_env = \"msvc\"))] type TryPayload = *mut u8; let mut payload: MaybeUninit = MaybeUninit::uninit(); let payload_ptr = payload.as_mut_ptr() as *mut u8; let r = intrinsics::r#try(try_fn, data, payload_ptr); if r != 0 { #[cfg(target_env = \"msvc\")] { catch_fn(data, payload_ptr) } #[cfg(not(target_env = \"msvc\"))] { catch_fn(data, payload.assume_init()) } { catch_fn(data, payload.assume_init()) } r } r } // We consider unwinding to be rare, so mark this function as cold. However,"} {"_id":"q-en-rust-57ed291c409e1a25c7fad04cc6a9533bf4a65f660fbecc6e0231a6ea82b712d5","text":"&exports, machine, !sess.target.is_like_msvc, /*comdat=*/ false, // Enable compatibility with MSVC's `/WHOLEARCHIVE` flag. // Without this flag a duplicate symbol error would be emitted // when linking a rust staticlib using `/WHOLEARCHIVE`. // See #129020 true, ) { sess.dcx() .emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() });"} {"_id":"q-en-rust-582e65b58030efc3d84679e42b134eaf558342d4f5f63576d76347af3148f130","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // compile-flags: -C lto // no-prefer-dynamic // ignore-emscripten no threads support use std::thread; static mut HIT: usize = 0; thread_local!(static A: Foo = Foo); struct Foo; impl Drop for Foo { fn drop(&mut self) { unsafe { HIT += 1; } } } fn main() { unsafe { assert_eq!(HIT, 0); thread::spawn(|| { assert_eq!(HIT, 0); A.with(|_| ()); assert_eq!(HIT, 0); }).join().unwrap(); assert_eq!(HIT, 1); } } "} {"_id":"q-en-rust-582efe21a4387f4120b9219821c4857d58cbb80a9df1bc8b6d4a8261c662a147","text":"drop(tx); thread.join().unwrap(); if !check { update_rustfmt_version(build); } }"} {"_id":"q-en-rust-585d6b7897376864be750b9b5728574dd3041229ca91a0d500e870cc70438cd3","text":"self.index = index; } pub fn look_ahead(&self, n: usize) -> Option<&TokenTree> { self.stream.0[self.index..].get(n).map(|(tree, _)| tree) pub fn look_ahead(&self, n: usize) -> Option { self.stream.0[self.index..].get(n).map(|(tree, _)| tree.clone()) } }"} {"_id":"q-en-rust-58f1031f09e71229080b0e8ea0ba69f7d2ce86904bc6f18f00b134ec1aea2ef9","text":"fn roundtrip(_1: *const u8) -> *const u8 { debug x => _1; let mut _0: *const u8; let mut _2: *mut u8; let mut _3: *const u8; let mut _2: *const u8; let mut _3: *mut u8; let mut _4: *const u8; bb0: { StorageLive(_2); StorageLive(_3); _3 = _1; _2 = move _3 as *mut u8 (PtrToPtr); _0 = move _2 as *const u8 (PointerCoercion(MutToConstPointer)); StorageLive(_4); _4 = _1; _3 = move _4 as *mut u8 (PtrToPtr); _2 = move _3 as *const u8 (PointerCoercion(MutToConstPointer)); StorageDead(_4); StorageDead(_3); - _0 = move _2 as *const u8 (PtrToPtr); + _0 = move _2; StorageDead(_2); return; }"} {"_id":"q-en-rust-58f1a427da5d5eca90f5c857c2cc049cf337d3d53e01e4b769953b5e75829ab3","text":" // compile-flags:--test // normalize-stdout-test: \"src/test/rustdoc-ui\" -> \"$$DIR\" // build-pass #![no_std] extern crate alloc; /// ``` /// assert!(true) /// ``` pub fn f() {} "} {"_id":"q-en-rust-59078cf8842892200fd42e9d5ce7c1a28487fc3871c3ccb857c65e88f94ae8ea","text":"crate fn run( krate: clean::Crate, renderopts: config::RenderOptions, mut renderopts: config::RenderOptions, cache: formats::cache::Cache, tcx: TyCtxt<'_>, options: ScrapeExamplesOptions, ) -> interface::Result<()> { let inner = move || -> Result<(), String> { // Generates source files for examples renderopts.no_emit_shared = true; let (cx, _) = Context::init(krate, renderopts, cache, tcx).map_err(|e| e.to_string())?; // Collect CrateIds corresponding to provided target crates"} {"_id":"q-en-rust-593742c237ac2dca8f374f90654f402fbef2fce7b9c880f2677a9c6e716cd822","text":"impl<'tcx> FnCtxt<'_, 'tcx> { fn pattern_cause(&self, ti: TopInfo<'tcx>, cause_span: Span) -> ObligationCause<'tcx> { let code = Pattern { span: ti.span, root_ty: ti.expected, origin_expr: ti.origin_expr }; let code = Pattern { span: ti.span, root_ty: ti.expected, origin_expr: ti.origin_expr.is_some() }; self.cause(cause_span, code) }"} {"_id":"q-en-rust-597f72db59e3a99770a16b6639673293836af9756bb2fca16acaaddae4cb9bc9","text":"#[allow(missing_docs)] pub mod color { /// Number for a terminal color pub type Color = u16; pub type Color = u32; pub const BLACK: Color = 0; pub const RED: Color = 1;"} {"_id":"q-en-rust-59875191696b7b8791c26a35835b30fda297b8165c2460b3c64ff563117fbc4c","text":"&& expected.iter().any(|tok| matches!(tok, TokenType::Token(TokenKind::Eq))) { // Likely typo: `=` → `==` in let expr or enum item return Err(self.dcx().create_err(UseEqInstead { span: self.token.span, suggestion: self.token.span.with_lo(self.token.span.lo() + BytePos(1)), })); return Err(self.dcx().create_err(UseEqInstead { span: self.token.span })); } if self.token.is_keyword(kw::Move) && self.prev_token.is_keyword(kw::Async) {"} {"_id":"q-en-rust-59cfee87dde3ec953446c05c00312260bec4f382072ee8048ffdf7d50f4f7145","text":" error: unnamed fields are not allowed outside of structs or unions --> $DIR/anon-struct-in-enum-issue-121446.rs:7:9 | LL | _ : struct { field: u8 }, | -^^^^^^^^^^^^^^^^^^^^^^^ | | | unnamed field declared here error: anonymous structs are not allowed outside of unnamed struct or union fields --> $DIR/anon-struct-in-enum-issue-121446.rs:7:13 | LL | _ : struct { field: u8 }, | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here error: aborting due to 2 previous errors "} {"_id":"q-en-rust-59dbd9f2953a536eca27348eab639b31a362a3f4305ab02c40eb2c5f59cadee0","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. enum A { A { foo: usize, } } fn main() { let x = A::A { foo: 3 }; match x { A::A { fob } => { println!(\"{}\", fob); } } } "} {"_id":"q-en-rust-59eb7fdfa060d2ec46fa87d4c49a16238d2dc1727f600d09650b5da67f72f38c","text":" error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:51 | LL | let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); | ^ not found in this scope error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:62 | LL | let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); | ^ not found in this scope error[E0425]: cannot find value `g` in this scope --> $DIR/issue-114423.rs:11:22 | LL | let _ = RGB { r, g, b }; | ^ help: a local variable with a similar name exists: `b` error[E0308]: mismatched types --> $DIR/issue-114423.rs:7:50 | LL | let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); | --------------- ^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements | | | expected due to this | = note: expected tuple `(f32, f32, f32)` found tuple `(f32, f32)` error[E0560]: struct `RGB` has no field named `r` --> $DIR/issue-114423.rs:11:19 | LL | let _ = RGB { r, g, b }; | ^ `RGB` does not have this field | = note: all struct fields are already assigned error[E0308]: mismatched types --> $DIR/issue-114423.rs:11:25 | LL | let _ = RGB { r, g, b }; | ^ expected `f64`, found `f32` | help: you can convert an `f32` to an `f64` | LL | let _ = RGB { r, g, b: b.into() }; | ++ +++++++ error: aborting due to 6 previous errors Some errors have detailed explanations: E0308, E0425, E0560. For more information about an error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-5a610bb0287e895e0e5818acec24672a5273d8009d8dcc212da1e1fb407c2b4c","text":"fn mir_const_qualif(&self, id: DefIndex) -> mir::ConstQualifs { match self.kind(id) { EntryKind::Const(qualif, _) EntryKind::AnonConst(qualif, _) | EntryKind::Const(qualif, _) | EntryKind::AssocConst( AssocContainer::ImplDefault | AssocContainer::ImplFinal"} {"_id":"q-en-rust-5a6e9f890e954d684ed70d1740fb726d6265b9c6d0706960fa6f1ada5eda73d9","text":" error: expected one of `,` or `>`, found `==` --> $DIR/issue-87493.rs:8:22 | LL | T: MyTrait, | ^^ expected one of `,` or `>` | help: if you meant to use an associated type binding, replace `==` with `=` | LL | T: MyTrait, | ~ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-87493.rs:8:8 | LL | T: MyTrait, | ^^^^^^^------------------- help: remove these generics | | | expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/issue-87493.rs:1:11 | LL | pub trait MyTrait { | ^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. "} {"_id":"q-en-rust-5a750c3da5972a3f5aefd3df86765802e48c808fd36aaa240e4f877a4b17954b","text":"RUN /tmp/build-cloudabi-toolchain.sh x86_64-unknown-cloudabi COPY dist-various-2/build-fuchsia-toolchain.sh /tmp/ RUN /tmp/build-fuchsia-toolchain.sh # FIXME(#61022) - reenable solaris # COPY dist-various-2/build-solaris-toolchain.sh /tmp/ # RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386 # RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc COPY dist-various-2/build-solaris-toolchain.sh /tmp/ RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386 RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc COPY dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/ # We pass the commit id of the port of LLVM's libunwind to the build script. # Any update to the commit id here, should cause the container image to be re-built from this point on."} {"_id":"q-en-rust-5a86a375b4b6ac3029e452d023a3be79e2dbac922a201c69354230a4a674e435","text":"pub struct DropLogger<'a, T> { extra: T, id: usize, log: &'a panic::AssertUnwindSafe>> log: &'a panic::AssertUnwindSafe>>, } impl<'a, T> Drop for DropLogger<'a, T> {"} {"_id":"q-en-rust-5aacb8b262e8c164bc3ff545ccf57dac2c3dc3719b2589ab0c49a6a1b34fb97e","text":"} } pub fn rustc_lib_paths(&self, compiler: Compiler) -> Vec { let mut dylib_dirs = vec![self.rustc_libdir(compiler)]; // Ensure that the downloaded LLVM libraries can be found. if self.config.llvm_from_ci { let ci_llvm_lib = self.out.join(&*compiler.host.triple).join(\"ci-llvm\").join(\"lib\"); dylib_dirs.push(ci_llvm_lib); } dylib_dirs } /// Adds the compiler's directory of dynamic libraries to `cmd`'s dynamic /// library lookup path. pub fn add_rustc_lib_path(&self, compiler: Compiler, cmd: &mut Command) {"} {"_id":"q-en-rust-5ab7f62a7f13a5d54d793bedfe3b165b8baed74d6ac643a5eaa193fc964fc6af","text":" error[E0408]: variable `v` is not bound in all patterns --> $DIR/tabs-trimming.rs:9:16 | LL | ... v @ 1 | 2 | 3 => panic!(\"You gave me too little money {}\", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT... | - ^ ^ pattern doesn't bind `v` | | | | | pattern doesn't bind `v` | variable not in all patterns error: aborting due to previous error For more information about this error, try `rustc --explain E0408`. "} {"_id":"q-en-rust-5ab85f3faf0c5bc8b2d7e5cd060d5d12e493178b8c31667bdb72aaec7140454d","text":"StatementKind::PlaceMention(place) => { self.visit_place( place, PlaceContext::NonUse(NonUseContext::PlaceMention), PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention), location ); }"} {"_id":"q-en-rust-5acd1c62f820d545f483121a0ee9601c948d5b257d42b46694450a64713b79a2","text":"} }; if self.suggest_constraining_numerical_ty( if self.suggest_wrapping_range_with_parens( tcx, actual, source, span, item_name, &ty_str, ) || self.suggest_constraining_numerical_ty( tcx, actual, source, span, item_kind, item_name, &ty_str, ) { return None;"} {"_id":"q-en-rust-5b003786af05f3088705ab5678a86293f172d95f37969d1b7cf363547d38cb4a","text":" //@ aux-build:issue-76736-1.rs //@ aux-build:issue-76736-2.rs // https://github.com/rust-lang/rust/issues/124635 #![crate_name = \"foo\"] #![feature(rustc_private, staged_api)] #![unstable(feature = \"rustc_private\", issue = \"none\")] extern crate issue_76736_1; extern crate issue_76736_2; // @has foo/struct.Foo.html // @has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' pub struct Foo; // @has foo/struct.Bar.html // @has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' pub use issue_76736_2::Bar; "} {"_id":"q-en-rust-5b18900581b3d5ab65f62cfe9dcde69f6271f80eff2477354f81337599f3193d","text":"generics_of => { table } inferred_outlives_of => { table_defaulted_array } super_predicates_of => { table } implied_predicates_of => { table } type_of => { table } type_alias_is_lazy => { cdata.root.tables.type_alias_is_lazy.get(cdata, def_id.index) } variances_of => { table }"} {"_id":"q-en-rust-5b9a3d237d5ea1efb3fecfe141cb6bac720b493fa9f2cb45460b19d8ab794605","text":"if sess.opts.incremental.is_none() { return; } // This is going to be deleted in finalize_session_directory, so let's not create it if sess.has_errors_or_delayed_span_bugs() { return; } debug!(\"save_work_product_index()\"); dep_graph.assert_ignored();"} {"_id":"q-en-rust-5bc92aef49b3e545b75b3f69b96529d4bc82d502d52f443299f8315129dca448","text":"Some(hir::CoroutineKind::Coroutine(_)) | Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Gen, _)) | None => { return hir::ExprKind::Err(self.dcx().emit_err(AwaitOnlyInAsyncFnAndBlocks { await_kw_span, item_span: self.current_item, })); // Lower to a block `{ EXPR; }` so that the awaited expr // is not accidentally orphaned. let stmt_id = self.next_id(); let expr_err = self.expr( expr.span, hir::ExprKind::Err(self.dcx().emit_err(AwaitOnlyInAsyncFnAndBlocks { await_kw_span, item_span: self.current_item, })), ); return hir::ExprKind::Block( self.block_all( expr.span, arena_vec![self; hir::Stmt { hir_id: stmt_id, kind: hir::StmtKind::Semi(expr), span: expr.span, }], Some(self.arena.alloc(expr_err)), ), None, ); } };"} {"_id":"q-en-rust-5bd68e8e611560e921ac1a28f6e5f777478edff891242036edb74af9ef68b133","text":"extern crate lint_unused_extern_crate as other; // no error, the use * marks it as used #[macro_use] extern crate core; // no error, the `#[macro_use]` marks it as used #[allow(unused_imports)] use rand::isaac::IsaacRng;"} {"_id":"q-en-rust-5bdedc812132e683bb84fce1ed07393ea44f05998df134b2dc1b437b1eafea15","text":"}; if self.can_coerce(ref_ty, expected) { if let Ok(src) = cm.span_to_snippet(sp) { let sugg_expr = match expr.node { // parenthesize if needed (Issue #46756) let needs_parens = match expr.node { // parenthesize if needed (Issue #46756) hir::ExprKind::Cast(_, _) | hir::ExprKind::Binary(_, _, _) => format!(\"({})\", src), _ => src, hir::ExprKind::Binary(_, _, _) => true, // parenthesize borrows of range literals (Issue #54505) _ if self.is_range_literal(expr) => true, _ => false, }; let sugg_expr = if needs_parens { format!(\"({})\", src) } else { src }; if let Some(sugg) = self.can_use_as_ref(expr) { return Some(sugg); }"} {"_id":"q-en-rust-5bf8fa1d9b21492ff21f7ceabf0b54d2731c870fd5164319e9bb1e9e3ac4a997","text":"SRC: . AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN) condition: and(succeeded(), not(variables.SKIP_JOB)) displayName: Run build # If we're a deploy builder, use the `aws` command to publish everything to our"} {"_id":"q-en-rust-5c287c509077516e7d8920d4d582ea5496786a7d313c94b12f29b1ce5a9a9665","text":"$(TMPDIR)/$(call BIN,directly_linked): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked.rs -l static:+whole-archive=c_static_lib_with_constructor # Native lib linked into test executable, +whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_plus_whole_archive.rs --test -l static:+whole-archive=c_static_lib_with_constructor # Native lib linked into test executable, -whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_minus_whole_archive.rs --test -l static:-whole-archive=c_static_lib_with_constructor # Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable $(TMPDIR)/$(call BIN,indirectly_linked): $(TMPDIR)/librlib_with_cmdline_native_lib.rlib $(RUSTC) indirectly_linked.rs"} {"_id":"q-en-rust-5c497fcdc8ed4419bfdba7d08965a0a93b521ccf18f5bed3c152ff98e45b3fbb","text":"// the post-inference `trait_ref`, as it's more accurate. trait_: Some(trait_ref.clean(cx)), for_: ty.clean(cx), items: cx .tcx .associated_items(impl_def_id) .in_definition_order() .map(|x| x.clean(cx)) .collect::>(), items, polarity: ty::ImplPolarity::Positive, kind: ImplKind::Blanket(box trait_ref.self_ty().clean(cx)), }),"} {"_id":"q-en-rust-5c5dcb263107e029358d283857ceecaab1890187d2e96cd953e92c6ba00aec8b","text":"let rcvr_substs = self.fresh_receiver_substs(self_ty, &pick); let all_substs = self.instantiate_method_substs(&pick, segment, rcvr_substs); debug!(\"all_substs={:?}\", all_substs); debug!(\"rcvr_substs={rcvr_substs:?}, all_substs={all_substs:?}\"); // Create the final signature for the method, replacing late-bound regions. let (method_sig, method_predicates) = self.instantiate_method_sig(&pick, all_substs); // If there is a `Self: Sized` bound and `Self` is a trait object, it is possible that // something which derefs to `Self` actually implements the trait and the caller // wanted to make a static dispatch on it but forgot to import the trait. // See test `src/test/ui/issue-35976.rs`. // // In that case, we'll error anyway, but we'll also re-run the search with all traits // in scope, and if we find another method which can be used, we'll output an // appropriate hint suggesting to import the trait. let filler_substs = rcvr_substs .extend_to(self.tcx, pick.item.def_id, |def, _| self.tcx.mk_param_from_def(def)); let illegal_sized_bound = self.predicates_require_illegal_sized_bound( &self.tcx.predicates_of(pick.item.def_id).instantiate(self.tcx, filler_substs), ); // Unify the (adjusted) self type with what the method expects. // // SUBTLE: if we want good error messages, because of \"guessing\" while matching"} {"_id":"q-en-rust-5c74c3295b7cbb090e71d42c4c3e57b5d4abae463790a7a89870ca49933cbeae","text":" // aux-build: issue_24843.rs // check-pass extern crate issue_24843; static _TEST_STR_2: &'static str = &issue_24843::TEST_STR; fn main() {} "} {"_id":"q-en-rust-5cb9200da135fda22026cd51c8a121fe35c1a7d73236881ed054f628ce82824c","text":" #![feature(duration_as_u128)] #![cfg_attr(stage0, feature(duration_as_u128))] use std::{collections::VecDeque, time::Instant}; const VECDEQUE_LEN: i32 = 100000;"} {"_id":"q-en-rust-5cc3addb1e7690b0394daf917d176160685c31d9a880489076b58708374d6438","text":"import.crate_lint(), ); let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len; if let Some(orig_unusable_binding) = orig_unusable_binding { self.r.unusable_binding = orig_unusable_binding; } import.vis.set(orig_vis); if let PathResult::Failed { .. } | PathResult::NonModule(..) = path_res { // Consider erroneous imports used to avoid duplicate diagnostics."} {"_id":"q-en-rust-5cd107bb229664596466a1316432162ab28094f40c9d483717abc193889d8ec8","text":"&Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public }, hir::CRATE_HIR_ID, &krate.item.module, None, Some(self.cx.tcx.crate_name), ); top_level_module.is_crate = true; // Attach the crate's exported macros to the top-level module."} {"_id":"q-en-rust-5d4ca8be03e1e45956ce82bb00385849836069e37c5b8c3ecff399c10ee706a0","text":"#![feature(maybe_uninit_extra)] #![feature(maybe_uninit_ref)] #![feature(maybe_uninit_slice)] #![feature(maybe_uninit_uninit_array)] #![feature(min_specialization)] #![feature(needs_panic_runtime)] #![feature(negative_impls)]"} {"_id":"q-en-rust-5d59b7738d326481cd3b75de93a144d655fe8a30e3b185bf1588917c9cd6d58b","text":"} else if self.label_right - self.span_left <= self.column_width { // Attempt to fit the code window considering only the spans and labels. let padding_left = (self.column_width - (self.label_right - self.span_left)) / 2; self.computed_left = self.span_left - padding_left; self.computed_left = self.span_left.saturating_sub(padding_left); self.computed_right = self.computed_left + self.column_width; } else if self.span_right - self.span_left <= self.column_width { // Attempt to fit the code window considering the spans and labels plus padding. let padding_left = (self.column_width - (self.span_right - self.span_left)) / 5 * 2; self.computed_left = self.span_left - padding_left; self.computed_left = self.span_left.saturating_sub(padding_left); self.computed_right = self.computed_left + self.column_width; } else { // Mostly give up but still don't show the full line. self.computed_left = self.span_left;"} {"_id":"q-en-rust-5d5c1dc678c40ea40f495a257450e7b4e75ff8d91802104df969c323ce7cad6d","text":"// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR. // Compiling with `-Cpanic=abort` because PGO+unwinding isn't supported on all platforms. // needs-profiler-support // compile-flags: -Cprofile-generate -Ccodegen-units=1 -Cpanic=abort // compile-flags: -Cprofile-generate -Ccodegen-units=1 // CHECK: @__llvm_profile_raw_version = // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global"} {"_id":"q-en-rust-5d8dc1e940ab0b118710e52c0419c2d37d382cf6c9ed5ecfc4d941c6b5fd48c0","text":" // run-rustfix // check-only #[derive(Debug)] struct Demo { a: String } trait GetString { fn get_a(&self) -> &String; } trait UseString: std::fmt::Debug + GetString { fn use_string(&self) { println!(\"{:?}\", self.get_a()); //~ ERROR no method named `get_a` found for type `&Self` } } trait UseString2: GetString { fn use_string(&self) { println!(\"{:?}\", self.get_a()); //~ ERROR no method named `get_a` found for type `&Self` } } impl GetString for Demo { fn get_a(&self) -> &String { &self.a } } impl UseString for Demo {} impl UseString2 for Demo {} #[cfg(test)] mod tests { use crate::{Demo, UseString}; #[test] fn it_works() { let d = Demo { a: \"test\".to_string() }; d.use_string(); } } fn main() {} "} {"_id":"q-en-rust-5d97b03df7f87a7d48cfca0edae35c1d34e673b9b5d9d4168db07826f1c7a99c","text":"/// /// [`to_ascii_lowercase`]: Self::to_ascii_lowercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); }"} {"_id":"q-en-rust-5dc90306e65cba6640cd2ce7f58799a9ac34e36497ae871594c92b9a2109b9c3","text":"// * Our custom AssertRecoverSafe wrapper is indeed recover safe impl RecoverSafe for .. {} impl<'a, T: ?Sized> !RecoverSafe for &'a mut T {} impl<'a, T: NoUnsafeCell + ?Sized> RecoverSafe for &'a T {} impl RecoverSafe for *const T {} impl RecoverSafe for *mut T {} impl<'a, T: RefRecoverSafe + ?Sized> RecoverSafe for &'a T {} impl RecoverSafe for *const T {} impl RecoverSafe for *mut T {} impl RecoverSafe for Unique {} impl RecoverSafe for Shared {} impl RecoverSafe for Shared {} impl RecoverSafe for Mutex {} impl RecoverSafe for RwLock {} impl RecoverSafe for AssertRecoverSafe {}"} {"_id":"q-en-rust-5dd555f9bdf6a9e51114c106be17e8c27adbedfafb34d401c7bdefc3ef9ce0c9","text":"changes = true; // remove a \"[ t]**\" block from each line, if possible for line in lines.iter_mut() { if horizontal + 1 < line.len() { *line = &line[horizontal + 1..]; if let Some(tmp) = line.strip_prefix(&horizontal) { *line = tmp; if kind == CommentKind::Block && (*line == \"*\" || line.starts_with(\"* \") || line.starts_with(\"**\")) { *line = &line[1..]; } } } }"} {"_id":"q-en-rust-5df07c8f9f4f01305e295e3d1d70eada1fe7beeace4b01e7cc636ef4b27e1e41","text":" // check-pass // edition:2021 #![feature(type_alias_impl_trait)] use std::future::Future; use std::marker::PhantomData; trait Stream { type Item; } struct Empty { _phantom: PhantomData, } impl Stream for Empty { type Item = T; } trait X { type LineStream<'a, Repr>: Stream where Self: 'a; type LineStreamFut<'a, Repr>: Future> where Self: 'a; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream; type LineStreamFut<'a, Repr> = impl Future>; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async { Empty { _phantom: PhantomData } } } } fn main() {} "} {"_id":"q-en-rust-5e0c7d07445c001d9b73ffbb39772dbc9b596cbeca2197440287919aeb08efe6","text":"/// // See how many bytes are currently buffered /// let bytes_buffered = buf_writer.buffer().len(); /// ``` #[unstable(feature = \"bufreader_buffer\", issue = \"45323\")] #[stable(feature = \"bufreader_buffer\", since = \"1.37.0\")] pub fn buffer(&self) -> &[u8] { &self.buf }"} {"_id":"q-en-rust-5e43e2f3512897897890ad6b8dbf5511cf4944db815a2a3bc1e9e88b5ea40ecc","text":"/// `//[foo]`), then the property is ignored unless `cfg` is /// `Some(\"foo\")`. fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) { // In CI, we've sometimes encountered non-determinism related to truncating very long paths. // Set a consistent (short) prefix to avoid issues, but only in CI to avoid regressing the // contributor experience. if CiEnv::is_ci() { self.remap_src_base = config.mode == Mode::Ui && !config.suite.contains(\"rustdoc\"); } let mut has_edition = false; if !testfile.is_dir() { let file = File::open(testfile).unwrap();"} {"_id":"q-en-rust-5e81c75718f40a733f3cde27c32c51a7588108a36c9e79ddd8b4d94d83e365d3","text":"use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_ast::{Attribute, LitKind, NestedMetaItem}; use rustc_ast::{Attribute, Lit, LitKind, NestedMetaItem}; use rustc_errors::{pluralize, struct_span_err}; use rustc_hir as hir; use rustc_hir::def_id::LocalDefId;"} {"_id":"q-en-rust-5e8f8369cd5d405cd51ee10336866785f47fcaec6de77f2d60bea7285fe0d54e","text":"assert_eq!(stripped.as_str(), \"!test\"); }) } #[test] fn test_doc_blocks() { create_default_session_globals_then(|| { let stripped = beautify_doc_string(Symbol::intern(\" # Returnsn *n \"), CommentKind::Block); assert_eq!(stripped.as_str(), \" # Returnsnn\"); let stripped = beautify_doc_string( Symbol::intern(\"n * # Returnsn *n \"), CommentKind::Block, ); assert_eq!(stripped.as_str(), \" # Returnsnn\"); let stripped = beautify_doc_string(Symbol::intern(\"n * an \"), CommentKind::Block); assert_eq!(stripped.as_str(), \" an\"); }) } "} {"_id":"q-en-rust-5e9a93d602316c40550c94e058b8eaa5ba491430f2ddd9db3b82b5c34565b1d0","text":"/// assert_eq!(\"grÜße, jÜrgen ❤\", s); /// ``` #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_lowercase(&mut self) { // SAFETY: changing ASCII letters only does not invalidate UTF-8. let me = unsafe { self.as_bytes_mut() };"} {"_id":"q-en-rust-5eb1e4dbae50f319fa79dbcd343149e00fb36e98e772d835effb56769a18e9f2","text":".with_indent_lines(true) .with_ansi(true) .with_targets(true) .with_thread_ids(true) .with_thread_names(true) .with_wraparound(10) .with_verbose_exit(true) .with_verbose_entry(true) .with_indent_amount(2); #[cfg(parallel_compiler)] let layer = layer.with_thread_ids(true).with_thread_names(true); use tracing_subscriber::layer::SubscriberExt; let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);"} {"_id":"q-en-rust-5eeda536016c00fb4c5eb2f471d5d63dc878ff41e231665bd8433e914df9f4fd","text":" fn test1() { let mut chars = \"Hello\".chars(); for _c in chars.by_ref() { chars.next(); //~ ERROR cannot borrow `chars` as mutable more than once at a time } } fn test2() { let v = vec![1, 2, 3]; let mut iter = v.iter(); for _i in iter { iter.next(); //~ ERROR borrow of moved value: `iter` } } fn main() { } "} {"_id":"q-en-rust-5f03ce461a3ac128f9eba9e3cd53ef758e3070bef22b6f8abb81df7224e54e41","text":" // This used to cause assert_10_13 to unexpectingly fail, due to simd_shuffle_indices being passed // the wrong Instance, causing issues with inlining. See #67557. // // run-pass // compile-flags: -Zmir-opt-level=3 #![feature(platform_intrinsics, repr_simd)] extern \"platform-intrinsic\" { fn simd_shuffle2(x: T, y: T, idx: [u32; 2]) -> U; } #[repr(simd)] #[derive(Debug, PartialEq)] struct Simd2(u8, u8); fn main() { unsafe { let p_res: Simd2 = simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 1]); let a_res: Simd2 = inline_me(); assert_10_11(p_res); assert_10_13(a_res); } } #[inline(never)] fn assert_10_11(x: Simd2) { assert_eq!(x, Simd2(10, 11)); } #[inline(never)] fn assert_10_13(x: Simd2) { assert_eq!(x, Simd2(10, 13)); } #[inline(always)] unsafe fn inline_me() -> Simd2 { simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3]) } "} {"_id":"q-en-rust-5f32b75941629d1e70b534a61e438a56e9fd455c52fd9deca03f162b5f1eca6b","text":"let mut etc_span = None; while self.token != token::CloseDelim(token::Brace) { let attrs = self.parse_outer_attributes()?; let attrs = match self.parse_outer_attributes() { Ok(attrs) => attrs, Err(err) => { if let Some(mut delayed) = delayed_err { delayed.emit(); } return Err(err); }, }; let lo = self.token.span; // check that a comma comes after every field"} {"_id":"q-en-rust-5f38be8f86845d203c77e6183245c5be3bfad433620a8a4c798c3484dfe29cd2","text":" //@ only-x86_64 //@ compile-flags: -C opt-level=3 #![crate_type = \"lib\"] #![no_std] #![feature(str_internals)] extern crate alloc; /// Ensure that the ascii-prefix loop for `str::to_lowercase` and `str::to_uppercase` uses vector /// instructions. /// /// The llvm ir should be the same for all targets that support some form of simd. Only targets /// without any simd instructions would see scalarized ir. /// Unfortunately, there is no `only-simd` directive to only run this test on only such platforms, /// and using test revisions would still require the core libraries for all platforms. // CHECK-LABEL: @lower_while_ascii // CHECK: [[A:%[0-9]]] = load <16 x i8> // CHECK-NEXT: [[B:%[0-9]]] = icmp slt <16 x i8> [[A]], zeroinitializer // CHECK-NEXT: [[C:%[0-9]]] = bitcast <16 x i1> [[B]] to i16 #[no_mangle] pub fn lower_while_ascii(s: &str) -> (alloc::string::String, &str) { alloc::str::convert_while_ascii(s, u8::to_ascii_lowercase) } "} {"_id":"q-en-rust-5f3d9cbac9fb6584f3640d7b0156f3e8ec271acd0da3b99c7bbe69836a53aec1","text":" error[E0277]: can't compare `[B; _]` with `&&[A]` --> $DIR/hash-tyvid-regression-2.rs:12:16 | LL | self.0 == other | ^^ no implementation for `[B; _] == &&[A]` | = help: the trait `PartialEq<&&[A]>` is not implemented for `[B; _]` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-5f47e3e208db6901f8710bac07686a4bf50e8adafda8bbe6ecc0f63d3b03c35e","text":"} impl Reader for UdpStream { /// Returns the next non-empty message from the specified address. fn read(&mut self, buf: &mut [u8]) -> IoResult { let peer = self.connected_to; self.as_socket(|sock| { match sock.recv_from(buf) { Ok((_nread, src)) if src != peer => Ok(0), Ok((nread, _src)) => Ok(nread), Err(e) => Err(e), loop { let (nread, src) = try!(sock.recv_from(buf)); if nread > 0 && src == peer { return Ok(nread); } } }) }"} {"_id":"q-en-rust-5f732e98954967b7b9e453c9ed6bdb91b99e6dfa0e08a191d34c337ab49db6ac","text":"source: self.mirror_expr(source), cast: PointerCoercion::ArrayToPointer, } } else { // check whether this is casting an enum variant discriminant // to prevent cycles, we refer to the discriminant initializer } else if let hir::ExprKind::Path(ref qpath) = source.kind && let res = self.typeck_results().qpath_res(qpath, source.hir_id) && let ty = self.typeck_results().node_type(source.hir_id) && let ty::Adt(adt_def, args) = ty.kind() && let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), variant_ctor_id) = res { // Check whether this is casting an enum variant discriminant. // To prevent cycles, we refer to the discriminant initializer, // which is always an integer and thus doesn't need to know the // enum's layout (or its tag type) to compute it during const eval // enum's layout (or its tag type) to compute it during const eval. // Example: // enum Foo { // A,"} {"_id":"q-en-rust-5f9c68327b78a9ca22420ad9caff9cd8c8612cefc1283e0b0c71b745dd23ec78","text":"/// /// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); }"} {"_id":"q-en-rust-5fc25bbce0aba6262cfc3dda304af56275348abbda43a8a6582a7fdd897445f7","text":"#![allow(dead_code)] #![feature(recover)] use std::panic::RecoverSafe; use std::panic::{RecoverSafe, AssertRecoverSafe}; use std::cell::RefCell; use std::sync::{Mutex, RwLock, Arc}; use std::rc::Rc;"} {"_id":"q-en-rust-5fc47318dfa11fca9603aefa33d7627df8167aee335e1cc01fd856eed38b648c","text":"/// # use std::fmt::Write; /// # let mut buf = String::new(); /// # let name = \"World\"; /// /// // Bad /// write!(buf, \"Hello {}!n\", name); /// /// // Good /// writeln!(buf, \"Hello {}!\", name); /// ``` pub WRITE_WITH_NEWLINE, style,"} {"_id":"q-en-rust-6005738fbba56c3a31bf93edd7b78113378b54f97e93650bfe445a70b1f3c3e2","text":"[dependencies] # tidy-alphabetical-start ar_archive_writer = \"0.4.0\" ar_archive_writer = \"0.4.2\" arrayvec = { version = \"0.7\", default-features = false } bitflags = \"2.4.1\" cc = \"1.0.90\""} {"_id":"q-en-rust-601b28195caaab5ccade86eac8c3b9407320098e3bd0cf5c039de7c262243fdd","text":"fn rustc_tables(&mut self, f: &mut dyn FnMut(&mut Tables<'_>)); } thread_local! { /// A thread local variable that stores a pointer to the tables mapping between TyCtxt /// datastructures and stable MIR datastructures. static TLV: Cell<*mut ()> = const { Cell::new(std::ptr::null_mut()) }; } // A thread local variable that stores a pointer to the tables mapping between TyCtxt // datastructures and stable MIR datastructures scoped_thread_local! (static TLV: Cell<*mut ()>); pub fn run(mut context: impl Context, f: impl FnOnce()) { assert!(TLV.get().is_null()); assert!(!TLV.is_set()); fn g<'a>(mut context: &mut (dyn Context + 'a), f: impl FnOnce()) { TLV.set(&mut context as *mut &mut _ as _); f(); TLV.replace(std::ptr::null_mut()); let ptr: *mut () = &mut context as *mut &mut _ as _; TLV.set(&Cell::new(ptr), || { f(); }); } g(&mut context, f); }"} {"_id":"q-en-rust-604bfdd8a2eded109ef22289d209980d17d9b07c1de3baa752867d4bd60b2e59","text":"} } } #[inline] fn len_utf8(code: u32) -> usize { if code < MAX_ONE_B { 1 } else if code < MAX_TWO_B { 2 } else if code < MAX_THREE_B { 3 } else { 4 } } /// Encodes a raw u32 value as UTF-8 into the provided byte buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf8`, this method also handles codepoints in the surrogate range. /// (Creating a `char` in the surrogate range is UB.) /// The result is valid [generalized UTF-8] but not valid UTF-8. /// /// [generalized UTF-8]: https://simonsapin.github.io/wtf-8/#generalized-utf8 /// /// # Panics /// /// Panics if the buffer is not large enough. /// A buffer of length four is large enough to encode any `char`. #[unstable(feature = \"char_internals\", reason = \"exposed only for libstd\", issue = \"none\")] #[doc(hidden)] #[inline] pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] { let len = len_utf8(code); 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(), ), }; &mut dst[..len] } /// Encodes a raw u32 value as UTF-16 into the provided `u16` buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf16`, this method also handles codepoints in the surrogate range. /// (Creating a `char` in the surrogate range is UB.) /// /// # Panics /// /// Panics if the buffer is not large enough. /// A buffer of length 2 is large enough to encode any `char`. #[unstable(feature = \"char_internals\", reason = \"exposed only for libstd\", issue = \"none\")] #[doc(hidden)] #[inline] pub fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] { // SAFETY: each arm checks whether there are enough bits to write into unsafe { if (code & 0xFFFF) == code && !dst.is_empty() { // The BMP falls through *dst.get_unchecked_mut(0) = code as u16; slice::from_raw_parts_mut(dst.as_mut_ptr(), 1) } else if dst.len() >= 2 { // Supplementary planes break into surrogates. code -= 0x1_0000; *dst.get_unchecked_mut(0) = 0xD800 | ((code >> 10) as u16); *dst.get_unchecked_mut(1) = 0xDC00 | ((code as u16) & 0x3FF); slice::from_raw_parts_mut(dst.as_mut_ptr(), 2) } else { panic!( \"encode_utf16: need {} units to encode U+{:X}, but the buffer has {}\", from_u32_unchecked(code).len_utf16(), code, dst.len(), ) } } } "} {"_id":"q-en-rust-60d0dc96ea97f45c3a1b324d5883deef9b02169ee9741fbfb79fee5a89908cb5","text":"LLVMInitializeMSP430Target, LLVMInitializeMSP430TargetMC, LLVMInitializeMSP430AsmPrinter); init_target!(all(llvm_component = \"msp430\", llvm_has_msp430_asm_parser), LLVMInitializeMSP430AsmParser); init_target!(llvm_component = \"riscv\", LLVMInitializeRISCVTargetInfo, LLVMInitializeRISCVTarget,"} {"_id":"q-en-rust-61323192d154fbf2866184a8fb039279523af214fd735eeebdd2cd0fb25aed66","text":"use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_metadata::find_native_static_library; use rustc_middle::middle::dependency_format::Linkage; use rustc_middle::middle::exported_symbols; use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo, SymbolExportKind}; use rustc_middle::ty::TyCtxt; use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};"} {"_id":"q-en-rust-61418002d67e70e846ab6a93ee3e69101900cb5ea5f5bc38dbe09f3ebbab4b5e","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct A<'a> { func: &'a fn() -> Option } impl<'a> A<'a> { fn call(&self) -> Option { (*self.func)() } } fn foo() -> Option { None } fn create() -> A<'static> { A { func: &foo, //~ ERROR borrowed value does not live long enough } } fn main() { let a = create(); a.call(); } "} {"_id":"q-en-rust-6152d6293ace66da9be60b9febd37fb896bb71e866f72c0b8141a711e3a93d09","text":" error: range endpoint is out of range for `u8` --> $DIR/issue-109529.rs:4:14 | LL | for _ in 0..256 as u8 {} | ------^^^^^^ | | | help: use an inclusive range instead: `0..=255` | = note: `#[deny(overflowing_literals)]` on by default error: range endpoint is out of range for `u8` --> $DIR/issue-109529.rs:5:14 | LL | for _ in 0..(256 as u8) {} | ^^^^^^^^^^^^^^ | help: use an inclusive range instead | LL | for _ in 0..=(255 as u8) {} | + ~~~ error: aborting due to 2 previous errors "} {"_id":"q-en-rust-61867dd0b7370023fdfb147febe24b9427c481fdf5efdd0029dd597e7ee77bc4","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. mod foo { pub mod bar { pub mod baz { pub fn name() -> &'static str { module_path!() } } } } fn main() { assert_eq!(module_path!(), \"issue-18859\"); assert_eq!(foo::bar::baz::name(), \"issue-18859::foo::bar::baz\"); } "} {"_id":"q-en-rust-6193b9347c205e5b99e3c9445927464f3afa12df5f51b1223c83e345f8672971","text":"let (resolver, resolver_caches) = { let (krate, resolver, _) = &*abort_on_err(queries.expansion(), sess).peek(); let resolver_caches = resolver.borrow_mut().access(|resolver| { collect_intra_doc_links::early_resolve_intra_doc_links(resolver, krate, externs) collect_intra_doc_links::early_resolve_intra_doc_links( resolver, krate, externs, document_private, ) }); (resolver.clone(), resolver_caches) };"} {"_id":"q-en-rust-61a2e392eaef86b085dd45f0ef877266d0f2456752ff0963d2d11765a9948936","text":"} } /// Constructs a new locked handle to the standard input of the current /// process. /// /// Each handle returned is a guard granting locked access to a shared /// global buffer whose access is synchronized via a mutex. If you need /// more explicit control over locking, for example, in a multi-threaded /// program, use the [`io::stdin`] function to obtain an unlocked handle, /// along with the [`Stdin::lock`] method. /// /// The lock is released when the returned guard goes out of scope. The /// returned guard also implements the [`Read`] and [`BufRead`] traits for /// accessing the underlying data. /// /// **Note**: The mutex locked by this handle is not reentrant. Even in a /// single-threaded program, calling other code that accesses [`Stdin`] /// could cause a deadlock or panic, if this locked handle is held across /// that call. /// /// ### Note: Windows Portability Consideration /// When operating in a console, the Windows implementation of this stream does not support /// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return /// an error. /// /// # Examples /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Read}; /// /// fn main() -> io::Result<()> { /// let mut buffer = String::new(); /// let mut handle = io::stdin_locked(); /// /// handle.read_to_string(&mut buffer)?; /// Ok(()) /// } /// ``` #[unstable(feature = \"stdio_locked\", issue = \"none\")] pub fn stdin_locked() -> StdinLock<'static> { stdin().into_locked() } impl Stdin { /// Locks this handle to the standard input stream, returning a readable /// guard."} {"_id":"q-en-rust-61ea0b79fc5c814f12c3e7d10cec34dfe7ec67db364958fe8f22d956ae5d23a9","text":"if sess.opts.incremental.is_none() { return; } // This is going to be deleted in finalize_session_directory, so let's not create it if sess.has_errors_or_delayed_span_bugs() { return; } let query_cache_path = query_cache_path(sess); let dep_graph_path = dep_graph_path(sess);"} {"_id":"q-en-rust-624ae0ac265c5e384b2cc5141d19685b1cc3d46a07c1e1d230e838675c412dca","text":"# ignore-cross-compile -- compiling C++ code does not work well when cross-compiling # This test case makes sure that native libraries are linked with --whole-archive semantics # when the `-bundle,+whole-archive` modifiers are applied to them. # This test case makes sure that native libraries are linked with appropriate semantics # when the `[+-]bundle,[+-]whole-archive` modifiers are applied to them. # # The test works by checking that the resulting executables produce the expected output, # part of which is emitted by otherwise unreferenced C code. If +whole-archive didn't work"} {"_id":"q-en-rust-626559eb02689c187aba1f0140e4bfcf5a4b68a2bf73ec33a51c148f6d4a9afa","text":" #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash // We should probably be able to infer the types here. However, this test is checking that we don't // get an ICE in this case. It may be modified later to not be an error. struct Foo(pub [u8; NUM_BYTES]); fn main() { let _ = Foo::<3>([1, 2, 3]); //~ ERROR type annotations needed } "} {"_id":"q-en-rust-62ab13074535eaf603aae444588b8bb187008936423b2b74a8a8fee788b7b9ee","text":"else { // 10 is not constructed d(10, None) } }, ); assert_eq!(get(), vec![3, 8, 7, 1, 2]); assert_eq!(get(), vec![8, 7, 1, 3, 2]); } assert_eq!(get(), vec![0, 4, 6, 9, 5]);"} {"_id":"q-en-rust-62adc5421f671882bb73878ac503fff9ee1a338572873ab354ca43f66e5f3b38","text":"// Fudge the receiver, so we can do new inference on it. let possible_rcvr_ty = possible_rcvr_ty.fold_with(&mut fudger); let method = self .lookup_method( .lookup_method_for_diagnostic( possible_rcvr_ty, segment, DUMMY_SP, call_expr, binding, args, ) .ok()?; // Unify the method signature with our incompatible arg, to"} {"_id":"q-en-rust-62ba3f5bfedd52d96842b825ec7ac3e83cc563bdf1681d63089a45c344fdb14a","text":"Use verbose output. .TP fB--externfR fINAMEfR=fIPATHfR Specify where an external rust library is located. Specify where an external rust library is located. These should match fIexternfR declarations in the crate's source code. .TP fB--sysrootfR fIPATHfR Override the system root."} {"_id":"q-en-rust-62e29d9fc90d1ccda510b83a5a98ac3b506430c06d6b885b97ddd3c6b49f74a4","text":"} } // FIXME #31379: We can use methods from imported traits shadowed by non-import items if !binding.is_import() { for glob_binding in resolution.duplicate_globs.iter() { // We can always use methods from the prelude traits for glob_binding in resolution.duplicate_globs.iter() { if glob_binding.defined_with(DefModifiers::PRELUDE) { module.shadowed_traits.borrow_mut().push(glob_binding); } }"} {"_id":"q-en-rust-63261035c961705a33338e3015a2809c5681dba00c0235f26eca0794d713706b","text":"/// 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() } unsafe { !(self.inner)().get().is_null() } } }"} {"_id":"q-en-rust-6369d2431e4ae5433b98785634fcefaa3f4b4cd92a7f6a23e04daeeef0f52ad6","text":"bootstrap_out.display() ) } config.check_build_rustc_version(); if rust_info.is_from_tarball() && config.description.is_none() { config.description = Some(\"built from a source tarball\".to_owned());"} {"_id":"q-en-rust-637f6c8357d6e4c912f12fda505cb77d233738fa357d70c5c826a023a0fd0934","text":"retained: &mut retained, access_levels: &access_levels, }; krate = stripper.fold_crate(krate); krate = ImportStripper.fold_crate(stripper.fold_crate(krate)); } // strip all private implementations of traits"} {"_id":"q-en-rust-63c48ddea592f089d8f0504e70a05c65858cbe3a6098328b39cd6df1aced3950","text":"} let total = arg.layout.size; if total.bits() > 128 { arg.make_indirect(); return; } arg.cast_to(Uniform { unit: Reg::i64(), total"} {"_id":"q-en-rust-63cc32afa60db33a1b779f708735f11379d4b68493b58585c1dbc047377d9acf","text":"\"clippy_lints\", \"compiletest_rs\", \"derive-new\", \"git2\", \"lazy_static 1.4.0\", \"regex\", \"rustc-workspace-hack\","} {"_id":"q-en-rust-63cd75f5f5bf283f2d605fc4df17d8f698e5478852d9bd9aef704ecd45e7b676","text":"matches!(self.kind, ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..)) } /// Check if this is an [`ItemKind::Struct`] or [`ItemKind::Union`]. pub fn is_struct_or_union(&self) -> bool { matches!(self.kind, ItemKind::Struct(..) | ItemKind::Union(..)) } expect_methods_self_kind! { expect_extern_crate, Option, ItemKind::ExternCrate(s), *s;"} {"_id":"q-en-rust-63d61066552c9f09f8bc311a8c0fde7f5c083b3aa44ab94aed15577760419e06","text":"}); }; suite(\"check-ui\", \"src/test/ui\", \"ui\", \"ui\"); suite(\"check-rpass-full\", \"src/test/run-pass-fulldeps\", \"run-pass\", \"run-pass-fulldeps\"); suite(\"check-rfail-full\", \"src/test/run-fail-fulldeps\","} {"_id":"q-en-rust-63f63c9bd950ade45fe47495d44a649d99b483bbdcf57c1a48e349a209c53491","text":" error[E0599]: no method named `push` found for struct `SmallVec` in the current scope --> $DIR/hash-tyvid-regression-4.rs:23:19 | LL | node.keys.push(k); | ^^^^ method not found in `SmallVec<_, { D * 2 }>` ... LL | struct SmallVec { | ---------------------------------- method `push` not found for this error: aborting due to previous error For more information about this error, try `rustc --explain E0599`. "} {"_id":"q-en-rust-63f9b216439270f9582097c31fb3bd1e54aa11c4fc32808682a2a850fd1b8b97","text":"} try!(self.maybe_print_comment(attr.span.lo)); if attr.node.is_sugared_doc { word(self.writer(), &attr.value_str().unwrap()) try!(word(self.writer(), &attr.value_str().unwrap())); hardbreak(self.writer()) } else { match attr.node.style { ast::AttrStyle::Inner => try!(word(self.writer(), \"#![\")),"} {"_id":"q-en-rust-6417f7a307eadb6630c6ce2d3c3b0ac19f058b65a8ad0ba19d92387185dff712","text":"//@aux-build:proc_macro_attr.rs:proc-macro // Flaky test, see https://github.com/rust-lang/rust/issues/113585. //@ignore-32bit //@ignore-64bit #![warn(clippy::empty_line_after_outer_attr)] #![allow(clippy::assertions_on_constants)] #![feature(custom_inner_attributes)]"} {"_id":"q-en-rust-642aa08361c0708bac9c34e04f7f95c4f7aad40d85950406eb2fae4dd628f156","text":"g: &'tcx hir::Generics, id: ast::NodeId) { if self.should_warn_about_variant(&variant.node) { self.warn_dead_code(variant.node.data.id(), variant.span, variant.node.name, \"variant\"); self.warn_dead_code(variant.node.data.id(), variant.span, variant.node.name, \"variant\", \"constructed\"); } else { intravisit::walk_variant(self, variant, g, id); }"} {"_id":"q-en-rust-642eb81ba5b99dec7a447e7be578abf9a527d1b780c29619d1b851d20b39986a","text":"// Make sure nobody calls `drop()` explicitly. self.enforce_illegal_method_limitations(&pick); // If there is a `Self: Sized` bound and `Self` is a trait object, it is possible that // something which derefs to `Self` actually implements the trait and the caller // wanted to make a static dispatch on it but forgot to import the trait. // See test `src/test/ui/issue-35976.rs`. // // In that case, we'll error anyway, but we'll also re-run the search with all traits // in scope, and if we find another method which can be used, we'll output an // appropriate hint suggesting to import the trait. let illegal_sized_bound = self.predicates_require_illegal_sized_bound(&method_predicates); // Add any trait/regions obligations specified on the method's type parameters. // We won't add these if we encountered an illegal sized bound, so that we can use // a custom error in that case."} {"_id":"q-en-rust-643614598dee75638dabc1b8e94bb911b15a2d52f3d06534ea2994babc623251","text":"COMMON_FLAGS=-Copt-level=2 -Ccodegen-units=1 -Cllvm-args=-disable-preinline # LLVM doesn't support instrumenting binaries that use SEH: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMMON_FLAGS+= -Cpanic=abort endif ifeq ($(UNAME),Darwin) # macOS does not have the `tac` command, but `tail -r` does the same thing TAC := tail -r"} {"_id":"q-en-rust-64585367fda5d5d4f35191e847aaca3ee276ee77d3dc831f2918be7912a4a34b","text":"} ty::UnsizeVtable(ref ty_trait, self_ty) => { vtable::check_object_safety(self.tcx(), ty_trait, span); // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` implements `Foo`: vtable::register_object_cast_obligations(self, span, ty_trait, self_ty); span, ty_trait, self_ty); // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` outlives `'a`:"} {"_id":"q-en-rust-6472646211ce02d6ef170d22aca480d5269712a4aa5570f182ae83ef660702eb","text":"// `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. PlaceContext::NonUse(NonUseContext::PlaceMention) | PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | PlaceContext::NonUse(NonUseContext::AscribeUserTy) | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) |"} {"_id":"q-en-rust-647290dafe8fd3f359122c9637b5a7f4960292093e001d0ed31f4c01f3a098cc","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-android: FIXME(#10381) // ignore-windows // min-lldb-version: 310"} {"_id":"q-en-rust-6481dc2278395d321aa130c39bd91d9016a2b00071e470443251cc902767dc37","text":"} #[bench] fn from_utf8_lossy_100_ascii(bh: &mut BenchHarness) { let s = bytes!(\"Hello there, the quick brown fox jumped over the lazy dog! Lorem ipsum dolor sit amet, consectetur. \"); assert_eq!(100, s.len()); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_100_multibyte(bh: &mut BenchHarness) { let s = bytes!(\"𐌀𐌖𐌋𐌄𐌑𐌉ปรدولة الكويتทศไทย中华𐍅𐌿𐌻𐍆𐌹𐌻𐌰\"); assert_eq!(100, s.len()); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_invalid(bh: &mut BenchHarness) { let s = bytes!(\"Hello\", 0xC0, 0x80, \" There\", 0xE6, 0x83, \" Goodbye\"); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn from_utf8_lossy_100_invalid(bh: &mut BenchHarness) { let s = ::vec::from_elem(100, 0xF5u8); bh.iter(|| { let _ = from_utf8_lossy(s); }); } #[bench] fn bench_with_capacity(bh: &mut BenchHarness) { bh.iter(|| { let _ = with_capacity(100);"} {"_id":"q-en-rust-64853565f8bc5cdee2a9fbe11979ce0b5658e4f0c6818429b6bfc029410604e5","text":"/// Map of capability name to boolean value pub bools: HashMap, /// Map of capability name to numeric value pub numbers: HashMap, pub numbers: HashMap, /// Map of capability name to raw (unexpanded) string pub strings: HashMap>, }"} {"_id":"q-en-rust-64be38536aa26e102108417ca93963a6c10d507014595f9e8b60dc2ad78eee33","text":"* * Strings are a packed UTF-8 representation of text, stored as null * terminated buffers of u8 bytes. Strings should be indexed in bytes, * for efficiency, but UTF-8 unsafe operations should be avoided. For * some heavy-duty uses, try extra::rope. * for efficiency, but UTF-8 unsafe operations should be avoided. */ use at_vec;"} {"_id":"q-en-rust-64c231afdcf3c3ddfb114c5f7c1c0697ee10a6e7d06a0ce9d93b905b48b5e83b","text":"//! These structs are a subset of the ones found in `rustc_errors::json`. //! They are only used for deserialization of JSON output provided by libtest. use std::path::{Path, PathBuf}; use std::str::FromStr;"} {"_id":"q-en-rust-64c60d4e9e0d43da6651534826f4a39806fbd8b63a41445d8bdabc636629d396","text":" use crate::cmp::{max, min}; use crate::io::prelude::*; use crate::io::{copy, empty, repeat, sink, Empty, Repeat, SeekFrom, Sink}; use crate::io::{ copy, empty, repeat, sink, BufWriter, Empty, Repeat, Result, SeekFrom, Sink, DEFAULT_BUF_SIZE, }; #[test] fn copy_copies() {"} {"_id":"q-en-rust-651e2ad5cf6d3ca2974db4ffa7c2694c9bfc609f2aa69ae8609fc288a849e120","text":" error[E0308]: mismatched types --> $DIR/dont-suggest-through-inner-const.rs:4:9 | LL | 0 | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/dont-suggest-through-inner-const.rs:1:17 | LL | const fn f() -> usize { | - ^^^^^ expected `usize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-656373ef21fd754284e0e19da4ed3494db327b81ae20b0ffbb7be8f712d84cac","text":"COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/ RUN ./build-openssl.sh # The `curl` binary on CentOS doesn't support SNI which is needed for fetching # The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching # some https urls we have, so install a new version of libcurl + curl which is # using the openssl we just built previously. # # Note that we also disable a bunch of optional features of curl that we don't # really need. COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/ RUN ./build-curl.sh RUN ./build-curl.sh && apt-get remove -y curl # binutils < 2.22 has a bug where the 32-bit executables it generates # immediately segfault in Rust, so we need to install our own binutils."} {"_id":"q-en-rust-657f2bb26cd7c265ac3d44371d515caf2e222196191149277b9645f13137f63f","text":"explicitly_linked: bool) -> (ast::CrateNum, Rc, cstore::CrateSource) { self.verify_rustc_version(name, span, &lib.metadata); // Claim this crate number and cache it let cnum = self.next_crate_num; self.next_crate_num += 1;"} {"_id":"q-en-rust-657fabc8065295b94b81d52a4d4e672e155a94ec81992284b872dc1ab962677b","text":"return this.tcx().types.err; } _ => { let id_node = tcx.map.as_local_node_id(def.def_id()).unwrap(); span_err!(tcx.sess, span, E0248, \"found value `{}` used as a type\", tcx.map.path_to_string(id_node)); tcx.item_path_str(def.def_id())); return this.tcx().types.err; } }"} {"_id":"q-en-rust-65a0e69f7ccf294e4afde9884ec1770bcae14ff7498b5832470fbda39f065204","text":" Subproject commit 777efaf5644706b36706a7a5c51edb63835e05ca Subproject commit f1ed22803f09e3b2c2b86d773db07ce70804987a "} {"_id":"q-en-rust-65a485428fc8cce21468a3e6f78e9128598e1f9ec65bb856e859a7ee81e215b8","text":" // Copyright 2012 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that we cannot return a stack allocated slice fn function(x: int) -> &'static [int] { &[x] //~ ERROR mismatched types } fn main() { let x = function(1); let y = x[0]; } "} {"_id":"q-en-rust-65b315a76d355a50cf960ad2c8de79767c6c64a45b73efae97cdc9e8b274dbb0","text":"EncodeCrossCrate::No, coroutines, experimental!(coroutines) ), // `#[pointee]` attribute to designate the pointee type in SmartPointer derive-macro gated!( pointee, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No, derive_smart_pointer, experimental!(pointee) ), // RFC 3543 // `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` gated!("} {"_id":"q-en-rust-65c06f362a40381073941a32792ed0ec53b9c502bd7533e108b740c717913224","text":"} else { // If another opaque type that we contain is recursive, then it // will report the error, so we don't have to. self.found_any_recursion = true; self.found_recursion = def_id == *self.primary_def_id.as_ref().unwrap(); None }"} {"_id":"q-en-rust-6645797321f7950a86c2583df37824ff5ef9fef9213a6d359d6b9fa341c89f82","text":"} ItemKind::Static(ref ty, _, ref expr) | ItemKind::Const(_, ref ty, ref expr) => { debug!(\"resolve_item ItemKind::Const\"); self.with_item_rib(HasGenericParams::No, |this| { this.visit_ty(ty); if let Some(expr) = expr {"} {"_id":"q-en-rust-669e65075676219cf2992646ac55f8a675e1ff0723d4b5e5527a2afa9fb01e60","text":" pub trait NSWindow: Sized { fn frame(self) -> () { unimplemented!() } fn setFrame_display_(self, display: ()) {} } impl NSWindow for () {} pub struct NSRect {} use std::ops::Deref; struct MainThreadSafe(T); impl Deref for MainThreadSafe { type Target = T; fn deref(&self) -> &T { unimplemented!() } } fn main() { || { let ns_window = MainThreadSafe(()); // Don't record adjustments twice for `*ns_window` (*ns_window).frame(); ns_window.setFrame_display_(0); //~^ ERROR mismatched types }; } "} {"_id":"q-en-rust-66a62aa2230bba08531a0b465f7623c23a0485c4391a309bd2f4121ed08fa06e","text":" // known-bug: #102688 // check-pass // edition:2021 #![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]"} {"_id":"q-en-rust-66b48e105ee8d1f1db70a664564be6884b6a4a64385e6cee3879facaf511f5be","text":"// Before we start looking for candidates, we have to get our hands // on the type user is trying to perform invocation on; basically: // we're transforming `HashMap::new` into just `HashMap` let path = if let Some((_, path)) = path.split_last() { path } else { return Some(parent_err); // we're transforming `HashMap::new` into just `HashMap`. let path = match path.split_last() { Some((_, path)) if !path.is_empty() => path, _ => return Some(parent_err), }; let (mut err, candidates) ="} {"_id":"q-en-rust-66c547dacc4d4a80238c73042b2ed00f5f1431558af8834226e873a9265929c9","text":" error: unknown disambiguator `hello` --> $DIR/email-address-localhost.rs:3:18 | LL | //! Email me at . | ^^^^^ | note: the lint level is defined here --> $DIR/email-address-localhost.rs:1:9 | LL | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]` error: aborting due to previous error "} {"_id":"q-en-rust-66cd9fe95571bc5754b952dc8f04f5c3124779a464c5a12d111c3de21f30c5da","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-tidy-linelength #![deny(deprecated)] extern crate url; fn main() { let _ = url::Url::parse(\"http://example.com\"); //~^ ERROR use of deprecated item: This is being removed. Use rust-url instead. http://servo.github.io/rust-url/ } "} {"_id":"q-en-rust-66cfd03b9f10f42560f5f491ba4b795ff727ca89f044a922054b29c21ee3a3f8","text":"// @has - '//*[@class=\"sidebar-elems\"]//section//a' 'Output' // @has - '//div[@class=\"sidebar-elems\"]//h3/a[@href=\"#provided-associated-types\"]' 'Provided Associated Types' // @has - '//*[@class=\"sidebar-elems\"]//section//a' 'Extra' // @has - '//div[@class=\"sidebar-elems\"]//h3/a[@href=\"#object-safety\"]' 'Object Safety' pub trait Foo { const FOO: usize; const BAR: u32 = 0;"} {"_id":"q-en-rust-6708d50b25c6b8e99fb68798e9b3d186c1dcf42d9a3e911830dd29e9a5d933e6","text":" enum will { s#[c\"owned_box\"] //~^ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `#` //~|ERROR expected item, found `\"owned_box\"` } "} {"_id":"q-en-rust-67307308c0cc56d4d1a8d818e7eccb9a11e91ba2a46b5d05751cf65a1cc9d4e6","text":"None, ); } // If `ty` is a `repr(transparent)` newtype, and the non-zero-sized type is a generic // argument, which after substitution, is `()`, then this branch can be hit. FfiResult::FfiUnsafe { ty, .. } if is_return_type && ty.is_unit() => {} FfiResult::FfiUnsafe { ty, reason, help } => { self.emit_ffi_unsafe_type_lint(ty, sp, reason, help); }"} {"_id":"q-en-rust-67471abdd0ddc9119e2079c17e37000dac506c26c58ff18e79b3e69938c381a3","text":" use std::io::Write; #[test] fn test_thing() { print!(\"ran the test\"); std::io::stdout().flush().unwrap(); } "} {"_id":"q-en-rust-674cc81bd82d8731a967556c6727f979237307e2ea695f7e2acdece978058209","text":"/// println!(\"{:?}\", Foo(10, \"Hello World\".to_string())); /// ``` #[stable(feature = \"debug_builders\", since = \"1.2.0\")] #[inline] pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> { builders::debug_tuple_new(self, name) }"} {"_id":"q-en-rust-676894d627a6b4759baec877660e902c83c437cc09e2143183a30cd4247111ab","text":"hir::TraitItemKind::Fn(_, hir::TraitFn::Required(_)) | hir::TraitItemKind::Type(..) => false, }, Some(Node::ImplItem(impl_item)) => { match impl_item.kind { hir::ImplItemKind::Const(..) => true, hir::ImplItemKind::Fn(..) => { let attrs = self.tcx.codegen_fn_attrs(def_id); let generics = self.tcx.generics_of(def_id); if generics.requires_monomorphization(self.tcx) || attrs.requests_inline() { true } else { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); let impl_did = self.tcx.hir().get_parent_item(hir_id); // Check the impl. If the generics on the self // type of the impl require inlining, this method // does too. match self.tcx.hir().expect_item(impl_did).kind { hir::ItemKind::Impl { .. } => { let generics = self.tcx.generics_of(impl_did); generics.requires_monomorphization(self.tcx) } _ => false, } } } hir::ImplItemKind::TyAlias(_) => false, Some(Node::ImplItem(impl_item)) => match impl_item.kind { hir::ImplItemKind::Const(..) => true, hir::ImplItemKind::Fn(..) => { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); let impl_did = self.tcx.hir().get_parent_item(hir_id); method_might_be_inlined(self.tcx, impl_item, impl_did) } } hir::ImplItemKind::TyAlias(_) => false, }, Some(_) => false, None => false, // This will happen for default methods. }"} {"_id":"q-en-rust-6769127e33eb328b83c8058ca50e52f9f0410f8079c4830d8b4ab8e70edb6b29","text":"let cursor_snapshot_next_calls = cursor_snapshot.num_next_calls; let mut end_pos = self.token_cursor.num_next_calls; let mut captured_trailing = false; // Capture a trailing token if requested by the callback 'f' match trailing { TrailingToken::None => {} TrailingToken::Gt => { assert_eq!(self.token.kind, token::Gt); } TrailingToken::Semi => { assert_eq!(self.token.kind, token::Semi); end_pos += 1; captured_trailing = true; } TrailingToken::MaybeComma => { if self.token.kind == token::Comma { end_pos += 1; captured_trailing = true; } } }"} {"_id":"q-en-rust-676ab03fbde2fd1ab5eed40c0e6239693f02ead7f8564879321124b2c12b8f2f","text":" error[E0580]: `main` function has wrong type --> $DIR/issue-111879-1.rs:12:1 | LL | fn main(_: for<'a> fn(Foo::Assoc)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | = note: expected fn pointer `fn()` found fn pointer `fn(for<'a> fn(Foo::Assoc))` error: aborting due to previous error For more information about this error, try `rustc --explain E0580`. "} {"_id":"q-en-rust-677058b7181d653e5d8757ca97af48fb546fd21b077935fb7d7a1820186a7da3","text":" //@ known-bug: rust-lang/rust#129503 use std::arch::asm; unsafe fn f6() { asm!(concat!(r#\"lJ𐏿Æ�.𐏿�\"#, \"r} {}\")); } "} {"_id":"q-en-rust-67fb4d0463732a4f753163e2caaf24f7308a8d04d605cbaf1df22d29063da3b1","text":" Subproject commit 51f104bf1cc6c3a588a11c90a3b4a4a18ee080ac Subproject commit e45c75de1148456a9eb1a67c14a66df4dfb50c94 "} {"_id":"q-en-rust-68052938402af349618cb8dc8d44abf5e172a80ace56d0851ed2f6fe37e0a355","text":" error: function can not have more than 65535 arguments --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:24 | LL | fn _f($($t: ()),*) {} | ________________________^ LL | | } LL | | } LL | | LL | | many_args!{[_]########## ######} | |____________^ error: aborting due to previous error "} {"_id":"q-en-rust-6867b9bce8838b2ca88df10d939814723b0aa65a8fb6895190243a81d2ceacd8","text":"emit, generate_link_to_definition, call_locations, no_emit_shared: false, }, crate_name, output_format,"} {"_id":"q-en-rust-68c26c1aec9baa24e623c7395c28070b9653c69ffa51a9cbc87d44c40d38156f","text":" //@ check-pass //@ edition: 2021 // issue: rust-lang/rust#123697 #![feature(async_closure)] struct S { t: i32 } fn test(s: &S, t: &i32) { async || { println!(\"{}\", s.t); println!(\"{}\", t); }; } fn main() {} "} {"_id":"q-en-rust-68e64ee10988f5f9ec6b35b4a0ad6e495853616f3e7767c2dbfc398bd19d4410","text":"/// Basic usage: /// /// ``` /// #![feature(nonzero_is_power_of_two)] /// #[doc = concat!(\"let eight = std::num::\", stringify!($Ty), \"::new(8).unwrap();\")] /// assert!(eight.is_power_of_two()); #[doc = concat!(\"let ten = std::num::\", stringify!($Ty), \"::new(10).unwrap();\")] /// assert!(!ten.is_power_of_two()); /// ``` #[must_use] #[unstable(feature = \"nonzero_is_power_of_two\", issue = \"81106\")] #[stable(feature = \"nonzero_is_power_of_two\", since = \"1.59.0\")] #[inline] pub const fn is_power_of_two(self) -> bool { // LLVM 11 normalizes `unchecked_sub(x, 1) & x == 0` to the implementation seen here."} {"_id":"q-en-rust-68ebc5885a93d998260791747394811988ff50bb0a1857c01187980bb5f6fc28","text":"fn process() { let handles: Vec<_> = (0..10).map(|_| { thread::spawn(|| { let mut _x = 0; let mut x = 0; for _ in (0..5_000_000) { _x += 1 x += 1 } x }) }).collect(); for h in handles { h.join().ok().expect(\"Could not join a thread!\"); println!(\"Thread finished with count={}\", h.join().map_err(|_| \"Could not join a thread!\").unwrap()); } println!(\"done!\"); } ``` Some of this should look familiar from previous examples. We spin up ten threads, collecting them into a `handles` vector. Inside of each thread, we loop five million times, and add one to `_x` each time. Why the underscore? Well, if we remove it and compile: ```bash $ cargo build Compiling embed v0.1.0 (file:///home/steve/src/embed) src/lib.rs:3:1: 16:2 warning: function is never used: `process`, #[warn(dead_code)] on by default src/lib.rs:3 fn process() { src/lib.rs:4 let handles: Vec<_> = (0..10).map(|_| { src/lib.rs:5 thread::spawn(|| { src/lib.rs:6 let mut x = 0; src/lib.rs:7 for _ in (0..5_000_000) { src/lib.rs:8 x += 1 ... src/lib.rs:6:17: 6:22 warning: variable `x` is assigned to, but never used, #[warn(unused_variables)] on by default src/lib.rs:6 let mut x = 0; ^~~~~ ``` That first warning is because we are building a library. If we had a test for this function, the warning would go away. But for now, it’s never called. The second is related to `x` versus `_x`. Because we never actually _do_ anything with `x`, we get a warning about it. In our case, that’s perfectly okay, as we’re just trying to waste CPU cycles. Prefixing `x` with the underscore removes the warning. Finally, we join on each thread. loop five million times, and add one to `x` each time. Finally, we join on each thread. Right now, however, this is a Rust library, and it doesn’t expose anything that’s callable from C. If we tried to hook this up to another language right"} {"_id":"q-en-rust-6900bdf9035c02b28e4fbaa1748313c967c10d25f67afd0ae2904999a071b157","text":"} #[test] #[cfg_attr(any(target_os = \"vxworks\", target_os = \"android\"), ignore)] #[cfg_attr(any(target_os = \"vxworks\"), ignore)] fn test_process_output_error() { let Output { status, stdout, stderr } = if cfg!(target_os = \"windows\") { Command::new(\"cmd\").args(&[\"/C\", \"mkdir .\"]).output().unwrap()"} {"_id":"q-en-rust-6918f6e5b9611d6d196b8ab61ac5fe7b20968f65a47d4979e9a1b74c2d5b59a9","text":"// Check magic number let magic = t!(read_le_u16(file)); if magic != 0x011A { return Err(format!(\"invalid magic number: expected {:x}, found {:x}\", 0x011A, magic)); } let extended = match magic { 0o0432 => false, 0o01036 => true, _ => return Err(format!(\"invalid magic number, found {:o}\", magic)), }; // According to the spec, these fields must be >= -1 where -1 means that the feature is not // supported. Using 0 instead of -1 works because we skip sections with length 0."} {"_id":"q-en-rust-69396fc678ea91026ca6427c40affb760918495b4ded367081cd109a69a339b0","text":" error[E0214]: parenthesized type parameters may only be used with a `Fn` trait --> $DIR/issue-66286.rs:8:22 | LL | pub extern fn foo(_: Vec(u32)) -> u32 { | ^^^^^^^^ | | | only `Fn` traits may use parentheses | help: use angle brackets instead: `Vec` error: aborting due to previous error For more information about this error, try `rustc --explain E0214`. "} {"_id":"q-en-rust-696a6968dcf128204924de394a0d57f67d1ad11247a1138862771c24a3117238","text":"} #[cfg(all( any(target_arch = \"aarch64\", target_arch = \"powerpc\", target_arch = \"x86_64\"), any( target_arch = \"aarch64\", target_arch = \"powerpc\", target_arch = \"s390x\", target_arch = \"x86_64\" ), any(not(target_arch = \"aarch64\"), not(any(target_os = \"macos\", target_os = \"ios\"))), not(target_family = \"wasm\"), not(target_arch = \"asmjs\"),"} {"_id":"q-en-rust-698ed1e0d75734afcca09b732dc4880d2f1953f48eaceef9547cf0cba15049e4","text":" error: `extern` fn uses type `NotSafe`, which is not FFI-safe --> $DIR/lint-ctypes-113436-1.rs:22:22 | LL | extern \"C\" fn bar(x: Bar) -> Bar { | ^^^ not FFI-safe | = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = note: this struct has unspecified layout note: the type is defined here --> $DIR/lint-ctypes-113436-1.rs:13:1 | LL | struct NotSafe(u32); | ^^^^^^^^^^^^^^ note: the lint level is defined here --> $DIR/lint-ctypes-113436-1.rs:1:9 | LL | #![deny(improper_ctypes_definitions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `extern` fn uses type `NotSafe`, which is not FFI-safe --> $DIR/lint-ctypes-113436-1.rs:22:30 | LL | extern \"C\" fn bar(x: Bar) -> Bar { | ^^^ not FFI-safe | = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = note: this struct has unspecified layout note: the type is defined here --> $DIR/lint-ctypes-113436-1.rs:13:1 | LL | struct NotSafe(u32); | ^^^^^^^^^^^^^^ error: aborting due to 2 previous errors "} {"_id":"q-en-rust-69936b11fb2c9a114bda6238e7d15aaf72819ab1cd163cc0873b199e41772056","text":"pub fn foo(arg: Option<&Vec>) -> Option<&[i32]> { arg //~ ERROR 5:5: 5:8: mismatched types [E0308] } pub fn bar(arg: Option<&Vec>) -> &[i32] { arg.unwrap_or(&[]) //~ ERROR 9:19: 9:22: mismatched types [E0308] } pub fn barzz<'a>(arg: Option<&'a Vec>, v: &'a [i32]) -> &'a [i32] { arg.unwrap_or(v) //~ ERROR 13:19: 13:20: mismatched types [E0308] } pub fn convert_result(arg: Result<&Vec, ()>) -> &[i32] { arg.unwrap_or(&[]) //~ ERROR 17:19: 17:22: mismatched types [E0308] } "} {"_id":"q-en-rust-69d876371a07dbc862162092dc8e57c9e5f3dd62e5f779def05c99a59f8d3c97","text":" error[E0706]: trait fns cannot be declared `async` --> $DIR/async-trait-fn.rs:3:5 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait error[E0706]: trait fns cannot be declared `async` --> $DIR/async-trait-fn.rs:4:5 | LL | async fn bar(&self) {} | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0706`. "} {"_id":"q-en-rust-69e406f43fe193657cbf3932ddc7e038d890556b8114c58c15252b2595f16edd","text":"#[rustc_doc_primitive = \"f128\"] #[doc(alias = \"quad\")] /// A 128-bit floating point type (specifically, the \"binary128\" type defined in IEEE 754-2008). /// A 128-bit floating-point type (specifically, the \"binary128\" type defined in IEEE 754-2008). /// /// This type is very similar to [`prim@f32`] and [`prim@f64`], but has increased precision by using twice /// as many bits as `f64`. Please see [the documentation for `f32`](prim@f32) or [Wikipedia on"} {"_id":"q-en-rust-69f74c843b11074cb3e52eb37d66176b49d13295b2bd4e83dc9d0568dcc0a8d3","text":" #[doc(hidden)] pub enum HiddenType {} #[doc(hidden)] pub trait HiddenTrait {} "} {"_id":"q-en-rust-6a27c3f3280cde5d1c139e2e6ee8ff9cfcc092b919bcd1f8408041c4c95204ed","text":" error[E0261]: use of undeclared lifetime name `'short` --> $DIR/issue-107090.rs:4:9 | LL | Foo<'short, 'out, T>: Convert<'a, 'b>; | ^^^^^^ undeclared lifetime | = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html help: consider making the bound lifetime-generic with a new `'short` lifetime | LL | for<'short> Foo<'short, 'out, T>: Convert<'a, 'b>; | +++++++++++ help: consider introducing lifetime `'short` here | LL | struct Foo<'short, 'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) | +++++++ error[E0261]: use of undeclared lifetime name `'out` --> $DIR/issue-107090.rs:4:17 | LL | Foo<'short, 'out, T>: Convert<'a, 'b>; | ^^^^ undeclared lifetime | help: consider making the bound lifetime-generic with a new `'out` lifetime | LL | for<'out> Foo<'short, 'out, T>: Convert<'a, 'b>; | +++++++++ help: consider introducing lifetime `'out` here | LL | struct Foo<'out, 'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) | +++++ error[E0261]: use of undeclared lifetime name `'b` --> $DIR/issue-107090.rs:13:47 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | - ^^ undeclared lifetime | | | help: consider introducing lifetime `'b` here: `'b,` error[E0261]: use of undeclared lifetime name `'out` --> $DIR/issue-107090.rs:13:67 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | - help: consider introducing lifetime `'out` here: `'out,` ^^^^ undeclared lifetime error[E0261]: use of undeclared lifetime name `'out` --> $DIR/issue-107090.rs:17:49 | LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> { | ^^^^ undeclared lifetime | help: consider introducing lifetime `'out` here | LL | fn cast<'out>(&'long self) -> &'short Foo<'short, 'out, T> { | ++++++ help: consider introducing lifetime `'out` here | LL | impl<'out, 'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | +++++ error[E0261]: use of undeclared lifetime name `'short` --> $DIR/issue-107090.rs:24:68 | LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { | - ^^^^^^ undeclared lifetime | | | help: consider introducing lifetime `'short` here: `'short,` error[E0308]: mismatched types --> $DIR/issue-107090.rs:4:27 | LL | Foo<'short, 'out, T>: Convert<'a, 'b>; | ^^^^^^^^^^^^^^^ lifetime mismatch | = note: expected trait `Convert<'static, 'static>` found trait `Convert<'a, 'b>` note: the lifetime `'a` as defined here... --> $DIR/issue-107090.rs:2:12 | LL | struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) | ^^ = note: ...does not necessarily outlive the static lifetime error[E0308]: mismatched types --> $DIR/issue-107090.rs:4:27 | LL | Foo<'short, 'out, T>: Convert<'a, 'b>; | ^^^^^^^^^^^^^^^ lifetime mismatch | = note: expected trait `Convert<'static, 'static>` found trait `Convert<'a, 'b>` note: the lifetime `'b` as defined here... --> $DIR/issue-107090.rs:2:16 | LL | struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) | ^^ = note: ...does not necessarily outlive the static lifetime error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'long` due to conflicting requirements --> $DIR/issue-107090.rs:13:55 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | ^^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'short` as defined here... --> $DIR/issue-107090.rs:13:21 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | ^^^^^^ = note: ...but the lifetime must also be valid for the static lifetime... note: ...so that the types are compatible --> $DIR/issue-107090.rs:13:55 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | ^^^^^^^^^^^^^^^^^^^^ = note: expected `Convert<'short, 'static>` found `Convert<'_, 'static>` error: incompatible lifetime on type --> $DIR/issue-107090.rs:24:29 | LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { | ^^^^^^^^^^^^^^^^^^ | note: because this has an unmet lifetime requirement --> $DIR/issue-107090.rs:4:27 | LL | Foo<'short, 'out, T>: Convert<'a, 'b>; | ^^^^^^^^^^^^^^^ introduces a `'static` lifetime requirement note: the lifetime `'out` as defined here... --> $DIR/issue-107090.rs:24:17 | LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { | ^^^^ note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl` --> $DIR/issue-107090.rs:13:1 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0759]: `x` has lifetime `'in_` but it needs to satisfy a `'static` lifetime requirement --> $DIR/issue-107090.rs:24:29 | LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { | ^^^^^^^^^^^^^^^^^^ | | | this data with lifetime `'in_`... | ...is used and required to live as long as `'static` here error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'long` due to conflicting requirements --> $DIR/issue-107090.rs:17:13 | LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> { | ^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'short` as defined here... --> $DIR/issue-107090.rs:13:21 | LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { | ^^^^^^ = note: ...but the lifetime must also be valid for the static lifetime... note: ...so that the types are compatible --> $DIR/issue-107090.rs:17:13 | LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> { | ^^^^^^^^^^^ = note: expected `Convert<'short, 'static>` found `Convert<'_, 'static>` error: aborting due to 12 previous errors Some errors have detailed explanations: E0261, E0308, E0495, E0759. For more information about an error, try `rustc --explain E0261`. "} {"_id":"q-en-rust-6a50b000ff011042eed475516d4d64a452d56c17b90b1b7a57451460fefca4d5","text":"} } impl<'a, 'tcx> TypeVisitor> for WfPredicates<'a, 'tcx> { type Result = (); fn visit_ty(&mut self, t: as ty::Interner>::Ty) -> Self::Result { debug!(\"wf bounds for t={:?} t.kind={:#?}\", t, t.kind()); match *t.kind() { ty::Bool | ty::Char | ty::Int(..) | ty::Uint(..) | ty::Float(..) | ty::Error(_) | ty::Str | ty::CoroutineWitness(..) | ty::Never | ty::Param(_) | ty::Bound(..) | ty::Placeholder(..) | ty::Foreign(..) => { // WfScalar, WfParameter, etc } // Can only infer to `ty::Int(_) | ty::Uint(_)`. ty::Infer(ty::IntVar(_)) => {} // Can only infer to `ty::Float(_)`. ty::Infer(ty::FloatVar(_)) => {} ty::Slice(subty) => { self.require_sized(subty, traits::SliceOrArrayElem); } ty::Array(subty, _) => { self.require_sized(subty, traits::SliceOrArrayElem); // Note that we handle the len is implicitly checked while walking `arg`. } ty::Tuple(tys) => { if let Some((_last, rest)) = tys.split_last() { for &elem in rest { self.require_sized(elem, traits::TupleElem); } } } ty::RawPtr(_) => { // Simple cases that are WF if their type args are WF. } ty::Alias(ty::Projection, data) => { self.compute_projection(data); return; // Subtree handled by compute_projection. } ty::Alias(ty::Inherent, data) => { self.compute_inherent_projection(data); return; // Subtree handled by compute_inherent_projection. } ty::Adt(def, args) => { // WfNominalType let obligations = self.nominal_obligations(def.did(), args); self.out.extend(obligations); } ty::FnDef(did, args) => { let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::Ref(r, rty, _) => { // WfReference if !r.has_escaping_bound_vars() && !rty.has_escaping_bound_vars() { let cause = self.cause(traits::ReferenceOutlivesReferent(t)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::TypeOutlives( ty::OutlivesPredicate(rty, r), ))), )); } } ty::Coroutine(did, args, ..) => { // Walk ALL the types in the coroutine: this will // include the upvar types as well as the yield // type. Note that this is mildly distinct from // the closure case, where we have to be careful // about the signature of the closure. We don't // have the problem of implied bounds here since // coroutines don't take arguments. let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::Closure(did, args) => { // Note that we cannot skip the generic types // types. Normally, within the fn // body where they are created, the generics will // always be WF, and outside of that fn body we // are not directly inspecting closure types // anyway, except via auto trait matching (which // only inspects the upvar types). // But when a closure is part of a type-alias-impl-trait // then the function that created the defining site may // have had more bounds available than the type alias // specifies. This may cause us to have a closure in the // hidden type that is not actually well formed and // can cause compiler crashes when the user abuses unsafe // code to procure such a closure. // See tests/ui/type-alias-impl-trait/wf_check_closures.rs let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); // Only check the upvar types for WF, not the rest // of the types within. This is needed because we // capture the signature and it may not be WF // without the implied bounds. Consider a closure // like `|x: &'a T|` -- it may be that `T: 'a` is // not known to hold in the creator's context (and // indeed the closure may not be invoked by its // creator, but rather turned to someone who *can* // verify that). // // The special treatment of closures here really // ought not to be necessary either; the problem // is related to #25860 -- there is no way for us // to express a fn type complete with the implied // bounds that it is assuming. I think in reality // the WF rules around fn are a bit messed up, and // that is the rot problem: `fn(&'a T)` should // probably always be WF, because it should be // shorthand for something like `where(T: 'a) { // fn(&'a T) }`, as discussed in #25860. let upvars = args.as_closure().tupled_upvars_ty(); return upvars.visit_with(self); } ty::CoroutineClosure(did, args) => { // See the above comments. The same apply to coroutine-closures. let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); let upvars = args.as_coroutine_closure().tupled_upvars_ty(); return upvars.visit_with(self); } ty::FnPtr(_) => { // Let the visitor iterate into the argument/return // types appearing in the fn signature. } ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => { // All of the requirements on type parameters // have already been checked for `impl Trait` in // return position. We do need to check type-alias-impl-trait though. if self.tcx().is_type_alias_impl_trait(def_id) { let obligations = self.nominal_obligations(def_id, args); self.out.extend(obligations); } } ty::Alias(ty::Weak, ty::AliasTy { def_id, args, .. }) => { let obligations = self.nominal_obligations(def_id, args); self.out.extend(obligations); } ty::Dynamic(data, r, _) => { // WfObject // // Here, we defer WF checking due to higher-ranked // regions. This is perhaps not ideal. self.from_object_ty(t, data, r); // FIXME(#27579) RFC also considers adding trait // obligations that don't refer to Self and // checking those let defer_to_coercion = self.tcx().features().object_safe_for_dispatch; if !defer_to_coercion { if let Some(principal) = data.principal_def_id() { self.out.push(traits::Obligation::with_depth( self.tcx(), self.cause(traits::WellFormed(None)), self.recursion_depth, self.param_env, ty::Binder::dummy(ty::PredicateKind::ObjectSafe(principal)), )); } } } // Inference variables are the complicated case, since we don't // know what type they are. We do two things: // // 1. Check if they have been resolved, and if so proceed with // THAT type. // 2. If not, we've at least simplified things (e.g., we went // from `Vec<$0>: WF` to `$0: WF`), so we can // register a pending obligation and keep // moving. (Goal is that an \"inductive hypothesis\" // is satisfied to ensure termination.) // See also the comment on `fn obligations`, describing \"livelock\" // prevention, which happens before this can be reached. ty::Infer(_) => { let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::WellFormed( t.into(), ))), )); } } t.super_visit_with(self) } fn visit_const(&mut self, c: as ty::Interner>::Const) -> Self::Result { match c.kind() { ty::ConstKind::Unevaluated(uv) => { if !c.has_escaping_bound_vars() { let obligations = self.nominal_obligations(uv.def, uv.args); self.out.extend(obligations); let predicate = ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::ConstEvaluatable(c), )); let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, predicate, )); } } ty::ConstKind::Infer(_) => { let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::WellFormed( c.into(), ))), )); } ty::ConstKind::Expr(_) => { // FIXME(generic_const_exprs): this doesn't verify that given `Expr(N + 1)` the // trait bound `typeof(N): Add` holds. This is currently unnecessary // as `ConstKind::Expr` is only produced via normalization of `ConstKind::Unevaluated` // which means that the `DefId` would have been typeck'd elsewhere. However in // the future we may allow directly lowering to `ConstKind::Expr` in which case // we would not be proving bounds we should. let predicate = ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::ConstEvaluatable(c), )); let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, predicate, )); } ty::ConstKind::Error(_) | ty::ConstKind::Param(_) | ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(..) => { // These variants are trivially WF, so nothing to do here. } ty::ConstKind::Value(..) => { // FIXME: Enforce that values are structurally-matchable. } } c.super_visit_with(self) } fn visit_predicate(&mut self, _p: as ty::Interner>::Predicate) -> Self::Result { bug!(\"predicate should not be checked for well-formedness\"); } } /// Given an object type like `SomeTrait + Send`, computes the lifetime /// bounds that must hold on the elided self type. These are derived /// from the declarations of `SomeTrait`, `Send`, and friends -- if"} {"_id":"q-en-rust-6a76063d6737f5f06abe8526dff996b08a849b432d59387cbc9ea87850ef1feb","text":" error: recursion limit reached while expanding `concat!` --> $DIR/issue-84632-eager-expansion-recursion-limit.rs:8:28 | LL | (A, $($A:ident),*) => (concat!(\"\", a!($($A),*))) | ^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | a!(A, A, A, A, A, A, A, A, A, A, A); | ------------------------------------ in this macro invocation | = help: consider adding a `#![recursion_limit=\"30\"]` attribute to your crate (`issue_84632_eager_expansion_recursion_limit`) = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error "} {"_id":"q-en-rust-6a87d92dd5feaf890957a557172777c70c112357be5895669e08e572a1d46df8","text":"} } /// Appends an element if there is sufficient spare capacity, otherwise an error is returned /// with the element. /// /// Unlike [`push`] this method will not reallocate when there's insufficient capacity. /// The caller should use [`reserve`] or [`try_reserve`] to ensure that there is enough capacity. /// /// [`push`]: Vec::push /// [`reserve`]: Vec::reserve /// [`try_reserve`]: Vec::try_reserve /// /// # Examples /// /// A manual, panic-free alternative to [`FromIterator`]: /// /// ``` /// #![feature(vec_push_within_capacity)] /// /// use std::collections::TryReserveError; /// fn from_iter_fallible(iter: impl Iterator) -> Result, TryReserveError> { /// let mut vec = Vec::new(); /// for value in iter { /// if let Err(value) = vec.push_within_capacity(value) { /// vec.try_reserve(1)?; /// // this cannot fail, the previous line either returned or added at least 1 free slot /// let _ = vec.push_within_capacity(value); /// } /// } /// Ok(vec) /// } /// assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100))); /// ``` #[inline] #[unstable(feature = \"vec_push_within_capacity\", issue = \"100486\")] pub fn push_within_capacity(&mut self, value: T) -> Result<(), T> { if self.len == self.buf.capacity() { return Err(value); } unsafe { let end = self.as_mut_ptr().add(self.len); ptr::write(end, value); self.len += 1; } Ok(()) } /// Removes the last element from a vector and returns it, or [`None`] if it /// is empty. ///"} {"_id":"q-en-rust-6a898ee3decd1ee258608541437e12b250437fae71eefa8960f35a7f84e43e2a","text":") { // Every lifetime used in an associated type must be constrained. let impl_self_ty = tcx.type_of(impl_def_id); if impl_self_ty.references_error() { // Don't complain about unconstrained type params when self ty isn't known due to errors. // (#36836) tcx.sess.delay_span_bug( tcx.def_span(impl_def_id), \"potentially unconstrained type parameters weren't evaluated\", ); return; } let impl_generics = tcx.generics_of(impl_def_id); let impl_predicates = tcx.predicates_of(impl_def_id); let impl_trait_ref = tcx.impl_trait_ref(impl_def_id);"} {"_id":"q-en-rust-6a9323dde171f77890d1d5cff7514ed82343d328d737f2e190b856c0f08b068e","text":" Subproject commit a18df16181947edd5eb593ea0f2321e0035448ee Subproject commit 5db91c7b94ca81eead6b25bcf6196b869a44ece0 "} {"_id":"q-en-rust-6a9357b94f9b8057a783c12bca71b97bc3f08ee723fce46a0578b17f31340971","text":"}; let ident = Ident::new(kw::UnderscoreLifetime, elided_lifetime_span); let node_ids = self.r.next_node_ids(expected_lifetimes); self.record_lifetime_res( segment_id, LifetimeRes::ElidedAnchor { start: node_ids.start, end: node_ids.end }, LifetimeElisionCandidate::Ignore, ); if !missing { // Do not create a parameter for patterns and expressions. for id in node_ids { self.record_lifetime_res( id, LifetimeRes::Infer, LifetimeElisionCandidate::Named, ); } continue; } let missing_lifetime = MissingLifetime { id: node_ids.start, span: elided_lifetime_span,"} {"_id":"q-en-rust-6ab38f4facdb7819c40c71aa7a003f8548fb7142ea8469c97f899513e78bdd5f","text":" // run-rustfix fn main() { for _ in 0..256 as u8 {} //~ ERROR range endpoint is out of range for _ in 0..(256 as u8) {} //~ ERROR range endpoint is out of range } "} {"_id":"q-en-rust-6af0fa357d87249fcbdcb679bb77bef51807ac4a63f9bfb14e129e24cfdb105d","text":"impl Stdio { fn to_handle(&self, stdio_id: c::DWORD, pipe: &mut Option) -> io::Result { match *self { // If no stdio handle is available, then inherit means that it // should still be unavailable so propagate the // INVALID_HANDLE_VALUE. Stdio::Inherit => match stdio::get_handle(stdio_id) { Ok(io) => unsafe { let io = Handle::from_raw_handle(io);"} {"_id":"q-en-rust-6afb3d17464f3ccd3af087ae8d1ff85bf638759916495cd09078195ef840b340","text":"\"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)\", \"jsonrpc-core 7.0.1 (registry+https://github.com/rust-lang/crates.io-index)\", \"languageserver-types 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)\", \"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)\", \"racer 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)\", \"rls-analysis 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)\", \"rls-data 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"rls-vfs 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)\", \"rustfmt-nightly 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)\", \"rustfmt-nightly 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)\", \"serde 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)\", \"serde_derive 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)\", \"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)\","} {"_id":"q-en-rust-6b1965d3f1b7ec8273570b8d77ba171d9e307af1828080c19e13165168cfde9f","text":" // edition:2018 #![feature(unboxed_closures)] use std::future::Future; async fn wrapper(f: F) //~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` //~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` //~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` where F:, for<'a> >::Output: Future + 'a, { //~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` let mut i = 41; &mut i; } fn main() {} "} {"_id":"q-en-rust-6b41bf55c084e67042039956585e53c3678979fba134de917dd015cad3c39ab4","text":" fn bar() -> impl Fn() { wrap(wrap(wrap(wrap(foo())))) } fn foo() -> impl Fn() { //~^ WARNING 5:1: 5:22: function cannot return without recursing [unconditional_recursion] //~| ERROR 5:13: 5:22: cannot resolve opaque type [E0720] wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo()))))))) } fn wrap(f: impl Fn()) -> impl Fn() { move || f() } fn main() { } "} {"_id":"q-en-rust-6b47ea2e05623da8c414aeb26fb514361db29b27e9ee59b8565380481673220e","text":"nested: Vec>) -> VtableDefaultImplData> { let derived_cause = self.derived_cause(obligation, ImplDerivedObligation); let obligations = nested.iter().map(|&nested_ty| { // the obligation might be higher-ranked, e.g. for<'a> &'a // int : Copy. In that case, we will wind up with // late-bound regions in the `nested` vector. So for each // one we instantiate to a skolemized region, do our work // to produce something like `&'0 int : Copy`, and then // re-bind it. This is a bit of busy-work but preserves // the invariant that we only manipulate free regions, not // bound ones. self.infcx.try(|snapshot| { let (skol_ty, skol_map) = self.infcx().skolemize_late_bound_regions(&ty::Binder(nested_ty), snapshot); let skol_predicate = util::predicate_for_default_trait_impl( self.tcx(), derived_cause.clone(), trait_def_id, obligation.recursion_depth + 1, skol_ty); match skol_predicate { Ok(skol_predicate) => Ok(self.infcx().plug_leaks(skol_map, snapshot, &skol_predicate)), Err(ErrorReported) => Err(ErrorReported) } }) }).collect::>(); let mut obligations = match obligations { Ok(o) => o, Err(ErrorReported) => Vec::new() }; let mut obligations = self.collect_predicates_for_types(obligation, trait_def_id, nested); let _: Result<(),()> = self.infcx.try(|snapshot| { let (_, skol_map) ="} {"_id":"q-en-rust-6b671bc8511f57d8e23394b7bde2875e2ae8f9e24d9f892b87c3ee6885c7551d","text":"#[license = \"MIT/ASL2\"]; #[crate_type = \"rlib\"]; #[crate_type = \"dylib\"]; #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk.png\", #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png\", html_favicon_url = \"http://www.rust-lang.org/favicon.ico\", html_root_url = \"http://static.rust-lang.org/doc/master\")]; #[deny(unused_result, unused_must_use)];"} {"_id":"q-en-rust-6b6a815fb1f625821bbe5863fd23d65d192bf903688c1a26791e1b8c2e2b688e","text":"let out = p.wait_with_output().unwrap(); assert!(!out.status.success()); let s = str::from_utf8(&out.stderr).unwrap(); assert!(!s.contains(\"stack backtrace\") && !s.contains(\"foo::h\"), assert!(!s.contains(\"stack backtrace\") && !s.contains(\" - foo\"), \"bad output2: {}\", s); // Make sure a stack trace is printed"} {"_id":"q-en-rust-6bac9f5df8475679a298ef42b8d350559b4d20ea687316525248514a074adcd2","text":"version = \"0.0.0\" dependencies = [ \"arena 0.0.0\", \"backtrace 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)\", \"backtrace 0.3.29 (registry+https://github.com/rust-lang/crates.io-index)\", \"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)\", \"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)\", \"chalk-engine 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)\","} {"_id":"q-en-rust-6bc678755628a39c13d1f12646b7586a2f047eb2c73759b2a5eb39d6420ec144","text":"fi fi # Unless we're using an older version of LLVM, check that all LLVM components # used by tests are available. if [ \"$IS_NOT_LATEST_LLVM\" = \"\" ]; then export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1 fi if [ \"$ENABLE_GCC_CODEGEN\" = \"1\" ]; then # If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling` # argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable."} {"_id":"q-en-rust-6c7c131e18e684a42ce95129a6d8fb8c3d6c4c863bd995c59a373292b71c8f52","text":"[dependencies] toml = \"0.5\" serde = { version = \"1.0\", features = [\"derive\"] } serde_json = \"1.0\" "} {"_id":"q-en-rust-6c7c39448ffd90697a21c3435123a505083a91d61a69bcd2094fb559ec720d42","text":" mod a { use std::marker::PhantomData; enum Bug { V = [PhantomData; { [ () ].len() ].len() as isize, //~^ ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` } } mod b { enum Bug { V = [Vec::new; { [].len() ].len() as isize, //~^ ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR type annotations needed } } mod c { enum Bug { V = [Vec::new; { [0].len() ].len() as isize, //~^ ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR mismatched closing delimiter: `]` //~| ERROR type annotations needed } } fn main() {} "} {"_id":"q-en-rust-6c7d29d8abc506094a9c058991bd31b2177ab4f9307642b2e58704a4abe635e8","text":"linker_error.emit(); if sess.target.target.options.is_like_msvc && linker_not_found { sess.note_without_error(\"the msvc targets depend on the msvc linker but `link.exe` was not found\"); sess.note_without_error(\"please ensure that VS 2013, VS 2015 or VS 2017 was installed with the Visual C++ option\"); sess.note_without_error( \"the msvc targets depend on the msvc linker but `link.exe` was not found\", ); sess.note_without_error( \"please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option\", ); } sess.abort_if_errors(); }"} {"_id":"q-en-rust-6c98053ef21a721e693cc8f4ca271c8887553985ec890841fb4e48c642735ad1","text":"use std::ffi::CString; use rustc::hir::CodegenFnAttrFlags; use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; use rustc::session::Session; use rustc::session::config::Sanitizer;"} {"_id":"q-en-rust-6cbf537947bb9c687d7733b7cd04a4a7d4e7a5a82a9566b8158388311d594c6b","text":"COMPILE_FLAGS=-g -Cprofile-generate=\"$(TMPDIR)\" # LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMPILE_FLAGS+= -Cpanic=abort endif all: $(RUSTC) $(COMPILE_FLAGS) test.rs $(call RUN,test) || exit 1"} {"_id":"q-en-rust-6cbfae295963556e4b853de5004cafe2b109002efb126ceb16d7ba8bd6095a95","text":"offset: Size, ) -> Self { let alloc_align = alloc.inner().align; assert_eq!(alloc_align, layout.align.abi); assert!(alloc_align >= layout.align.abi); let read_scalar = |start, size, s: abi::Scalar, ty| { match alloc.0.read_scalar("} {"_id":"q-en-rust-6cd5c706d6ff03560bdac27912ee565271e84d2ec60ba3e2ad2d97962584a5d0","text":"Ok(true) } ty::Float(_) | ty::Int(_) | ty::Uint(_) => { let value = self.ecx.read_scalar(value)?; let value = try_validation!( self.ecx.read_scalar(value), self.path, err_unsup!(ReadPointerAsBytes) => { \"read of part of a pointer\" }, ); // NOTE: Keep this in sync with the array optimization for int/float // types below! if self.ctfe_mode.is_some() {"} {"_id":"q-en-rust-6d83031827c989cd3ac8fbb55106da7f4c12e987be41bf38e9737e44a161f37c","text":"use middle::typeck::astconv::ast_ty_to_ty; use middle::typeck::infer; use middle::{typeck, ty, def, pat_util, stability}; use middle::const_eval::{eval_const_expr_partial, const_int, const_uint}; use util::ppaux::{ty_to_string}; use util::nodemap::NodeSet; use lint::{Context, LintPass, LintArray};"} {"_id":"q-en-rust-6d9aca29eb8f0aed8fcbc109ff103251c0ccd66ce3fd0e63968f5792815f444e","text":"pub fn takes_non_exhaustive(_: NonExhaustiveEnum) { let _closure = |_: NonExhaustiveEnum| {}; } // ICE #117033 enum Void {} #[deny(non_exhaustive_omitted_patterns)] pub fn void(v: Void) -> ! { match v {} } "} {"_id":"q-en-rust-6de813a8077cea89059fb2bd09ec70f3f90cc10288cbba3e69ae5b2bff923b4b","text":" error[E0433]: failed to resolve: use of undeclared crate or module `should_panic` --> $DIR/check-builtin-attr-ice.rs:43:7 | LL | #[should_panic::skip] | ^^^^^^^^^^^^ use of undeclared crate or module `should_panic` error[E0433]: failed to resolve: use of undeclared crate or module `should_panic` --> $DIR/check-builtin-attr-ice.rs:47:7 | LL | #[should_panic::a::b::c] | ^^^^^^^^^^^^ use of undeclared crate or module `should_panic` error[E0433]: failed to resolve: use of undeclared crate or module `deny` --> $DIR/check-builtin-attr-ice.rs:55:7 | LL | #[deny::skip] | ^^^^ use of undeclared crate or module `deny` error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0433`. "} {"_id":"q-en-rust-6e1c51289c21c9e4a1f1e0c60db204ff5e28c9e6d2d716104c3793c55141fa59","text":"} } match r.read(&mut g.buf[g.len..]) { Ok(0) => { ret = Ok(g.len - start_len); break; let buf = &mut g.buf[g.len..]; match r.read(buf) { Ok(0) => return Ok(g.len - start_len), Ok(n) => { // We can't allow bogus values from read. If it is too large, the returned vec could have its length // set past its capacity, or if it overflows the vec could be shortened which could create an invalid // string if this is called via read_to_string. assert!(n <= buf.len()); g.len += n; } Ok(n) => g.len += n, Err(ref e) if e.kind() == ErrorKind::Interrupted => {} Err(e) => { ret = Err(e); break; } Err(e) => return Err(e), } } ret } pub(crate) fn default_read_vectored(read: F, bufs: &mut [IoSliceMut<'_>]) -> Result"} {"_id":"q-en-rust-6e45e106f587f17dae1f8a02089bb92bed70d0b0bd83a53b2a3567bfbfcfa76a","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(rustc_attrs)] #![deny(non_snake_case)] #[no_mangle] pub extern \"C\" fn SparklingGenerationForeignFunctionInterface() {} #[rustc_error] fn main() {} //~ ERROR compilation successful "} {"_id":"q-en-rust-6e56c9270ef05438aab80c03b454916c84f72d4223f248a97d8980ea78a7ca91","text":"test(parse(\"\"), None); { let build_dir = if cfg!(windows) { Some(\"C:tmp\") } else { Some(\"/tmp\") }; test(parse(\"build.build-dir = \"/tmp\"\"), build_dir); let build_dir = if cfg!(windows) { \"C:tmp\" } else { \"/tmp\" }; test(parse(&format!(\"build.build-dir = '{build_dir}'\")), Some(build_dir)); } }"} {"_id":"q-en-rust-6e78b73a82aba9d675ad7959bf102ebcf7b848aeb8c83e34b455a8b14bdbd6bd","text":" // check-pass // check that `deref_into_dyn_supertrait` doesn't cause ICE by eagerly converting // a cancelled lint #![allow(deref_into_dyn_supertrait)] trait Trait {} impl std::ops::Deref for dyn Trait + Send + Sync { type Target = dyn Trait; fn deref(&self) -> &Self::Target { self } } fn main() {} "} {"_id":"q-en-rust-6e8203554452ac60e944f7e6aa2fb96fe4ac5cd37402d89a7fb9ac69c0087fea","text":" A control-flow expression was used inside a const context. An unsupported expression was used inside a const context. Erroneous code example:"} {"_id":"q-en-rust-6e90958e6ecd5d0e9d6ba2dd9e35a23c943a1dd30337aa554ad3604c6e1a68cb","text":"// error-pattern: too big for the current fn main() { let fat : [u8, ..(1<<61)+(1<<31)] = [0, ..(1<<61)+(1<<31)]; let fat : [u8, ..(1<<61)+(1<<31)] = [0, ..(1u64<<61) as uint +(1u64<<31) as uint]; }"} {"_id":"q-en-rust-6ea3852ba204066d6df6f2c8d72c267749799c0476916c576d7b269c583220ac","text":"| LL | fn d() {} | ^ expected named lifetime parameter | help: consider introducing a named lifetime parameter | LL | fn d<'a, const C: S<'a>>() {} | +++ ++++ error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/unusual-rib-combinations.rs:29:22"} {"_id":"q-en-rust-6ebc58832d762e1c0ce8b084ea1271ed555d6f232a9db87215aa25907829c741","text":" Subproject commit 68ff8b19bc6705724d1e77a8dc17ffb8dfbbe26b Subproject commit edd90473ec5ba29b9ae1ee706c982e7046a6e63e "} {"_id":"q-en-rust-6eeefac4ff76985d2e37437e02be70c87d34e14a26c7b939f1c9af12adc8aad2","text":"IfExpression(a) => { format!(\"IfExpression({})\", a.repr(tcx)) } IfExpressionWithNoElse(a) => { format!(\"IfExpressionWithNoElse({})\", a.repr(tcx)) } } } }"} {"_id":"q-en-rust-6ef6b9388a7f496dd00ba4f9715a6756cb07e4ec6d31e3499dbb827363b558b2","text":" error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-gat.rs:2:21 | LL | type A: S = ()>; | ^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. "} {"_id":"q-en-rust-6ef9929fef58d1bdff550b3c8ac044c4b2a626fc53a5f27b183047a7d10d9de7","text":"#![feature(try_blocks)] fn main() { while try { false } {} //~ ERROR expected expression, found reserved keyword `try` while try { false } {} //~^ ERROR the trait bound `bool: std::ops::Try` is not satisfied }"} {"_id":"q-en-rust-6f20e50d0a74630cceef28a382781fc3586718b8459eb75df09b7cb49291f10d","text":"} } } // FIXME: also check auto-trait def-ids? (e.g. `impl Sync for Foo+Sync`)? } }"} {"_id":"q-en-rust-6f2660261c36578db62045580a617652cf7d8bd011cc79b8a151ecdf2e4c46b7","text":" error[E0106]: missing lifetime specifier --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ expected named lifetime parameter error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0106`. "} {"_id":"q-en-rust-6f5b713b531600d85f0a01729169aa33661b339b0e1c5f0bb200eddbc9b39157","text":" error: repetition matches empty token tree --> $DIR/issue-57597.rs:8:7 | LL | ($($($i:ident)?)+) => {}; | ^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:13:7 | LL | ($($($i:ident)?)*) => {}; | ^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:18:7 | LL | ($($($i:ident)?)?) => {}; | ^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:23:7 | LL | ($($($($i:ident)?)?)?) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:28:7 | LL | ($($($($i:ident)*)?)?) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:33:7 | LL | ($($($($i:ident)?)*)?) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:38:7 | LL | ($($($($i:ident)?)?)*) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:43:7 | LL | ($($($($i:ident)*)*)?) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:48:7 | LL | ($($($($i:ident)?)*)*) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:53:7 | LL | ($($($($i:ident)?)*)+) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:58:7 | LL | ($($($($i:ident)+)?)*) => {}; | ^^^^^^^^^^^^^^^^^^ error: repetition matches empty token tree --> $DIR/issue-57597.rs:63:7 | LL | ($($($($i:ident)+)*)?) => {}; | ^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors "} {"_id":"q-en-rust-6f6d06b0a0ad14364bb973838aa32f3a8f013da80a32488c893f1ac632b1312f","text":"// Does the expected pattern type originate from an expression and what is the span? let (origin_expr, ty_span) = match (decl.ty, decl.init) { (Some(ty), _) => (false, Some(ty.span)), // Bias towards the explicit user type. (Some(ty), _) => (None, Some(ty.span)), // Bias towards the explicit user type. (_, Some(init)) => { (true, Some(init.span.find_ancestor_inside(decl.span).unwrap_or(init.span))) (Some(init), Some(init.span.find_ancestor_inside(decl.span).unwrap_or(init.span))) } // No explicit type; so use the scrutinee. _ => (false, None), // We have `let $pat;`, so the expected type is unconstrained. _ => (None, None), // We have `let $pat;`, so the expected type is unconstrained. }; // Type check the pattern. Override if necessary to avoid knock-on errors."} {"_id":"q-en-rust-6f713abece3c456d06e5bc12ba655ce236b3d8da2cb66d89a17fd91b1e76e54d","text":"#[unstable(feature = \"scoped_tls\", reason = \"scoped TLS has yet to have wide enough use to fully consider stabilizing its interface\")] pub struct ScopedKey { inner: imp::KeyInner } pub struct ScopedKey { inner: fn() -> &'static imp::KeyInner } /// Declare a new scoped thread local storage key. ///"} {"_id":"q-en-rust-6f7871c5aaae61e5e8a266b20e3d46d00eac43dbde18e02baff51779946429ac","text":"/// an underlying type by providing a mutable reference. See [`Borrow`] /// for more information on borrowing as another type. #[stable(feature = \"rust1\", since = \"1.0.0\")] #[rustc_diagnostic_item = \"BorrowMut\"] pub trait BorrowMut: Borrow { /// Mutably borrows from an owned value. ///"} {"_id":"q-en-rust-6f7893da9b2164b9c21b41cdc7adc8bb926edb78d3488f03819d411fecd76a86","text":"&& let Some(pos) = args.iter().position(|arg| arg.hir_id == expr.hir_id) && let Some(arg) = fn_sig.decl.inputs.get(pos + offset) { let mut span: MultiSpan = arg.span.into(); span.push_span_label( arg.span, \"this parameter takes ownership of the value\".to_string(), ); let descr = match node.fn_kind() { Some(hir::intravisit::FnKind::ItemFn(..)) | None => \"function\", Some(hir::intravisit::FnKind::Method(..)) => \"method\", Some(hir::intravisit::FnKind::Closure) => \"closure\", }; span.push_span_label(ident.span, format!(\"in this {descr}\")); err.span_note( span, format!( \"consider changing this parameter type in {descr} `{ident}` to borrow instead if owning the value isn't necessary\", ), ); let mut is_mut = false; if let hir::TyKind::Path(hir::QPath::Resolved(None, path)) = arg.kind && let Res::Def(DefKind::TyParam, param_def_id) = path.res && self .infcx .tcx .predicates_of(def_id) .instantiate_identity(self.infcx.tcx) .predicates .into_iter() .any(|pred| { if let ty::ClauseKind::Trait(predicate) = pred.kind().skip_binder() && [ self.infcx.tcx.get_diagnostic_item(sym::AsRef), self.infcx.tcx.get_diagnostic_item(sym::AsMut), self.infcx.tcx.get_diagnostic_item(sym::Borrow), self.infcx.tcx.get_diagnostic_item(sym::BorrowMut), ] .contains(&Some(predicate.def_id())) && let ty::Param(param) = predicate.self_ty().kind() && let generics = self.infcx.tcx.generics_of(def_id) && let param = generics.type_param(*param, self.infcx.tcx) && param.def_id == param_def_id { if [ self.infcx.tcx.get_diagnostic_item(sym::AsMut), self.infcx.tcx.get_diagnostic_item(sym::BorrowMut), ] .contains(&Some(predicate.def_id())) { is_mut = true; } true } else { false } }) { // The type of the argument corresponding to the expression that got moved // is a type parameter `T`, which is has a `T: AsRef` obligation. err.span_suggestion_verbose( expr.span.shrink_to_lo(), \"borrow the value to avoid moving it\", format!(\"&{}\", if is_mut { \"mut \" } else { \"\" }), Applicability::MachineApplicable, ); can_suggest_clone = is_mut; } else { let mut span: MultiSpan = arg.span.into(); span.push_span_label( arg.span, \"this parameter takes ownership of the value\".to_string(), ); let descr = match node.fn_kind() { Some(hir::intravisit::FnKind::ItemFn(..)) | None => \"function\", Some(hir::intravisit::FnKind::Method(..)) => \"method\", Some(hir::intravisit::FnKind::Closure) => \"closure\", }; span.push_span_label(ident.span, format!(\"in this {descr}\")); err.span_note( span, format!( \"consider changing this parameter type in {descr} `{ident}` to borrow instead if owning the value isn't necessary\", ), ); } } let place = &self.move_data.move_paths[mpi].place; let ty = place.ty(self.body, self.infcx.tcx).ty;"} {"_id":"q-en-rust-6fddc24c4606dc7477730c9095876576aed09801469f66436326bc224558f971","text":"} // Don't report FFI errors for unit return types. This check exists here, and not in // `check_foreign_fn` (where it would make more sense) so that normalization has definitely // the caller (where it would make more sense) so that normalization has definitely // happened. if is_return_type && ty.is_unit() { return;"} {"_id":"q-en-rust-7001a7f205ca9861a20e7e790e03c52923c60e0d440d367ee78ea222a1da8ea4","text":"// Computing common supertype in an if expression IfExpression(Span), // Computing common supertype of an if expression with no else counter-part IfExpressionWithNoElse(Span) } /// See `error_reporting.rs` for more details"} {"_id":"q-en-rust-7034274869976c403f89e9442503a8903f47077ff9a3ddda839f1cf35ddf27f9","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that wrapping an unsized struct in an enum which gets optimised does // not ICE. struct Str { f: [u8] } fn main() { let str: Option<&Str> = None; str.is_some(); } "} {"_id":"q-en-rust-704031d84e126b99ff640069c082da95ba9819af7d09bf1c39e9f10aecf6f0d6","text":"} } } // just tests by whether or not this compiles fn _pending_impl_all_auto_traits() { use std::panic::{RefUnwindSafe, UnwindSafe}; fn all_auto_traits() {} all_auto_traits::>(); } "} {"_id":"q-en-rust-704826f2c1ccc90a2263643640aa87f494d5077bb4ac837dfd2a9dda2821a8a6","text":"() => ((file!(), line!())) } #[cfg(all(unix, not(target_os = \"macos\"), not(target_os = \"ios\"), not(target_os = \"android\"), not(all(target_os = \"linux\", target_arch = \"arm\"))))] macro_rules! dump_and_die { ($($pos:expr),*) => ({ // FIXME(#18285): we cannot include the current position because // the macro span takes over the last frame's file/line. dump_filelines(&[$($pos),*]); panic!(); if cfg!(target_os = \"macos\") || cfg!(target_os = \"ios\") || cfg!(target_os = \"android\") || cfg!(all(target_os = \"linux\", target_arch = \"arm\")) || cfg!(all(windows, target_env = \"gnu\")) { // skip these platforms as this support isn't implemented yet. } else { dump_filelines(&[$($pos),*]); panic!(); } }) } // this does not work on Windows, Android, OSX or iOS #[cfg(not(all(unix, not(target_os = \"macos\"), not(target_os = \"ios\"), not(target_os = \"android\"), not(all(target_os = \"linux\", target_arch = \"arm\")))))] macro_rules! dump_and_die { ($($pos:expr),*) => ({ let _ = [$($pos),*]; }) } // we can't use a function as it will alter the backtrace macro_rules! check { ($counter:expr; $($pos:expr),*) => ({"} {"_id":"q-en-rust-7056667870caa5c4389e2132ba66549631ab02685b24cbf766c50c4b7f4912ca","text":"// MACRO_RULES ITEM self.parse_item_macro_rules(vis, has_bang)? } else if self.isnt_macro_invocation() && (self.token.is_ident_named(sym::import) || self.token.is_ident_named(sym::using)) && (self.token.is_ident_named(sym::import) || self.token.is_ident_named(sym::using) || self.token.is_ident_named(sym::include) || self.token.is_ident_named(sym::require)) { return self.recover_import_as_use(); } else if self.isnt_macro_invocation() && vis.kind.is_pub() {"} {"_id":"q-en-rust-7064e3e450a17d58370b49def05b89f69a839f27cc541ab97619f4ef42ff924e","text":")?; write_minify(\"search.js\", static_files::SEARCH_JS)?; write_minify(\"settings.js\", static_files::SETTINGS_JS)?; write_minify(\"sidebar-items.js\", static_files::sidebar::ITEMS)?; if cx.shared.include_sources { write_minify(\"source-script.js\", static_files::sidebar::SOURCE_SCRIPT)?; }"} {"_id":"q-en-rust-7080dfbdc72cfe3c0e5c833d198a69c0615a924d43e36aafaaa3a02e466ab74d","text":" error[E0106]: missing lifetime specifier --> $DIR/opaque-and-lifetime-mismatch.rs:5:24 | LL | fn bar() -> Wrapper; | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | LL | fn bar() -> Wrapper<'static, impl Sized>; | ++++++++ error[E0412]: cannot find type `T` in this scope --> $DIR/opaque-and-lifetime-mismatch.rs:1:22 | LL | struct Wrapper<'rom>(T); | ^ not found in this scope | help: you might be missing a type parameter | LL | struct Wrapper<'rom, T>(T); | +++ error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/opaque-and-lifetime-mismatch.rs:5:17 | LL | fn bar() -> Wrapper; | ^^^^^^^ ---------- help: remove this generic argument | | | expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/opaque-and-lifetime-mismatch.rs:1:8 | LL | struct Wrapper<'rom>(T); | ^^^^^^^ error[E0053]: method `bar` has an incompatible return type for trait --> $DIR/opaque-and-lifetime-mismatch.rs:11:17 | LL | fn bar() -> i32 { | ^^^ | | | expected `Wrapper<'static>`, found `i32` | return type in trait error[E0053]: method `bar` has an incompatible type for trait --> $DIR/opaque-and-lifetime-mismatch.rs:11:17 | LL | fn bar() -> i32 { | ^^^ | | | expected `Wrapper<'static>`, found `i32` | help: change the output type to match the trait: `Wrapper<'static>` | note: type in trait --> $DIR/opaque-and-lifetime-mismatch.rs:5:17 | LL | fn bar() -> Wrapper; | ^^^^^^^^^^^^^^^^^^^ = note: expected signature `fn() -> Wrapper<'static>` found signature `fn() -> i32` error: aborting due to 5 previous errors Some errors have detailed explanations: E0053, E0106, E0107, E0412. For more information about an error, try `rustc --explain E0053`. "} {"_id":"q-en-rust-70dec8397775e1eaa1705a1ec97968a5456a8ee70af48206bcde47ea8f63eab5","text":" error[E0596]: cannot borrow `*inner` as mutable, as it is behind a `&` reference --> $DIR/issue-91206.rs:13:5 | LL | let inner = client.get_inner_ref(); | ----- help: consider changing this to be a mutable reference: `&mut Vec` LL | LL | inner.clear(); | ^^^^^^^^^^^^^ `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable error: aborting due to previous error For more information about this error, try `rustc --explain E0596`. "} {"_id":"q-en-rust-70ec1f573299b59e1b0bd082fc752ae3a57bafd440a8232edda25b696f011165","text":"use libc::types::os::arch::c95::{c_int, size_t}; pub static SIGTRAP : c_int = 5; pub static SIGPIPE: c_int = 13; pub static SIG_IGN: size_t = 1; pub static GLOB_ERR : c_int = 1 << 0; pub static GLOB_MARK : c_int = 1 << 1;"} {"_id":"q-en-rust-70f445cfc5866ae57726a237735a28f6b2164213c6a41e18cb17718e181b63be","text":" // edition:2021 #![feature(async_closure)] // Don't ICE in ByMove shim builder when MIR body is tainted by writeback errors fn main() { let _ = async || { used_fn(); //~^ ERROR cannot find function `used_fn` in this scope 0 }; } "} {"_id":"q-en-rust-70fc8aa0bbaa89b403091f4a745d53d2490d25e44b3f93d8f35be393b069515b","text":" error: invalid asm template string: unmatched `}` found --> $DIR/ice-bad-err-span-in-template-129503.rs:12:10 | LL | asm!(concat!(r#\"lJ𐏿Æ�.𐏿�\"#, \"r} {}\")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unmatched `}` in asm template string | = note: if you intended to print `}`, you can escape it using `}}` = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid asm template string: unmatched `}` found --> $DIR/ice-bad-err-span-in-template-129503.rs:18:10 | LL | asm!(concat!(\"abc\", \"r} {}\")); | ^^^^^^^^^^^^^^^^^^^^^^^ unmatched `}` in asm template string | = note: if you intended to print `}`, you can escape it using `}}` = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid asm template string: unmatched `}` found --> $DIR/ice-bad-err-span-in-template-129503.rs:24:19 | LL | asm!(\"abc\", \"r} {}\"); | ^ unmatched `}` in asm template string | = note: if you intended to print `}`, you can escape it using `}}` error: aborting due to 3 previous errors "} {"_id":"q-en-rust-71070add9c517bcee74ebe4e72b98b4ac27a29e228201dcfb95d41fdf93793fd","text":"} } let document_hidden = cx.render_options.document_hidden; let predicates = tcx.explicit_predicates_of(did); let (trait_items, generics) = match impl_item { Some(impl_) => ( impl_ .items .iter() .map(|item| tcx.hir().impl_item(item.id).clean(cx)) .map(|item| tcx.hir().impl_item(item.id)) .filter(|item| { // Filter out impl items whose corresponding trait item has `doc(hidden)` // not to document such impl items. // For inherent impls, we don't do any filtering, because that's already done in strip_hidden.rs. // When `--document-hidden-items` is passed, we don't // do any filtering, too. if document_hidden { return true; } if let Some(associated_trait) = associated_trait { let assoc_kind = match item.kind { hir::ImplItemKind::Const(..) => ty::AssocKind::Const, hir::ImplItemKind::Fn(..) => ty::AssocKind::Fn, hir::ImplItemKind::TyAlias(..) => ty::AssocKind::Type, }; let trait_item = tcx .associated_items(associated_trait.def_id) .find_by_name_and_kind( tcx, item.ident, assoc_kind, associated_trait.def_id, ) .unwrap(); // SAFETY: For all impl items there exists trait item that has the same name. !tcx.get_attrs(trait_item.def_id).lists(sym::doc).has_word(sym::hidden) } else { true } }) .map(|item| item.clean(cx)) .collect::>(), impl_.generics.clean(cx), ),"} {"_id":"q-en-rust-71372ec23b33bb04a1372883a3733ad58beae48fe13c63b5aaf27be936234552","text":"match ct.ty.kind() { ty::Uint(_) => {} ty::Bool => {} _ => { bug!(\"symbol_names: unsupported constant of type `{}` ({:?})\", ct.ty, ct); }"} {"_id":"q-en-rust-713750027e213bf62249d1c3daf30a0355e948f12607a350f291890c6e4deaac","text":"} #[test] fn test_buf_writer() { let mut buf = [0 as u8, ..8]; { let mut writer = BufWriter::new(buf); assert_eq!(writer.tell(), 0); writer.write([0]); assert_eq!(writer.tell(), 1); writer.write([1, 2, 3]); writer.write([4, 5, 6, 7]); assert_eq!(writer.tell(), 8); } assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7]); } #[test] fn test_buf_writer_seek() { let mut buf = [0 as u8, ..8]; { let mut writer = BufWriter::new(buf); assert_eq!(writer.tell(), 0); writer.write([1]); assert_eq!(writer.tell(), 1); writer.seek(2, SeekSet); assert_eq!(writer.tell(), 2); writer.write([2]); assert_eq!(writer.tell(), 3); writer.seek(-2, SeekCur); assert_eq!(writer.tell(), 1); writer.write([3]); assert_eq!(writer.tell(), 2); writer.seek(-1, SeekEnd); assert_eq!(writer.tell(), 7); writer.write([4]); assert_eq!(writer.tell(), 8); } assert_eq!(buf, [1, 3, 2, 0, 0, 0, 0, 4]); } #[test] fn test_buf_writer_error() { let mut buf = [0 as u8, ..2]; let mut writer = BufWriter::new(buf); writer.write([0]); let mut called = false; do io_error::cond.trap(|err| { assert_eq!(err.kind, OtherIoError); called = true; }).inside { writer.write([0, 0]); } assert!(called); } #[test] fn test_mem_reader() { let mut reader = MemReader::new(~[0, 1, 2, 3, 4, 5, 6, 7]); let mut buf = [];"} {"_id":"q-en-rust-713cf682d473c55416addf4a25f6b43219978f5443c57292a0008d399214a9db","text":"let const_did = tcx.def_map.borrow().get_copy(&pat.id).def_id(); let const_pty = ty::lookup_item_type(tcx, const_did); fcx.write_ty(pat.id, const_pty.ty); demand::eqtype(fcx, pat.span, expected, const_pty.ty); demand::suptype(fcx, pat.span, expected, const_pty.ty); } ast::PatIdent(bm, ref path, ref sub) if pat_is_binding(&tcx.def_map, pat) => { let typ = fcx.local_ty(pat.span, pat.id);"} {"_id":"q-en-rust-7144bcefea915c03e5dfd35df1670c127d3ce4e874603d1e721e39e25ffbe2eb","text":" const A: usize ⩵ 2; //~^ ERROR unknown start of token: u{2a75} //~| ERROR unexpected `==` "} {"_id":"q-en-rust-715ae37313cc1ce39cc6061348575d82e35e4e45e029f115c702425862986851","text":"{ continue; } // opaque types generated when desugaring an async function can have a single // use lifetime even if it is explicitly denied (Issue #77175) if let hir::Node::Item(hir::Item { kind: hir::ItemKind::OpaqueTy(ref opaque), .. }) = self.tcx.hir().get(parent_hir_id) { if opaque.origin != hir::OpaqueTyOrigin::AsyncFn { continue 'lifetimes; } // We want to do this only if the liftime identifier is already defined // in the async function that generated this. Otherwise it could be // an opaque type defined by the developer and we still want this // lint to fail compilation for p in opaque.generics.params { if defined_by.contains_key(&p.name) { continue 'lifetimes; } } } } }"} {"_id":"q-en-rust-7196bb8e803928fa687b79f3d843faef3632ab74d6f12d988e672f22f367634b","text":"// FIXME: This can be smarter and take `StorageDead` into account (which // invalidates borrows). if self.ever_borrowed_locals.contains(dest.local) && self.ever_borrowed_locals.contains(src.local) || self.ever_borrowed_locals.contains(src.local) { return; }"} {"_id":"q-en-rust-71bd7d7c58fcce0bdcdd81341679592a48b2185b034331a87f13709d9c80f533","text":") .fold_with(&mut collector); if !unnormalized_trait_sig.output().references_error() { debug_assert_ne!( collector.types.len(), 0, \"expect >1 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`\" ); } let trait_sig = ocx.normalize(&misc_cause, param_env, unnormalized_trait_sig); trait_sig.error_reported()?; let trait_return_ty = trait_sig.output();"} {"_id":"q-en-rust-71e9fb0594e9408fbf1ed9550f6ccb14772a345e7debe383b8a60800cd0f7e12","text":"} pub fn ext(&mut self, ext: ArgExtension) -> &mut Self { assert!(self.arg_ext == ArgExtension::None || self.arg_ext == ext); assert!( self.arg_ext == ArgExtension::None || self.arg_ext == ext, \"cannot set {:?} when {:?} is already set\", ext, self.arg_ext ); self.arg_ext = ext; self }"} {"_id":"q-en-rust-72308b5d3c69abeaab9b4b4da20ab64cd6d91cf3c683406d9788949a430c8103","text":"} /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. /// If The dylib_path_par is already set for this cmd, the old value will be overwritten! /// If the dylib_path_var is already set for this cmd, the old value will be overwritten! pub fn add_dylib_path(path: Vec, cmd: &mut Command) { let mut list = dylib_path(); for path in path {"} {"_id":"q-en-rust-72362443f1003048411db653e955efa597c34de8fc70af627c67f9d599a5fc03","text":"#[diag(lint_supertrait_as_deref_target)] pub struct SupertraitAsDerefTarget<'a> { pub t: Ty<'a>, pub target_principal: String, // pub target_principal: Binder<'a, ExistentialTraitRef<'b>>, pub target_principal: PolyExistentialTraitRef<'a>, #[subdiagnostic] pub label: Option, }"} {"_id":"q-en-rust-723d142671a5fd02eb89331a9e88711d360e5c66ec09b71461ce8cd2a6926898","text":" // build-pass // ignore-tidy-filelength #![crate_type=\"rlib\"] fn banana(v: &str) -> u32 { match v { \"0\" => 0, \"1\" => 1, \"2\" => 2, \"3\" => 3, \"4\" => 4, \"5\" => 5, \"6\" => 6, \"7\" => 7, \"8\" => 8, \"9\" => 9, \"10\" => 10, \"11\" => 11, \"12\" => 12, \"13\" => 13, \"14\" => 14, \"15\" => 15, \"16\" => 16, \"17\" => 17, \"18\" => 18, \"19\" => 19, \"20\" => 20, \"21\" => 21, \"22\" => 22, \"23\" => 23, \"24\" => 24, \"25\" => 25, \"26\" => 26, \"27\" => 27, \"28\" => 28, \"29\" => 29, \"30\" => 30, \"31\" => 31, \"32\" => 32, \"33\" => 33, \"34\" => 34, \"35\" => 35, \"36\" => 36, \"37\" => 37, \"38\" => 38, \"39\" => 39, \"40\" => 40, \"41\" => 41, \"42\" => 42, \"43\" => 43, \"44\" => 44, \"45\" => 45, \"46\" => 46, \"47\" => 47, \"48\" => 48, \"49\" => 49, \"50\" => 50, \"51\" => 51, \"52\" => 52, \"53\" => 53, \"54\" => 54, \"55\" => 55, \"56\" => 56, \"57\" => 57, \"58\" => 58, \"59\" => 59, \"60\" => 60, \"61\" => 61, \"62\" => 62, \"63\" => 63, \"64\" => 64, \"65\" => 65, \"66\" => 66, \"67\" => 67, \"68\" => 68, \"69\" => 69, \"70\" => 70, \"71\" => 71, \"72\" => 72, \"73\" => 73, \"74\" => 74, \"75\" => 75, \"76\" => 76, \"77\" => 77, \"78\" => 78, \"79\" => 79, \"80\" => 80, \"81\" => 81, \"82\" => 82, \"83\" => 83, \"84\" => 84, \"85\" => 85, \"86\" => 86, \"87\" => 87, \"88\" => 88, \"89\" => 89, \"90\" => 90, \"91\" => 91, \"92\" => 92, \"93\" => 93, \"94\" => 94, \"95\" => 95, \"96\" => 96, \"97\" => 97, \"98\" => 98, \"99\" => 99, \"100\" => 100, \"101\" => 101, \"102\" => 102, \"103\" => 103, \"104\" => 104, \"105\" => 105, \"106\" => 106, \"107\" => 107, \"108\" => 108, \"109\" => 109, \"110\" => 110, \"111\" => 111, \"112\" => 112, \"113\" => 113, \"114\" => 114, \"115\" => 115, \"116\" => 116, \"117\" => 117, \"118\" => 118, \"119\" => 119, \"120\" => 120, \"121\" => 121, \"122\" => 122, \"123\" => 123, \"124\" => 124, \"125\" => 125, \"126\" => 126, \"127\" => 127, \"128\" => 128, \"129\" => 129, \"130\" => 130, \"131\" => 131, \"132\" => 132, \"133\" => 133, \"134\" => 134, \"135\" => 135, \"136\" => 136, \"137\" => 137, \"138\" => 138, \"139\" => 139, \"140\" => 140, \"141\" => 141, \"142\" => 142, \"143\" => 143, \"144\" => 144, \"145\" => 145, \"146\" => 146, \"147\" => 147, \"148\" => 148, \"149\" => 149, \"150\" => 150, \"151\" => 151, \"152\" => 152, \"153\" => 153, \"154\" => 154, \"155\" => 155, \"156\" => 156, \"157\" => 157, \"158\" => 158, \"159\" => 159, \"160\" => 160, \"161\" => 161, \"162\" => 162, \"163\" => 163, \"164\" => 164, \"165\" => 165, \"166\" => 166, \"167\" => 167, \"168\" => 168, \"169\" => 169, \"170\" => 170, \"171\" => 171, \"172\" => 172, \"173\" => 173, \"174\" => 174, \"175\" => 175, \"176\" => 176, \"177\" => 177, \"178\" => 178, \"179\" => 179, \"180\" => 180, \"181\" => 181, \"182\" => 182, \"183\" => 183, \"184\" => 184, \"185\" => 185, \"186\" => 186, \"187\" => 187, \"188\" => 188, \"189\" => 189, \"190\" => 190, \"191\" => 191, \"192\" => 192, \"193\" => 193, \"194\" => 194, \"195\" => 195, \"196\" => 196, \"197\" => 197, \"198\" => 198, \"199\" => 199, \"200\" => 200, \"201\" => 201, \"202\" => 202, \"203\" => 203, \"204\" => 204, \"205\" => 205, \"206\" => 206, \"207\" => 207, \"208\" => 208, \"209\" => 209, \"210\" => 210, \"211\" => 211, \"212\" => 212, \"213\" => 213, \"214\" => 214, \"215\" => 215, \"216\" => 216, \"217\" => 217, \"218\" => 218, \"219\" => 219, \"220\" => 220, \"221\" => 221, \"222\" => 222, \"223\" => 223, \"224\" => 224, \"225\" => 225, \"226\" => 226, \"227\" => 227, \"228\" => 228, \"229\" => 229, \"230\" => 230, \"231\" => 231, \"232\" => 232, \"233\" => 233, \"234\" => 234, \"235\" => 235, \"236\" => 236, \"237\" => 237, \"238\" => 238, \"239\" => 239, \"240\" => 240, \"241\" => 241, \"242\" => 242, \"243\" => 243, \"244\" => 244, \"245\" => 245, \"246\" => 246, \"247\" => 247, \"248\" => 248, \"249\" => 249, \"250\" => 250, \"251\" => 251, \"252\" => 252, \"253\" => 253, \"254\" => 254, \"255\" => 255, \"256\" => 256, \"257\" => 257, \"258\" => 258, \"259\" => 259, \"260\" => 260, \"261\" => 261, \"262\" => 262, \"263\" => 263, \"264\" => 264, \"265\" => 265, \"266\" => 266, \"267\" => 267, \"268\" => 268, \"269\" => 269, \"270\" => 270, \"271\" => 271, \"272\" => 272, \"273\" => 273, \"274\" => 274, \"275\" => 275, \"276\" => 276, \"277\" => 277, \"278\" => 278, \"279\" => 279, \"280\" => 280, \"281\" => 281, \"282\" => 282, \"283\" => 283, \"284\" => 284, \"285\" => 285, \"286\" => 286, \"287\" => 287, \"288\" => 288, \"289\" => 289, \"290\" => 290, \"291\" => 291, \"292\" => 292, \"293\" => 293, \"294\" => 294, \"295\" => 295, \"296\" => 296, \"297\" => 297, \"298\" => 298, \"299\" => 299, \"300\" => 300, \"301\" => 301, \"302\" => 302, \"303\" => 303, \"304\" => 304, \"305\" => 305, \"306\" => 306, \"307\" => 307, \"308\" => 308, \"309\" => 309, \"310\" => 310, \"311\" => 311, \"312\" => 312, \"313\" => 313, \"314\" => 314, \"315\" => 315, \"316\" => 316, \"317\" => 317, \"318\" => 318, \"319\" => 319, \"320\" => 320, \"321\" => 321, \"322\" => 322, \"323\" => 323, \"324\" => 324, \"325\" => 325, \"326\" => 326, \"327\" => 327, \"328\" => 328, \"329\" => 329, \"330\" => 330, \"331\" => 331, \"332\" => 332, \"333\" => 333, \"334\" => 334, \"335\" => 335, \"336\" => 336, \"337\" => 337, \"338\" => 338, \"339\" => 339, \"340\" => 340, \"341\" => 341, \"342\" => 342, \"343\" => 343, \"344\" => 344, \"345\" => 345, \"346\" => 346, \"347\" => 347, \"348\" => 348, \"349\" => 349, \"350\" => 350, \"351\" => 351, \"352\" => 352, \"353\" => 353, \"354\" => 354, \"355\" => 355, \"356\" => 356, \"357\" => 357, \"358\" => 358, \"359\" => 359, \"360\" => 360, \"361\" => 361, \"362\" => 362, \"363\" => 363, \"364\" => 364, \"365\" => 365, \"366\" => 366, \"367\" => 367, \"368\" => 368, \"369\" => 369, \"370\" => 370, \"371\" => 371, \"372\" => 372, \"373\" => 373, \"374\" => 374, \"375\" => 375, \"376\" => 376, \"377\" => 377, \"378\" => 378, \"379\" => 379, \"380\" => 380, \"381\" => 381, \"382\" => 382, \"383\" => 383, \"384\" => 384, \"385\" => 385, \"386\" => 386, \"387\" => 387, \"388\" => 388, \"389\" => 389, \"390\" => 390, \"391\" => 391, \"392\" => 392, \"393\" => 393, \"394\" => 394, \"395\" => 395, \"396\" => 396, \"397\" => 397, \"398\" => 398, \"399\" => 399, \"400\" => 400, \"401\" => 401, \"402\" => 402, \"403\" => 403, \"404\" => 404, \"405\" => 405, \"406\" => 406, \"407\" => 407, \"408\" => 408, \"409\" => 409, \"410\" => 410, \"411\" => 411, \"412\" => 412, \"413\" => 413, \"414\" => 414, \"415\" => 415, \"416\" => 416, \"417\" => 417, \"418\" => 418, \"419\" => 419, \"420\" => 420, \"421\" => 421, \"422\" => 422, \"423\" => 423, \"424\" => 424, \"425\" => 425, \"426\" => 426, \"427\" => 427, \"428\" => 428, \"429\" => 429, \"430\" => 430, \"431\" => 431, \"432\" => 432, \"433\" => 433, \"434\" => 434, \"435\" => 435, \"436\" => 436, \"437\" => 437, \"438\" => 438, \"439\" => 439, \"440\" => 440, \"441\" => 441, \"442\" => 442, \"443\" => 443, \"444\" => 444, \"445\" => 445, \"446\" => 446, \"447\" => 447, \"448\" => 448, \"449\" => 449, \"450\" => 450, \"451\" => 451, \"452\" => 452, \"453\" => 453, \"454\" => 454, \"455\" => 455, \"456\" => 456, \"457\" => 457, \"458\" => 458, \"459\" => 459, \"460\" => 460, \"461\" => 461, \"462\" => 462, \"463\" => 463, \"464\" => 464, \"465\" => 465, \"466\" => 466, \"467\" => 467, \"468\" => 468, \"469\" => 469, \"470\" => 470, \"471\" => 471, \"472\" => 472, \"473\" => 473, \"474\" => 474, \"475\" => 475, \"476\" => 476, \"477\" => 477, \"478\" => 478, \"479\" => 479, \"480\" => 480, \"481\" => 481, \"482\" => 482, \"483\" => 483, \"484\" => 484, \"485\" => 485, \"486\" => 486, \"487\" => 487, \"488\" => 488, \"489\" => 489, \"490\" => 490, \"491\" => 491, \"492\" => 492, \"493\" => 493, \"494\" => 494, \"495\" => 495, \"496\" => 496, \"497\" => 497, \"498\" => 498, \"499\" => 499, \"500\" => 500, \"501\" => 501, \"502\" => 502, \"503\" => 503, \"504\" => 504, \"505\" => 505, \"506\" => 506, \"507\" => 507, \"508\" => 508, \"509\" => 509, \"510\" => 510, \"511\" => 511, \"512\" => 512, \"513\" => 513, \"514\" => 514, \"515\" => 515, \"516\" => 516, \"517\" => 517, \"518\" => 518, \"519\" => 519, \"520\" => 520, \"521\" => 521, \"522\" => 522, \"523\" => 523, \"524\" => 524, \"525\" => 525, \"526\" => 526, \"527\" => 527, \"528\" => 528, \"529\" => 529, \"530\" => 530, \"531\" => 531, \"532\" => 532, \"533\" => 533, \"534\" => 534, \"535\" => 535, \"536\" => 536, \"537\" => 537, \"538\" => 538, \"539\" => 539, \"540\" => 540, \"541\" => 541, \"542\" => 542, \"543\" => 543, \"544\" => 544, \"545\" => 545, \"546\" => 546, \"547\" => 547, \"548\" => 548, \"549\" => 549, \"550\" => 550, \"551\" => 551, \"552\" => 552, \"553\" => 553, \"554\" => 554, \"555\" => 555, \"556\" => 556, \"557\" => 557, \"558\" => 558, \"559\" => 559, \"560\" => 560, \"561\" => 561, \"562\" => 562, \"563\" => 563, \"564\" => 564, \"565\" => 565, \"566\" => 566, \"567\" => 567, \"568\" => 568, \"569\" => 569, \"570\" => 570, \"571\" => 571, \"572\" => 572, \"573\" => 573, \"574\" => 574, \"575\" => 575, \"576\" => 576, \"577\" => 577, \"578\" => 578, \"579\" => 579, \"580\" => 580, \"581\" => 581, \"582\" => 582, \"583\" => 583, \"584\" => 584, \"585\" => 585, \"586\" => 586, \"587\" => 587, \"588\" => 588, \"589\" => 589, \"590\" => 590, \"591\" => 591, \"592\" => 592, \"593\" => 593, \"594\" => 594, \"595\" => 595, \"596\" => 596, \"597\" => 597, \"598\" => 598, \"599\" => 599, \"600\" => 600, \"601\" => 601, \"602\" => 602, \"603\" => 603, \"604\" => 604, \"605\" => 605, \"606\" => 606, \"607\" => 607, \"608\" => 608, \"609\" => 609, \"610\" => 610, \"611\" => 611, \"612\" => 612, \"613\" => 613, \"614\" => 614, \"615\" => 615, \"616\" => 616, \"617\" => 617, \"618\" => 618, \"619\" => 619, \"620\" => 620, \"621\" => 621, \"622\" => 622, \"623\" => 623, \"624\" => 624, \"625\" => 625, \"626\" => 626, \"627\" => 627, \"628\" => 628, \"629\" => 629, \"630\" => 630, \"631\" => 631, \"632\" => 632, \"633\" => 633, \"634\" => 634, \"635\" => 635, \"636\" => 636, \"637\" => 637, \"638\" => 638, \"639\" => 639, \"640\" => 640, \"641\" => 641, \"642\" => 642, \"643\" => 643, \"644\" => 644, \"645\" => 645, \"646\" => 646, \"647\" => 647, \"648\" => 648, \"649\" => 649, \"650\" => 650, \"651\" => 651, \"652\" => 652, \"653\" => 653, \"654\" => 654, \"655\" => 655, \"656\" => 656, \"657\" => 657, \"658\" => 658, \"659\" => 659, \"660\" => 660, \"661\" => 661, \"662\" => 662, \"663\" => 663, \"664\" => 664, \"665\" => 665, \"666\" => 666, \"667\" => 667, \"668\" => 668, \"669\" => 669, \"670\" => 670, \"671\" => 671, \"672\" => 672, \"673\" => 673, \"674\" => 674, \"675\" => 675, \"676\" => 676, \"677\" => 677, \"678\" => 678, \"679\" => 679, \"680\" => 680, \"681\" => 681, \"682\" => 682, \"683\" => 683, \"684\" => 684, \"685\" => 685, \"686\" => 686, \"687\" => 687, \"688\" => 688, \"689\" => 689, \"690\" => 690, \"691\" => 691, \"692\" => 692, \"693\" => 693, \"694\" => 694, \"695\" => 695, \"696\" => 696, \"697\" => 697, \"698\" => 698, \"699\" => 699, \"700\" => 700, \"701\" => 701, \"702\" => 702, \"703\" => 703, \"704\" => 704, \"705\" => 705, \"706\" => 706, \"707\" => 707, \"708\" => 708, \"709\" => 709, \"710\" => 710, \"711\" => 711, \"712\" => 712, \"713\" => 713, \"714\" => 714, \"715\" => 715, \"716\" => 716, \"717\" => 717, \"718\" => 718, \"719\" => 719, \"720\" => 720, \"721\" => 721, \"722\" => 722, \"723\" => 723, \"724\" => 724, \"725\" => 725, \"726\" => 726, \"727\" => 727, \"728\" => 728, \"729\" => 729, \"730\" => 730, \"731\" => 731, \"732\" => 732, \"733\" => 733, \"734\" => 734, \"735\" => 735, \"736\" => 736, \"737\" => 737, \"738\" => 738, \"739\" => 739, \"740\" => 740, \"741\" => 741, \"742\" => 742, \"743\" => 743, \"744\" => 744, \"745\" => 745, \"746\" => 746, \"747\" => 747, \"748\" => 748, \"749\" => 749, \"750\" => 750, \"751\" => 751, \"752\" => 752, \"753\" => 753, \"754\" => 754, \"755\" => 755, \"756\" => 756, \"757\" => 757, \"758\" => 758, \"759\" => 759, \"760\" => 760, \"761\" => 761, \"762\" => 762, \"763\" => 763, \"764\" => 764, \"765\" => 765, \"766\" => 766, \"767\" => 767, \"768\" => 768, \"769\" => 769, \"770\" => 770, \"771\" => 771, \"772\" => 772, \"773\" => 773, \"774\" => 774, \"775\" => 775, \"776\" => 776, \"777\" => 777, \"778\" => 778, \"779\" => 779, \"780\" => 780, \"781\" => 781, \"782\" => 782, \"783\" => 783, \"784\" => 784, \"785\" => 785, \"786\" => 786, \"787\" => 787, \"788\" => 788, \"789\" => 789, \"790\" => 790, \"791\" => 791, \"792\" => 792, \"793\" => 793, \"794\" => 794, \"795\" => 795, \"796\" => 796, \"797\" => 797, \"798\" => 798, \"799\" => 799, \"800\" => 800, \"801\" => 801, \"802\" => 802, \"803\" => 803, \"804\" => 804, \"805\" => 805, \"806\" => 806, \"807\" => 807, \"808\" => 808, \"809\" => 809, \"810\" => 810, \"811\" => 811, \"812\" => 812, \"813\" => 813, \"814\" => 814, \"815\" => 815, \"816\" => 816, \"817\" => 817, \"818\" => 818, \"819\" => 819, \"820\" => 820, \"821\" => 821, \"822\" => 822, \"823\" => 823, \"824\" => 824, \"825\" => 825, \"826\" => 826, \"827\" => 827, \"828\" => 828, \"829\" => 829, \"830\" => 830, \"831\" => 831, \"832\" => 832, \"833\" => 833, \"834\" => 834, \"835\" => 835, \"836\" => 836, \"837\" => 837, \"838\" => 838, \"839\" => 839, \"840\" => 840, \"841\" => 841, \"842\" => 842, \"843\" => 843, \"844\" => 844, \"845\" => 845, \"846\" => 846, \"847\" => 847, \"848\" => 848, \"849\" => 849, \"850\" => 850, \"851\" => 851, \"852\" => 852, \"853\" => 853, \"854\" => 854, \"855\" => 855, \"856\" => 856, \"857\" => 857, \"858\" => 858, \"859\" => 859, \"860\" => 860, \"861\" => 861, \"862\" => 862, \"863\" => 863, \"864\" => 864, \"865\" => 865, \"866\" => 866, \"867\" => 867, \"868\" => 868, \"869\" => 869, \"870\" => 870, \"871\" => 871, \"872\" => 872, \"873\" => 873, \"874\" => 874, \"875\" => 875, \"876\" => 876, \"877\" => 877, \"878\" => 878, \"879\" => 879, \"880\" => 880, \"881\" => 881, \"882\" => 882, \"883\" => 883, \"884\" => 884, \"885\" => 885, \"886\" => 886, \"887\" => 887, \"888\" => 888, \"889\" => 889, \"890\" => 890, \"891\" => 891, \"892\" => 892, \"893\" => 893, \"894\" => 894, \"895\" => 895, \"896\" => 896, \"897\" => 897, \"898\" => 898, \"899\" => 899, \"900\" => 900, \"901\" => 901, \"902\" => 902, \"903\" => 903, \"904\" => 904, \"905\" => 905, \"906\" => 906, \"907\" => 907, \"908\" => 908, \"909\" => 909, \"910\" => 910, \"911\" => 911, \"912\" => 912, \"913\" => 913, \"914\" => 914, \"915\" => 915, \"916\" => 916, \"917\" => 917, \"918\" => 918, \"919\" => 919, \"920\" => 920, \"921\" => 921, \"922\" => 922, \"923\" => 923, \"924\" => 924, \"925\" => 925, \"926\" => 926, \"927\" => 927, \"928\" => 928, \"929\" => 929, \"930\" => 930, \"931\" => 931, \"932\" => 932, \"933\" => 933, \"934\" => 934, \"935\" => 935, \"936\" => 936, \"937\" => 937, \"938\" => 938, \"939\" => 939, \"940\" => 940, \"941\" => 941, \"942\" => 942, \"943\" => 943, \"944\" => 944, \"945\" => 945, \"946\" => 946, \"947\" => 947, \"948\" => 948, \"949\" => 949, \"950\" => 950, \"951\" => 951, \"952\" => 952, \"953\" => 953, \"954\" => 954, \"955\" => 955, \"956\" => 956, \"957\" => 957, \"958\" => 958, \"959\" => 959, \"960\" => 960, \"961\" => 961, \"962\" => 962, \"963\" => 963, \"964\" => 964, \"965\" => 965, \"966\" => 966, \"967\" => 967, \"968\" => 968, \"969\" => 969, \"970\" => 970, \"971\" => 971, \"972\" => 972, \"973\" => 973, \"974\" => 974, \"975\" => 975, \"976\" => 976, \"977\" => 977, \"978\" => 978, \"979\" => 979, \"980\" => 980, \"981\" => 981, \"982\" => 982, \"983\" => 983, \"984\" => 984, \"985\" => 985, \"986\" => 986, \"987\" => 987, \"988\" => 988, \"989\" => 989, \"990\" => 990, \"991\" => 991, \"992\" => 992, \"993\" => 993, \"994\" => 994, \"995\" => 995, \"996\" => 996, \"997\" => 997, \"998\" => 998, \"999\" => 999, \"1000\" => 1000, \"1001\" => 1001, \"1002\" => 1002, \"1003\" => 1003, \"1004\" => 1004, \"1005\" => 1005, \"1006\" => 1006, \"1007\" => 1007, \"1008\" => 1008, \"1009\" => 1009, \"1010\" => 1010, \"1011\" => 1011, \"1012\" => 1012, \"1013\" => 1013, \"1014\" => 1014, \"1015\" => 1015, \"1016\" => 1016, \"1017\" => 1017, \"1018\" => 1018, \"1019\" => 1019, \"1020\" => 1020, \"1021\" => 1021, \"1022\" => 1022, \"1023\" => 1023, \"1024\" => 1024, \"1025\" => 1025, \"1026\" => 1026, \"1027\" => 1027, \"1028\" => 1028, \"1029\" => 1029, \"1030\" => 1030, \"1031\" => 1031, \"1032\" => 1032, \"1033\" => 1033, \"1034\" => 1034, \"1035\" => 1035, \"1036\" => 1036, \"1037\" => 1037, \"1038\" => 1038, \"1039\" => 1039, \"1040\" => 1040, \"1041\" => 1041, \"1042\" => 1042, \"1043\" => 1043, \"1044\" => 1044, \"1045\" => 1045, \"1046\" => 1046, \"1047\" => 1047, \"1048\" => 1048, \"1049\" => 1049, \"1050\" => 1050, \"1051\" => 1051, \"1052\" => 1052, \"1053\" => 1053, \"1054\" => 1054, \"1055\" => 1055, \"1056\" => 1056, \"1057\" => 1057, \"1058\" => 1058, \"1059\" => 1059, \"1060\" => 1060, \"1061\" => 1061, \"1062\" => 1062, \"1063\" => 1063, \"1064\" => 1064, \"1065\" => 1065, \"1066\" => 1066, \"1067\" => 1067, \"1068\" => 1068, \"1069\" => 1069, \"1070\" => 1070, \"1071\" => 1071, \"1072\" => 1072, \"1073\" => 1073, \"1074\" => 1074, \"1075\" => 1075, \"1076\" => 1076, \"1077\" => 1077, \"1078\" => 1078, \"1079\" => 1079, \"1080\" => 1080, \"1081\" => 1081, \"1082\" => 1082, \"1083\" => 1083, \"1084\" => 1084, \"1085\" => 1085, \"1086\" => 1086, \"1087\" => 1087, \"1088\" => 1088, \"1089\" => 1089, \"1090\" => 1090, \"1091\" => 1091, \"1092\" => 1092, \"1093\" => 1093, \"1094\" => 1094, \"1095\" => 1095, \"1096\" => 1096, \"1097\" => 1097, \"1098\" => 1098, \"1099\" => 1099, \"1100\" => 1100, \"1101\" => 1101, \"1102\" => 1102, \"1103\" => 1103, \"1104\" => 1104, \"1105\" => 1105, \"1106\" => 1106, \"1107\" => 1107, \"1108\" => 1108, \"1109\" => 1109, \"1110\" => 1110, \"1111\" => 1111, \"1112\" => 1112, \"1113\" => 1113, \"1114\" => 1114, \"1115\" => 1115, \"1116\" => 1116, \"1117\" => 1117, \"1118\" => 1118, \"1119\" => 1119, \"1120\" => 1120, \"1121\" => 1121, \"1122\" => 1122, \"1123\" => 1123, \"1124\" => 1124, \"1125\" => 1125, \"1126\" => 1126, \"1127\" => 1127, \"1128\" => 1128, \"1129\" => 1129, \"1130\" => 1130, \"1131\" => 1131, \"1132\" => 1132, \"1133\" => 1133, \"1134\" => 1134, \"1135\" => 1135, \"1136\" => 1136, \"1137\" => 1137, \"1138\" => 1138, \"1139\" => 1139, \"1140\" => 1140, \"1141\" => 1141, \"1142\" => 1142, \"1143\" => 1143, \"1144\" => 1144, \"1145\" => 1145, \"1146\" => 1146, \"1147\" => 1147, \"1148\" => 1148, \"1149\" => 1149, \"1150\" => 1150, \"1151\" => 1151, \"1152\" => 1152, \"1153\" => 1153, \"1154\" => 1154, \"1155\" => 1155, \"1156\" => 1156, \"1157\" => 1157, \"1158\" => 1158, \"1159\" => 1159, \"1160\" => 1160, \"1161\" => 1161, \"1162\" => 1162, \"1163\" => 1163, \"1164\" => 1164, \"1165\" => 1165, \"1166\" => 1166, \"1167\" => 1167, \"1168\" => 1168, \"1169\" => 1169, \"1170\" => 1170, \"1171\" => 1171, \"1172\" => 1172, \"1173\" => 1173, \"1174\" => 1174, \"1175\" => 1175, \"1176\" => 1176, \"1177\" => 1177, \"1178\" => 1178, \"1179\" => 1179, \"1180\" => 1180, \"1181\" => 1181, \"1182\" => 1182, \"1183\" => 1183, \"1184\" => 1184, \"1185\" => 1185, \"1186\" => 1186, \"1187\" => 1187, \"1188\" => 1188, \"1189\" => 1189, \"1190\" => 1190, \"1191\" => 1191, \"1192\" => 1192, \"1193\" => 1193, \"1194\" => 1194, \"1195\" => 1195, \"1196\" => 1196, \"1197\" => 1197, \"1198\" => 1198, \"1199\" => 1199, \"1200\" => 1200, \"1201\" => 1201, \"1202\" => 1202, \"1203\" => 1203, \"1204\" => 1204, \"1205\" => 1205, \"1206\" => 1206, \"1207\" => 1207, \"1208\" => 1208, \"1209\" => 1209, \"1210\" => 1210, \"1211\" => 1211, \"1212\" => 1212, \"1213\" => 1213, \"1214\" => 1214, \"1215\" => 1215, \"1216\" => 1216, \"1217\" => 1217, \"1218\" => 1218, \"1219\" => 1219, \"1220\" => 1220, \"1221\" => 1221, \"1222\" => 1222, \"1223\" => 1223, \"1224\" => 1224, \"1225\" => 1225, \"1226\" => 1226, \"1227\" => 1227, \"1228\" => 1228, \"1229\" => 1229, \"1230\" => 1230, \"1231\" => 1231, \"1232\" => 1232, \"1233\" => 1233, \"1234\" => 1234, \"1235\" => 1235, \"1236\" => 1236, \"1237\" => 1237, \"1238\" => 1238, \"1239\" => 1239, \"1240\" => 1240, \"1241\" => 1241, \"1242\" => 1242, \"1243\" => 1243, \"1244\" => 1244, \"1245\" => 1245, \"1246\" => 1246, \"1247\" => 1247, \"1248\" => 1248, \"1249\" => 1249, \"1250\" => 1250, \"1251\" => 1251, \"1252\" => 1252, \"1253\" => 1253, \"1254\" => 1254, \"1255\" => 1255, \"1256\" => 1256, \"1257\" => 1257, \"1258\" => 1258, \"1259\" => 1259, \"1260\" => 1260, \"1261\" => 1261, \"1262\" => 1262, \"1263\" => 1263, \"1264\" => 1264, \"1265\" => 1265, \"1266\" => 1266, \"1267\" => 1267, \"1268\" => 1268, \"1269\" => 1269, \"1270\" => 1270, \"1271\" => 1271, \"1272\" => 1272, \"1273\" => 1273, \"1274\" => 1274, \"1275\" => 1275, \"1276\" => 1276, \"1277\" => 1277, \"1278\" => 1278, \"1279\" => 1279, \"1280\" => 1280, \"1281\" => 1281, \"1282\" => 1282, \"1283\" => 1283, \"1284\" => 1284, \"1285\" => 1285, \"1286\" => 1286, \"1287\" => 1287, \"1288\" => 1288, \"1289\" => 1289, \"1290\" => 1290, \"1291\" => 1291, \"1292\" => 1292, \"1293\" => 1293, \"1294\" => 1294, \"1295\" => 1295, \"1296\" => 1296, \"1297\" => 1297, \"1298\" => 1298, \"1299\" => 1299, \"1300\" => 1300, \"1301\" => 1301, \"1302\" => 1302, \"1303\" => 1303, \"1304\" => 1304, \"1305\" => 1305, \"1306\" => 1306, \"1307\" => 1307, \"1308\" => 1308, \"1309\" => 1309, \"1310\" => 1310, \"1311\" => 1311, \"1312\" => 1312, \"1313\" => 1313, \"1314\" => 1314, \"1315\" => 1315, \"1316\" => 1316, \"1317\" => 1317, \"1318\" => 1318, \"1319\" => 1319, \"1320\" => 1320, \"1321\" => 1321, \"1322\" => 1322, \"1323\" => 1323, \"1324\" => 1324, \"1325\" => 1325, \"1326\" => 1326, \"1327\" => 1327, \"1328\" => 1328, \"1329\" => 1329, \"1330\" => 1330, \"1331\" => 1331, \"1332\" => 1332, \"1333\" => 1333, \"1334\" => 1334, \"1335\" => 1335, \"1336\" => 1336, \"1337\" => 1337, \"1338\" => 1338, \"1339\" => 1339, \"1340\" => 1340, \"1341\" => 1341, \"1342\" => 1342, \"1343\" => 1343, \"1344\" => 1344, \"1345\" => 1345, \"1346\" => 1346, \"1347\" => 1347, \"1348\" => 1348, \"1349\" => 1349, \"1350\" => 1350, \"1351\" => 1351, \"1352\" => 1352, \"1353\" => 1353, \"1354\" => 1354, \"1355\" => 1355, \"1356\" => 1356, \"1357\" => 1357, \"1358\" => 1358, \"1359\" => 1359, \"1360\" => 1360, \"1361\" => 1361, \"1362\" => 1362, \"1363\" => 1363, \"1364\" => 1364, \"1365\" => 1365, \"1366\" => 1366, \"1367\" => 1367, \"1368\" => 1368, \"1369\" => 1369, \"1370\" => 1370, \"1371\" => 1371, \"1372\" => 1372, \"1373\" => 1373, \"1374\" => 1374, \"1375\" => 1375, \"1376\" => 1376, \"1377\" => 1377, \"1378\" => 1378, \"1379\" => 1379, \"1380\" => 1380, \"1381\" => 1381, \"1382\" => 1382, \"1383\" => 1383, \"1384\" => 1384, \"1385\" => 1385, \"1386\" => 1386, \"1387\" => 1387, \"1388\" => 1388, \"1389\" => 1389, \"1390\" => 1390, \"1391\" => 1391, \"1392\" => 1392, \"1393\" => 1393, \"1394\" => 1394, \"1395\" => 1395, \"1396\" => 1396, \"1397\" => 1397, \"1398\" => 1398, \"1399\" => 1399, \"1400\" => 1400, \"1401\" => 1401, \"1402\" => 1402, \"1403\" => 1403, \"1404\" => 1404, \"1405\" => 1405, \"1406\" => 1406, \"1407\" => 1407, \"1408\" => 1408, \"1409\" => 1409, \"1410\" => 1410, \"1411\" => 1411, \"1412\" => 1412, \"1413\" => 1413, \"1414\" => 1414, \"1415\" => 1415, \"1416\" => 1416, \"1417\" => 1417, \"1418\" => 1418, \"1419\" => 1419, \"1420\" => 1420, \"1421\" => 1421, \"1422\" => 1422, \"1423\" => 1423, \"1424\" => 1424, \"1425\" => 1425, \"1426\" => 1426, \"1427\" => 1427, \"1428\" => 1428, \"1429\" => 1429, \"1430\" => 1430, \"1431\" => 1431, \"1432\" => 1432, \"1433\" => 1433, \"1434\" => 1434, \"1435\" => 1435, \"1436\" => 1436, \"1437\" => 1437, \"1438\" => 1438, \"1439\" => 1439, \"1440\" => 1440, \"1441\" => 1441, \"1442\" => 1442, \"1443\" => 1443, \"1444\" => 1444, \"1445\" => 1445, \"1446\" => 1446, \"1447\" => 1447, \"1448\" => 1448, \"1449\" => 1449, \"1450\" => 1450, \"1451\" => 1451, \"1452\" => 1452, \"1453\" => 1453, \"1454\" => 1454, \"1455\" => 1455, \"1456\" => 1456, \"1457\" => 1457, \"1458\" => 1458, \"1459\" => 1459, \"1460\" => 1460, \"1461\" => 1461, \"1462\" => 1462, \"1463\" => 1463, \"1464\" => 1464, \"1465\" => 1465, \"1466\" => 1466, \"1467\" => 1467, \"1468\" => 1468, \"1469\" => 1469, \"1470\" => 1470, \"1471\" => 1471, \"1472\" => 1472, \"1473\" => 1473, \"1474\" => 1474, \"1475\" => 1475, \"1476\" => 1476, \"1477\" => 1477, \"1478\" => 1478, \"1479\" => 1479, \"1480\" => 1480, \"1481\" => 1481, \"1482\" => 1482, \"1483\" => 1483, \"1484\" => 1484, \"1485\" => 1485, \"1486\" => 1486, \"1487\" => 1487, \"1488\" => 1488, \"1489\" => 1489, \"1490\" => 1490, \"1491\" => 1491, \"1492\" => 1492, \"1493\" => 1493, \"1494\" => 1494, \"1495\" => 1495, \"1496\" => 1496, \"1497\" => 1497, \"1498\" => 1498, \"1499\" => 1499, \"1500\" => 1500, \"1501\" => 1501, \"1502\" => 1502, \"1503\" => 1503, \"1504\" => 1504, \"1505\" => 1505, \"1506\" => 1506, \"1507\" => 1507, \"1508\" => 1508, \"1509\" => 1509, \"1510\" => 1510, \"1511\" => 1511, \"1512\" => 1512, \"1513\" => 1513, \"1514\" => 1514, \"1515\" => 1515, \"1516\" => 1516, \"1517\" => 1517, \"1518\" => 1518, \"1519\" => 1519, \"1520\" => 1520, \"1521\" => 1521, \"1522\" => 1522, \"1523\" => 1523, \"1524\" => 1524, \"1525\" => 1525, \"1526\" => 1526, \"1527\" => 1527, \"1528\" => 1528, \"1529\" => 1529, \"1530\" => 1530, \"1531\" => 1531, \"1532\" => 1532, \"1533\" => 1533, \"1534\" => 1534, \"1535\" => 1535, \"1536\" => 1536, \"1537\" => 1537, \"1538\" => 1538, \"1539\" => 1539, \"1540\" => 1540, \"1541\" => 1541, \"1542\" => 1542, \"1543\" => 1543, \"1544\" => 1544, \"1545\" => 1545, \"1546\" => 1546, \"1547\" => 1547, \"1548\" => 1548, \"1549\" => 1549, \"1550\" => 1550, \"1551\" => 1551, \"1552\" => 1552, \"1553\" => 1553, \"1554\" => 1554, \"1555\" => 1555, \"1556\" => 1556, \"1557\" => 1557, \"1558\" => 1558, \"1559\" => 1559, \"1560\" => 1560, \"1561\" => 1561, \"1562\" => 1562, \"1563\" => 1563, \"1564\" => 1564, \"1565\" => 1565, \"1566\" => 1566, \"1567\" => 1567, \"1568\" => 1568, \"1569\" => 1569, \"1570\" => 1570, \"1571\" => 1571, \"1572\" => 1572, \"1573\" => 1573, \"1574\" => 1574, \"1575\" => 1575, \"1576\" => 1576, \"1577\" => 1577, \"1578\" => 1578, \"1579\" => 1579, \"1580\" => 1580, \"1581\" => 1581, \"1582\" => 1582, \"1583\" => 1583, \"1584\" => 1584, \"1585\" => 1585, \"1586\" => 1586, \"1587\" => 1587, \"1588\" => 1588, \"1589\" => 1589, \"1590\" => 1590, \"1591\" => 1591, \"1592\" => 1592, \"1593\" => 1593, \"1594\" => 1594, \"1595\" => 1595, \"1596\" => 1596, \"1597\" => 1597, \"1598\" => 1598, \"1599\" => 1599, \"1600\" => 1600, \"1601\" => 1601, \"1602\" => 1602, \"1603\" => 1603, \"1604\" => 1604, \"1605\" => 1605, \"1606\" => 1606, \"1607\" => 1607, \"1608\" => 1608, \"1609\" => 1609, \"1610\" => 1610, \"1611\" => 1611, \"1612\" => 1612, \"1613\" => 1613, \"1614\" => 1614, \"1615\" => 1615, \"1616\" => 1616, \"1617\" => 1617, \"1618\" => 1618, \"1619\" => 1619, \"1620\" => 1620, \"1621\" => 1621, \"1622\" => 1622, \"1623\" => 1623, \"1624\" => 1624, \"1625\" => 1625, \"1626\" => 1626, \"1627\" => 1627, \"1628\" => 1628, \"1629\" => 1629, \"1630\" => 1630, \"1631\" => 1631, \"1632\" => 1632, \"1633\" => 1633, \"1634\" => 1634, \"1635\" => 1635, \"1636\" => 1636, \"1637\" => 1637, \"1638\" => 1638, \"1639\" => 1639, \"1640\" => 1640, \"1641\" => 1641, \"1642\" => 1642, \"1643\" => 1643, \"1644\" => 1644, \"1645\" => 1645, \"1646\" => 1646, \"1647\" => 1647, \"1648\" => 1648, \"1649\" => 1649, \"1650\" => 1650, \"1651\" => 1651, \"1652\" => 1652, \"1653\" => 1653, \"1654\" => 1654, \"1655\" => 1655, \"1656\" => 1656, \"1657\" => 1657, \"1658\" => 1658, \"1659\" => 1659, \"1660\" => 1660, \"1661\" => 1661, \"1662\" => 1662, \"1663\" => 1663, \"1664\" => 1664, \"1665\" => 1665, \"1666\" => 1666, \"1667\" => 1667, \"1668\" => 1668, \"1669\" => 1669, \"1670\" => 1670, \"1671\" => 1671, \"1672\" => 1672, \"1673\" => 1673, \"1674\" => 1674, \"1675\" => 1675, \"1676\" => 1676, \"1677\" => 1677, \"1678\" => 1678, \"1679\" => 1679, \"1680\" => 1680, \"1681\" => 1681, \"1682\" => 1682, \"1683\" => 1683, \"1684\" => 1684, \"1685\" => 1685, \"1686\" => 1686, \"1687\" => 1687, \"1688\" => 1688, \"1689\" => 1689, \"1690\" => 1690, \"1691\" => 1691, \"1692\" => 1692, \"1693\" => 1693, \"1694\" => 1694, \"1695\" => 1695, \"1696\" => 1696, \"1697\" => 1697, \"1698\" => 1698, \"1699\" => 1699, \"1700\" => 1700, \"1701\" => 1701, \"1702\" => 1702, \"1703\" => 1703, \"1704\" => 1704, \"1705\" => 1705, \"1706\" => 1706, \"1707\" => 1707, \"1708\" => 1708, \"1709\" => 1709, \"1710\" => 1710, \"1711\" => 1711, \"1712\" => 1712, \"1713\" => 1713, \"1714\" => 1714, \"1715\" => 1715, \"1716\" => 1716, \"1717\" => 1717, \"1718\" => 1718, \"1719\" => 1719, \"1720\" => 1720, \"1721\" => 1721, \"1722\" => 1722, \"1723\" => 1723, \"1724\" => 1724, \"1725\" => 1725, \"1726\" => 1726, \"1727\" => 1727, \"1728\" => 1728, \"1729\" => 1729, \"1730\" => 1730, \"1731\" => 1731, \"1732\" => 1732, \"1733\" => 1733, \"1734\" => 1734, \"1735\" => 1735, \"1736\" => 1736, \"1737\" => 1737, \"1738\" => 1738, \"1739\" => 1739, \"1740\" => 1740, \"1741\" => 1741, \"1742\" => 1742, \"1743\" => 1743, \"1744\" => 1744, \"1745\" => 1745, \"1746\" => 1746, \"1747\" => 1747, \"1748\" => 1748, \"1749\" => 1749, \"1750\" => 1750, \"1751\" => 1751, \"1752\" => 1752, \"1753\" => 1753, \"1754\" => 1754, \"1755\" => 1755, \"1756\" => 1756, \"1757\" => 1757, \"1758\" => 1758, \"1759\" => 1759, \"1760\" => 1760, \"1761\" => 1761, \"1762\" => 1762, \"1763\" => 1763, \"1764\" => 1764, \"1765\" => 1765, \"1766\" => 1766, \"1767\" => 1767, \"1768\" => 1768, \"1769\" => 1769, \"1770\" => 1770, \"1771\" => 1771, \"1772\" => 1772, \"1773\" => 1773, \"1774\" => 1774, \"1775\" => 1775, \"1776\" => 1776, \"1777\" => 1777, \"1778\" => 1778, \"1779\" => 1779, \"1780\" => 1780, \"1781\" => 1781, \"1782\" => 1782, \"1783\" => 1783, \"1784\" => 1784, \"1785\" => 1785, \"1786\" => 1786, \"1787\" => 1787, \"1788\" => 1788, \"1789\" => 1789, \"1790\" => 1790, \"1791\" => 1791, \"1792\" => 1792, \"1793\" => 1793, \"1794\" => 1794, \"1795\" => 1795, \"1796\" => 1796, \"1797\" => 1797, \"1798\" => 1798, \"1799\" => 1799, \"1800\" => 1800, \"1801\" => 1801, \"1802\" => 1802, \"1803\" => 1803, \"1804\" => 1804, \"1805\" => 1805, \"1806\" => 1806, \"1807\" => 1807, \"1808\" => 1808, \"1809\" => 1809, \"1810\" => 1810, \"1811\" => 1811, \"1812\" => 1812, \"1813\" => 1813, \"1814\" => 1814, \"1815\" => 1815, \"1816\" => 1816, \"1817\" => 1817, \"1818\" => 1818, \"1819\" => 1819, \"1820\" => 1820, \"1821\" => 1821, \"1822\" => 1822, \"1823\" => 1823, \"1824\" => 1824, \"1825\" => 1825, \"1826\" => 1826, \"1827\" => 1827, \"1828\" => 1828, \"1829\" => 1829, \"1830\" => 1830, \"1831\" => 1831, \"1832\" => 1832, \"1833\" => 1833, \"1834\" => 1834, \"1835\" => 1835, \"1836\" => 1836, \"1837\" => 1837, \"1838\" => 1838, \"1839\" => 1839, \"1840\" => 1840, \"1841\" => 1841, \"1842\" => 1842, \"1843\" => 1843, \"1844\" => 1844, \"1845\" => 1845, \"1846\" => 1846, \"1847\" => 1847, \"1848\" => 1848, \"1849\" => 1849, \"1850\" => 1850, \"1851\" => 1851, \"1852\" => 1852, \"1853\" => 1853, \"1854\" => 1854, \"1855\" => 1855, \"1856\" => 1856, \"1857\" => 1857, \"1858\" => 1858, \"1859\" => 1859, \"1860\" => 1860, \"1861\" => 1861, \"1862\" => 1862, \"1863\" => 1863, \"1864\" => 1864, \"1865\" => 1865, \"1866\" => 1866, \"1867\" => 1867, \"1868\" => 1868, \"1869\" => 1869, \"1870\" => 1870, \"1871\" => 1871, \"1872\" => 1872, \"1873\" => 1873, \"1874\" => 1874, \"1875\" => 1875, \"1876\" => 1876, \"1877\" => 1877, \"1878\" => 1878, \"1879\" => 1879, \"1880\" => 1880, \"1881\" => 1881, \"1882\" => 1882, \"1883\" => 1883, \"1884\" => 1884, \"1885\" => 1885, \"1886\" => 1886, \"1887\" => 1887, \"1888\" => 1888, \"1889\" => 1889, \"1890\" => 1890, \"1891\" => 1891, \"1892\" => 1892, \"1893\" => 1893, \"1894\" => 1894, \"1895\" => 1895, \"1896\" => 1896, \"1897\" => 1897, \"1898\" => 1898, \"1899\" => 1899, \"1900\" => 1900, \"1901\" => 1901, \"1902\" => 1902, \"1903\" => 1903, \"1904\" => 1904, \"1905\" => 1905, \"1906\" => 1906, \"1907\" => 1907, \"1908\" => 1908, \"1909\" => 1909, \"1910\" => 1910, \"1911\" => 1911, \"1912\" => 1912, \"1913\" => 1913, \"1914\" => 1914, \"1915\" => 1915, \"1916\" => 1916, \"1917\" => 1917, \"1918\" => 1918, \"1919\" => 1919, \"1920\" => 1920, \"1921\" => 1921, \"1922\" => 1922, \"1923\" => 1923, \"1924\" => 1924, \"1925\" => 1925, \"1926\" => 1926, \"1927\" => 1927, \"1928\" => 1928, \"1929\" => 1929, \"1930\" => 1930, \"1931\" => 1931, \"1932\" => 1932, \"1933\" => 1933, \"1934\" => 1934, \"1935\" => 1935, \"1936\" => 1936, \"1937\" => 1937, \"1938\" => 1938, \"1939\" => 1939, \"1940\" => 1940, \"1941\" => 1941, \"1942\" => 1942, \"1943\" => 1943, \"1944\" => 1944, \"1945\" => 1945, \"1946\" => 1946, \"1947\" => 1947, \"1948\" => 1948, \"1949\" => 1949, \"1950\" => 1950, \"1951\" => 1951, \"1952\" => 1952, \"1953\" => 1953, \"1954\" => 1954, \"1955\" => 1955, \"1956\" => 1956, \"1957\" => 1957, \"1958\" => 1958, \"1959\" => 1959, \"1960\" => 1960, \"1961\" => 1961, \"1962\" => 1962, \"1963\" => 1963, \"1964\" => 1964, \"1965\" => 1965, \"1966\" => 1966, \"1967\" => 1967, \"1968\" => 1968, \"1969\" => 1969, \"1970\" => 1970, \"1971\" => 1971, \"1972\" => 1972, \"1973\" => 1973, \"1974\" => 1974, \"1975\" => 1975, \"1976\" => 1976, \"1977\" => 1977, \"1978\" => 1978, \"1979\" => 1979, \"1980\" => 1980, \"1981\" => 1981, \"1982\" => 1982, \"1983\" => 1983, \"1984\" => 1984, \"1985\" => 1985, \"1986\" => 1986, \"1987\" => 1987, \"1988\" => 1988, \"1989\" => 1989, \"1990\" => 1990, \"1991\" => 1991, \"1992\" => 1992, \"1993\" => 1993, \"1994\" => 1994, \"1995\" => 1995, \"1996\" => 1996, \"1997\" => 1997, \"1998\" => 1998, \"1999\" => 1999, \"2000\" => 2000, \"2001\" => 2001, \"2002\" => 2002, \"2003\" => 2003, \"2004\" => 2004, \"2005\" => 2005, \"2006\" => 2006, \"2007\" => 2007, \"2008\" => 2008, \"2009\" => 2009, \"2010\" => 2010, \"2011\" => 2011, \"2012\" => 2012, \"2013\" => 2013, \"2014\" => 2014, \"2015\" => 2015, \"2016\" => 2016, \"2017\" => 2017, \"2018\" => 2018, \"2019\" => 2019, \"2020\" => 2020, \"2021\" => 2021, \"2022\" => 2022, \"2023\" => 2023, \"2024\" => 2024, \"2025\" => 2025, \"2026\" => 2026, \"2027\" => 2027, \"2028\" => 2028, \"2029\" => 2029, \"2030\" => 2030, \"2031\" => 2031, \"2032\" => 2032, \"2033\" => 2033, \"2034\" => 2034, \"2035\" => 2035, \"2036\" => 2036, \"2037\" => 2037, \"2038\" => 2038, \"2039\" => 2039, \"2040\" => 2040, \"2041\" => 2041, \"2042\" => 2042, \"2043\" => 2043, \"2044\" => 2044, \"2045\" => 2045, \"2046\" => 2046, \"2047\" => 2047, \"2048\" => 2048, \"2049\" => 2049, \"2050\" => 2050, \"2051\" => 2051, \"2052\" => 2052, \"2053\" => 2053, \"2054\" => 2054, \"2055\" => 2055, \"2056\" => 2056, \"2057\" => 2057, \"2058\" => 2058, \"2059\" => 2059, \"2060\" => 2060, \"2061\" => 2061, \"2062\" => 2062, \"2063\" => 2063, \"2064\" => 2064, \"2065\" => 2065, \"2066\" => 2066, \"2067\" => 2067, \"2068\" => 2068, \"2069\" => 2069, \"2070\" => 2070, \"2071\" => 2071, \"2072\" => 2072, \"2073\" => 2073, \"2074\" => 2074, \"2075\" => 2075, \"2076\" => 2076, \"2077\" => 2077, \"2078\" => 2078, \"2079\" => 2079, \"2080\" => 2080, \"2081\" => 2081, \"2082\" => 2082, \"2083\" => 2083, \"2084\" => 2084, \"2085\" => 2085, \"2086\" => 2086, \"2087\" => 2087, \"2088\" => 2088, \"2089\" => 2089, \"2090\" => 2090, \"2091\" => 2091, \"2092\" => 2092, \"2093\" => 2093, \"2094\" => 2094, \"2095\" => 2095, \"2096\" => 2096, \"2097\" => 2097, \"2098\" => 2098, \"2099\" => 2099, \"2100\" => 2100, \"2101\" => 2101, \"2102\" => 2102, \"2103\" => 2103, \"2104\" => 2104, \"2105\" => 2105, \"2106\" => 2106, \"2107\" => 2107, \"2108\" => 2108, \"2109\" => 2109, \"2110\" => 2110, \"2111\" => 2111, \"2112\" => 2112, \"2113\" => 2113, \"2114\" => 2114, \"2115\" => 2115, \"2116\" => 2116, \"2117\" => 2117, \"2118\" => 2118, \"2119\" => 2119, \"2120\" => 2120, \"2121\" => 2121, \"2122\" => 2122, \"2123\" => 2123, \"2124\" => 2124, \"2125\" => 2125, \"2126\" => 2126, \"2127\" => 2127, \"2128\" => 2128, \"2129\" => 2129, \"2130\" => 2130, \"2131\" => 2131, \"2132\" => 2132, \"2133\" => 2133, \"2134\" => 2134, \"2135\" => 2135, \"2136\" => 2136, \"2137\" => 2137, \"2138\" => 2138, \"2139\" => 2139, \"2140\" => 2140, \"2141\" => 2141, \"2142\" => 2142, \"2143\" => 2143, \"2144\" => 2144, \"2145\" => 2145, \"2146\" => 2146, \"2147\" => 2147, \"2148\" => 2148, \"2149\" => 2149, \"2150\" => 2150, \"2151\" => 2151, \"2152\" => 2152, \"2153\" => 2153, \"2154\" => 2154, \"2155\" => 2155, \"2156\" => 2156, \"2157\" => 2157, \"2158\" => 2158, \"2159\" => 2159, \"2160\" => 2160, \"2161\" => 2161, \"2162\" => 2162, \"2163\" => 2163, \"2164\" => 2164, \"2165\" => 2165, \"2166\" => 2166, \"2167\" => 2167, \"2168\" => 2168, \"2169\" => 2169, \"2170\" => 2170, \"2171\" => 2171, \"2172\" => 2172, \"2173\" => 2173, \"2174\" => 2174, \"2175\" => 2175, \"2176\" => 2176, \"2177\" => 2177, \"2178\" => 2178, \"2179\" => 2179, \"2180\" => 2180, \"2181\" => 2181, \"2182\" => 2182, \"2183\" => 2183, \"2184\" => 2184, \"2185\" => 2185, \"2186\" => 2186, \"2187\" => 2187, \"2188\" => 2188, \"2189\" => 2189, \"2190\" => 2190, \"2191\" => 2191, \"2192\" => 2192, \"2193\" => 2193, \"2194\" => 2194, \"2195\" => 2195, \"2196\" => 2196, \"2197\" => 2197, \"2198\" => 2198, \"2199\" => 2199, \"2200\" => 2200, \"2201\" => 2201, \"2202\" => 2202, \"2203\" => 2203, \"2204\" => 2204, \"2205\" => 2205, \"2206\" => 2206, \"2207\" => 2207, \"2208\" => 2208, \"2209\" => 2209, \"2210\" => 2210, \"2211\" => 2211, \"2212\" => 2212, \"2213\" => 2213, \"2214\" => 2214, \"2215\" => 2215, \"2216\" => 2216, \"2217\" => 2217, \"2218\" => 2218, \"2219\" => 2219, \"2220\" => 2220, \"2221\" => 2221, \"2222\" => 2222, \"2223\" => 2223, \"2224\" => 2224, \"2225\" => 2225, \"2226\" => 2226, \"2227\" => 2227, \"2228\" => 2228, \"2229\" => 2229, \"2230\" => 2230, \"2231\" => 2231, \"2232\" => 2232, \"2233\" => 2233, \"2234\" => 2234, \"2235\" => 2235, \"2236\" => 2236, \"2237\" => 2237, \"2238\" => 2238, \"2239\" => 2239, \"2240\" => 2240, \"2241\" => 2241, \"2242\" => 2242, \"2243\" => 2243, \"2244\" => 2244, \"2245\" => 2245, \"2246\" => 2246, \"2247\" => 2247, \"2248\" => 2248, \"2249\" => 2249, \"2250\" => 2250, \"2251\" => 2251, \"2252\" => 2252, \"2253\" => 2253, \"2254\" => 2254, \"2255\" => 2255, \"2256\" => 2256, \"2257\" => 2257, \"2258\" => 2258, \"2259\" => 2259, \"2260\" => 2260, \"2261\" => 2261, \"2262\" => 2262, \"2263\" => 2263, \"2264\" => 2264, \"2265\" => 2265, \"2266\" => 2266, \"2267\" => 2267, \"2268\" => 2268, \"2269\" => 2269, \"2270\" => 2270, \"2271\" => 2271, \"2272\" => 2272, \"2273\" => 2273, \"2274\" => 2274, \"2275\" => 2275, \"2276\" => 2276, \"2277\" => 2277, \"2278\" => 2278, \"2279\" => 2279, \"2280\" => 2280, \"2281\" => 2281, \"2282\" => 2282, \"2283\" => 2283, \"2284\" => 2284, \"2285\" => 2285, \"2286\" => 2286, \"2287\" => 2287, \"2288\" => 2288, \"2289\" => 2289, \"2290\" => 2290, \"2291\" => 2291, \"2292\" => 2292, \"2293\" => 2293, \"2294\" => 2294, \"2295\" => 2295, \"2296\" => 2296, \"2297\" => 2297, \"2298\" => 2298, \"2299\" => 2299, \"2300\" => 2300, \"2301\" => 2301, \"2302\" => 2302, \"2303\" => 2303, \"2304\" => 2304, \"2305\" => 2305, \"2306\" => 2306, \"2307\" => 2307, \"2308\" => 2308, \"2309\" => 2309, \"2310\" => 2310, \"2311\" => 2311, \"2312\" => 2312, \"2313\" => 2313, \"2314\" => 2314, \"2315\" => 2315, \"2316\" => 2316, \"2317\" => 2317, \"2318\" => 2318, \"2319\" => 2319, \"2320\" => 2320, \"2321\" => 2321, \"2322\" => 2322, \"2323\" => 2323, \"2324\" => 2324, \"2325\" => 2325, \"2326\" => 2326, \"2327\" => 2327, \"2328\" => 2328, \"2329\" => 2329, \"2330\" => 2330, \"2331\" => 2331, \"2332\" => 2332, \"2333\" => 2333, \"2334\" => 2334, \"2335\" => 2335, \"2336\" => 2336, \"2337\" => 2337, \"2338\" => 2338, \"2339\" => 2339, \"2340\" => 2340, \"2341\" => 2341, \"2342\" => 2342, \"2343\" => 2343, \"2344\" => 2344, \"2345\" => 2345, \"2346\" => 2346, \"2347\" => 2347, \"2348\" => 2348, \"2349\" => 2349, \"2350\" => 2350, \"2351\" => 2351, \"2352\" => 2352, \"2353\" => 2353, \"2354\" => 2354, \"2355\" => 2355, \"2356\" => 2356, \"2357\" => 2357, \"2358\" => 2358, \"2359\" => 2359, \"2360\" => 2360, \"2361\" => 2361, \"2362\" => 2362, \"2363\" => 2363, \"2364\" => 2364, \"2365\" => 2365, \"2366\" => 2366, \"2367\" => 2367, \"2368\" => 2368, \"2369\" => 2369, \"2370\" => 2370, \"2371\" => 2371, \"2372\" => 2372, \"2373\" => 2373, \"2374\" => 2374, \"2375\" => 2375, \"2376\" => 2376, \"2377\" => 2377, \"2378\" => 2378, \"2379\" => 2379, \"2380\" => 2380, \"2381\" => 2381, \"2382\" => 2382, \"2383\" => 2383, \"2384\" => 2384, \"2385\" => 2385, \"2386\" => 2386, \"2387\" => 2387, \"2388\" => 2388, \"2389\" => 2389, \"2390\" => 2390, \"2391\" => 2391, \"2392\" => 2392, \"2393\" => 2393, \"2394\" => 2394, \"2395\" => 2395, \"2396\" => 2396, \"2397\" => 2397, \"2398\" => 2398, \"2399\" => 2399, \"2400\" => 2400, \"2401\" => 2401, \"2402\" => 2402, \"2403\" => 2403, \"2404\" => 2404, \"2405\" => 2405, \"2406\" => 2406, \"2407\" => 2407, \"2408\" => 2408, \"2409\" => 2409, \"2410\" => 2410, \"2411\" => 2411, \"2412\" => 2412, \"2413\" => 2413, \"2414\" => 2414, \"2415\" => 2415, \"2416\" => 2416, \"2417\" => 2417, \"2418\" => 2418, \"2419\" => 2419, \"2420\" => 2420, \"2421\" => 2421, \"2422\" => 2422, \"2423\" => 2423, \"2424\" => 2424, \"2425\" => 2425, \"2426\" => 2426, \"2427\" => 2427, \"2428\" => 2428, \"2429\" => 2429, \"2430\" => 2430, \"2431\" => 2431, \"2432\" => 2432, \"2433\" => 2433, \"2434\" => 2434, \"2435\" => 2435, \"2436\" => 2436, \"2437\" => 2437, \"2438\" => 2438, \"2439\" => 2439, \"2440\" => 2440, \"2441\" => 2441, \"2442\" => 2442, \"2443\" => 2443, \"2444\" => 2444, \"2445\" => 2445, \"2446\" => 2446, \"2447\" => 2447, \"2448\" => 2448, \"2449\" => 2449, \"2450\" => 2450, \"2451\" => 2451, \"2452\" => 2452, \"2453\" => 2453, \"2454\" => 2454, \"2455\" => 2455, \"2456\" => 2456, \"2457\" => 2457, \"2458\" => 2458, \"2459\" => 2459, \"2460\" => 2460, \"2461\" => 2461, \"2462\" => 2462, \"2463\" => 2463, \"2464\" => 2464, \"2465\" => 2465, \"2466\" => 2466, \"2467\" => 2467, \"2468\" => 2468, \"2469\" => 2469, \"2470\" => 2470, \"2471\" => 2471, \"2472\" => 2472, \"2473\" => 2473, \"2474\" => 2474, \"2475\" => 2475, \"2476\" => 2476, \"2477\" => 2477, \"2478\" => 2478, \"2479\" => 2479, \"2480\" => 2480, \"2481\" => 2481, \"2482\" => 2482, \"2483\" => 2483, \"2484\" => 2484, \"2485\" => 2485, \"2486\" => 2486, \"2487\" => 2487, \"2488\" => 2488, \"2489\" => 2489, \"2490\" => 2490, \"2491\" => 2491, \"2492\" => 2492, \"2493\" => 2493, \"2494\" => 2494, \"2495\" => 2495, \"2496\" => 2496, \"2497\" => 2497, \"2498\" => 2498, \"2499\" => 2499, \"2500\" => 2500, \"2501\" => 2501, \"2502\" => 2502, \"2503\" => 2503, \"2504\" => 2504, \"2505\" => 2505, \"2506\" => 2506, \"2507\" => 2507, \"2508\" => 2508, \"2509\" => 2509, \"2510\" => 2510, \"2511\" => 2511, \"2512\" => 2512, \"2513\" => 2513, \"2514\" => 2514, \"2515\" => 2515, \"2516\" => 2516, \"2517\" => 2517, \"2518\" => 2518, \"2519\" => 2519, \"2520\" => 2520, \"2521\" => 2521, \"2522\" => 2522, \"2523\" => 2523, \"2524\" => 2524, \"2525\" => 2525, \"2526\" => 2526, \"2527\" => 2527, \"2528\" => 2528, \"2529\" => 2529, \"2530\" => 2530, \"2531\" => 2531, \"2532\" => 2532, \"2533\" => 2533, \"2534\" => 2534, \"2535\" => 2535, \"2536\" => 2536, \"2537\" => 2537, \"2538\" => 2538, \"2539\" => 2539, \"2540\" => 2540, \"2541\" => 2541, \"2542\" => 2542, \"2543\" => 2543, \"2544\" => 2544, \"2545\" => 2545, \"2546\" => 2546, \"2547\" => 2547, \"2548\" => 2548, \"2549\" => 2549, \"2550\" => 2550, \"2551\" => 2551, \"2552\" => 2552, \"2553\" => 2553, \"2554\" => 2554, \"2555\" => 2555, \"2556\" => 2556, \"2557\" => 2557, \"2558\" => 2558, \"2559\" => 2559, \"2560\" => 2560, \"2561\" => 2561, \"2562\" => 2562, \"2563\" => 2563, \"2564\" => 2564, \"2565\" => 2565, \"2566\" => 2566, \"2567\" => 2567, \"2568\" => 2568, \"2569\" => 2569, \"2570\" => 2570, \"2571\" => 2571, \"2572\" => 2572, \"2573\" => 2573, \"2574\" => 2574, \"2575\" => 2575, \"2576\" => 2576, \"2577\" => 2577, \"2578\" => 2578, \"2579\" => 2579, \"2580\" => 2580, \"2581\" => 2581, \"2582\" => 2582, \"2583\" => 2583, \"2584\" => 2584, \"2585\" => 2585, \"2586\" => 2586, \"2587\" => 2587, \"2588\" => 2588, \"2589\" => 2589, \"2590\" => 2590, \"2591\" => 2591, \"2592\" => 2592, \"2593\" => 2593, \"2594\" => 2594, \"2595\" => 2595, \"2596\" => 2596, \"2597\" => 2597, \"2598\" => 2598, \"2599\" => 2599, \"2600\" => 2600, \"2601\" => 2601, \"2602\" => 2602, \"2603\" => 2603, \"2604\" => 2604, \"2605\" => 2605, \"2606\" => 2606, \"2607\" => 2607, \"2608\" => 2608, \"2609\" => 2609, \"2610\" => 2610, \"2611\" => 2611, \"2612\" => 2612, \"2613\" => 2613, \"2614\" => 2614, \"2615\" => 2615, \"2616\" => 2616, \"2617\" => 2617, \"2618\" => 2618, \"2619\" => 2619, \"2620\" => 2620, \"2621\" => 2621, \"2622\" => 2622, \"2623\" => 2623, \"2624\" => 2624, \"2625\" => 2625, \"2626\" => 2626, \"2627\" => 2627, \"2628\" => 2628, \"2629\" => 2629, \"2630\" => 2630, \"2631\" => 2631, \"2632\" => 2632, \"2633\" => 2633, \"2634\" => 2634, \"2635\" => 2635, \"2636\" => 2636, \"2637\" => 2637, \"2638\" => 2638, \"2639\" => 2639, \"2640\" => 2640, \"2641\" => 2641, \"2642\" => 2642, \"2643\" => 2643, \"2644\" => 2644, \"2645\" => 2645, \"2646\" => 2646, \"2647\" => 2647, \"2648\" => 2648, \"2649\" => 2649, \"2650\" => 2650, \"2651\" => 2651, \"2652\" => 2652, \"2653\" => 2653, \"2654\" => 2654, \"2655\" => 2655, \"2656\" => 2656, \"2657\" => 2657, \"2658\" => 2658, \"2659\" => 2659, \"2660\" => 2660, \"2661\" => 2661, \"2662\" => 2662, \"2663\" => 2663, \"2664\" => 2664, \"2665\" => 2665, \"2666\" => 2666, \"2667\" => 2667, \"2668\" => 2668, \"2669\" => 2669, \"2670\" => 2670, \"2671\" => 2671, \"2672\" => 2672, \"2673\" => 2673, \"2674\" => 2674, \"2675\" => 2675, \"2676\" => 2676, \"2677\" => 2677, \"2678\" => 2678, \"2679\" => 2679, \"2680\" => 2680, \"2681\" => 2681, \"2682\" => 2682, \"2683\" => 2683, \"2684\" => 2684, \"2685\" => 2685, \"2686\" => 2686, \"2687\" => 2687, \"2688\" => 2688, \"2689\" => 2689, \"2690\" => 2690, \"2691\" => 2691, \"2692\" => 2692, \"2693\" => 2693, \"2694\" => 2694, \"2695\" => 2695, \"2696\" => 2696, \"2697\" => 2697, \"2698\" => 2698, \"2699\" => 2699, \"2700\" => 2700, \"2701\" => 2701, \"2702\" => 2702, \"2703\" => 2703, \"2704\" => 2704, \"2705\" => 2705, \"2706\" => 2706, \"2707\" => 2707, \"2708\" => 2708, \"2709\" => 2709, \"2710\" => 2710, \"2711\" => 2711, \"2712\" => 2712, \"2713\" => 2713, \"2714\" => 2714, \"2715\" => 2715, \"2716\" => 2716, \"2717\" => 2717, \"2718\" => 2718, \"2719\" => 2719, \"2720\" => 2720, \"2721\" => 2721, \"2722\" => 2722, \"2723\" => 2723, \"2724\" => 2724, \"2725\" => 2725, \"2726\" => 2726, \"2727\" => 2727, \"2728\" => 2728, \"2729\" => 2729, \"2730\" => 2730, \"2731\" => 2731, \"2732\" => 2732, \"2733\" => 2733, \"2734\" => 2734, \"2735\" => 2735, \"2736\" => 2736, \"2737\" => 2737, \"2738\" => 2738, \"2739\" => 2739, \"2740\" => 2740, \"2741\" => 2741, \"2742\" => 2742, \"2743\" => 2743, \"2744\" => 2744, \"2745\" => 2745, \"2746\" => 2746, \"2747\" => 2747, \"2748\" => 2748, \"2749\" => 2749, \"2750\" => 2750, \"2751\" => 2751, \"2752\" => 2752, \"2753\" => 2753, \"2754\" => 2754, \"2755\" => 2755, \"2756\" => 2756, \"2757\" => 2757, \"2758\" => 2758, \"2759\" => 2759, \"2760\" => 2760, \"2761\" => 2761, \"2762\" => 2762, \"2763\" => 2763, \"2764\" => 2764, \"2765\" => 2765, \"2766\" => 2766, \"2767\" => 2767, \"2768\" => 2768, \"2769\" => 2769, \"2770\" => 2770, \"2771\" => 2771, \"2772\" => 2772, \"2773\" => 2773, \"2774\" => 2774, \"2775\" => 2775, \"2776\" => 2776, \"2777\" => 2777, \"2778\" => 2778, \"2779\" => 2779, \"2780\" => 2780, \"2781\" => 2781, \"2782\" => 2782, \"2783\" => 2783, \"2784\" => 2784, \"2785\" => 2785, \"2786\" => 2786, \"2787\" => 2787, \"2788\" => 2788, \"2789\" => 2789, \"2790\" => 2790, \"2791\" => 2791, \"2792\" => 2792, \"2793\" => 2793, \"2794\" => 2794, \"2795\" => 2795, \"2796\" => 2796, \"2797\" => 2797, \"2798\" => 2798, \"2799\" => 2799, \"2800\" => 2800, \"2801\" => 2801, \"2802\" => 2802, \"2803\" => 2803, \"2804\" => 2804, \"2805\" => 2805, \"2806\" => 2806, \"2807\" => 2807, \"2808\" => 2808, \"2809\" => 2809, \"2810\" => 2810, \"2811\" => 2811, \"2812\" => 2812, \"2813\" => 2813, \"2814\" => 2814, \"2815\" => 2815, \"2816\" => 2816, \"2817\" => 2817, \"2818\" => 2818, \"2819\" => 2819, \"2820\" => 2820, \"2821\" => 2821, \"2822\" => 2822, \"2823\" => 2823, \"2824\" => 2824, \"2825\" => 2825, \"2826\" => 2826, \"2827\" => 2827, \"2828\" => 2828, \"2829\" => 2829, \"2830\" => 2830, \"2831\" => 2831, \"2832\" => 2832, \"2833\" => 2833, \"2834\" => 2834, \"2835\" => 2835, \"2836\" => 2836, \"2837\" => 2837, \"2838\" => 2838, \"2839\" => 2839, \"2840\" => 2840, \"2841\" => 2841, \"2842\" => 2842, \"2843\" => 2843, \"2844\" => 2844, \"2845\" => 2845, \"2846\" => 2846, \"2847\" => 2847, \"2848\" => 2848, \"2849\" => 2849, \"2850\" => 2850, \"2851\" => 2851, \"2852\" => 2852, \"2853\" => 2853, \"2854\" => 2854, \"2855\" => 2855, \"2856\" => 2856, \"2857\" => 2857, \"2858\" => 2858, \"2859\" => 2859, \"2860\" => 2860, \"2861\" => 2861, \"2862\" => 2862, \"2863\" => 2863, \"2864\" => 2864, \"2865\" => 2865, \"2866\" => 2866, \"2867\" => 2867, \"2868\" => 2868, \"2869\" => 2869, \"2870\" => 2870, \"2871\" => 2871, \"2872\" => 2872, \"2873\" => 2873, \"2874\" => 2874, \"2875\" => 2875, \"2876\" => 2876, \"2877\" => 2877, \"2878\" => 2878, \"2879\" => 2879, \"2880\" => 2880, \"2881\" => 2881, \"2882\" => 2882, \"2883\" => 2883, \"2884\" => 2884, \"2885\" => 2885, \"2886\" => 2886, \"2887\" => 2887, \"2888\" => 2888, \"2889\" => 2889, \"2890\" => 2890, \"2891\" => 2891, \"2892\" => 2892, \"2893\" => 2893, \"2894\" => 2894, \"2895\" => 2895, \"2896\" => 2896, \"2897\" => 2897, \"2898\" => 2898, \"2899\" => 2899, \"2900\" => 2900, \"2901\" => 2901, \"2902\" => 2902, \"2903\" => 2903, \"2904\" => 2904, \"2905\" => 2905, \"2906\" => 2906, \"2907\" => 2907, \"2908\" => 2908, \"2909\" => 2909, \"2910\" => 2910, \"2911\" => 2911, \"2912\" => 2912, \"2913\" => 2913, \"2914\" => 2914, \"2915\" => 2915, \"2916\" => 2916, \"2917\" => 2917, \"2918\" => 2918, \"2919\" => 2919, \"2920\" => 2920, \"2921\" => 2921, \"2922\" => 2922, \"2923\" => 2923, \"2924\" => 2924, \"2925\" => 2925, \"2926\" => 2926, \"2927\" => 2927, \"2928\" => 2928, \"2929\" => 2929, \"2930\" => 2930, \"2931\" => 2931, \"2932\" => 2932, \"2933\" => 2933, \"2934\" => 2934, \"2935\" => 2935, \"2936\" => 2936, \"2937\" => 2937, \"2938\" => 2938, \"2939\" => 2939, \"2940\" => 2940, \"2941\" => 2941, \"2942\" => 2942, \"2943\" => 2943, \"2944\" => 2944, \"2945\" => 2945, \"2946\" => 2946, \"2947\" => 2947, \"2948\" => 2948, \"2949\" => 2949, \"2950\" => 2950, \"2951\" => 2951, \"2952\" => 2952, \"2953\" => 2953, \"2954\" => 2954, \"2955\" => 2955, \"2956\" => 2956, \"2957\" => 2957, \"2958\" => 2958, \"2959\" => 2959, \"2960\" => 2960, \"2961\" => 2961, \"2962\" => 2962, \"2963\" => 2963, \"2964\" => 2964, \"2965\" => 2965, \"2966\" => 2966, \"2967\" => 2967, \"2968\" => 2968, \"2969\" => 2969, \"2970\" => 2970, \"2971\" => 2971, \"2972\" => 2972, \"2973\" => 2973, \"2974\" => 2974, \"2975\" => 2975, \"2976\" => 2976, \"2977\" => 2977, \"2978\" => 2978, \"2979\" => 2979, \"2980\" => 2980, \"2981\" => 2981, \"2982\" => 2982, \"2983\" => 2983, \"2984\" => 2984, \"2985\" => 2985, \"2986\" => 2986, \"2987\" => 2987, \"2988\" => 2988, \"2989\" => 2989, \"2990\" => 2990, \"2991\" => 2991, \"2992\" => 2992, \"2993\" => 2993, \"2994\" => 2994, \"2995\" => 2995, \"2996\" => 2996, \"2997\" => 2997, \"2998\" => 2998, \"2999\" => 2999, \"3000\" => 3000, \"3001\" => 3001, \"3002\" => 3002, \"3003\" => 3003, \"3004\" => 3004, \"3005\" => 3005, \"3006\" => 3006, \"3007\" => 3007, \"3008\" => 3008, \"3009\" => 3009, \"3010\" => 3010, \"3011\" => 3011, \"3012\" => 3012, \"3013\" => 3013, \"3014\" => 3014, \"3015\" => 3015, \"3016\" => 3016, \"3017\" => 3017, \"3018\" => 3018, \"3019\" => 3019, \"3020\" => 3020, \"3021\" => 3021, \"3022\" => 3022, \"3023\" => 3023, \"3024\" => 3024, \"3025\" => 3025, \"3026\" => 3026, \"3027\" => 3027, \"3028\" => 3028, \"3029\" => 3029, \"3030\" => 3030, \"3031\" => 3031, \"3032\" => 3032, \"3033\" => 3033, \"3034\" => 3034, \"3035\" => 3035, \"3036\" => 3036, \"3037\" => 3037, \"3038\" => 3038, \"3039\" => 3039, \"3040\" => 3040, \"3041\" => 3041, \"3042\" => 3042, \"3043\" => 3043, \"3044\" => 3044, \"3045\" => 3045, \"3046\" => 3046, \"3047\" => 3047, \"3048\" => 3048, \"3049\" => 3049, \"3050\" => 3050, \"3051\" => 3051, \"3052\" => 3052, \"3053\" => 3053, \"3054\" => 3054, \"3055\" => 3055, \"3056\" => 3056, \"3057\" => 3057, \"3058\" => 3058, \"3059\" => 3059, \"3060\" => 3060, \"3061\" => 3061, \"3062\" => 3062, \"3063\" => 3063, \"3064\" => 3064, \"3065\" => 3065, \"3066\" => 3066, \"3067\" => 3067, \"3068\" => 3068, \"3069\" => 3069, \"3070\" => 3070, \"3071\" => 3071, \"3072\" => 3072, \"3073\" => 3073, \"3074\" => 3074, \"3075\" => 3075, \"3076\" => 3076, \"3077\" => 3077, \"3078\" => 3078, \"3079\" => 3079, \"3080\" => 3080, \"3081\" => 3081, \"3082\" => 3082, \"3083\" => 3083, \"3084\" => 3084, \"3085\" => 3085, \"3086\" => 3086, \"3087\" => 3087, \"3088\" => 3088, \"3089\" => 3089, \"3090\" => 3090, \"3091\" => 3091, \"3092\" => 3092, \"3093\" => 3093, \"3094\" => 3094, \"3095\" => 3095, \"3096\" => 3096, \"3097\" => 3097, \"3098\" => 3098, \"3099\" => 3099, \"3100\" => 3100, \"3101\" => 3101, \"3102\" => 3102, \"3103\" => 3103, \"3104\" => 3104, \"3105\" => 3105, \"3106\" => 3106, \"3107\" => 3107, \"3108\" => 3108, \"3109\" => 3109, \"3110\" => 3110, \"3111\" => 3111, \"3112\" => 3112, \"3113\" => 3113, \"3114\" => 3114, \"3115\" => 3115, \"3116\" => 3116, \"3117\" => 3117, \"3118\" => 3118, \"3119\" => 3119, \"3120\" => 3120, \"3121\" => 3121, \"3122\" => 3122, \"3123\" => 3123, \"3124\" => 3124, \"3125\" => 3125, \"3126\" => 3126, \"3127\" => 3127, \"3128\" => 3128, \"3129\" => 3129, \"3130\" => 3130, \"3131\" => 3131, \"3132\" => 3132, \"3133\" => 3133, \"3134\" => 3134, \"3135\" => 3135, \"3136\" => 3136, \"3137\" => 3137, \"3138\" => 3138, \"3139\" => 3139, \"3140\" => 3140, \"3141\" => 3141, \"3142\" => 3142, \"3143\" => 3143, \"3144\" => 3144, \"3145\" => 3145, \"3146\" => 3146, \"3147\" => 3147, \"3148\" => 3148, \"3149\" => 3149, \"3150\" => 3150, \"3151\" => 3151, \"3152\" => 3152, \"3153\" => 3153, \"3154\" => 3154, \"3155\" => 3155, \"3156\" => 3156, \"3157\" => 3157, \"3158\" => 3158, \"3159\" => 3159, \"3160\" => 3160, \"3161\" => 3161, \"3162\" => 3162, \"3163\" => 3163, \"3164\" => 3164, \"3165\" => 3165, \"3166\" => 3166, \"3167\" => 3167, \"3168\" => 3168, \"3169\" => 3169, \"3170\" => 3170, \"3171\" => 3171, \"3172\" => 3172, \"3173\" => 3173, \"3174\" => 3174, \"3175\" => 3175, \"3176\" => 3176, \"3177\" => 3177, \"3178\" => 3178, \"3179\" => 3179, \"3180\" => 3180, \"3181\" => 3181, \"3182\" => 3182, \"3183\" => 3183, \"3184\" => 3184, \"3185\" => 3185, \"3186\" => 3186, \"3187\" => 3187, \"3188\" => 3188, \"3189\" => 3189, \"3190\" => 3190, \"3191\" => 3191, \"3192\" => 3192, \"3193\" => 3193, \"3194\" => 3194, \"3195\" => 3195, \"3196\" => 3196, \"3197\" => 3197, \"3198\" => 3198, \"3199\" => 3199, \"3200\" => 3200, \"3201\" => 3201, \"3202\" => 3202, \"3203\" => 3203, \"3204\" => 3204, \"3205\" => 3205, \"3206\" => 3206, \"3207\" => 3207, \"3208\" => 3208, \"3209\" => 3209, \"3210\" => 3210, \"3211\" => 3211, \"3212\" => 3212, \"3213\" => 3213, \"3214\" => 3214, \"3215\" => 3215, \"3216\" => 3216, \"3217\" => 3217, \"3218\" => 3218, \"3219\" => 3219, \"3220\" => 3220, \"3221\" => 3221, \"3222\" => 3222, \"3223\" => 3223, \"3224\" => 3224, \"3225\" => 3225, \"3226\" => 3226, \"3227\" => 3227, \"3228\" => 3228, \"3229\" => 3229, \"3230\" => 3230, \"3231\" => 3231, \"3232\" => 3232, \"3233\" => 3233, \"3234\" => 3234, \"3235\" => 3235, \"3236\" => 3236, \"3237\" => 3237, \"3238\" => 3238, \"3239\" => 3239, \"3240\" => 3240, \"3241\" => 3241, \"3242\" => 3242, \"3243\" => 3243, \"3244\" => 3244, \"3245\" => 3245, \"3246\" => 3246, \"3247\" => 3247, \"3248\" => 3248, \"3249\" => 3249, \"3250\" => 3250, \"3251\" => 3251, \"3252\" => 3252, \"3253\" => 3253, \"3254\" => 3254, \"3255\" => 3255, \"3256\" => 3256, \"3257\" => 3257, \"3258\" => 3258, \"3259\" => 3259, \"3260\" => 3260, \"3261\" => 3261, \"3262\" => 3262, \"3263\" => 3263, \"3264\" => 3264, \"3265\" => 3265, \"3266\" => 3266, \"3267\" => 3267, \"3268\" => 3268, \"3269\" => 3269, \"3270\" => 3270, \"3271\" => 3271, \"3272\" => 3272, \"3273\" => 3273, \"3274\" => 3274, \"3275\" => 3275, \"3276\" => 3276, \"3277\" => 3277, \"3278\" => 3278, \"3279\" => 3279, \"3280\" => 3280, \"3281\" => 3281, \"3282\" => 3282, \"3283\" => 3283, \"3284\" => 3284, \"3285\" => 3285, \"3286\" => 3286, \"3287\" => 3287, \"3288\" => 3288, \"3289\" => 3289, \"3290\" => 3290, \"3291\" => 3291, \"3292\" => 3292, \"3293\" => 3293, \"3294\" => 3294, \"3295\" => 3295, \"3296\" => 3296, \"3297\" => 3297, \"3298\" => 3298, \"3299\" => 3299, \"3300\" => 3300, \"3301\" => 3301, \"3302\" => 3302, \"3303\" => 3303, \"3304\" => 3304, \"3305\" => 3305, \"3306\" => 3306, \"3307\" => 3307, \"3308\" => 3308, \"3309\" => 3309, \"3310\" => 3310, \"3311\" => 3311, \"3312\" => 3312, \"3313\" => 3313, \"3314\" => 3314, \"3315\" => 3315, \"3316\" => 3316, \"3317\" => 3317, \"3318\" => 3318, \"3319\" => 3319, \"3320\" => 3320, \"3321\" => 3321, \"3322\" => 3322, \"3323\" => 3323, \"3324\" => 3324, \"3325\" => 3325, \"3326\" => 3326, \"3327\" => 3327, \"3328\" => 3328, \"3329\" => 3329, \"3330\" => 3330, \"3331\" => 3331, \"3332\" => 3332, \"3333\" => 3333, \"3334\" => 3334, \"3335\" => 3335, \"3336\" => 3336, \"3337\" => 3337, \"3338\" => 3338, \"3339\" => 3339, \"3340\" => 3340, \"3341\" => 3341, \"3342\" => 3342, \"3343\" => 3343, \"3344\" => 3344, \"3345\" => 3345, \"3346\" => 3346, \"3347\" => 3347, \"3348\" => 3348, \"3349\" => 3349, \"3350\" => 3350, \"3351\" => 3351, \"3352\" => 3352, \"3353\" => 3353, \"3354\" => 3354, \"3355\" => 3355, \"3356\" => 3356, \"3357\" => 3357, \"3358\" => 3358, \"3359\" => 3359, \"3360\" => 3360, \"3361\" => 3361, \"3362\" => 3362, \"3363\" => 3363, \"3364\" => 3364, \"3365\" => 3365, \"3366\" => 3366, \"3367\" => 3367, \"3368\" => 3368, \"3369\" => 3369, \"3370\" => 3370, \"3371\" => 3371, \"3372\" => 3372, \"3373\" => 3373, \"3374\" => 3374, \"3375\" => 3375, \"3376\" => 3376, \"3377\" => 3377, \"3378\" => 3378, \"3379\" => 3379, \"3380\" => 3380, \"3381\" => 3381, \"3382\" => 3382, \"3383\" => 3383, \"3384\" => 3384, \"3385\" => 3385, \"3386\" => 3386, \"3387\" => 3387, \"3388\" => 3388, \"3389\" => 3389, \"3390\" => 3390, \"3391\" => 3391, \"3392\" => 3392, \"3393\" => 3393, \"3394\" => 3394, \"3395\" => 3395, \"3396\" => 3396, \"3397\" => 3397, \"3398\" => 3398, \"3399\" => 3399, \"3400\" => 3400, \"3401\" => 3401, \"3402\" => 3402, \"3403\" => 3403, \"3404\" => 3404, \"3405\" => 3405, \"3406\" => 3406, \"3407\" => 3407, \"3408\" => 3408, \"3409\" => 3409, \"3410\" => 3410, \"3411\" => 3411, \"3412\" => 3412, \"3413\" => 3413, \"3414\" => 3414, \"3415\" => 3415, \"3416\" => 3416, \"3417\" => 3417, \"3418\" => 3418, \"3419\" => 3419, \"3420\" => 3420, \"3421\" => 3421, \"3422\" => 3422, \"3423\" => 3423, \"3424\" => 3424, \"3425\" => 3425, \"3426\" => 3426, \"3427\" => 3427, \"3428\" => 3428, \"3429\" => 3429, \"3430\" => 3430, \"3431\" => 3431, \"3432\" => 3432, \"3433\" => 3433, \"3434\" => 3434, \"3435\" => 3435, \"3436\" => 3436, \"3437\" => 3437, \"3438\" => 3438, \"3439\" => 3439, \"3440\" => 3440, \"3441\" => 3441, \"3442\" => 3442, \"3443\" => 3443, \"3444\" => 3444, \"3445\" => 3445, \"3446\" => 3446, \"3447\" => 3447, \"3448\" => 3448, \"3449\" => 3449, \"3450\" => 3450, \"3451\" => 3451, \"3452\" => 3452, \"3453\" => 3453, \"3454\" => 3454, \"3455\" => 3455, \"3456\" => 3456, \"3457\" => 3457, \"3458\" => 3458, \"3459\" => 3459, \"3460\" => 3460, \"3461\" => 3461, \"3462\" => 3462, \"3463\" => 3463, \"3464\" => 3464, \"3465\" => 3465, \"3466\" => 3466, \"3467\" => 3467, \"3468\" => 3468, \"3469\" => 3469, \"3470\" => 3470, \"3471\" => 3471, \"3472\" => 3472, \"3473\" => 3473, \"3474\" => 3474, \"3475\" => 3475, \"3476\" => 3476, \"3477\" => 3477, \"3478\" => 3478, \"3479\" => 3479, \"3480\" => 3480, \"3481\" => 3481, \"3482\" => 3482, \"3483\" => 3483, \"3484\" => 3484, \"3485\" => 3485, \"3486\" => 3486, \"3487\" => 3487, \"3488\" => 3488, \"3489\" => 3489, \"3490\" => 3490, \"3491\" => 3491, \"3492\" => 3492, \"3493\" => 3493, \"3494\" => 3494, \"3495\" => 3495, \"3496\" => 3496, \"3497\" => 3497, \"3498\" => 3498, \"3499\" => 3499, \"3500\" => 3500, \"3501\" => 3501, \"3502\" => 3502, \"3503\" => 3503, \"3504\" => 3504, \"3505\" => 3505, \"3506\" => 3506, \"3507\" => 3507, \"3508\" => 3508, \"3509\" => 3509, \"3510\" => 3510, \"3511\" => 3511, \"3512\" => 3512, \"3513\" => 3513, \"3514\" => 3514, \"3515\" => 3515, \"3516\" => 3516, \"3517\" => 3517, \"3518\" => 3518, \"3519\" => 3519, \"3520\" => 3520, \"3521\" => 3521, \"3522\" => 3522, \"3523\" => 3523, \"3524\" => 3524, \"3525\" => 3525, \"3526\" => 3526, \"3527\" => 3527, \"3528\" => 3528, \"3529\" => 3529, \"3530\" => 3530, \"3531\" => 3531, \"3532\" => 3532, \"3533\" => 3533, \"3534\" => 3534, \"3535\" => 3535, \"3536\" => 3536, \"3537\" => 3537, \"3538\" => 3538, \"3539\" => 3539, \"3540\" => 3540, \"3541\" => 3541, \"3542\" => 3542, \"3543\" => 3543, \"3544\" => 3544, \"3545\" => 3545, \"3546\" => 3546, \"3547\" => 3547, \"3548\" => 3548, \"3549\" => 3549, \"3550\" => 3550, \"3551\" => 3551, \"3552\" => 3552, \"3553\" => 3553, \"3554\" => 3554, \"3555\" => 3555, \"3556\" => 3556, \"3557\" => 3557, \"3558\" => 3558, \"3559\" => 3559, \"3560\" => 3560, \"3561\" => 3561, \"3562\" => 3562, \"3563\" => 3563, \"3564\" => 3564, \"3565\" => 3565, \"3566\" => 3566, \"3567\" => 3567, \"3568\" => 3568, \"3569\" => 3569, \"3570\" => 3570, \"3571\" => 3571, \"3572\" => 3572, \"3573\" => 3573, \"3574\" => 3574, \"3575\" => 3575, \"3576\" => 3576, \"3577\" => 3577, \"3578\" => 3578, \"3579\" => 3579, \"3580\" => 3580, \"3581\" => 3581, \"3582\" => 3582, \"3583\" => 3583, \"3584\" => 3584, \"3585\" => 3585, \"3586\" => 3586, \"3587\" => 3587, \"3588\" => 3588, \"3589\" => 3589, \"3590\" => 3590, \"3591\" => 3591, \"3592\" => 3592, \"3593\" => 3593, \"3594\" => 3594, \"3595\" => 3595, \"3596\" => 3596, \"3597\" => 3597, \"3598\" => 3598, \"3599\" => 3599, \"3600\" => 3600, \"3601\" => 3601, \"3602\" => 3602, \"3603\" => 3603, \"3604\" => 3604, \"3605\" => 3605, \"3606\" => 3606, \"3607\" => 3607, \"3608\" => 3608, \"3609\" => 3609, \"3610\" => 3610, \"3611\" => 3611, \"3612\" => 3612, \"3613\" => 3613, \"3614\" => 3614, \"3615\" => 3615, \"3616\" => 3616, \"3617\" => 3617, \"3618\" => 3618, \"3619\" => 3619, \"3620\" => 3620, \"3621\" => 3621, \"3622\" => 3622, \"3623\" => 3623, \"3624\" => 3624, \"3625\" => 3625, \"3626\" => 3626, \"3627\" => 3627, \"3628\" => 3628, \"3629\" => 3629, \"3630\" => 3630, \"3631\" => 3631, \"3632\" => 3632, \"3633\" => 3633, \"3634\" => 3634, \"3635\" => 3635, \"3636\" => 3636, \"3637\" => 3637, \"3638\" => 3638, \"3639\" => 3639, \"3640\" => 3640, \"3641\" => 3641, \"3642\" => 3642, \"3643\" => 3643, \"3644\" => 3644, \"3645\" => 3645, \"3646\" => 3646, \"3647\" => 3647, \"3648\" => 3648, \"3649\" => 3649, \"3650\" => 3650, \"3651\" => 3651, \"3652\" => 3652, \"3653\" => 3653, \"3654\" => 3654, \"3655\" => 3655, \"3656\" => 3656, \"3657\" => 3657, \"3658\" => 3658, \"3659\" => 3659, \"3660\" => 3660, \"3661\" => 3661, \"3662\" => 3662, \"3663\" => 3663, \"3664\" => 3664, \"3665\" => 3665, \"3666\" => 3666, \"3667\" => 3667, \"3668\" => 3668, \"3669\" => 3669, \"3670\" => 3670, \"3671\" => 3671, \"3672\" => 3672, \"3673\" => 3673, \"3674\" => 3674, \"3675\" => 3675, \"3676\" => 3676, \"3677\" => 3677, \"3678\" => 3678, \"3679\" => 3679, \"3680\" => 3680, \"3681\" => 3681, \"3682\" => 3682, \"3683\" => 3683, \"3684\" => 3684, \"3685\" => 3685, \"3686\" => 3686, \"3687\" => 3687, \"3688\" => 3688, \"3689\" => 3689, \"3690\" => 3690, \"3691\" => 3691, \"3692\" => 3692, \"3693\" => 3693, \"3694\" => 3694, \"3695\" => 3695, \"3696\" => 3696, \"3697\" => 3697, \"3698\" => 3698, \"3699\" => 3699, \"3700\" => 3700, \"3701\" => 3701, \"3702\" => 3702, \"3703\" => 3703, \"3704\" => 3704, \"3705\" => 3705, \"3706\" => 3706, \"3707\" => 3707, \"3708\" => 3708, \"3709\" => 3709, \"3710\" => 3710, \"3711\" => 3711, \"3712\" => 3712, \"3713\" => 3713, \"3714\" => 3714, \"3715\" => 3715, \"3716\" => 3716, \"3717\" => 3717, \"3718\" => 3718, \"3719\" => 3719, \"3720\" => 3720, \"3721\" => 3721, \"3722\" => 3722, \"3723\" => 3723, \"3724\" => 3724, \"3725\" => 3725, \"3726\" => 3726, \"3727\" => 3727, \"3728\" => 3728, \"3729\" => 3729, \"3730\" => 3730, \"3731\" => 3731, \"3732\" => 3732, \"3733\" => 3733, \"3734\" => 3734, \"3735\" => 3735, \"3736\" => 3736, \"3737\" => 3737, \"3738\" => 3738, \"3739\" => 3739, \"3740\" => 3740, \"3741\" => 3741, \"3742\" => 3742, \"3743\" => 3743, \"3744\" => 3744, \"3745\" => 3745, \"3746\" => 3746, \"3747\" => 3747, \"3748\" => 3748, \"3749\" => 3749, \"3750\" => 3750, \"3751\" => 3751, \"3752\" => 3752, \"3753\" => 3753, \"3754\" => 3754, \"3755\" => 3755, \"3756\" => 3756, \"3757\" => 3757, \"3758\" => 3758, \"3759\" => 3759, \"3760\" => 3760, \"3761\" => 3761, \"3762\" => 3762, \"3763\" => 3763, \"3764\" => 3764, \"3765\" => 3765, \"3766\" => 3766, \"3767\" => 3767, \"3768\" => 3768, \"3769\" => 3769, \"3770\" => 3770, \"3771\" => 3771, \"3772\" => 3772, \"3773\" => 3773, \"3774\" => 3774, \"3775\" => 3775, \"3776\" => 3776, \"3777\" => 3777, \"3778\" => 3778, \"3779\" => 3779, \"3780\" => 3780, \"3781\" => 3781, \"3782\" => 3782, \"3783\" => 3783, \"3784\" => 3784, \"3785\" => 3785, \"3786\" => 3786, \"3787\" => 3787, \"3788\" => 3788, \"3789\" => 3789, \"3790\" => 3790, \"3791\" => 3791, \"3792\" => 3792, \"3793\" => 3793, \"3794\" => 3794, \"3795\" => 3795, \"3796\" => 3796, \"3797\" => 3797, \"3798\" => 3798, \"3799\" => 3799, \"3800\" => 3800, \"3801\" => 3801, \"3802\" => 3802, \"3803\" => 3803, \"3804\" => 3804, \"3805\" => 3805, \"3806\" => 3806, \"3807\" => 3807, \"3808\" => 3808, \"3809\" => 3809, \"3810\" => 3810, \"3811\" => 3811, \"3812\" => 3812, \"3813\" => 3813, \"3814\" => 3814, \"3815\" => 3815, \"3816\" => 3816, \"3817\" => 3817, \"3818\" => 3818, \"3819\" => 3819, \"3820\" => 3820, \"3821\" => 3821, \"3822\" => 3822, \"3823\" => 3823, \"3824\" => 3824, \"3825\" => 3825, \"3826\" => 3826, \"3827\" => 3827, \"3828\" => 3828, \"3829\" => 3829, \"3830\" => 3830, \"3831\" => 3831, \"3832\" => 3832, \"3833\" => 3833, \"3834\" => 3834, \"3835\" => 3835, \"3836\" => 3836, \"3837\" => 3837, \"3838\" => 3838, \"3839\" => 3839, \"3840\" => 3840, \"3841\" => 3841, \"3842\" => 3842, \"3843\" => 3843, \"3844\" => 3844, \"3845\" => 3845, \"3846\" => 3846, \"3847\" => 3847, \"3848\" => 3848, \"3849\" => 3849, \"3850\" => 3850, \"3851\" => 3851, \"3852\" => 3852, \"3853\" => 3853, \"3854\" => 3854, \"3855\" => 3855, \"3856\" => 3856, \"3857\" => 3857, \"3858\" => 3858, \"3859\" => 3859, \"3860\" => 3860, \"3861\" => 3861, \"3862\" => 3862, \"3863\" => 3863, \"3864\" => 3864, \"3865\" => 3865, \"3866\" => 3866, \"3867\" => 3867, \"3868\" => 3868, \"3869\" => 3869, \"3870\" => 3870, \"3871\" => 3871, \"3872\" => 3872, \"3873\" => 3873, \"3874\" => 3874, \"3875\" => 3875, \"3876\" => 3876, \"3877\" => 3877, \"3878\" => 3878, \"3879\" => 3879, \"3880\" => 3880, \"3881\" => 3881, \"3882\" => 3882, \"3883\" => 3883, \"3884\" => 3884, \"3885\" => 3885, \"3886\" => 3886, \"3887\" => 3887, \"3888\" => 3888, \"3889\" => 3889, \"3890\" => 3890, \"3891\" => 3891, \"3892\" => 3892, \"3893\" => 3893, \"3894\" => 3894, \"3895\" => 3895, \"3896\" => 3896, \"3897\" => 3897, \"3898\" => 3898, \"3899\" => 3899, \"3900\" => 3900, \"3901\" => 3901, \"3902\" => 3902, \"3903\" => 3903, \"3904\" => 3904, \"3905\" => 3905, \"3906\" => 3906, \"3907\" => 3907, \"3908\" => 3908, \"3909\" => 3909, \"3910\" => 3910, \"3911\" => 3911, \"3912\" => 3912, \"3913\" => 3913, \"3914\" => 3914, \"3915\" => 3915, \"3916\" => 3916, \"3917\" => 3917, \"3918\" => 3918, \"3919\" => 3919, \"3920\" => 3920, \"3921\" => 3921, \"3922\" => 3922, \"3923\" => 3923, \"3924\" => 3924, \"3925\" => 3925, \"3926\" => 3926, \"3927\" => 3927, \"3928\" => 3928, \"3929\" => 3929, \"3930\" => 3930, \"3931\" => 3931, \"3932\" => 3932, \"3933\" => 3933, \"3934\" => 3934, \"3935\" => 3935, \"3936\" => 3936, \"3937\" => 3937, \"3938\" => 3938, \"3939\" => 3939, \"3940\" => 3940, \"3941\" => 3941, \"3942\" => 3942, \"3943\" => 3943, \"3944\" => 3944, \"3945\" => 3945, \"3946\" => 3946, \"3947\" => 3947, \"3948\" => 3948, \"3949\" => 3949, \"3950\" => 3950, \"3951\" => 3951, \"3952\" => 3952, \"3953\" => 3953, \"3954\" => 3954, \"3955\" => 3955, \"3956\" => 3956, \"3957\" => 3957, \"3958\" => 3958, \"3959\" => 3959, \"3960\" => 3960, \"3961\" => 3961, \"3962\" => 3962, \"3963\" => 3963, \"3964\" => 3964, \"3965\" => 3965, \"3966\" => 3966, \"3967\" => 3967, \"3968\" => 3968, \"3969\" => 3969, \"3970\" => 3970, \"3971\" => 3971, \"3972\" => 3972, \"3973\" => 3973, \"3974\" => 3974, \"3975\" => 3975, \"3976\" => 3976, \"3977\" => 3977, \"3978\" => 3978, \"3979\" => 3979, \"3980\" => 3980, \"3981\" => 3981, \"3982\" => 3982, \"3983\" => 3983, \"3984\" => 3984, \"3985\" => 3985, \"3986\" => 3986, \"3987\" => 3987, \"3988\" => 3988, \"3989\" => 3989, \"3990\" => 3990, \"3991\" => 3991, \"3992\" => 3992, \"3993\" => 3993, \"3994\" => 3994, \"3995\" => 3995, \"3996\" => 3996, \"3997\" => 3997, \"3998\" => 3998, \"3999\" => 3999, \"4000\" => 4000, \"4001\" => 4001, \"4002\" => 4002, \"4003\" => 4003, \"4004\" => 4004, \"4005\" => 4005, \"4006\" => 4006, \"4007\" => 4007, \"4008\" => 4008, \"4009\" => 4009, \"4010\" => 4010, \"4011\" => 4011, \"4012\" => 4012, \"4013\" => 4013, \"4014\" => 4014, \"4015\" => 4015, \"4016\" => 4016, \"4017\" => 4017, \"4018\" => 4018, \"4019\" => 4019, \"4020\" => 4020, \"4021\" => 4021, \"4022\" => 4022, \"4023\" => 4023, \"4024\" => 4024, \"4025\" => 4025, \"4026\" => 4026, \"4027\" => 4027, \"4028\" => 4028, \"4029\" => 4029, \"4030\" => 4030, \"4031\" => 4031, \"4032\" => 4032, \"4033\" => 4033, \"4034\" => 4034, \"4035\" => 4035, \"4036\" => 4036, \"4037\" => 4037, \"4038\" => 4038, \"4039\" => 4039, \"4040\" => 4040, \"4041\" => 4041, \"4042\" => 4042, \"4043\" => 4043, \"4044\" => 4044, \"4045\" => 4045, \"4046\" => 4046, \"4047\" => 4047, \"4048\" => 4048, \"4049\" => 4049, \"4050\" => 4050, \"4051\" => 4051, \"4052\" => 4052, \"4053\" => 4053, \"4054\" => 4054, \"4055\" => 4055, \"4056\" => 4056, \"4057\" => 4057, \"4058\" => 4058, \"4059\" => 4059, \"4060\" => 4060, \"4061\" => 4061, \"4062\" => 4062, \"4063\" => 4063, \"4064\" => 4064, \"4065\" => 4065, \"4066\" => 4066, \"4067\" => 4067, \"4068\" => 4068, \"4069\" => 4069, \"4070\" => 4070, \"4071\" => 4071, \"4072\" => 4072, \"4073\" => 4073, \"4074\" => 4074, \"4075\" => 4075, \"4076\" => 4076, \"4077\" => 4077, \"4078\" => 4078, \"4079\" => 4079, \"4080\" => 4080, \"4081\" => 4081, \"4082\" => 4082, \"4083\" => 4083, \"4084\" => 4084, \"4085\" => 4085, \"4086\" => 4086, \"4087\" => 4087, \"4088\" => 4088, \"4089\" => 4089, \"4090\" => 4090, \"4091\" => 4091, \"4092\" => 4092, \"4093\" => 4093, \"4094\" => 4094, \"4095\" => 4095, \"4096\" => 4096, \"4097\" => 4097, \"4098\" => 4098, \"4099\" => 4099, \"4100\" => 4100, \"4101\" => 4101, \"4102\" => 4102, \"4103\" => 4103, \"4104\" => 4104, \"4105\" => 4105, \"4106\" => 4106, \"4107\" => 4107, \"4108\" => 4108, \"4109\" => 4109, \"4110\" => 4110, \"4111\" => 4111, \"4112\" => 4112, \"4113\" => 4113, \"4114\" => 4114, \"4115\" => 4115, \"4116\" => 4116, \"4117\" => 4117, \"4118\" => 4118, \"4119\" => 4119, \"4120\" => 4120, \"4121\" => 4121, \"4122\" => 4122, \"4123\" => 4123, \"4124\" => 4124, \"4125\" => 4125, \"4126\" => 4126, \"4127\" => 4127, \"4128\" => 4128, \"4129\" => 4129, \"4130\" => 4130, \"4131\" => 4131, \"4132\" => 4132, \"4133\" => 4133, \"4134\" => 4134, \"4135\" => 4135, \"4136\" => 4136, \"4137\" => 4137, \"4138\" => 4138, \"4139\" => 4139, \"4140\" => 4140, \"4141\" => 4141, \"4142\" => 4142, \"4143\" => 4143, \"4144\" => 4144, \"4145\" => 4145, \"4146\" => 4146, \"4147\" => 4147, \"4148\" => 4148, \"4149\" => 4149, \"4150\" => 4150, \"4151\" => 4151, \"4152\" => 4152, \"4153\" => 4153, \"4154\" => 4154, \"4155\" => 4155, \"4156\" => 4156, \"4157\" => 4157, \"4158\" => 4158, \"4159\" => 4159, \"4160\" => 4160, \"4161\" => 4161, \"4162\" => 4162, \"4163\" => 4163, \"4164\" => 4164, \"4165\" => 4165, \"4166\" => 4166, \"4167\" => 4167, \"4168\" => 4168, \"4169\" => 4169, \"4170\" => 4170, \"4171\" => 4171, \"4172\" => 4172, \"4173\" => 4173, \"4174\" => 4174, \"4175\" => 4175, \"4176\" => 4176, \"4177\" => 4177, \"4178\" => 4178, \"4179\" => 4179, \"4180\" => 4180, \"4181\" => 4181, \"4182\" => 4182, \"4183\" => 4183, \"4184\" => 4184, \"4185\" => 4185, \"4186\" => 4186, \"4187\" => 4187, \"4188\" => 4188, \"4189\" => 4189, \"4190\" => 4190, \"4191\" => 4191, \"4192\" => 4192, \"4193\" => 4193, \"4194\" => 4194, \"4195\" => 4195, \"4196\" => 4196, \"4197\" => 4197, \"4198\" => 4198, \"4199\" => 4199, \"4200\" => 4200, \"4201\" => 4201, \"4202\" => 4202, \"4203\" => 4203, \"4204\" => 4204, \"4205\" => 4205, \"4206\" => 4206, \"4207\" => 4207, \"4208\" => 4208, \"4209\" => 4209, \"4210\" => 4210, \"4211\" => 4211, \"4212\" => 4212, \"4213\" => 4213, \"4214\" => 4214, \"4215\" => 4215, \"4216\" => 4216, \"4217\" => 4217, \"4218\" => 4218, \"4219\" => 4219, \"4220\" => 4220, \"4221\" => 4221, \"4222\" => 4222, \"4223\" => 4223, \"4224\" => 4224, \"4225\" => 4225, \"4226\" => 4226, \"4227\" => 4227, \"4228\" => 4228, \"4229\" => 4229, \"4230\" => 4230, \"4231\" => 4231, \"4232\" => 4232, \"4233\" => 4233, \"4234\" => 4234, \"4235\" => 4235, \"4236\" => 4236, \"4237\" => 4237, \"4238\" => 4238, \"4239\" => 4239, \"4240\" => 4240, \"4241\" => 4241, \"4242\" => 4242, \"4243\" => 4243, \"4244\" => 4244, \"4245\" => 4245, \"4246\" => 4246, \"4247\" => 4247, \"4248\" => 4248, \"4249\" => 4249, \"4250\" => 4250, \"4251\" => 4251, \"4252\" => 4252, \"4253\" => 4253, \"4254\" => 4254, \"4255\" => 4255, \"4256\" => 4256, \"4257\" => 4257, \"4258\" => 4258, \"4259\" => 4259, \"4260\" => 4260, \"4261\" => 4261, \"4262\" => 4262, \"4263\" => 4263, \"4264\" => 4264, \"4265\" => 4265, \"4266\" => 4266, \"4267\" => 4267, \"4268\" => 4268, \"4269\" => 4269, \"4270\" => 4270, \"4271\" => 4271, \"4272\" => 4272, \"4273\" => 4273, \"4274\" => 4274, \"4275\" => 4275, \"4276\" => 4276, \"4277\" => 4277, \"4278\" => 4278, \"4279\" => 4279, \"4280\" => 4280, \"4281\" => 4281, \"4282\" => 4282, \"4283\" => 4283, \"4284\" => 4284, \"4285\" => 4285, \"4286\" => 4286, \"4287\" => 4287, \"4288\" => 4288, \"4289\" => 4289, \"4290\" => 4290, \"4291\" => 4291, \"4292\" => 4292, \"4293\" => 4293, \"4294\" => 4294, \"4295\" => 4295, \"4296\" => 4296, \"4297\" => 4297, \"4298\" => 4298, \"4299\" => 4299, \"4300\" => 4300, \"4301\" => 4301, \"4302\" => 4302, \"4303\" => 4303, \"4304\" => 4304, \"4305\" => 4305, \"4306\" => 4306, \"4307\" => 4307, \"4308\" => 4308, \"4309\" => 4309, \"4310\" => 4310, \"4311\" => 4311, \"4312\" => 4312, \"4313\" => 4313, \"4314\" => 4314, \"4315\" => 4315, \"4316\" => 4316, \"4317\" => 4317, \"4318\" => 4318, \"4319\" => 4319, \"4320\" => 4320, \"4321\" => 4321, \"4322\" => 4322, \"4323\" => 4323, \"4324\" => 4324, \"4325\" => 4325, \"4326\" => 4326, \"4327\" => 4327, \"4328\" => 4328, \"4329\" => 4329, \"4330\" => 4330, \"4331\" => 4331, \"4332\" => 4332, \"4333\" => 4333, \"4334\" => 4334, \"4335\" => 4335, \"4336\" => 4336, \"4337\" => 4337, \"4338\" => 4338, \"4339\" => 4339, \"4340\" => 4340, \"4341\" => 4341, \"4342\" => 4342, \"4343\" => 4343, \"4344\" => 4344, \"4345\" => 4345, \"4346\" => 4346, \"4347\" => 4347, \"4348\" => 4348, \"4349\" => 4349, \"4350\" => 4350, \"4351\" => 4351, \"4352\" => 4352, \"4353\" => 4353, \"4354\" => 4354, \"4355\" => 4355, \"4356\" => 4356, \"4357\" => 4357, \"4358\" => 4358, \"4359\" => 4359, \"4360\" => 4360, \"4361\" => 4361, \"4362\" => 4362, \"4363\" => 4363, \"4364\" => 4364, \"4365\" => 4365, \"4366\" => 4366, \"4367\" => 4367, \"4368\" => 4368, \"4369\" => 4369, \"4370\" => 4370, \"4371\" => 4371, \"4372\" => 4372, \"4373\" => 4373, \"4374\" => 4374, \"4375\" => 4375, \"4376\" => 4376, \"4377\" => 4377, \"4378\" => 4378, \"4379\" => 4379, \"4380\" => 4380, \"4381\" => 4381, \"4382\" => 4382, \"4383\" => 4383, \"4384\" => 4384, \"4385\" => 4385, \"4386\" => 4386, \"4387\" => 4387, \"4388\" => 4388, \"4389\" => 4389, \"4390\" => 4390, \"4391\" => 4391, \"4392\" => 4392, \"4393\" => 4393, \"4394\" => 4394, \"4395\" => 4395, \"4396\" => 4396, \"4397\" => 4397, \"4398\" => 4398, \"4399\" => 4399, \"4400\" => 4400, \"4401\" => 4401, \"4402\" => 4402, \"4403\" => 4403, \"4404\" => 4404, \"4405\" => 4405, \"4406\" => 4406, \"4407\" => 4407, \"4408\" => 4408, \"4409\" => 4409, \"4410\" => 4410, \"4411\" => 4411, \"4412\" => 4412, \"4413\" => 4413, \"4414\" => 4414, \"4415\" => 4415, \"4416\" => 4416, \"4417\" => 4417, \"4418\" => 4418, \"4419\" => 4419, \"4420\" => 4420, \"4421\" => 4421, \"4422\" => 4422, \"4423\" => 4423, \"4424\" => 4424, \"4425\" => 4425, \"4426\" => 4426, \"4427\" => 4427, \"4428\" => 4428, \"4429\" => 4429, \"4430\" => 4430, \"4431\" => 4431, \"4432\" => 4432, \"4433\" => 4433, \"4434\" => 4434, \"4435\" => 4435, \"4436\" => 4436, \"4437\" => 4437, \"4438\" => 4438, \"4439\" => 4439, \"4440\" => 4440, \"4441\" => 4441, \"4442\" => 4442, \"4443\" => 4443, \"4444\" => 4444, \"4445\" => 4445, \"4446\" => 4446, \"4447\" => 4447, \"4448\" => 4448, \"4449\" => 4449, \"4450\" => 4450, \"4451\" => 4451, \"4452\" => 4452, \"4453\" => 4453, \"4454\" => 4454, \"4455\" => 4455, \"4456\" => 4456, \"4457\" => 4457, \"4458\" => 4458, \"4459\" => 4459, \"4460\" => 4460, \"4461\" => 4461, \"4462\" => 4462, \"4463\" => 4463, \"4464\" => 4464, \"4465\" => 4465, \"4466\" => 4466, \"4467\" => 4467, \"4468\" => 4468, \"4469\" => 4469, \"4470\" => 4470, \"4471\" => 4471, \"4472\" => 4472, \"4473\" => 4473, \"4474\" => 4474, \"4475\" => 4475, \"4476\" => 4476, \"4477\" => 4477, \"4478\" => 4478, \"4479\" => 4479, \"4480\" => 4480, \"4481\" => 4481, \"4482\" => 4482, \"4483\" => 4483, \"4484\" => 4484, \"4485\" => 4485, \"4486\" => 4486, \"4487\" => 4487, \"4488\" => 4488, \"4489\" => 4489, \"4490\" => 4490, \"4491\" => 4491, \"4492\" => 4492, \"4493\" => 4493, \"4494\" => 4494, \"4495\" => 4495, \"4496\" => 4496, \"4497\" => 4497, \"4498\" => 4498, \"4499\" => 4499, \"4500\" => 4500, \"4501\" => 4501, \"4502\" => 4502, \"4503\" => 4503, \"4504\" => 4504, \"4505\" => 4505, \"4506\" => 4506, \"4507\" => 4507, \"4508\" => 4508, \"4509\" => 4509, \"4510\" => 4510, \"4511\" => 4511, \"4512\" => 4512, \"4513\" => 4513, \"4514\" => 4514, \"4515\" => 4515, \"4516\" => 4516, \"4517\" => 4517, \"4518\" => 4518, \"4519\" => 4519, \"4520\" => 4520, \"4521\" => 4521, \"4522\" => 4522, \"4523\" => 4523, \"4524\" => 4524, \"4525\" => 4525, \"4526\" => 4526, \"4527\" => 4527, \"4528\" => 4528, \"4529\" => 4529, \"4530\" => 4530, \"4531\" => 4531, \"4532\" => 4532, \"4533\" => 4533, \"4534\" => 4534, \"4535\" => 4535, \"4536\" => 4536, \"4537\" => 4537, \"4538\" => 4538, \"4539\" => 4539, \"4540\" => 4540, \"4541\" => 4541, \"4542\" => 4542, \"4543\" => 4543, \"4544\" => 4544, \"4545\" => 4545, \"4546\" => 4546, \"4547\" => 4547, \"4548\" => 4548, \"4549\" => 4549, \"4550\" => 4550, \"4551\" => 4551, \"4552\" => 4552, \"4553\" => 4553, \"4554\" => 4554, \"4555\" => 4555, \"4556\" => 4556, \"4557\" => 4557, \"4558\" => 4558, \"4559\" => 4559, \"4560\" => 4560, \"4561\" => 4561, \"4562\" => 4562, \"4563\" => 4563, \"4564\" => 4564, \"4565\" => 4565, \"4566\" => 4566, \"4567\" => 4567, \"4568\" => 4568, \"4569\" => 4569, \"4570\" => 4570, \"4571\" => 4571, \"4572\" => 4572, \"4573\" => 4573, \"4574\" => 4574, \"4575\" => 4575, \"4576\" => 4576, \"4577\" => 4577, \"4578\" => 4578, \"4579\" => 4579, \"4580\" => 4580, \"4581\" => 4581, \"4582\" => 4582, \"4583\" => 4583, \"4584\" => 4584, \"4585\" => 4585, \"4586\" => 4586, \"4587\" => 4587, \"4588\" => 4588, \"4589\" => 4589, \"4590\" => 4590, \"4591\" => 4591, \"4592\" => 4592, \"4593\" => 4593, \"4594\" => 4594, \"4595\" => 4595, \"4596\" => 4596, \"4597\" => 4597, \"4598\" => 4598, \"4599\" => 4599, \"4600\" => 4600, \"4601\" => 4601, \"4602\" => 4602, \"4603\" => 4603, \"4604\" => 4604, \"4605\" => 4605, \"4606\" => 4606, \"4607\" => 4607, \"4608\" => 4608, \"4609\" => 4609, \"4610\" => 4610, \"4611\" => 4611, \"4612\" => 4612, \"4613\" => 4613, \"4614\" => 4614, \"4615\" => 4615, \"4616\" => 4616, \"4617\" => 4617, \"4618\" => 4618, \"4619\" => 4619, \"4620\" => 4620, \"4621\" => 4621, \"4622\" => 4622, \"4623\" => 4623, \"4624\" => 4624, \"4625\" => 4625, \"4626\" => 4626, \"4627\" => 4627, \"4628\" => 4628, \"4629\" => 4629, \"4630\" => 4630, \"4631\" => 4631, \"4632\" => 4632, \"4633\" => 4633, \"4634\" => 4634, \"4635\" => 4635, \"4636\" => 4636, \"4637\" => 4637, \"4638\" => 4638, \"4639\" => 4639, \"4640\" => 4640, \"4641\" => 4641, \"4642\" => 4642, \"4643\" => 4643, \"4644\" => 4644, \"4645\" => 4645, \"4646\" => 4646, \"4647\" => 4647, \"4648\" => 4648, \"4649\" => 4649, \"4650\" => 4650, \"4651\" => 4651, \"4652\" => 4652, \"4653\" => 4653, \"4654\" => 4654, \"4655\" => 4655, \"4656\" => 4656, \"4657\" => 4657, \"4658\" => 4658, \"4659\" => 4659, \"4660\" => 4660, \"4661\" => 4661, \"4662\" => 4662, \"4663\" => 4663, \"4664\" => 4664, \"4665\" => 4665, \"4666\" => 4666, \"4667\" => 4667, \"4668\" => 4668, \"4669\" => 4669, \"4670\" => 4670, \"4671\" => 4671, \"4672\" => 4672, \"4673\" => 4673, \"4674\" => 4674, \"4675\" => 4675, \"4676\" => 4676, \"4677\" => 4677, \"4678\" => 4678, \"4679\" => 4679, \"4680\" => 4680, \"4681\" => 4681, \"4682\" => 4682, \"4683\" => 4683, \"4684\" => 4684, \"4685\" => 4685, \"4686\" => 4686, \"4687\" => 4687, \"4688\" => 4688, \"4689\" => 4689, \"4690\" => 4690, \"4691\" => 4691, \"4692\" => 4692, \"4693\" => 4693, \"4694\" => 4694, \"4695\" => 4695, \"4696\" => 4696, \"4697\" => 4697, \"4698\" => 4698, \"4699\" => 4699, \"4700\" => 4700, \"4701\" => 4701, \"4702\" => 4702, \"4703\" => 4703, \"4704\" => 4704, \"4705\" => 4705, \"4706\" => 4706, \"4707\" => 4707, \"4708\" => 4708, \"4709\" => 4709, \"4710\" => 4710, \"4711\" => 4711, \"4712\" => 4712, \"4713\" => 4713, \"4714\" => 4714, \"4715\" => 4715, \"4716\" => 4716, \"4717\" => 4717, \"4718\" => 4718, \"4719\" => 4719, \"4720\" => 4720, \"4721\" => 4721, \"4722\" => 4722, \"4723\" => 4723, \"4724\" => 4724, \"4725\" => 4725, \"4726\" => 4726, \"4727\" => 4727, \"4728\" => 4728, \"4729\" => 4729, \"4730\" => 4730, \"4731\" => 4731, \"4732\" => 4732, \"4733\" => 4733, \"4734\" => 4734, \"4735\" => 4735, \"4736\" => 4736, \"4737\" => 4737, \"4738\" => 4738, \"4739\" => 4739, \"4740\" => 4740, \"4741\" => 4741, \"4742\" => 4742, \"4743\" => 4743, \"4744\" => 4744, \"4745\" => 4745, \"4746\" => 4746, \"4747\" => 4747, \"4748\" => 4748, \"4749\" => 4749, \"4750\" => 4750, \"4751\" => 4751, \"4752\" => 4752, \"4753\" => 4753, \"4754\" => 4754, \"4755\" => 4755, \"4756\" => 4756, \"4757\" => 4757, \"4758\" => 4758, \"4759\" => 4759, \"4760\" => 4760, \"4761\" => 4761, \"4762\" => 4762, \"4763\" => 4763, \"4764\" => 4764, \"4765\" => 4765, \"4766\" => 4766, \"4767\" => 4767, \"4768\" => 4768, \"4769\" => 4769, \"4770\" => 4770, \"4771\" => 4771, \"4772\" => 4772, \"4773\" => 4773, \"4774\" => 4774, \"4775\" => 4775, \"4776\" => 4776, \"4777\" => 4777, \"4778\" => 4778, \"4779\" => 4779, \"4780\" => 4780, \"4781\" => 4781, \"4782\" => 4782, \"4783\" => 4783, \"4784\" => 4784, \"4785\" => 4785, \"4786\" => 4786, \"4787\" => 4787, \"4788\" => 4788, \"4789\" => 4789, \"4790\" => 4790, \"4791\" => 4791, \"4792\" => 4792, \"4793\" => 4793, \"4794\" => 4794, \"4795\" => 4795, \"4796\" => 4796, \"4797\" => 4797, \"4798\" => 4798, \"4799\" => 4799, \"4800\" => 4800, \"4801\" => 4801, \"4802\" => 4802, \"4803\" => 4803, \"4804\" => 4804, \"4805\" => 4805, \"4806\" => 4806, \"4807\" => 4807, \"4808\" => 4808, \"4809\" => 4809, \"4810\" => 4810, \"4811\" => 4811, \"4812\" => 4812, \"4813\" => 4813, \"4814\" => 4814, \"4815\" => 4815, \"4816\" => 4816, \"4817\" => 4817, \"4818\" => 4818, \"4819\" => 4819, \"4820\" => 4820, \"4821\" => 4821, \"4822\" => 4822, \"4823\" => 4823, \"4824\" => 4824, \"4825\" => 4825, \"4826\" => 4826, \"4827\" => 4827, \"4828\" => 4828, \"4829\" => 4829, \"4830\" => 4830, \"4831\" => 4831, \"4832\" => 4832, \"4833\" => 4833, \"4834\" => 4834, \"4835\" => 4835, \"4836\" => 4836, \"4837\" => 4837, \"4838\" => 4838, \"4839\" => 4839, \"4840\" => 4840, \"4841\" => 4841, \"4842\" => 4842, \"4843\" => 4843, \"4844\" => 4844, \"4845\" => 4845, \"4846\" => 4846, \"4847\" => 4847, \"4848\" => 4848, \"4849\" => 4849, \"4850\" => 4850, \"4851\" => 4851, \"4852\" => 4852, \"4853\" => 4853, \"4854\" => 4854, \"4855\" => 4855, \"4856\" => 4856, \"4857\" => 4857, \"4858\" => 4858, \"4859\" => 4859, \"4860\" => 4860, \"4861\" => 4861, \"4862\" => 4862, \"4863\" => 4863, \"4864\" => 4864, \"4865\" => 4865, \"4866\" => 4866, \"4867\" => 4867, \"4868\" => 4868, \"4869\" => 4869, \"4870\" => 4870, \"4871\" => 4871, \"4872\" => 4872, \"4873\" => 4873, \"4874\" => 4874, \"4875\" => 4875, \"4876\" => 4876, \"4877\" => 4877, \"4878\" => 4878, \"4879\" => 4879, \"4880\" => 4880, \"4881\" => 4881, \"4882\" => 4882, \"4883\" => 4883, \"4884\" => 4884, \"4885\" => 4885, \"4886\" => 4886, \"4887\" => 4887, \"4888\" => 4888, \"4889\" => 4889, \"4890\" => 4890, \"4891\" => 4891, \"4892\" => 4892, \"4893\" => 4893, \"4894\" => 4894, \"4895\" => 4895, \"4896\" => 4896, \"4897\" => 4897, \"4898\" => 4898, \"4899\" => 4899, \"4900\" => 4900, \"4901\" => 4901, \"4902\" => 4902, \"4903\" => 4903, \"4904\" => 4904, \"4905\" => 4905, \"4906\" => 4906, \"4907\" => 4907, \"4908\" => 4908, \"4909\" => 4909, \"4910\" => 4910, \"4911\" => 4911, \"4912\" => 4912, \"4913\" => 4913, \"4914\" => 4914, \"4915\" => 4915, \"4916\" => 4916, \"4917\" => 4917, \"4918\" => 4918, \"4919\" => 4919, \"4920\" => 4920, \"4921\" => 4921, \"4922\" => 4922, \"4923\" => 4923, \"4924\" => 4924, \"4925\" => 4925, \"4926\" => 4926, \"4927\" => 4927, \"4928\" => 4928, \"4929\" => 4929, \"4930\" => 4930, \"4931\" => 4931, \"4932\" => 4932, \"4933\" => 4933, \"4934\" => 4934, \"4935\" => 4935, \"4936\" => 4936, \"4937\" => 4937, \"4938\" => 4938, \"4939\" => 4939, \"4940\" => 4940, \"4941\" => 4941, \"4942\" => 4942, \"4943\" => 4943, \"4944\" => 4944, \"4945\" => 4945, \"4946\" => 4946, \"4947\" => 4947, \"4948\" => 4948, \"4949\" => 4949, \"4950\" => 4950, \"4951\" => 4951, \"4952\" => 4952, \"4953\" => 4953, \"4954\" => 4954, \"4955\" => 4955, \"4956\" => 4956, \"4957\" => 4957, \"4958\" => 4958, \"4959\" => 4959, \"4960\" => 4960, \"4961\" => 4961, \"4962\" => 4962, \"4963\" => 4963, \"4964\" => 4964, \"4965\" => 4965, \"4966\" => 4966, \"4967\" => 4967, \"4968\" => 4968, \"4969\" => 4969, \"4970\" => 4970, \"4971\" => 4971, \"4972\" => 4972, \"4973\" => 4973, \"4974\" => 4974, \"4975\" => 4975, \"4976\" => 4976, \"4977\" => 4977, \"4978\" => 4978, \"4979\" => 4979, \"4980\" => 4980, \"4981\" => 4981, \"4982\" => 4982, \"4983\" => 4983, \"4984\" => 4984, \"4985\" => 4985, \"4986\" => 4986, \"4987\" => 4987, \"4988\" => 4988, \"4989\" => 4989, \"4990\" => 4990, \"4991\" => 4991, \"4992\" => 4992, \"4993\" => 4993, \"4994\" => 4994, \"4995\" => 4995, \"4996\" => 4996, \"4997\" => 4997, \"4998\" => 4998, \"4999\" => 4999, \"5000\" => 5000, \"5001\" => 5001, \"5002\" => 5002, \"5003\" => 5003, \"5004\" => 5004, \"5005\" => 5005, \"5006\" => 5006, \"5007\" => 5007, \"5008\" => 5008, \"5009\" => 5009, \"5010\" => 5010, \"5011\" => 5011, \"5012\" => 5012, \"5013\" => 5013, \"5014\" => 5014, \"5015\" => 5015, \"5016\" => 5016, \"5017\" => 5017, \"5018\" => 5018, \"5019\" => 5019, \"5020\" => 5020, \"5021\" => 5021, \"5022\" => 5022, \"5023\" => 5023, \"5024\" => 5024, \"5025\" => 5025, \"5026\" => 5026, \"5027\" => 5027, \"5028\" => 5028, \"5029\" => 5029, \"5030\" => 5030, \"5031\" => 5031, \"5032\" => 5032, \"5033\" => 5033, \"5034\" => 5034, \"5035\" => 5035, \"5036\" => 5036, \"5037\" => 5037, \"5038\" => 5038, \"5039\" => 5039, \"5040\" => 5040, \"5041\" => 5041, \"5042\" => 5042, \"5043\" => 5043, \"5044\" => 5044, \"5045\" => 5045, \"5046\" => 5046, \"5047\" => 5047, \"5048\" => 5048, \"5049\" => 5049, \"5050\" => 5050, \"5051\" => 5051, \"5052\" => 5052, \"5053\" => 5053, \"5054\" => 5054, \"5055\" => 5055, \"5056\" => 5056, \"5057\" => 5057, \"5058\" => 5058, \"5059\" => 5059, \"5060\" => 5060, \"5061\" => 5061, \"5062\" => 5062, \"5063\" => 5063, \"5064\" => 5064, \"5065\" => 5065, \"5066\" => 5066, \"5067\" => 5067, \"5068\" => 5068, \"5069\" => 5069, \"5070\" => 5070, \"5071\" => 5071, \"5072\" => 5072, \"5073\" => 5073, \"5074\" => 5074, \"5075\" => 5075, \"5076\" => 5076, \"5077\" => 5077, \"5078\" => 5078, \"5079\" => 5079, \"5080\" => 5080, \"5081\" => 5081, \"5082\" => 5082, \"5083\" => 5083, \"5084\" => 5084, \"5085\" => 5085, \"5086\" => 5086, \"5087\" => 5087, \"5088\" => 5088, \"5089\" => 5089, \"5090\" => 5090, \"5091\" => 5091, \"5092\" => 5092, \"5093\" => 5093, \"5094\" => 5094, \"5095\" => 5095, \"5096\" => 5096, \"5097\" => 5097, \"5098\" => 5098, \"5099\" => 5099, \"5100\" => 5100, \"5101\" => 5101, \"5102\" => 5102, \"5103\" => 5103, \"5104\" => 5104, \"5105\" => 5105, \"5106\" => 5106, \"5107\" => 5107, \"5108\" => 5108, \"5109\" => 5109, \"5110\" => 5110, \"5111\" => 5111, \"5112\" => 5112, \"5113\" => 5113, \"5114\" => 5114, \"5115\" => 5115, \"5116\" => 5116, \"5117\" => 5117, \"5118\" => 5118, \"5119\" => 5119, \"5120\" => 5120, \"5121\" => 5121, \"5122\" => 5122, \"5123\" => 5123, \"5124\" => 5124, \"5125\" => 5125, \"5126\" => 5126, \"5127\" => 5127, \"5128\" => 5128, \"5129\" => 5129, \"5130\" => 5130, \"5131\" => 5131, \"5132\" => 5132, \"5133\" => 5133, \"5134\" => 5134, \"5135\" => 5135, \"5136\" => 5136, \"5137\" => 5137, \"5138\" => 5138, \"5139\" => 5139, \"5140\" => 5140, \"5141\" => 5141, \"5142\" => 5142, \"5143\" => 5143, \"5144\" => 5144, \"5145\" => 5145, \"5146\" => 5146, \"5147\" => 5147, \"5148\" => 5148, \"5149\" => 5149, \"5150\" => 5150, \"5151\" => 5151, \"5152\" => 5152, \"5153\" => 5153, \"5154\" => 5154, \"5155\" => 5155, \"5156\" => 5156, \"5157\" => 5157, \"5158\" => 5158, \"5159\" => 5159, \"5160\" => 5160, \"5161\" => 5161, \"5162\" => 5162, \"5163\" => 5163, \"5164\" => 5164, \"5165\" => 5165, \"5166\" => 5166, \"5167\" => 5167, \"5168\" => 5168, \"5169\" => 5169, \"5170\" => 5170, \"5171\" => 5171, \"5172\" => 5172, \"5173\" => 5173, \"5174\" => 5174, \"5175\" => 5175, \"5176\" => 5176, \"5177\" => 5177, \"5178\" => 5178, \"5179\" => 5179, \"5180\" => 5180, \"5181\" => 5181, \"5182\" => 5182, \"5183\" => 5183, \"5184\" => 5184, \"5185\" => 5185, \"5186\" => 5186, \"5187\" => 5187, \"5188\" => 5188, \"5189\" => 5189, \"5190\" => 5190, \"5191\" => 5191, \"5192\" => 5192, \"5193\" => 5193, \"5194\" => 5194, \"5195\" => 5195, \"5196\" => 5196, \"5197\" => 5197, \"5198\" => 5198, _ => 5199, } } "} {"_id":"q-en-rust-728d20d0754a4f2a609acf4213d939ee1f53d13146ebc9152e478e21b9242c0f","text":"return None; } } // handled in the `strip-priv-imports` pass clean::ExternCrateItem(..) | clean::ImportItem(_) => {} clean::DefaultImplItem(..) | clean::ImplItem(..) => {} // tymethods/macros have no control over privacy"} {"_id":"q-en-rust-72a36cc9dce9051fa29e046b4b2cbe2a96bd36207941a44c4b603f852b33e793","text":"// Avoid pointing to the same function in multiple different // error messages. if span != DUMMY_SP && self.fn_self_span_reported.insert(self_arg.span) { self.explain_iterator_advancement_in_for_loop_if_applicable( err, span, &move_spans, ); let func = tcx.def_path_str(method_did); err.subdiagnostic(CaptureReasonNote::FuncTakeSelf { func,"} {"_id":"q-en-rust-72b9af626a7bcc6ddd8d6bedb2564223ace5f3a45bb0f99befb933f7d93d5894","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![deny(exceeding_bitshifts)] #![allow(unused_variables)] fn main() { let n = 1u8 << 8; let n = 1u8 << 9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u16 << 16; let n = 1u16 << 17; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u32 << 32; let n = 1u32 << 33; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u64 << 64; let n = 1u64 << 65; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i8 << 8; let n = 1i8 << 9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i16 << 16; let n = 1i16 << 17; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i32 << 32; let n = 1i32 << 33; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i64 << 64; let n = 1i64 << 65; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u8 >> 8; let n = 1u8 >> 9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u16 >> 16; let n = 1u16 >> 17; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u32 >> 32; let n = 1u32 >> 33; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u64 >> 64; let n = 1u64 >> 65; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i8 >> 8; let n = 1i8 >> 9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i16 >> 16; let n = 1i16 >> 17; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i32 >> 32; let n = 1i32 >> 33; //~ ERROR: bitshift exceeds the type's number of bits let n = 1i64 >> 64; let n = 1i64 >> 65; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u8; let n = n << 8; let n = n << 9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u8 << -9; //~ ERROR: bitshift exceeds the type's number of bits let n = 1u8 << (4+4); let n = 1u8 << (4+5); //~ ERROR: bitshift exceeds the type's number of bits } "} {"_id":"q-en-rust-72ba153c93a54b7223298ca099b624aa307dbcf1080bc610685455b66359dcb8","text":"match base_cmt.cat { mc::cat_upvar(mc::Upvar { id: ty::UpvarId { var_id: vid, .. }, .. }) | mc::cat_local(vid) => { self.reassigned |= self.node == vid && Some(field) == self.field self.reassigned |= self.node == vid && (self.field.is_none() || Some(field) == self.field) }, _ => {} }"} {"_id":"q-en-rust-72dfd5ce98bda4b7042b0c07064728c6e95da46fd78500b70a3f2759ca75ee0e","text":"visibility: self.vis.clean(cx), stability: self.stab.clean(cx), deprecation: self.depr.clean(cx), def_id: cx.tcx.hir().local_def_id(self.id), def_id: did, inner: FunctionItem(Function { decl, generics, header: self.header, header: hir::FnHeader { constness, ..self.header }, }), } }"} {"_id":"q-en-rust-730d8af471a097ca87de7e62ba799a568736de53310b9d3a004bfae9da5412d0","text":"intravisit::walk_crate(this, krate); }); }); compiler.session().abort_if_errors(); let ret: Result<_, ErrorReported> = Ok(collector.tests); ret }) }) .expect(\"compiler aborted in rustdoc!\"); }); let tests = match tests { Ok(tests) => tests, Err(ErrorReported) => return 1, }; test_args.insert(0, \"rustdoctest\".to_string());"} {"_id":"q-en-rust-731a0fe37f040565a71950b1fd4f35aadc5088d0a3578f94f63b6f1f0a716848","text":" trait Foo {} trait T { fn a(&self) -> impl Foo { self.b(|| 0) //~^ ERROR no method named `b` found for reference `&Self` in the current scope } } fn main() {} "} {"_id":"q-en-rust-731f8570765ef255880449fd80c63f53c95599c914b5ea9bd56105558e6fc2bb","text":"}); // We're done if we found errors, but we already emitted them. if let Some(reported) = reported { assert!(errors.is_empty()); if let Some(reported) = reported && errors.is_empty() { return reported; } assert!(!errors.is_empty());"} {"_id":"q-en-rust-732ea03ba11d3053733e8885860dd544a33018c7b492f2f6dbd25bea6eb54cf6","text":" pub enum Foo { Variant { #[doc(hidden)] a: i32, // @set b = \"$.index[*][?(@.name=='b')].id\" b: i32, #[doc(hidden)] x: i32, // @set y = \"$.index[*][?(@.name=='y')].id\" y: i32, }, // @is \"$.index[*][?(@.name=='Variant')].inner.variant_kind\" '\"struct\"' // @is \"$.index[*][?(@.name=='Variant')].inner.variant_inner.fields_stripped\" true // @is \"$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[0]\" $b // @is \"$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[1]\" $y // @count \"$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[*]\" 2 } "} {"_id":"q-en-rust-73303dd55c71e4bc144800d8d9a91fdca6f97f939c1ef46aee18bb5698ca15a1","text":" // check-pass use std::io::Write; struct A(Vec); struct B<'a> { one: &'a mut A, two: &'a mut Vec, three: Vec, } impl<'a> B<'a> { fn one(&mut self) -> &mut impl Write { &mut self.one.0 } fn two(&mut self) -> &mut impl Write { &mut *self.two } fn three(&mut self) -> &mut impl Write { &mut self.three } } struct C<'a>(B<'a>); impl<'a> C<'a> { fn one(&mut self) -> &mut impl Write { self.0.one() } fn two(&mut self) -> &mut impl Write { self.0.two() } fn three(&mut self) -> &mut impl Write { self.0.three() } } fn main() {} "} {"_id":"q-en-rust-7342625c7bf74dee22f01abfa2e844315b24b44568b33088d25bd7da5e5946eb","text":"//@aux-build:proc_macro_attr.rs:proc-macro // Flaky test, see https://github.com/rust-lang/rust/issues/113585. //@ignore-32bit //@ignore-64bit #![warn(clippy::empty_line_after_doc_comments)] #![allow(clippy::assertions_on_constants)] #![feature(custom_inner_attributes)]"} {"_id":"q-en-rust-734f46667d022b9328075cb40fd760c62f31eeba60cc847150e6631e0c32aac9","text":" Subproject commit fc5d0cc583cb1cd35d58fdb7f3e0cfa12dccd6c0 Subproject commit 8b7f7e667268921c278af94ae30a61e87a22b22b "} {"_id":"q-en-rust-7359ff5af78740cb050d0da85031ed316cdbcaa4cddc6559907c5b1bb03aeb0a","text":"println!(\"cargo:rustc-cfg=llvm_component=\"{}\"\", component); } if major >= 9 { println!(\"cargo:rustc-cfg=llvm_has_msp430_asm_parser\"); } // Link in our own LLVM shims, compiled with the same flags as LLVM let mut cmd = Command::new(&llvm_config); cmd.arg(\"--cxxflags\");"} {"_id":"q-en-rust-738340ac9eaede3bcc99cd52987e31e0af0fc9867f9a0dd3eeba75f011e5d790","text":"use core::iter::{FromIterator}; use core::mem::swap; use core::ptr; use core::fmt; use slice; use vec::{self, Vec};"} {"_id":"q-en-rust-73ab323806371a581397fa631bbb750f4501e504e57a004924eb0457688741e5","text":"#![feature(core_intrinsics)] #![feature(dropck_eyepatch)] #![feature(generic_param_attrs)] #![feature(needs_drop)] #![cfg_attr(test, feature(test))] #![allow(deprecated)]"} {"_id":"q-en-rust-73bb3a7996bbf62c0d140f45427a371d01c49b629f362f4e52634e8166e72397","text":"} } /// The general read-write-loop implementation of /// `io::copy` that is used when specializations are not available or not applicable. pub(crate) fn generic_copy(reader: &mut R, writer: &mut W) -> io::Result /// The userspace read-write-loop implementation of `io::copy` that is used when /// OS-specific specializations for copy offloading are not available or not applicable. pub(crate) fn generic_copy(reader: &mut R, writer: &mut W) -> Result where R: Read, W: Write, { let mut buf = MaybeUninit::<[u8; super::DEFAULT_BUF_SIZE]>::uninit(); BufferedCopySpec::copy_to(reader, writer) } /// Specialization of the read-write loop that either uses a stack buffer /// or reuses the internal buffer of a BufWriter trait BufferedCopySpec: Write { fn copy_to(reader: &mut R, writer: &mut Self) -> Result; } impl BufferedCopySpec for W { default fn copy_to(reader: &mut R, writer: &mut Self) -> Result { stack_buffer_copy(reader, writer) } } impl BufferedCopySpec for BufWriter { fn copy_to(reader: &mut R, writer: &mut Self) -> Result { if writer.capacity() < DEFAULT_BUF_SIZE { return stack_buffer_copy(reader, writer); } // FIXME: #42788 // // - This creates a (mut) reference to a slice of // _uninitialized_ integers, which is **undefined behavior** // // - Only the standard library gets to soundly \"ignore\" this, // based on its privileged knowledge of unstable rustc // internals; unsafe { let spare_cap = writer.buffer_mut().spare_capacity_mut(); reader.initializer().initialize(MaybeUninit::slice_assume_init_mut(spare_cap)); } let mut len = 0; loop { let buf = writer.buffer_mut(); let spare_cap = buf.spare_capacity_mut(); if spare_cap.len() >= DEFAULT_BUF_SIZE { match reader.read(unsafe { MaybeUninit::slice_assume_init_mut(spare_cap) }) { Ok(0) => return Ok(len), // EOF reached Ok(bytes_read) => { assert!(bytes_read <= spare_cap.len()); // Safety: The initializer contract guarantees that either it or `read` // will have initialized these bytes. And we just checked that the number // of bytes is within the buffer capacity. unsafe { buf.set_len(buf.len() + bytes_read) }; len += bytes_read as u64; // Read again if the buffer still has enough capacity, as BufWriter itself would do // This will occur if the reader returns short reads continue; } Err(ref e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) => return Err(e), } } writer.flush_buf()?; } } } fn stack_buffer_copy( reader: &mut R, writer: &mut W, ) -> Result { let mut buf = MaybeUninit::<[u8; DEFAULT_BUF_SIZE]>::uninit(); // FIXME: #42788 // // - This creates a (mut) reference to a slice of"} {"_id":"q-en-rust-741fe611a30940e9fecf5c79b335d2fb14a819adc1e553367e7806646bef28aa","text":" trait T { type A: S = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C: Q; } fn main() {} "} {"_id":"q-en-rust-7427bbda53a4e6023f757e7be7932a64638a105f6c40fe5d7b557cd6a603ef6f","text":"use hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, DefIndexAddressSpace, CRATE_DEF_INDEX}; use ich::Fingerprint; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::indexed_vec::IndexVec; use rustc_data_structures::stable_hasher::StableHasher; use serialize::{Encodable, Decodable, Encoder, Decoder};"} {"_id":"q-en-rust-742de74291e3a49a19702e72f386ac80e8eeded68b679f9a417a6b0a1d9a3f8c","text":"} }; // This restriction needs to be applied after we have handled adjustments for `move` // closures. We want to make sure any adjustment that might make us move the place into // the closure gets handled. let (place, capture_kind) = restrict_precision_for_drop_types(self, place, capture_kind, usage_span); capture_info.capture_kind = capture_kind; let capture_info = if let Some(existing) = processed.get(&place) { determine_capture_info(*existing, capture_info) } else {"} {"_id":"q-en-rust-746789fd2a342ccfa4d72841666a2049a73c8d2aa64923c23d2d0ef1729612ce","text":"let mut buf = BorrowedBuf::from(&mut *self.buf); // SAFETY: `self.filled` bytes will always have been initialized. unsafe { buf.set_init(self.filled); buf.set_init(self.initialized); } reader.read_buf(buf.unfilled())?; self.filled = buf.len(); self.pos = 0; self.filled = buf.len(); self.initialized = buf.init_len(); } Ok(self.buffer()) }"} {"_id":"q-en-rust-74c092ec9c80ab9f5817946a3c20506a69e5f121f9e598980b4aa4576decdf03","text":"[[package]] name = \"git2-curl\" version = \"0.12.0\" version = \"0.13.0\" source = \"registry+https://github.com/rust-lang/crates.io-index\" checksum = \"d2559abb1d87d27668d31bd868a000f0e2e0065d10e78961b62da95d7a7f1cc7\" checksum = \"af1754ec4170e7dcaf9bb43743bb16eddb8d827b2e0291deb6f220a6e16fe46a\" dependencies = [ \"curl\", \"git2\","} {"_id":"q-en-rust-74cec4d1fd6c2a8a2fde26cd5701bdc4a3a51d66eb4082894962096388a1c14a","text":"} .stab .emoji { font-size: 1.5em; font-size: 1.2em; } /* Black one-pixel outline around emoji shapes */"} {"_id":"q-en-rust-74ee4849913049a9bbffe46deb8445b6afcb211c99a7f76018a5baede17f38fd","text":" Subproject commit 0537f6354cffe546cbf47f6dc9c7f82e49e86cfb Subproject commit 42263494d29febc26d3c1ebdaa7b63677573ec47 "} {"_id":"q-en-rust-751e9c09fd62669bcd3ca878cd0588d7e4bbbc2219a54cd3edf09dfd085511ac","text":"border-bottom: 1px solid; } .impl, .method, .type, .associatedconstant, .type:not(.container-rustdoc), .associatedconstant, .associatedtype { flex-basis: 100%; font-weight: 600;"} {"_id":"q-en-rust-752e99c8bfea1aa142d67ce282b5646c28a7318862a75ef65fc593a56901517a","text":"} } function getSearchLoadingText() { return \"Loading search results...\"; } if (search_input) { search_input.onfocus = function() { putBackSearch(this);"} {"_id":"q-en-rust-75391dfc100be62894a8d8ed6ba5006fd5f99155c8116acf48ebf736af74fe60","text":"} impl FileType { /// Test whether this file type represents a directory. /// Test whether this file type represents a directory. The /// result is mutually exclusive to the results of /// [`is_file`] and [`is_symlink`]; only zero or one of these /// tests may pass. /// /// [`is_file`]: struct.FileType.html#method.is_file /// [`is_symlink`]: struct.FileType.html#method.is_symlink /// /// # Examples ///"} {"_id":"q-en-rust-75ce47ed45b018824d0b592e18c6aaa0f882962b6eb1de08b227a2e095a855a7","text":"test(); } fn test_62350() { use std::ptr; unsafe { let null = ptr::null(); let q = QuadFloats { a: 10.2, b: 20.3, c: 30.4, d: 40.5 }; assert_eq!( get_c_exhaust_sysv64_ints(null, null, null, null, null, null, null, q), q.c, ); } } pub fn issue_62350() { test_62350(); } fn test1() { unsafe { let q = Quad { a: 0xaaaa_aaaa_aaaa_aaaa,"} {"_id":"q-en-rust-75fba6293eef888017b01570b111a8eb5a26360fc024b9ebd80f7cb00812e644","text":"#[inline] fn next_back(&mut self) -> Option<$elem> { // could be implemented with slices, but this avoids bounds checks if self.end == self.ptr { None } else { unsafe { unsafe { if mem::size_of::() != 0 { assume(!self.ptr.is_null()); assume(!self.end.is_null()); } if self.end == self.ptr { None } else { self.end = slice_offset!(self.end, -1); if mem::size_of::() != 0 { ::intrinsics::assume(!self.ptr.is_null()); ::intrinsics::assume(!self.end.is_null()); } Some(slice_ref!(self.end)) } }"} {"_id":"q-en-rust-7600f71e025acfbd6a506e94689a5431a3bf52d1daebf2fd30f7f2ee7c5d1436","text":"} fn expr_field_access(&self, sp: Span, expr: P, ident: ast::Ident) -> P { let field_span = Span { lo: sp.lo - Pos::from_usize(ident.name.as_str().len()), hi: sp.hi, expn_id: sp.expn_id, }; let id = Spanned { node: ident, span: field_span }; let id = Spanned { node: ident, span: sp }; self.expr(sp, ast::ExprKind::Field(expr, id)) } fn expr_tup_field_access(&self, sp: Span, expr: P, idx: usize) -> P { let field_span = Span { lo: sp.lo - Pos::from_usize(idx.to_string().len()), hi: sp.hi, expn_id: sp.expn_id, }; let id = Spanned { node: idx, span: field_span }; let id = Spanned { node: idx, span: sp }; self.expr(sp, ast::ExprKind::TupField(expr, id)) } fn expr_addr_of(&self, sp: Span, e: P) -> P {"} {"_id":"q-en-rust-76049f8c8d7104fd9212bcf83cabab458007d2ec041d480891d2e37a47e51320","text":"view_path.map(|Spanned {node, span}| Spanned { node: match node { ViewPathSimple(ident, path) => { ViewPathSimple(ident, fld.fold_path(path)) ViewPathSimple(fld.fold_ident(ident), fld.fold_path(path)) } ViewPathGlob(path) => { ViewPathGlob(fld.fold_path(path)) } ViewPathList(path, path_list_idents) => { ViewPathList(fld.fold_path(path), path_list_idents.move_map(|path_list_ident| { Spanned { node: PathListItem_ { id: fld.new_id(path_list_ident.node.id), rename: path_list_ident.node.rename, name: path_list_ident.node.name, }, span: fld.new_span(path_list_ident.span) } })) let path = fld.fold_path(path); let path_list_idents = path_list_idents.move_map(|path_list_ident| Spanned { node: PathListItem_ { id: fld.new_id(path_list_ident.node.id), rename: path_list_ident.node.rename.map(|ident| fld.fold_ident(ident)), name: fld.fold_ident(path_list_ident.node.name), }, span: fld.new_span(path_list_ident.span) }); ViewPathList(path, path_list_idents) } }, span: fld.new_span(span)"} {"_id":"q-en-rust-7618a8882a0a1c2fdc6e55ed02eea29fa08b5f83b9f82c6b1dff9fc328a0d2aa","text":" // known-bug // build-fail // failure-status: 101 // compile-flags:--crate-type=lib -Zmir-opt-level=3 // rustc-env:RUST_BACKTRACE=0 // normalize-stderr-test \"thread 'rustc' panicked.*\" -> \"thread 'rustc' panicked\" // normalize-stderr-test \"note:.*RUST_BACKTRACE=1.*n\" -> \"\" // normalize-stderr-test \"error: internal compiler error.*\" -> \"error: internal compiler error\" // normalize-stderr-test \"encountered.*with incompatible types:\" \"encountered ... with incompatible types:\" // normalize-stderr-test \"note:.*unexpectedly panicked.*nn\" -> \"\" // normalize-stderr-test \"note: we would appreciate a bug report.*nn\" -> \"\" // normalize-stderr-test \"note: compiler flags.*nn\" -> \"\" // normalize-stderr-test \"note: rustc.*running on.*nn\" -> \"\" // normalize-stderr-test \"query stack during panic:n\" -> \"\" // normalize-stderr-test \"we're just showing a limited slice of the query stackn\" -> \"\" // normalize-stderr-test \"end of query stackn\" -> \"\" // normalize-stderr-test \"#.*n\" -> \"\" // This is a known bug that @compiler-errors tried to fix in #94238, // but the solution was probably not correct. pub trait Factory { type Item; } pub struct IntFactory; impl Factory for IntFactory { type Item = usize; } pub fn foo() where IntFactory: Factory, { let mut x: >::Item = bar::(); } #[inline] pub fn bar() -> >::Item { 0usize } "} {"_id":"q-en-rust-762052824baf3fd7a574cbfd618e94f063a9a3713f6523e4558722449ee52e39","text":" //@ edition:2021 fn main() { async { use std::ops::Add; let _ = 1.add(3); }.await //~^ ERROR `await` is only allowed inside `async` functions and blocks } "} {"_id":"q-en-rust-7625560df811c6fbcd831e834fb02cbddc4cf528b3edada28e993965eb6abc3a","text":"/// } /// ``` #[stable(feature = \"io_error_inner\", since = \"1.3.0\")] #[inline] pub fn get_ref(&self) -> Option<&(dyn error::Error + Send + Sync + 'static)> { match self.repr { Repr::Os(..) => None,"} {"_id":"q-en-rust-7676ebd3c07f997d75c023ab9a5add2d40d5905553ee275501a83c5fe70d223d","text":" #![allow(incomplete_features)] #![feature(return_position_impl_trait_in_trait)] use std::ops::Deref; pub trait Foo { fn lol(&self) -> impl Deref { //~^ type mismatch resolving `<&i32 as Deref>::Target == String` &1i32 } } fn main() {} "} {"_id":"q-en-rust-7688189d2aff086fa2904a4ca9902db143319e76517b109708318e4041230ddd","text":" // aux-build:issue-92755.rs // build-pass // Thank you @tmiasko for providing the content of this test! extern crate issue_92755; fn main() { issue_92755::ctx().a.b.f(); } "} {"_id":"q-en-rust-76c52def65f3202d5ab6403e59d1d25ab37663ecec55baca6238b43794254b6e","text":"PatternKind::Variant { adt_def, substs, variant_index, ref subpatterns } => { let irrefutable = adt_def.variants.iter_enumerated().all(|(i, v)| { i == variant_index || { self.hir.tcx().features().never_type && self.hir.tcx().features().exhaustive_patterns && !v.uninhabited_from(self.hir.tcx(), substs, adt_def.adt_kind()).is_empty() }"} {"_id":"q-en-rust-76e933d5f4a7b6dbe1da1789462564df0b25d6d55d538b9e8f5bfa000805a494","text":"} } /// For rustdoc. pub fn get_partial_res(&self, node_id: NodeId) -> Option { self.partial_res_map.get(&node_id).copied() } /// Retrieves the span of the given `DefId` if `DefId` is in the local crate. #[inline] pub fn opt_span(&self, def_id: DefId) -> Option {"} {"_id":"q-en-rust-76ec39a12d780e02f8335f90c3c7423f70f2dc7aa2cd1bf643afc33f800abfe9","text":" 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 {} | ^^^^^^^^^^^^^^ 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 {} | ^^^^^^^^^^^^^^ | = 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 {} | ^^^^^^^^^^^^^^ | = 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 Fun> MyTrait for F {} | ^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/ice-wf-missing-span-in-error-130012.rs:14:50 | LL | impl Fun> 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`. "} {"_id":"q-en-rust-771bb892998056de6c7d0afc27202321479e2b916ddd174c139f596fb844e11d","text":"writeln!(&mut writer, \"{}, {}!\", \"hello\", \"world\").unwrap(); assert_eq!(writer.get_ref().events, [RecordedEvent::Write(\"hello, world!n\".to_string())]); } #[test] fn bufreader_full_initialize() { struct OneByteReader; impl Read for OneByteReader { fn read(&mut self, buf: &mut [u8]) -> crate::io::Result { 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()); } "} {"_id":"q-en-rust-774193bed73449c1019171b0ee4f7b8294d2ef9c0ee5714baff0cac5eafb7e13","text":" // 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 for MyLibType' impl From for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} } } pub struct T(T); // @!has foo/enum.MyLibType.html '//*[@id=\"impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E\"]' 'impl From>>>> for MyLibType' impl From>>>> for MyLibType { fn from(it: T>>>) -> 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 for T>>>' impl From for T>>> { fn from(it: MyLibType) -> T>>> { match it {} } } "} {"_id":"q-en-rust-776112d2adc0a28d8fd67248788f69fafc1dd6ef7097e227931b8063a108c4f0","text":"} } include!(concat!(env!(\"OUT_DIR\"), \"/error_codes.rs\")); 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::>());} )* ) } include!(concat!(env!(\"OUT_DIR\"), \"/all_error_codes.rs\")); long_codes } "} {"_id":"q-en-rust-7774a16eedc78e9170c3c6e5ebe2b1019cfc83c4e483891ab47a6847958149c0","text":"let (a, b) = ($a, $b); if a != b { let (a, b) = if a > b {(a, b)} else {(b, a)}; assert!(a - Duration::new(0, 1) <= b); assert!(a - Duration::new(0, 100) <= b); } }) }"} {"_id":"q-en-rust-7779dec9c17e9311afe7dd650f1f8f17cffd4171fd33d9c21269cb7c4171f80b","text":"return Some(LexicalScopeBinding::Item(binding)); } } self.early_resolve_ident_in_lexical_scope( orig_ident, ScopeSet::Late(ns, module, record_used_id),"} {"_id":"q-en-rust-77d9611afa14a96f0ecfaa3abcff17231e543cc29df6d28de33f5da5ef70293f","text":"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\") assert: (\".sidebar-elems > .items > ul > li:nth-child(2)\", \"Functions\") 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\") assert:\t(\"#functions + table td > a\", \"foobar\") click: \"#functions + table td > a\""} {"_id":"q-en-rust-780cd6f446ca1e9349ebe8918a2e302b87523e547d44598493c66203054867c3","text":"} PathResult::Failed { is_error_from_last_segment: true, span, label, suggestion } => { if no_ambiguity { assert!(import.imported_module.get().is_none()); let err = match self.make_path_suggestion( span, import.module_path.clone(),"} {"_id":"q-en-rust-786dcf8e0c9e6b32959e7235f7183ccd5aa32980e13fccaeb9741dd759f451ed","text":"AssignmentLhsSized, // L = X implies that L is Sized StructInitializerSized, // S { ... } must be Sized VariableType(ast::NodeId), // Type of each variable must be Sized ReturnType, // Return type must be Sized RepeatVec, // [T,..n] --> T must be Copy // Captures of variable the given id by a closure (span is the"} {"_id":"q-en-rust-788e077dbdc3706bbf0ce5308d1e30d749aec9065c84e347be7875bf8fe4cbc5","text":"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) { db.span_suggestion( span, &format!(\"to make the {} mutable, use `mut` as shown:\", self.cmt_to_string(&err.cmt)), format!(\"mut {}\", snippet)); 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)); } } } }"} {"_id":"q-en-rust-78a48c269bab1d74336b91a800376f8c14b5f1d46e1a4404afb8df9ae9b44897","text":"parent_item: Option, report_on: ReportOn, ) { 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 } } let Some(&first_item) = dead_codes.first() else { return; };"} {"_id":"q-en-rust-78bb01fad11c33a6aeaf1b46c28c2eefbf4904f7ab2a18376540db399038b5e5","text":"} // Reverse scan: Sequence comes before `first`. if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore { if subfirst.maybe_empty || seq_rep.op == quoted::KleeneOp::ZeroOrMore || seq_rep.op == quoted::KleeneOp::ZeroOrOne { // If sequence is potentially empty, then // union them (preserving first emptiness). first.add_all(&TokenSet { maybe_empty: true, ..subfirst });"} {"_id":"q-en-rust-78d6916150aec0d9f9610d8db89f016724133b6d92a9556a03457e8dd54a16bf","text":"/// Loads the current context and calls a function with it. /// Do not nest these, as that will ICE. pub(crate) fn with(f: impl FnOnce(&mut dyn Context) -> R) -> R { 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 assert!(TLV.is_set()); TLV.with(|tlv| { let ptr = tlv.get(); assert!(!ptr.is_null()); f(unsafe { *(ptr as *mut &mut dyn Context) }) }) }"} {"_id":"q-en-rust-78de3f8b905d7b0719a77454fcbfce5a2d6c902f387922d129d72e287f6ff6dd","text":"#[stable(feature = \"unicode_encode_char\", since = \"1.15.0\")] #[inline] pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str { 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]) } // SAFETY: `char` is not a surrogate, so this is valid UTF-8. unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) } } /// Encodes this character as UTF-16 into the provided `u16` buffer,"} {"_id":"q-en-rust-78e4a62c676c2f111920c31e53d865265335d78101c136456b64f5d7a1407d0a","text":"/// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] 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;"} {"_id":"q-en-rust-79983bc8d32ddd7f22f99c0e50e9d5304022911567733c95d0dfa7f2d1db79ae","text":" struct NotCopyable; fn func 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() {} "} {"_id":"q-en-rust-79aa393b624f54a2e99c47156a08fbd4b26c3741acb8aced3235a4c1a600c124","text":" // ignore-32bit // This test gives a different error on 32-bit architectures. union Transmute { 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() {} "} {"_id":"q-en-rust-79ab79f670c9d37b7b413c8e4078a920ea0c6b76776d1bdba60736fcb0c586d3","text":"offsets[usize::try_from(field).unwrap()], layout::FieldPlacement::Array { stride, .. } => { let len = base.len(self)?; assert!(field < len, \"Tried to access element {} of array/slice with length {}\", field, len); 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 }); } stride * field } layout::FieldPlacement::Union(count) => {"} {"_id":"q-en-rust-79b9a56a31b42e57d953809c9d820d2ce7b1e17c454c0d24dd2cd2cd3dce947a","text":"LL | m!(); | ----- in this macro invocation warning: `$crate` may not be imported error: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:9:9 | LL | use $crate; // OK LL | use $crate; | ^^^^^^^^^^^ ... LL | m!(); | ----- in this macro invocation | = 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 error: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:10:9 | LL | use $crate as $crate; | ^^^^^^^^^^^^^^^^^^^^^ ... LL | m!(); | ----- in this macro invocation | = note: `use $crate;` was erroneously allowed and will become a hard error in a future release error: aborting due to 2 previous errors error: aborting due to 4 previous errors "} {"_id":"q-en-rust-79cac1470f473535a3844d271c6392c4b74bebd34375a2d1bd56d8e43b15c2bf","text":"/// ``` #[macro_export] macro_rules! write { ($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*))) ($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*))) } /// Equivalent to the `write!` macro, except that a newline is appended after"} {"_id":"q-en-rust-79eb50ba043b4281a0ba3dd915cc26fa8c24b8998d940bdc8f4f3bf6feb7142f","text":"use libc::{mmap, munmap}; use libc::{sigaction, sighandler_t, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIG_DFL}; use libc::{sigaltstack, SIGSTKSZ, SS_DISABLE}; use libc::{MAP_ANON, MAP_PRIVATE, PROT_READ, PROT_WRITE, SIGSEGV}; use libc::{MAP_ANON, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SIGSEGV}; use crate::sys::unix::os::page_size; use crate::sys_common::thread_info; #[cfg(any(target_os = \"linux\", target_os = \"android\"))]"} {"_id":"q-en-rust-7a2038ecbb2fe74aa3c3438c9f52e4de0a58982a6d75c712ff994f9b525eab40","text":"let source = pprust::token_to_string(self); parse_stream_from_source_str(FileName::MacroExpansion, source, sess, Some(span)) }); // 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. if let Some(tokens) = tokens { if tokens.eq_unspanned(&tokens_for_real) { if tokens.probably_equal_for_proc_macro(&tokens_for_real) { return tokens } } return tokens_for_real } // 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?\"), } } } #[derive(Clone, RustcEncodable, RustcDecodable, Eq, Hash)]"} {"_id":"q-en-rust-7a274ab162ced45742c809ba7e2283191d97e0b42664a261e6527343c59facc2","text":"// no-pretty-expanded FIXME #15189 // ignore-android FIXME #17520 // ignore-msvc FIXME #28133 // compile-flags:-g use std::env; use std::process::{Command, Stdio}; use std::str; use std::ops::{Drop, FnMut, FnOnce}; #[inline(never)] fn foo() {"} {"_id":"q-en-rust-7a3e9beca7582a3f8fc783da56c050cb20a8424a67da6484af2d318bcfd08c24","text":"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}` .suggestion = use an inclusive range instead lint_range_use_inclusive_range = use an inclusive range instead lint_overflowing_bin_hex = literal out of range for `{$ty}` .negative_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}`"} {"_id":"q-en-rust-7a61d3d8e88b1ae160152b81241a82e6d4ebe70cde594e64d70c1f48395a3808","text":" 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), }, ] "} {"_id":"q-en-rust-7a61fffc674adb902e126e50f97e01477b1a881159dc2d22cf2c544d22d274b0","text":"let mut cmd = Command::new(SHELL); cmd.current_dir(&empty_dir) .arg(sanitize_sh(&tarball.decompressed_output().join(\"install.sh\"))) .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))) .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))) .arg(\"--disable-ldconfig\"); builder.run(&mut cmd); t!(fs::remove_dir_all(&empty_dir));"} {"_id":"q-en-rust-7a99729c9c550a4da94c5c3d61399861ade61fdfc4e6ac7997ad2bfeb55318b5","text":"#[note] pub struct BuiltinInternalFeatures { pub name: Symbol, #[subdiagnostic] pub note: Option, } #[derive(Subdiagnostic)]"} {"_id":"q-en-rust-7aa087940525cc450f33c0366ec4163d6b3c75b34b22e787923afa5293b8010c","text":"show_type_layout, generate_link_to_definition, call_locations, no_emit_shared, .. } = options;"} {"_id":"q-en-rust-7ae05d49d538852d2c81389c5234934104105cb69382c90b8f5a3765d934716c","text":"Exercise: use macros to reduce duplication in the above definition of the `bct!` macro. # 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`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`, and gives `T` if it’s a `Ok`, 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 = 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. # Procedural macros If Rust's macro system can't do what you need, you may want to write a"} {"_id":"q-en-rust-7ae44c0ee39d1f1e2c76c5d09ef808affeacd9a47a43d785c7e9a39cdee9b700","text":"/// Strip items marked `#[doc(hidden)]` pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult { struct Stripper; impl fold::DocFolder for Stripper { fn fold_item(&mut self, i: Item) -> Option { 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; }, _ => (), let mut stripped = HashSet::new(); // strip all #[doc(hidden)] items let krate = { struct Stripper<'a> { stripped: &'a mut HashSet }; impl<'a> fold::DocFolder for Stripper<'a> { fn fold_item(&mut self, i: Item) -> Option { 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; }, _ => (), } } }, _ => () } } 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 }; impl<'a> fold::DocFolder for ImplStripper<'a> { fn fold_item(&mut self, i: Item) -> Option { match i.inner { clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: for_id, .. }, .. }) => { if self.stripped.contains(&for_id) { return None; } }, _ => () } _ => {} } self.fold_item_recur(i) } self.fold_item_recur(i) } } let mut stripper = Stripper; let krate = stripper.fold_crate(krate); let mut stripper = ImplStripper{ stripped: &mut stripped }; stripper.fold_crate(krate) }; (krate, None) }"} {"_id":"q-en-rust-7aef8c94e1baa6c37ab2fbd9810fb7305d9873b842b9a4952ef8dd6808236ec5","text":"self_expr: &'tcx hir::Expr<'tcx>, call_expr: &'tcx hir::Expr<'tcx>, ) -> ConfirmContext<'a, 'tcx> { ConfirmContext { fcx, span, self_expr, call_expr } ConfirmContext { fcx, span, self_expr, call_expr, skip_record_for_diagnostics: false } } fn confirm("} {"_id":"q-en-rust-7b0faa7fa43ff1376cf740c0b3f25ffe61550d758db1d2105d1683211fe87f5a","text":"// can just use the tcx as the typer. // // FIXME(stage0): the :'t here is probably only important for stage0 pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d+'t> { pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> { typer: &'t infer::InferCtxt<'a, 'tcx>, mc: mc::MemCategorizationContext<'t, 'a, 'tcx>, delegate: &'d mut Delegate<'tcx>,"} {"_id":"q-en-rust-7b248bc5a5217c790bd41ac5ecbc4b17b0e29df7b18e9b50eaefe41f89ef38cf","text":"#[rustc_on_unimplemented = \"the type {Self} contains interior mutability and a reference may not be safely transferrable across a recover boundary\"] pub trait NoUnsafeCell {} pub trait RefRecoverSafe {} /// A simple wrapper around a type to assert that it is panic safe. ///"} {"_id":"q-en-rust-7b3144dfec5ff6e0b3aefc4a6ebaa015833061bc2cea5b31b911a9b544ff31ea","text":"impl FromStr for Ipv4Addr { type Err = AddrParseError; fn from_str(s: &str) -> Result { Parser::new(s).parse_with(|p| p.read_ipv4_addr()) // 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()) } } }"} {"_id":"q-en-rust-7b64230b569253844dbbb9ce807b6e1b8f688759fa95c8d7c6a9bfdb57a36562","text":"_ => {} } } if arg.layout.is_aggregate() && (int_regs < needed_int || sse_regs < needed_sse) { cls_or_mem = Err(Memory); 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); } } } } }"} {"_id":"q-en-rust-7b70679e44525bec7a19beb49d535a1e4d637b637e60433ae59596e15dac400b","text":" fn foo() { match 0 { _ => {} } if foo } } //~ ERROR unexpected closing delimiter: `}` fn main() {} "} {"_id":"q-en-rust-7b8470178e22d34a4a768d3b0d5d1dd10b71d7a45f797f4951a866a990d3363e","text":"/// use std::sync::Arc; /// use std::task::{Context, Poll, Wake}; /// use std::thread::{self, Thread}; /// use core::pin::pin; /// /// /// A waker that wakes up the current thread when called. /// struct ThreadWaker(Thread);"} {"_id":"q-en-rust-7b8bb29f835de36f492338071f7678065f93136c1632d95bd2af959399ae6b61","text":" // 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; impl Bar { pub fn foo() {} } impl Bar { pub fn bar() {} } fn main() {} "} {"_id":"q-en-rust-7b94bc40ea3b5f17760fab63e4a9259908534400fe3054a5aebd2fbaa9de8cfc","text":"} #[cfg(any( all(not(target_arch = \"aarch64\"), not(target_arch = \"powerpc\"), not(target_arch = \"x86_64\")), all( not(target_arch = \"aarch64\"), not(target_arch = \"powerpc\"), not(target_arch = \"s390x\"), not(target_arch = \"x86_64\") ), all(target_arch = \"aarch64\", any(target_os = \"macos\", target_os = \"ios\")), target_family = \"wasm\", target_arch = \"asmjs\","} {"_id":"q-en-rust-7bab5b9546b369af11baf5d8446e7dcfe04a7fe6a9497ca8d6b6b033a5561515","text":" 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() {} "} {"_id":"q-en-rust-7be1f038be15b85192a47199ea0eb35bff558eab7f1a1ed88e74dfc8a8d976fa","text":"/// assert!(weak.upgrade().is_none()); /// ``` /// /// 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(to_drop: *mut T) { /// let mut copy: MaybeUninit = MaybeUninit::uninit(); /// ptr::copy(to_drop, copy.as_mut_ptr(), 1); /// drop(copy.assume_init()); /// } /// /// #[repr(packed, C)] /// struct Packed { /// _padding: u8, /// unaligned: Vec, /// } /// /// let mut p = Packed { _padding: 0, unaligned: vec![42] }; /// unsafe { /// drop_after_copy(&mut p.unaligned as *mut _); /// mem::forget(p); /// } /// ``` /// /// 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."} {"_id":"q-en-rust-7bfbe51c3ed62b8b5be6816d05c0d6d82c163087817b5914f804860b14fee19f","text":"} } /// 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 = 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`. 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();"} {"_id":"q-en-rust-7bfc0a3ea74199c760e0e735d8a8f5a07792ce98b3cd9c75731f4a33a1d0256e","text":"} } impl Allocation<()> { /// Add Tag and Extra fields pub fn retag( self, mut tagger: impl FnMut(AllocId) -> T, extra: E, ) -> Allocation { 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, } } } /// Raw accessors. Provide access to otherwise private bytes. impl Allocation { pub fn len(&self) -> usize {"} {"_id":"q-en-rust-7c30742bfc331e03a5f6e5e958f101c5004cd3442165f263fd3b130373be0bf5","text":" #![feature(const_fn_trait_bound)] // Regression test for issue 88434 const _CONST: &[u8] = &f(&[], |_| {}); const fn f(_: &[u8], _: F) -> &[u8] where F: FnMut(&u8), { panic!() //~ ERROR evaluation of constant value failed } fn main() { } "} {"_id":"q-en-rust-7c4cf518769fbf19cd76f0d002c44322baf833d706d6baf24684f25476ff4bc7","text":"use crate::ffi::CStr; use crate::mem; use crate::os::raw::{c_char, c_int, c_long, c_longlong, c_uint, c_ulong, c_ushort}; use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort}; 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}; pub use crate::os::raw::c_int; #[path = \"c/errors.rs\"] // c.rs is included from two places so we need to specify this mod errors; pub use errors::*;"} {"_id":"q-en-rust-7c6c3ff61ffa83524e55531d6ddb88dc3c665004140aea08432101ce91ff3d6d","text":"let md_content = fs::read_to_string(entry.path()).unwrap(); fs::write(&out_dir.join(entry.file_name()), &md_content).unwrap(); } 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::>());} )* ) } \"###, ); 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(); }"} {"_id":"q-en-rust-7ce8b12111d0874283674a6c6e20da3ab12426b0a1668afc34a7c8aeb0648dc3","text":"} } 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); } fn visit_expr(&mut self, e: &'a ast::Expr) { match e.kind { ast::ExprKind::TryBlock(_) => {"} {"_id":"q-en-rust-7d0dcfed4463ef882f27def797166c874a42323686ed9cb2c439f6f82ca71d80","text":"static WAKER: Waker = unsafe { Waker::from_raw(VOID_WAKER) }; static CONTEXT: Context<'static> = Context::from_waker(&WAKER); static WAKER_REF: &'static Waker = CONTEXT.waker(); WAKER_REF.wake_by_ref(); WAKER.wake_by_ref(); }"} {"_id":"q-en-rust-7d24d3dfba2aaa52d7e727c4e7c194738a9e10cc5ac25f6b513ece905deff03f","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-android: FIXME(#10381) // min-lldb-version: 310 // compile-flags:-g"} {"_id":"q-en-rust-7d269aec264b68c4821978f5192430f464692b54eeb297e5545d8913ddb07c38","text":"} } 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 } } /// Checks if `#[rustc_legacy_const_generics]` is applied to a function and has a valid argument. fn check_rustc_legacy_const_generics( &self,"} {"_id":"q-en-rust-7d33ecc9cae196a7c1f82d7c9c68165710ef51d3322b15ee440812d088aee80c","text":"use llvm::BasicBlockRef; use rustc::mir::repr as mir; use trans::adt; use trans::base; use trans::build; use trans::common::Block;"} {"_id":"q-en-rust-7d345cce6e2e516bbcda4d5727ccc0231b644c6f134c02122b861d92bab584ef","text":"!preds.is_empty() && { let ty_empty_region = cx.tcx.mk_imm_ref(cx.tcx.lifetimes.re_root_empty, ty); preds.iter().all(|t| { let ty_params = &t.skip_binder().trait_ref.substs.iter().skip(1).collect::>(); let ty_params = &t .skip_binder() .trait_ref .substs .iter() .skip(1) .collect::>(); implements_trait(cx, ty_empty_region, t.def_id(), ty_params) }) },"} {"_id":"q-en-rust-7d4582848f16325e26334259d0163260fc24bb8a8690bcf2faf90e8e0dba5c28","text":" // 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 or the MIT license // , 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 { std::iter::once(n) } fn main() {} "} {"_id":"q-en-rust-7d4d287c064721db4d7c56513410fefb46550f0487660403746af45329096484","text":"index::Index::from_buf(index.data, index.start, index.end) } pub fn crate_rustc_version(data: &[u8]) -> Option { let doc = rbml::Doc::new(data); reader::maybe_get_doc(doc, tag_rustc_version).map(|s| s.as_str()) } #[derive(Debug, PartialEq)] enum Family { ImmStatic, // c"} {"_id":"q-en-rust-7d4eef6f0f0d5687b3376f5742f6b44950d8496033c18133ded87be6904d6b0d","text":"//! Validates the MIR to ensure that invariants are upheld. use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir as hir; use rustc_hir::LangItem; use rustc_index::bit_set::BitSet; use rustc_index::IndexVec;"} {"_id":"q-en-rust-7d600ab1499851d4129ca176334803b0e563a87dbfbed6b25610f4bd7b434f77","text":"#[inline] #[stable(feature = \"char_from_unchecked\", since = \"1.5.0\")] pub unsafe fn from_u32_unchecked(i: u32) -> char { transmute(i) if cfg!(debug_assertions) { char::from_u32(i).unwrap() } else { transmute(i) } } #[stable(feature = \"char_convert\", since = \"1.13.0\")]"} {"_id":"q-en-rust-7d7312d07a2e66b55c2a515c964a5ea4dc6f68d6f3a6f8e4bbb7fcf50270fe03","text":" #![feature(const_trait_impl)] #![feature(const_trait_impl, effects)] // edition: 2021 #[const_trait]"} {"_id":"q-en-rust-7d8940d0bf3c934dce2a68d8daa4cd458679e7e60d544178bf15f68ffcb06ef7","text":"fn avg(_: T) {} //~^ ERROR defaults for type parameters are only allowed //~| WARNING hard error struct S(T); impl S {} //~^ ERROR defaults for type parameters are only allowed //~| WARNING hard error fn main() {}"} {"_id":"q-en-rust-7da4a6c535bd013a1a34ebc3b8d9832e6a78c15cfd4fbad08f82a7b07373344d","text":"hir::ItemKind::Fn(..) | hir::ItemKind::Ty(..) | hir::ItemKind::Static(..) | hir::ItemKind::Existential(..) | hir::ItemKind::Const(..) => { intravisit::walk_item(self, &item); }"} {"_id":"q-en-rust-7db4d0e3fa18941ff1396b4e222039f84ad7c32900ac906d4a4fa3cabfebd246","text":"self.primitive_locations.insert(prim, def_id); } self.stack.push(krate.name.to_string()); krate = CacheBuilder { tcx, cache: self, empty_cache: Cache::default() }.fold_crate(krate); for (trait_did, dids, impl_) in self.orphan_trait_impls.drain(..) {"} {"_id":"q-en-rust-7db86965d444a86aa495f22a3da4eee7cb4de58bcfc86e28f435ce18f55d3310","text":"/// /// # Example /// ``` /// #![feature(io_into_inner_error_parts)] /// use std::io::{BufWriter, ErrorKind, Write}; /// /// let mut not_enough_space = [0u8; 10];"} {"_id":"q-en-rust-7dbeae108c48a6161279d515b1ff4d21e84f86ff4cd9c87e85341771ef628ac6","text":" #![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 } "} {"_id":"q-en-rust-7dda1b6802add27bb1d15f75d69d59a04e3749be2b42dc4496bdee70d4b4d794","text":"| LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait error: aborting due to 10 previous errors For more information about this error, try `rustc --explain E0670`. Some errors have detailed explanations: E0670, E0706. For more information about an error, try `rustc --explain E0670`. "} {"_id":"q-en-rust-7e1bc498d0229ed7f05109e43c74eeab536beb360e81b317e0ddaf98650f92a5","text":" Subproject commit 7c06679f93df53f83bbf61b197f2e5c39f5d7633 Subproject commit ae9e9cb47c7b79d8bb29fab90929bd9b3606348a "} {"_id":"q-en-rust-7e5d1e082dc9eda74d0ce13fd583014c5d5b9c44609f7dc39ddfbef94b90686d","text":" 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 "} {"_id":"q-en-rust-7e8a7919a8d758c766ac1c4bc02a1d04939e6aa1f2a5b5d6caabf18b718c6324","text":"across a recover boundary\"] pub trait RecoverSafe {} /// A marker trait representing types which do not contain an `UnsafeCell` by /// value internally. /// 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. /// /// This is a \"helper marker trait\" used to provide impl blocks for the /// `RecoverSafe` trait, for more information see that documentation."} {"_id":"q-en-rust-7e98df629249153e894f5cdb0a290c836cb7061af115f5956b630133b79f2eb6","text":"// 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); if c == 'x00' { err.help(\"source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used\"); } err.emit(); token? }"} {"_id":"q-en-rust-7eb69e735fbbebbaf4e9a4698b593274641826ea0292b118cb4bab67bdc9219b","text":"} for child in self.resolver.module_children_or_reexports(module_id) { if child.vis == Visibility::Public { if child.vis == Visibility::Public || self.document_private_items { if let Some(def_id) = child.res.opt_def_id() { self.add_traits_in_parent_scope(def_id); }"} {"_id":"q-en-rust-7eeb386d180509b664d2fb494b96b6bb1fb339a21c73cb29e686802cd6e6cfea","text":"fn read_scope_id(&mut self) -> Option { self.read_atomically(|p| { p.read_given_char('%')?; p.read_number(10, None) p.read_number(10, None, true) }) }"} {"_id":"q-en-rust-7f211250bedb527f98283dbabcc8512b7d425ee03cd74f737d62be3cab55ba37","text":" Subproject commit c8e3cfbdd997839c771ca32c7ac860fe95149a04 Subproject commit 3abdd2f1ced4cf3a44c7de88c5e39b3bb5037c4d "} {"_id":"q-en-rust-7f2daa7f707e5e1ba91f4cad7dffef675dc62e149b88dab1724e7df6a36bb7b3","text":"cd .. rm -rf curl-build rm -rf curl-$VERSION yum erase -y curl "} {"_id":"q-en-rust-7f7d2422d27aa4cba089905e4d08ec078cd41ec42eea84fc5f0b05ad650b9143","text":" // 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 or the MIT license // , 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 } "} {"_id":"q-en-rust-7f9fb0a0741a9707d2b9c5a52448ef1a298b920f54c60d6d96da4a0f81e20dc8","text":"// 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 { span_bug!(import.span, \"inconsistent resolution for an import\"); let msg = \"inconsistent resolution for an import\"; self.r.session.span_err(import.span, msg); } } else { if self.r.privacy_errors.is_empty() {"} {"_id":"q-en-rust-7fa27024c7cadefa5fed79f02a67da88f62864aa7436630a01af4607c82e6e73","text":"source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)\", \"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)\", \"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)\", \"unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)\", ]"} {"_id":"q-en-rust-7fbccaa413ee70f517debcddd35f0dd7d3809989a9f55f84d823659cf61ac039","text":"#[unstable(feature = \"scoped_tls\", reason = \"scoped TLS has yet to have wide enough use to fully consider stabilizing its interface\")] pub use self::scoped::ScopedKey; pub use self::scoped_tls::ScopedKey; #[doc(hidden)] pub use self::local::__impl as __local; #[doc(hidden)] pub use self::scoped::__impl as __scoped; #[doc(hidden)] pub use self::scoped_tls::__impl as __scoped; //////////////////////////////////////////////////////////////////////////////// // Builder"} {"_id":"q-en-rust-7fdeee752b56755cf57d466dcb72a6e93641725ad1fab3372450501cec779123","text":"self.register_predicates(autoderef.into_obligations()); // Write out the final adjustments. self.apply_adjustments(self.self_expr, adjustments); if !self.skip_record_for_diagnostics { self.apply_adjustments(self.self_expr, adjustments); } target }"} {"_id":"q-en-rust-8002d7e2f16224de1eb5f72d9ea61c6cfb7ed88feff9c0ae02d0e805a34797c4","text":" // 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); impl Bar { const fn value() -> usize { 42 } } struct Foo::value()]>; pub fn main() {} "} {"_id":"q-en-rust-80050bab5b2423fa1a814cc5f779cec6cdd6687e10fde0f0d09bdb3af9b85b76","text":"\"you may want to use a bool value instead\", format!(\"{}\", item_typo), )) // 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(), )) } else { suggestion };"} {"_id":"q-en-rust-8019e4d1c6829d13ab2c7ada9f5354489be6b404886a2a97424bd7b60099cca8","text":"/// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] pub fn lock(&self) -> StderrLock<'_> { 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> { StderrLock { inner: self.inner.lock() } } /// 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() } } #[stable(feature = \"std_debug\", since = \"1.16.0\")]"} {"_id":"q-en-rust-801ca3d521a48fe3b8e895575d68e1b61df34fa548965a598ae49ca7d6c0711b","text":" // 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 or the MIT license // , 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 } } } "} {"_id":"q-en-rust-80237d3946948c57926f7c1aec3e651dfeaf4bccae0542f0fbf8659d45805689","text":"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\"); self.check_toolstate(); self.digest_and_sign(); let manifest = self.build_manifest(); self.write_channel_files(&self.rust_release, &manifest);"} {"_id":"q-en-rust-803836717353ca6b73f111855c5accd5b4b473766988ba4367ddf95d70ed2ec7","text":"cd .. rm -rf gcc-build rm -rf gcc-$GCC yum erase -y gcc gcc-c++ binutils "} {"_id":"q-en-rust-8058bc7a5978904375ef4b5a7a25782f9259b82687c82d38af0f010bb18b9bfc","text":"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\"); tp!(r\"?A:xy\", r\"\", r\"?A:xy\"); } }"} {"_id":"q-en-rust-808436811d1e463411241a6eb98ddc1352afb05833b0d2e990110d7ffa45ce18","text":"[[package]] name = \"phf\" version = \"0.7.22\" version = \"0.7.24\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\", \"phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\", ] [[package]] name = \"phf_codegen\" version = \"0.7.22\" version = \"0.7.24\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"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)\", \"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)\", ] [[package]] name = \"phf_generator\" version = \"0.7.22\" version = \"0.7.24\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"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)\", \"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)\", ] [[package]] name = \"phf_shared\" version = \"0.7.22\" version = \"0.7.24\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)\","} {"_id":"q-en-rust-8098ea873ae95ac468c5c3441363230e43649387f254efcc4e5354b0e083635e","text":" 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`. "} {"_id":"q-en-rust-809fd0775a481122ec11e79ab2d21591082b0059af84d2a7e6be2dd917f2b9d1","text":" // 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 or the MIT license // , 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)); } "} {"_id":"q-en-rust-80b21ded77695030493ae0dc7ec3c1366bfb18cec15f43a994d333ee2be70fb5","text":" // Regression test for . #![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), } "} {"_id":"q-en-rust-80ed051665603204b1bb2cdcdfb8e45d9f31a4bb7151f8deb72ce7d0bef903da","text":"Ok(result.callee) } 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, 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) } #[instrument(level = \"debug\", skip(self, call_expr))] pub fn lookup_probe( &self,"} {"_id":"q-en-rust-80edbbd0e00a8562bd9685d1ed3d2c92436d8c715077d563a6bdb95fb3666169","text":"/// 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. pub fn parameters_for<'tcx, T>(t: &T, include_nonconstraining: bool) -> Vec where T: TypeFoldable<'tcx> { pub fn parameters_for<'tcx>( t: &impl TypeFoldable<'tcx>, include_nonconstraining: bool, ) -> Vec { let mut collector = ParameterCollector { parameters: vec![], include_nonconstraining,"} {"_id":"q-en-rust-80f7623b5d0c058fde7bde309c05e897966fd865351ef2449cc9b8cec1c05bf3","text":"impl Foo for Bar { // ok! // functions implementation } fn baz(t: T) {} // ok! ``` or: Alternatively, you could introduce a new trait with your desired restrictions as a super trait: ``` trait Foo { // some functions } # trait Foo {} # struct Bar; # impl Foo for Bar {} trait Qux: Foo {} // Anything that implements Qux also needs to implement Foo fn baz(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; fn bar(t: T) {} // ok! ```"} {"_id":"q-en-rust-81a4512587a2d41d8718e4ce8bb9035f6c538a6353413487b1d8a1cf28d2d5f5","text":"name = \"build-manifest\" version = \"0.1.0\" dependencies = [ \"reqwest\", \"serde\", \"serde_json\", \"toml\", ]"} {"_id":"q-en-rust-81b9bcac09820a958917105f529f452a13065b337f9c8ca17e82ce9df7c6fc89","text":"} } // FIXME(#10432) impl Seek for MemWriter { fn tell(&self) -> u64 { self.pos as u64 } fn seek(&mut self, pos: i64, style: SeekStyle) { match style { SeekSet => { self.pos = pos as uint; } SeekEnd => { self.pos = self.buf.len() + pos as uint; } SeekCur => { self.pos += pos as uint; } } // 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; } }"} {"_id":"q-en-rust-821b9b4d1e91c18861fec1d8c82b36f710be9d7f85f0597e7e1c673f3794d594","text":"pub type SuccessorsMut<'a> = iter::Chain, slice::IterMut<'a, BasicBlock>>; 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> { self.kind.unwind() } pub fn unwind_mut(&mut self) -> Option<&mut Option> { 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> { 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> { 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), } } } impl<'tcx> BasicBlockData<'tcx> { pub fn new(terminator: Option>) -> BasicBlockData<'tcx> { BasicBlockData { statements: vec![], terminator, is_cleanup: false }"} {"_id":"q-en-rust-82268035238162cf5088440a8a821f1f3c0861f2faaefd58bb2094295a4d3388","text":" // 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 or the MIT license // , 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`) } "} {"_id":"q-en-rust-82277957d3372de60cf8a5fce67a7c491888ea1de531ac71d2f0d45dff4cbcbd","text":" 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 } "} {"_id":"q-en-rust-822a7586b59f057755aabfd9bb54c4db0f1f5928829916c10c2e357763ab6a21","text":"version = \"0.4.2\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"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)\", \"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)\", \"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)\","} {"_id":"q-en-rust-824bd24b76cedd1ab4ab2434851def9a736563117a268701e31cfd15dd3e61f4","text":"LL | #![deny(dead_code)] | ^^^^^^^^^ error: aborting due to 1 previous error 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 "} {"_id":"q-en-rust-827cc82e71fc44e41d22dc42979279e5e636debe4e428b66f627dc241e3c5edf","text":"fn visit_lifetime(&mut self, _: &hir::Lifetime) { // Unneeded. } 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; } }"} {"_id":"q-en-rust-82b07c1e0d9b29c78db934d5c5dd2f22d336d7ab9d43805c79d3aad9ae446303","text":"let const_data = self.encode_rendered_const_for_body(body_id); let qualifs = self.tcx.mir_const_qualif(def_id); record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::Const(qualifs, const_data)); record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::AnonConst(qualifs, const_data)); 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());"} {"_id":"q-en-rust-82b205bbad5297babd01d206876d7370476209c24387644bfdb20aaf1cedf1ca","text":"version = \"0.7.5\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"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)\", \"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)\", \"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)\","} {"_id":"q-en-rust-82d1d7cb0f27c108e4a8de86564bd9f6d29e88aa89b7a8462c2ed2e82e74bb76","text":"= help: enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` help: try using `=` instead | LL - B == 2 LL + B = 2 | LL | B = 2 | ~ error: expected item, found `==` --> $DIR/issue-101477-enum.rs:6:7"} {"_id":"q-en-rust-82da87c69080c55809a5fbaa1b0c4da5194bf55964d33cd3e2a4a321f9d70dd1","text":" 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 error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-82f77d7ec752e13c01534cffae8dec0e7abf2aecd0f344109954990002917b29","text":"LL | arg.map(|v| &**v) | ++++++++++++++ error: aborting due to 1 previous error error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:9:19 | LL | arg.unwrap_or(&[]) | --------- ^^^ expected `&Vec`, found `&[_; 0]` | | | arguments to this method are incorrect | = note: expected reference `&Vec` 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`, found `&[i32]` | | | arguments to this method are incorrect | = note: expected reference `&Vec` 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`, found `&[_; 0]` | | | arguments to this method are incorrect | = note: expected reference `&Vec` 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 For more information about this error, try `rustc --explain E0308`."} {"_id":"q-en-rust-8303ff161ab4e39c5bb600e265bd6a3c3a8c312958f2d105a7b433f5324397a8","text":" // check-pass // compile-flags: -Z validate-mir #![feature(let_chains)] fn let_chains(entry: std::io::Result) { if let Ok(entry) = entry && let Some(s) = entry.file_name().to_str() && s.contains(\"\") {} } fn main() {} "} {"_id":"q-en-rust-8343783cd6cdead4f8f320a6062f1bc371865525990afd1e8670c364161d39c6","text":"= 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 error: aborting due to 3 previous errors error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`."} {"_id":"q-en-rust-834fbc70360b487080d39e350229ac8c2877a5d610106d1bca5f73fa33f2fcbd","text":"[[package]] name = \"git2\" version = \"0.11.0\" version = \"0.12.0\" source = \"registry+https://github.com/rust-lang/crates.io-index\" checksum = \"77519ef7c5beee314d0804d4534f01e0f9e8d9acdee2b7a48627e590b27e0ec4\" checksum = \"26e07ef27260a78f7e8d218ebac2c72f2c4db50493741b190b6e8eade1da7c68\" dependencies = [ \"bitflags\", \"libc\","} {"_id":"q-en-rust-8365a03cc30c2dc6936493e88373cb8dac3e9f18faf9329d2a764bd6b34ef3a0","text":"declare_lint!(OVERFLOWING_LITERALS, Warn, \"literal out of range for its type\") declare_lint!(EXCEEDING_BITSHIFTS, Deny, \"shift exceeds the type's number of bits\") pub struct TypeLimits { /// Id of the last visited negated expression negated_expr_id: ast::NodeId,"} {"_id":"q-en-rust-836b680022205ef5353aa021dbe767010833b2fc430c292363de59cdb4d9629d","text":" 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 "} {"_id":"q-en-rust-8398dc526bbccad3a1e641343466773320511b26f0d4fb0c16bf4137a78e4706","text":"} /// Returns the set of parameters constrained by the impl header. pub fn parameters_for_impl<'tcx>(impl_self_ty: Ty<'tcx>, impl_trait_ref: Option>) -> FxHashSet { pub fn parameters_for_impl<'tcx>( impl_self_ty: Ty<'tcx>, impl_trait_ref: Option>, ) -> FxHashSet { let vec = match impl_trait_ref { Some(tr) => parameters_for(&tr, false), None => parameters_for(&impl_self_ty, false),"} {"_id":"q-en-rust-83db75b67ccbb9236a8e9c2e1d8054a5710ed3763267c2505b9243f0b091084f","text":" 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 "} {"_id":"q-en-rust-83fb5a5595d8bfadc69a01c99749539609decb5baae9f56dc453df7052d4ef36","text":"// Float => does not implement iterator. for i in 0f32..42f32 {} //~^ ERROR `core::iter::Iterator` is not implemented for the type `core::ops::Range` //~^^ ERROR //~^^^ ERROR // FIXME(#21528) not fulfilled obligation error should be reported once, not thrice //~^ ERROR the trait `core::num::Int` is not implemented for the type `f32` // Unsized type. let arr: &[_] = &[1us, 2, 3];"} {"_id":"q-en-rust-840a775eacf6eba96a10eadd30e82887dc901ea7fe96b648abd39ef50641f1db","text":"/// [`Metadata`]: struct.Metadata.html /// [`fs::metadata`]: fn.metadata.html /// [`fs::symlink_metadata`]: fn.symlink_metadata.html /// [`is_dir`]: struct.FileType.html#method.is_dir /// [`is_file`]: struct.FileType.html#method.is_file /// [`is_symlink`]: struct.FileType.html#method.is_symlink /// /// # Examples"} {"_id":"q-en-rust-842aeac0ee1ee04937e0063ef82af90ff3c57ebec0a99d582d8da7073ef6ea62","text":"unsafe { Box::from_raw(Box::into_raw(v) as *mut str) } } /// Converts the bytes while the bytes are still ascii. /// Converts leading ascii bytes in `s` by calling the `convert` function. /// /// For better average performance, this happens in chunks of `2*size_of::()`. /// Returns a vec with the converted bytes. /// /// 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)] #[inline] #[cfg(not(test))] #[cfg(not(no_global_oom_handling))] fn convert_while_ascii(b: &[u8], convert: fn(&u8) -> u8) -> Vec { let mut out = Vec::with_capacity(b.len()); 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; } const USIZE_SIZE: usize = mem::size_of::(); const MAGIC_UNROLL: usize = 2; const N: usize = USIZE_SIZE * MAGIC_UNROLL; const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; USIZE_SIZE]); // 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::() as usize != N { break; } 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::().add(j).read_unaligned(); } // if our chunks aren't ascii, then return only the prior bytes as init if bits & NONASCII_MASK != 0 { break; } for j in 0..N { out_chunk[j] = MaybeUninit::new(convert(&chunk[j])); } // 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))); } ascii_prefix_len += N; slice = unsafe { slice.get_unchecked(N..) }; out_slice = unsafe { out_slice.get_unchecked_mut(N..) }; } // mark these bytes as initialised i += N; // 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)); } out.set_len(i); ascii_prefix_len += 1; slice = unsafe { slice.get_unchecked(1..) }; out_slice = unsafe { out_slice.get_unchecked_mut(1..) }; } out 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) } }"} {"_id":"q-en-rust-844d325c0658c4f7fd9318bc3cdcf16a36a63bec6da3d6373d67af9c7e272bbd","text":"let addr = builder.config.dist_upload_addr.as_ref().unwrap_or_else(|| { panic!(\"nnfailed to specify `dist.upload-addr` in `config.toml`nn\") }); 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() }; 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)); let today = output(Command::new(\"date\").arg(\"+%Y-%m-%d\"));"} {"_id":"q-en-rust-844f7078720c405b82e091caaab695dc949197751ce5cf6654a09682d0f02568","text":" // Copyright 2012 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. /*! * High-level text containers. * * Ropes are a high-level representation of text that offers * much better performance than strings for common operations, * and generally reduce memory allocations and copies, while only * entailing a small degradation of less common operations. * * More precisely, where a string is represented as a memory buffer, * a rope is a tree structure whose leaves are slices of immutable * strings. Therefore, concatenation, appending, prepending, substrings, * etc. are operations that require only trivial tree manipulation, * generally without having to copy memory. In addition, the tree * structure of ropes makes them suitable as a form of index to speed-up * access to Unicode characters by index in long chunks of text. * * The following operations are algorithmically faster in ropes: * * * extracting a subrope is logarithmic (linear in strings); * * appending/prepending is near-constant time (linear in strings); * * concatenation is near-constant time (linear in strings); * * char length is constant-time (linear in strings); * * access to a character by index is logarithmic (linear in strings); */ #[allow(missing_doc)]; use std::uint; use std::vec; use std::str; /// The type of ropes. pub type Rope = node::Root; /* Section: Creating a rope */ /// Create an empty rope pub fn empty() -> Rope { return node::Empty; } /** * Adopt a string as a rope. * * # Arguments * * * str - A valid string. * * # Return value * * A rope representing the same string as `str`. Depending of the length * of `str`, this rope may be empty, flat or complex. * * # Performance notes * * * this operation does not copy the string; * * the function runs in linear time. */ pub fn of_str(str: @~str) -> Rope { return of_substr(str, 0u, str.len()); } /** * As `of_str` but for a substring. * * # Arguments * * byte_offset - The offset of `str` at which the rope starts. * * byte_len - The number of bytes of `str` to use. * * # Return value * * A rope representing the same string as `str.slice(byte_offset, * byte_offset + byte_len)`. Depending on `byte_len`, this rope may * be empty, flat or complex. * * # Performance note * * This operation does not copy the substring. * * # Safety notes * * * this function does _not_ check the validity of the substring; * * this function fails if `byte_offset` or `byte_len` do not match `str`. */ pub fn of_substr(str: @~str, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } if byte_offset + byte_len > str.len() { fail!(); } return node::Content(node::of_substr(str, byte_offset, byte_len)); } /* Section: Adding things to a rope */ /** * Add one char to the end of the rope * * # Performance note * * * this function executes in near-constant time */ pub fn append_char(rope: Rope, char: char) -> Rope { return append_str(rope, @str::from_chars([char])); } /** * Add one string to the end of the rope * * # Performance note * * * this function executes in near-linear time */ pub fn append_str(rope: Rope, str: @~str) -> Rope { return append_rope(rope, of_str(str)) } /** * Add one char to the beginning of the rope * * # Performance note * * this function executes in near-constant time */ pub fn prepend_char(rope: Rope, char: char) -> Rope { return prepend_str(rope, @str::from_chars([char])); } /** * Add one string to the beginning of the rope * * # Performance note * * this function executes in near-linear time */ pub fn prepend_str(rope: Rope, str: @~str) -> Rope { return append_rope(of_str(str), rope) } /// Concatenate two ropes pub fn append_rope(left: Rope, right: Rope) -> Rope { match (left) { node::Empty => return right, node::Content(left_content) => { match (right) { node::Empty => return left, node::Content(right_content) => { return node::Content(node::concat2(left_content, right_content)); } } } } } /** * Concatenate many ropes. * * If the ropes are balanced initially and have the same height, the resulting * rope remains balanced. However, this function does not take any further * measure to ensure that the result is balanced. */ pub fn concat(v: ~[Rope]) -> Rope { //Copy `v` into a mut vector let mut len = v.len(); if len == 0u { return node::Empty; } let mut ropes = vec::from_elem(len, v[0]); for uint::range(1u, len) |i| { ropes[i] = v[i]; } //Merge progresively while len > 1u { for uint::range(0u, len/2u) |i| { ropes[i] = append_rope(ropes[2u*i], ropes[2u*i+1u]); } if len%2u != 0u { ropes[len/2u] = ropes[len - 1u]; len = len/2u + 1u; } else { len = len/2u; } } //Return final rope return ropes[0]; } /* Section: Keeping ropes healthy */ /** * Balance a rope. * * # Return value * * A copy of the rope in which small nodes have been grouped in memory, * and with a reduced height. * * If you perform numerous rope concatenations, it is generally a good idea * to rebalance your rope at some point, before using it for other purposes. */ pub fn bal(rope:Rope) -> Rope { match (rope) { node::Empty => return rope, node::Content(x) => match (node::bal(x)) { None => rope, Some(y) => node::Content(y) } } } /* Section: Transforming ropes */ /** * Extract a subrope from a rope. * * # Performance note * * * on a balanced rope, this operation takes algorithmic time; * * this operation does not involve any copying * * # Safety note * * * this function fails if char_offset/char_len do not represent * valid positions in rope */ pub fn sub_chars(rope: Rope, char_offset: uint, char_len: uint) -> Rope { if char_len == 0u { return node::Empty; } match (rope) { node::Empty => fail!(), node::Content(node) => if char_len > node::char_len(node) { fail!() } else { return node::Content(node::sub_chars(node, char_offset, char_len)) } } } /** * Extract a subrope from a rope. * * # Performance note * * * on a balanced rope, this operation takes algorithmic time; * * this operation does not involve any copying * * # Safety note * * * this function fails if byte_offset/byte_len do not represent * valid positions in rope */ pub fn sub_bytes(rope: Rope, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } match (rope) { node::Empty => fail!(), node::Content(node) =>if byte_len > node::byte_len(node) { fail!() } else { return node::Content(node::sub_bytes(node, byte_offset, byte_len)) } } } /* Section: Comparing ropes */ /** * Compare two ropes by Unicode lexicographical order. * * This function compares only the contents of the rope, not their structure. * * # Return value * * A negative value if `left < right`, 0 if eq(left, right) or a positive * value if `left > right` */ pub fn cmp(left: Rope, right: Rope) -> int { match ((left, right)) { (node::Empty, node::Empty) => return 0, (node::Empty, _) => return -1, (_, node::Empty) => return 1, (node::Content(a), node::Content(b)) => { return node::cmp(a, b); } } } /** * Returns `true` if both ropes have the same content (regardless of * their structure), `false` otherwise */ pub fn eq(left: Rope, right: Rope) -> bool { return cmp(left, right) == 0; } /** * # Arguments * * * left - an arbitrary rope * * right - an arbitrary rope * * # Return value * * `true` if `left <= right` in lexicographical order (regardless of their * structure), `false` otherwise */ pub fn le(left: Rope, right: Rope) -> bool { return cmp(left, right) <= 0; } /** * # Arguments * * * left - an arbitrary rope * * right - an arbitrary rope * * # Return value * * `true` if `left < right` in lexicographical order (regardless of their * structure), `false` otherwise */ pub fn lt(left: Rope, right: Rope) -> bool { return cmp(left, right) < 0; } /** * # Arguments * * * left - an arbitrary rope * * right - an arbitrary rope * * # Return value * * `true` if `left >= right` in lexicographical order (regardless of their * structure), `false` otherwise */ pub fn ge(left: Rope, right: Rope) -> bool { return cmp(left, right) >= 0; } /** * # Arguments * * * left - an arbitrary rope * * right - an arbitrary rope * * # Return value * * `true` if `left > right` in lexicographical order (regardless of their * structure), `false` otherwise */ pub fn gt(left: Rope, right: Rope) -> bool { return cmp(left, right) > 0; } /* Section: Iterating */ /** * Loop through a rope, char by char * * While other mechanisms are available, this is generally the best manner * of looping through the contents of a rope char by char. If you prefer a * loop that iterates through the contents string by string (e.g. to print * the contents of the rope or output it to the system), however, * you should rather use `traverse_components`. * * # Arguments * * * rope - A rope to traverse. It may be empty. * * it - A block to execute with each consecutive character of the rope. * Return `true` to continue, `false` to stop. * * # Return value * * `true` If execution proceeded correctly, `false` if it was interrupted, * that is if `it` returned `false` at any point. */ pub fn loop_chars(rope: Rope, it: &fn(c: char) -> bool) -> bool { match (rope) { node::Empty => return true, node::Content(x) => return node::loop_chars(x, it) } } /** * Loop through a rope, char by char, until the end. * * # Arguments * * rope - A rope to traverse. It may be empty * * it - A block to execute with each consecutive character of the rope. */ pub fn iter_chars(rope: Rope, it: &fn(char)) { do loop_chars(rope) |x| { it(x); true }; } /** * Loop through a rope, string by string * * While other mechanisms are available, this is generally the best manner of * looping through the contents of a rope string by string, which may be * useful e.g. to print strings as you see them (without having to copy their * contents into a new string), to send them to then network, to write them to * a file, etc.. If you prefer a loop that iterates through the contents * char by char (e.g. to search for a char), however, you should rather * use `traverse`. * * # Arguments * * * rope - A rope to traverse. It may be empty * * it - A block to execute with each consecutive string component of the * rope. Return `true` to continue, `false` to stop * * # Return value * * `true` If execution proceeded correctly, `false` if it was interrupted, * that is if `it` returned `false` at any point. */ pub fn loop_leaves(rope: Rope, it: &fn(node::Leaf) -> bool) -> bool{ match (rope) { node::Empty => return true, node::Content(x) => return node::loop_leaves(x, it) } } pub mod iterator { pub mod leaf { use rope::{Rope, node}; pub fn start(rope: Rope) -> node::leaf_iterator::T { match (rope) { node::Empty => return node::leaf_iterator::empty(), node::Content(x) => return node::leaf_iterator::start(x) } } pub fn next(it: &mut node::leaf_iterator::T) -> Option { return node::leaf_iterator::next(it); } } pub mod char { use rope::{Rope, node}; pub fn start(rope: Rope) -> node::char_iterator::T { match (rope) { node::Empty => return node::char_iterator::empty(), node::Content(x) => return node::char_iterator::start(x) } } pub fn next(it: &mut node::char_iterator::T) -> Option { return node::char_iterator::next(it) } } } /* Section: Rope properties */ /** * Returns the height of the rope. * * The height of the rope is a bound on the number of operations which * must be performed during a character access before finding the leaf in * which a character is contained. * * # Performance note * * Constant time. */ pub fn height(rope: Rope) -> uint { match (rope) { node::Empty => return 0u, node::Content(x) => return node::height(x) } } /** * The number of character in the rope * * # Performance note * * Constant time. */ pub fn char_len(rope: Rope) -> uint { match (rope) { node::Empty => return 0u, node::Content(x) => return node::char_len(x) } } /** * The number of bytes in the rope * * # Performance note * * Constant time. */ pub fn byte_len(rope: Rope) -> uint { match (rope) { node::Empty => return 0u, node::Content(x) => return node::byte_len(x) } } /** * The character at position `pos` * * # Arguments * * * pos - A position in the rope * * # Safety notes * * The function will fail if `pos` is not a valid position in the rope. * * # Performance note * * This function executes in a time proportional to the height of the * rope + the (bounded) length of the largest leaf. */ pub fn char_at(rope: Rope, pos: uint) -> char { match (rope) { node::Empty => fail!(), node::Content(x) => return node::char_at(x, pos) } } /* Section: Implementation */ pub mod node { use rope::node; use std::cast; use std::uint; use std::vec; /// Implementation of type `rope` pub enum Root { /// An empty rope Empty, /// A non-empty rope Content(@Node), } /** * A text component in a rope. * * This is actually a slice in a rope, so as to ensure maximal sharing. * * # Fields * * * byte_offset = The number of bytes skipped in `content` * * byte_len - The number of bytes of `content` to use * * char_len - The number of chars in the leaf. * * content - Contents of the leaf. * * Note that we can have `char_len < content.char_len()`, if * this leaf is only a subset of the string. Also note that the * string can be shared between several ropes, e.g. for indexing * purposes. */ pub struct Leaf { byte_offset: uint, byte_len: uint, char_len: uint, content: @~str, } /** * A node obtained from the concatenation of two other nodes * * # Fields * * * left - The node containing the beginning of the text. * * right - The node containing the end of the text. * * char_len - The number of chars contained in all leaves of this node. * * byte_len - The number of bytes in the subrope. * * Used to pre-allocate the correct amount of storage for * serialization. * * * height - Height of the subrope. * * Used for rebalancing and to allocate stacks for traversals. */ pub struct Concat { //FIXME (#2744): Perhaps a `vec` instead of `left`/`right` left: @Node, right: @Node, char_len: uint, byte_len: uint, height: uint, } pub enum Node { /// A leaf consisting in a `str` Leaf(Leaf), /// The concatenation of two ropes Concat(Concat), } /** * The maximal number of chars that _should_ be permitted in a single node * * This is not a strict value */ pub static HINT_MAX_LEAF_CHAR_LEN: uint = 256u; /** * The maximal height that _should_ be permitted in a tree. * * This is not a strict value */ pub static HINT_MAX_NODE_HEIGHT: uint = 16u; /** * Adopt a string as a node. * * If the string is longer than `max_leaf_char_len`, it is * logically split between as many leaves as necessary. Regardless, * the string itself is not copied. * * Performance note: The complexity of this function is linear in * the length of `str`. */ pub fn of_str(str: @~str) -> @Node { return of_substr(str, 0u, str.len()); } /** * Adopt a slice of a string as a node. * * If the slice is longer than `max_leaf_char_len`, it is logically split * between as many leaves as necessary. Regardless, the string itself * is not copied * * # Arguments * * * byte_start - The byte offset where the slice of `str` starts. * * byte_len - The number of bytes from `str` to use. * * # Safety note * * Behavior is undefined if `byte_start` or `byte_len` do not represent * valid positions in `str` */ pub fn of_substr(str: @~str, byte_start: uint, byte_len: uint) -> @Node { return of_substr_unsafer(str, byte_start, byte_len, str.slice(byte_start, byte_start + byte_len).char_len()); } /** * Adopt a slice of a string as a node. * * If the slice is longer than `max_leaf_char_len`, it is logically split * between as many leaves as necessary. Regardless, the string itself * is not copied * * # Arguments * * * byte_start - The byte offset where the slice of `str` starts. * * byte_len - The number of bytes from `str` to use. * * char_len - The number of chars in `str` in the interval * [byte_start, byte_start+byte_len) * * # Safety notes * * * Behavior is undefined if `byte_start` or `byte_len` do not represent * valid positions in `str` * * Behavior is undefined if `char_len` does not accurately represent the * number of chars between byte_start and byte_start+byte_len */ pub fn of_substr_unsafer(str: @~str, byte_start: uint, byte_len: uint, char_len: uint) -> @Node { assert!((byte_start + byte_len <= str.len())); let candidate = @Leaf(Leaf { byte_offset: byte_start, byte_len: byte_len, char_len: char_len, content: str, }); if char_len <= HINT_MAX_LEAF_CHAR_LEN { return candidate; } else { //Firstly, split `str` in slices of HINT_MAX_LEAF_CHAR_LEN let mut leaves = uint::div_ceil(char_len, HINT_MAX_LEAF_CHAR_LEN); //Number of leaves let mut nodes = vec::from_elem(leaves, candidate); let mut i = 0u; let mut offset = byte_start; let first_leaf_char_len = if char_len%HINT_MAX_LEAF_CHAR_LEN == 0u { HINT_MAX_LEAF_CHAR_LEN } else { char_len%HINT_MAX_LEAF_CHAR_LEN }; while i < leaves { let chunk_char_len: uint = if i == 0u { first_leaf_char_len } else { HINT_MAX_LEAF_CHAR_LEN }; let chunk_byte_len = str.slice_from(offset).slice_chars(0, chunk_char_len).len(); nodes[i] = @Leaf(Leaf { byte_offset: offset, byte_len: chunk_byte_len, char_len: chunk_char_len, content: str, }); offset += chunk_byte_len; i += 1u; } //Then, build a tree from these slices by collapsing them while leaves > 1u { i = 0u; while i < leaves - 1u {//Concat nodes 0 with 1, 2 with 3 etc. nodes[i/2u] = concat2(nodes[i], nodes[i + 1u]); i += 2u; } if i == leaves - 1u { //And don't forget the last node if it is in even position nodes[i/2u] = nodes[i]; } leaves = uint::div_ceil(leaves, 2u); } return nodes[0u]; } } pub fn byte_len(node: @Node) -> uint { //FIXME (#2744): Could we do this without the pattern-matching? match (*node) { Leaf(y) => y.byte_len, Concat(ref y) => y.byte_len } } pub fn char_len(node: @Node) -> uint { match (*node) { Leaf(y) => y.char_len, Concat(ref y) => y.char_len } } /** * Concatenate a forest of nodes into one tree. * * # Arguments * * * forest - The forest. This vector is progressively rewritten during * execution and should be discarded as meaningless afterwards. */ pub fn tree_from_forest_destructive(forest: &mut [@Node]) -> @Node { let mut i; let mut len = forest.len(); while len > 1u { i = 0u; while i < len - 1u {//Concat nodes 0 with 1, 2 with 3 etc. let mut left = forest[i]; let mut right = forest[i+1u]; let left_len = char_len(left); let right_len= char_len(right); let mut left_height= height(left); let mut right_height=height(right); if left_len + right_len > HINT_MAX_LEAF_CHAR_LEN { if left_len <= HINT_MAX_LEAF_CHAR_LEN { left = flatten(left); left_height = height(left); } if right_len <= HINT_MAX_LEAF_CHAR_LEN { right = flatten(right); right_height = height(right); } } if left_height >= HINT_MAX_NODE_HEIGHT { left = of_substr_unsafer(@serialize_node(left), 0u,byte_len(left), left_len); } if right_height >= HINT_MAX_NODE_HEIGHT { right = of_substr_unsafer(@serialize_node(right), 0u,byte_len(right), right_len); } forest[i/2u] = concat2(left, right); i += 2u; } if i == len - 1u { //And don't forget the last node if it is in even position forest[i/2u] = forest[i]; } len = uint::div_ceil(len, 2u); } return forest[0]; } pub fn serialize_node(node: @Node) -> ~str { unsafe { let mut buf = vec::from_elem(byte_len(node), 0); let mut offset = 0u;//Current position in the buffer let mut it = leaf_iterator::start(node); loop { match leaf_iterator::next(&mut it) { None => break, Some(x) => { //FIXME (#2744): Replace with memcpy or something similar let local_buf: ~[u8] = cast::transmute(copy *x.content); let mut i = x.byte_offset; while i < x.byte_len { buf[offset] = local_buf[i]; offset += 1u; i += 1u; } cast::forget(local_buf); } } } return cast::transmute(buf); } } /** * Replace a subtree by a single leaf with the same contents. * * * Performance note * * This function executes in linear time. */ pub fn flatten(node: @Node) -> @Node { match (*node) { Leaf(_) => node, Concat(ref x) => { @Leaf(Leaf { byte_offset: 0u, byte_len: x.byte_len, char_len: x.char_len, content: @serialize_node(node), }) } } } /** * Balance a node. * * # Algorithm * * * if the node height is smaller than `HINT_MAX_NODE_HEIGHT`, do nothing * * otherwise, gather all leaves as a forest, rebuild a balanced node, * concatenating small leaves along the way * * # Return value * * * `None` if no transformation happened * * `Some(x)` otherwise, in which case `x` has the same contents * as `node` bot lower height and/or fragmentation. */ pub fn bal(node: @Node) -> Option<@Node> { if height(node) < HINT_MAX_NODE_HEIGHT { return None; } //1. Gather all leaves as a forest let mut forest = ~[]; let mut it = leaf_iterator::start(node); loop { match leaf_iterator::next(&mut it) { None => break, Some(x) => forest.push(@Leaf(x)) } } //2. Rebuild tree from forest let root = @*tree_from_forest_destructive(forest); return Some(root); } /** * Compute the subnode of a node. * * # Arguments * * * node - A node * * byte_offset - A byte offset in `node` * * byte_len - The number of bytes to return * * # Performance notes * * * this function performs no copying; * * this function executes in a time proportional to the height of `node` * * # Safety notes * * This function fails if `byte_offset` or `byte_len` do not represent * valid positions in `node`. */ pub fn sub_bytes(node: @Node, byte_offset: uint, byte_len: uint) -> @Node { let mut node = node; let mut byte_offset = byte_offset; loop { if byte_offset == 0u && byte_len == node::byte_len(node) { return node; } match (*node) { node::Leaf(x) => { let char_len = x.content.slice(byte_offset, byte_offset + byte_len).char_len(); return @Leaf(Leaf { byte_offset: byte_offset, byte_len: byte_len, char_len: char_len, content: x.content, }); } node::Concat(ref x) => { let left_len: uint = node::byte_len(x.left); if byte_offset <= left_len { if byte_offset + byte_len <= left_len { //Case 1: Everything fits in x.left, tail-call node = x.left; } else { //Case 2: A (non-empty, possibly full) suffix //of x.left and a (non-empty, possibly full) prefix //of x.right let left_result = sub_bytes(x.left, byte_offset, left_len); let right_result = sub_bytes(x.right, 0u, left_len - byte_offset); return concat2(left_result, right_result); } } else { //Case 3: Everything fits in x.right byte_offset -= left_len; node = x.right; } } } }; } /** * Compute the subnode of a node. * * # Arguments * * * node - A node * * char_offset - A char offset in `node` * * char_len - The number of chars to return * * # Performance notes * * * this function performs no copying; * * this function executes in a time proportional to the height of `node` * * # Safety notes * * This function fails if `char_offset` or `char_len` do not represent * valid positions in `node`. */ pub fn sub_chars(node: @Node, char_offset: uint, char_len: uint) -> @Node { let mut node = node; let mut char_offset = char_offset; loop { match (*node) { node::Leaf(x) => { if char_offset == 0u && char_len == x.char_len { return node; } let byte_offset = x.content.slice_chars(0, char_offset).len(); let byte_len = x.content.slice_from(byte_offset).slice_chars(0, char_len).len(); return @Leaf(Leaf { byte_offset: byte_offset, byte_len: byte_len, char_len: char_len, content: x.content, }); } node::Concat(ref x) => { if char_offset == 0u && char_len == x.char_len {return node;} let left_len : uint = node::char_len(x.left); if char_offset <= left_len { if char_offset + char_len <= left_len { //Case 1: Everything fits in x.left, tail call node = x.left; } else { //Case 2: A (non-empty, possibly full) suffix //of x.left and a (non-empty, possibly full) prefix //of x.right let left_result = sub_chars(x.left, char_offset, left_len); let right_result = sub_chars(x.right, 0u, left_len - char_offset); return concat2(left_result, right_result); } } else { //Case 3: Everything fits in x.right, tail call node = x.right; char_offset -= left_len; } } } }; } pub fn concat2(left: @Node, right: @Node) -> @Node { @Concat(Concat { left: left, right: right, char_len: char_len(left) + char_len(right), byte_len: byte_len(left) + byte_len(right), height: uint::max(height(left), height(right)) + 1u, }) } pub fn height(node: @Node) -> uint { match (*node) { Leaf(_) => 0u, Concat(ref x) => x.height, } } pub fn cmp(a: @Node, b: @Node) -> int { let mut ita = char_iterator::start(a); let mut itb = char_iterator::start(b); let mut result = 0; while result == 0 { match (char_iterator::next(&mut ita), char_iterator::next(&mut itb)) { (None, None) => break, (Some(chara), Some(charb)) => { result = chara.cmp(&charb) as int; } (Some(_), _) => { result = 1; } (_, Some(_)) => { result = -1; } } } return result; } pub fn loop_chars(node: @Node, it: &fn(c: char) -> bool) -> bool { return loop_leaves(node,|leaf| { leaf.content.slice(leaf.byte_offset, leaf.byte_len).iter().all(|c| it(c)) }); } /** * Loop through a node, leaf by leaf * * # Arguments * * * rope - A node to traverse. * * it - A block to execute with each consecutive leaf of the node. * Return `true` to continue, `false` to stop * * # Arguments * * `true` If execution proceeded correctly, `false` if it was interrupted, * that is if `it` returned `false` at any point. */ pub fn loop_leaves(node: @Node, it: &fn(Leaf) -> bool) -> bool{ let mut current = node; loop { match (*current) { Leaf(x) => return it(x), Concat(ref x) => if loop_leaves(x.left, |l| it(l)) { //non tail call current = x.right; //tail call } else { return false; } } }; } /** * # Arguments * * * pos - A position in the rope * * # Return value * * The character at position `pos` * * # Safety notes * * The function will fail if `pos` is not a valid position in the rope. * * Performance note: This function executes in a time * proportional to the height of the rope + the (bounded) * length of the largest leaf. */ pub fn char_at(mut node: @Node, mut pos: uint) -> char { loop { match *node { Leaf(x) => return x.content.char_at(pos), Concat(Concat {left, right, _}) => { let left_len = char_len(left); node = if left_len > pos { left } else { pos -= left_len; right }; } } }; } pub mod leaf_iterator { use rope::node::{Concat, Leaf, Node, height}; use std::vec; pub struct T { stack: ~[@Node], stackpos: int, } pub fn empty() -> T { let stack : ~[@Node] = ~[]; T { stack: stack, stackpos: -1 } } pub fn start(node: @Node) -> T { let stack = vec::from_elem(height(node)+1u, node); T { stack: stack, stackpos: 0, } } pub fn next(it: &mut T) -> Option { if it.stackpos < 0 { return None; } loop { let current = it.stack[it.stackpos]; it.stackpos -= 1; match (*current) { Concat(ref x) => { it.stackpos += 1; it.stack[it.stackpos] = x.right; it.stackpos += 1; it.stack[it.stackpos] = x.left; } Leaf(x) => return Some(x) } }; } } pub mod char_iterator { use rope::node::{Leaf, Node}; use rope::node::leaf_iterator; pub struct T { leaf_iterator: leaf_iterator::T, leaf: Option, leaf_byte_pos: uint, } pub fn start(node: @Node) -> T { T { leaf_iterator: leaf_iterator::start(node), leaf: None, leaf_byte_pos: 0u, } } pub fn empty() -> T { T { leaf_iterator: leaf_iterator::empty(), leaf: None, leaf_byte_pos: 0u, } } pub fn next(it: &mut T) -> Option { loop { match get_current_or_next_leaf(it) { None => return None, Some(_) => { let next_char = get_next_char_in_leaf(it); match next_char { None => loop, Some(_) => return next_char } } } }; } pub fn get_current_or_next_leaf(it: &mut T) -> Option { match it.leaf { Some(_) => return it.leaf, None => { let next = leaf_iterator::next(&mut it.leaf_iterator); match next { None => return None, Some(_) => { it.leaf = next; it.leaf_byte_pos = 0u; return next; } } } } } pub fn get_next_char_in_leaf(it: &mut T) -> Option { match copy it.leaf { None => return None, Some(aleaf) => { if it.leaf_byte_pos >= aleaf.byte_len { //We are actually past the end of the leaf it.leaf = None; return None } else { let range = aleaf.content.char_range_at((*it).leaf_byte_pos + aleaf.byte_offset); let ch = range.ch; let next = range.next; (*it).leaf_byte_pos = next - aleaf.byte_offset; return Some(ch) } } } } } } #[cfg(test)] mod tests { use rope::*; use std::uint; use std::vec; //Utility function, used for sanity check fn rope_to_string(r: Rope) -> ~str { match (r) { node::Empty => return ~\"\", node::Content(x) => { let mut str = ~\"\"; fn aux(str: &mut ~str, node: @node::Node) { match (*node) { node::Leaf(x) => { str.push_str(x.content.slice(x.byte_offset, x.byte_offset + x.byte_len)); } node::Concat(ref x) => { aux(str, x.left); aux(str, x.right); } } } aux(&mut str, x); return str } } } #[test] fn trivial() { assert_eq!(char_len(empty()), 0u); assert_eq!(byte_len(empty()), 0u); } #[test] fn of_string1() { let sample = @~\"0123456789ABCDE\"; let r = of_str(sample); assert_eq!(char_len(r), sample.char_len()); assert!(rope_to_string(r) == *sample); } #[test] fn of_string2() { let buf = @ mut ~\"1234567890\"; let mut i = 0; while i < 10 { let a = copy *buf; let b = copy *buf; *buf = a + b; i+=1; } let sample = @copy *buf; let r = of_str(sample); assert_eq!(char_len(r), sample.char_len()); assert!(rope_to_string(r) == *sample); let mut string_iter = 0u; let string_len = sample.len(); let mut rope_iter = iterator::char::start(r); let mut equal = true; while equal { match (node::char_iterator::next(&mut rope_iter)) { None => { if string_iter < string_len { equal = false; } break; } Some(c) => { let range = sample.char_range_at(string_iter); string_iter = range.next; if range.ch != c { equal = false; break; } } } } assert!(equal); } #[test] fn iter1() { let buf = @ mut ~\"1234567890\"; let mut i = 0; while i < 10 { let a = copy *buf; let b = copy *buf; *buf = a + b; i+=1; } let sample = @copy *buf; let r = of_str(sample); let mut len = 0u; let mut it = iterator::char::start(r); loop { match (node::char_iterator::next(&mut it)) { None => break, Some(_) => len += 1u } } assert_eq!(len, sample.char_len()); } #[test] fn bal1() { let init = @~\"1234567890\"; let buf = @mut copy *init; let mut i = 0; while i < 8 { let a = copy *buf; let b = copy *buf; *buf = a + b; i+=1; } let sample = @copy *buf; let r1 = of_str(sample); let mut r2 = of_str(init); i = 0; while i < 8 { r2 = append_rope(r2, r2); i+= 1;} assert!(eq(r1, r2)); let r3 = bal(r2); assert_eq!(char_len(r1), char_len(r3)); assert!(eq(r1, r3)); } #[test] #[ignore] fn char_at1() { //Generate a large rope let mut r = of_str(@~\"123456789\"); for uint::range(0u, 10u) |_i| { r = append_rope(r, r); } //Copy it in the slowest possible way let mut r2 = empty(); for uint::range(0u, char_len(r)) |i| { r2 = append_char(r2, char_at(r, i)); } assert!(eq(r, r2)); let mut r3 = empty(); for uint::range(0u, char_len(r)) |i| { r3 = prepend_char(r3, char_at(r, char_len(r) - i - 1u)); } assert!(eq(r, r3)); //Additional sanity checks let balr = bal(r); let bal2 = bal(r2); let bal3 = bal(r3); assert!(eq(r, balr)); assert!(eq(r, bal2)); assert!(eq(r, bal3)); assert!(eq(r2, r3)); assert!(eq(bal2, bal3)); } #[test] fn concat1() { //Generate a reasonable rope let chunk = of_str(@~\"123456789\"); let mut r = empty(); for uint::range(0u, 10u) |_i| { r = append_rope(r, chunk); } //Same rope, obtained with rope::concat let r2 = concat(vec::from_elem(10u, chunk)); assert!(eq(r, r2)); } } "} {"_id":"q-en-rust-846de1da8d0f214ff9982585b3b66606c34aefbcbcc5b950f181c1aa35198b96","text":"} else { match self.try_coercion_cast(fcx) { Ok(()) => { self.trivial_cast_lint(fcx); debug!(\" -> CoercionCast\"); fcx.typeck_results.borrow_mut().set_coercion_cast(self.expr.hir_id.local_id); if self.expr_ty.is_unsafe_ptr() && self.cast_ty.is_unsafe_ptr() { // When casting a raw pointer to another raw pointer, we cannot convert the cast into // a coercion because the pointee types might only differ in regions, which HIR typeck // cannot distinguish. This would cause us to erroneously discard a cast which will // lead to a borrowck error like #113257. // We still did a coercion above to unify inference variables for `ptr as _` casts. // This does cause us to miss some trivial casts in the trival cast lint. debug!(\" -> PointerCast\"); } else { self.trivial_cast_lint(fcx); debug!(\" -> CoercionCast\"); fcx.typeck_results .borrow_mut() .set_coercion_cast(self.expr.hir_id.local_id); } } Err(_) => { match self.do_check(fcx) {"} {"_id":"q-en-rust-84bb9874033566e1aa8abaf576aa07973989efa015bae47b9a019a0b78ed445d","text":"//! } //! //! // This function wants to log its parameter out prior to doing work with it. //! fn do_work(value: &T) { //! fn do_work(value: &T) { //! log(value); //! // ...do some other work //! }"} {"_id":"q-en-rust-84d031e913b3ada1a897b1307c786452986ee2ed2af0522e0e13a34083d925fe","text":"None => return DummyResult::any(sp), }; // The file will be added to the code map by the parser let file = cx.resolve_path(file, sp); let file = match cx.resolve_path(file, sp) { Ok(f) => f, Err(mut err) => { err.emit(); return DummyResult::any(sp); }, }; let directory_ownership = DirectoryOwnership::Owned { relative: None }; let p = parse::new_sub_parser_from_file(cx.parse_sess(), &file, directory_ownership, None, sp);"} {"_id":"q-en-rust-84d4fd570686444027993b0ac3f04a6e567059b5ba4069b6a8e7ac7b037087e8","text":"ARCH=$1 LIB_ARCH=$2 APT_ARCH=$3 MANUFACTURER=$4 BINUTILS=2.28.1 GCC=6.5.0 # Choose correct target based on the $ARCH case \"$ARCH\" in x86_64) TARGET=x86_64-pc-solaris2.10 ;; sparcv9) TARGET=sparcv9-sun-solaris2.10 ;; *) printf 'ERROR: unknown architecture: %sn' \"$ARCH\" exit 1 esac TARGET=${ARCH}-${MANUFACTURER}-solaris2.10 # First up, build binutils mkdir binutils"} {"_id":"q-en-rust-84e66a991ec6c44ca52e87eb6a0c00bff288f764089f07ff989e6844ec0a8339","text":"let diagnostic = &sess.span_diagnostic; 'outer: for attr in attrs_iter { if attr.path != \"deprecated\" { continue if !attr.check_name(\"deprecated\") { continue; } mark_used(attr); if depr.is_some() { span_err!(diagnostic, item_sp, E0550, \"multiple deprecated attributes\"); break } depr = if let Some(metas) = attr.meta_item_list() { let get = |meta: &MetaItem, item: &mut Option| { if item.is_some() { handle_errors(sess, meta.span, AttrError::MultipleItem(meta.name())); return false } if let Some(v) = meta.value_str() { *item = Some(v); true } else { if let Some(lit) = meta.name_value_literal() { handle_errors( sess, lit.span, AttrError::UnsupportedLiteral( \"literal in `deprecated` value must be a string\", lit.node.is_bytestr() ), ); } else { span_err!(diagnostic, meta.span, E0551, \"incorrect meta item\"); let meta = attr.meta().unwrap(); depr = match &meta.node { MetaItemKind::Word => Some(Deprecation { since: None, note: None }), MetaItemKind::NameValue(..) => { meta.value_str().map(|note| { Deprecation { since: None, note: Some(note) } }) } MetaItemKind::List(list) => { let get = |meta: &MetaItem, item: &mut Option| { if item.is_some() { handle_errors(sess, meta.span, AttrError::MultipleItem(meta.name())); return false } if let Some(v) = meta.value_str() { *item = Some(v); true } else { if let Some(lit) = meta.name_value_literal() { handle_errors( sess, lit.span, AttrError::UnsupportedLiteral( \"literal in `deprecated` value must be a string\", lit.node.is_bytestr() ), ); } else { span_err!(diagnostic, meta.span, E0551, \"incorrect meta item\"); } false } }; false } }; let mut since = None; let mut note = None; for meta in metas { match &meta.node { NestedMetaItemKind::MetaItem(mi) => { match &*mi.name().as_str() { \"since\" => if !get(mi, &mut since) { continue 'outer }, \"note\" => if !get(mi, &mut note) { continue 'outer }, _ => { handle_errors( sess, meta.span, AttrError::UnknownMetaItem(mi.name(), &[\"since\", \"note\"]), ); continue 'outer let mut since = None; let mut note = None; for meta in list { match &meta.node { NestedMetaItemKind::MetaItem(mi) => { match &*mi.name().as_str() { \"since\" => if !get(mi, &mut since) { continue 'outer }, \"note\" => if !get(mi, &mut note) { continue 'outer }, _ => { handle_errors( sess, meta.span, AttrError::UnknownMetaItem(mi.name(), &[\"since\", \"note\"]), ); continue 'outer } } } } NestedMetaItemKind::Literal(lit) => { handle_errors( sess, lit.span, AttrError::UnsupportedLiteral( \"item in `deprecated` must be a key/value pair\", false, ), ); continue 'outer NestedMetaItemKind::Literal(lit) => { handle_errors( sess, lit.span, AttrError::UnsupportedLiteral( \"item in `deprecated` must be a key/value pair\", false, ), ); continue 'outer } } } } Some(Deprecation {since: since, note: note}) } else { Some(Deprecation{since: None, note: None}) } Some(Deprecation { since, note }) } }; } depr"} {"_id":"q-en-rust-84ea84f69a3abd8e4b636e29d7a124740446df0872d3bfe3526c19ff22e46ebd","text":" #![crate_type = \"lib\"] #![feature(unnamed_fields)] #![allow(unused, incomplete_features)] enum K { M { _ : struct { field: u8 }, //~^ error: unnamed fields are not allowed outside of structs or unions //~| error: anonymous structs are not allowed outside of unnamed struct or union fields } } "} {"_id":"q-en-rust-853d7432c85a094f995058d56a963708e24a3cea50ed170bc5e99ea31ed334ad","text":" error[E0080]: it is undefined behavior to use this value --> $DIR/issue-79690.rs:29:1 | LL | const G: Fat = unsafe { Transmute { t: FOO }.u }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered read of part of a pointer at .1..size.foo | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. "} {"_id":"q-en-rust-858ab9a8c56eb62b8dc9a32af5b15cb0b017c552a8b355e5ab847d74dea4d38f","text":"&format!(\"comparison of `{}`\", cx.ty_to_string(rhs_t))[], StrEqFnLangItem); callee::trans_lang_call(cx, did, &[lhs, rhs], None, debug_loc) let t = ty::mk_str_slice(cx.tcx(), cx.tcx().mk_region(ty::ReStatic), ast::MutImmutable); // The comparison function gets the slices by value, so we have to make copies here. Even // if the function doesn't write through the pointer, things like lifetime intrinsics // require that we do this properly let lhs_arg = alloc_ty(cx, t, \"lhs\"); let rhs_arg = alloc_ty(cx, t, \"rhs\"); memcpy_ty(cx, lhs_arg, lhs, t); memcpy_ty(cx, rhs_arg, rhs, t); let res = callee::trans_lang_call(cx, did, &[lhs_arg, rhs_arg], None, debug_loc); call_lifetime_end(res.bcx, lhs_arg); call_lifetime_end(res.bcx, rhs_arg); res } let _icx = push_ctxt(\"compare_values\");"} {"_id":"q-en-rust-858eeb413ee6531d124aef6be6803d56f545bbb932dc89195fd9303ee3e70cbf","text":" // Regression test for ICE #130012 // Checks that we do not ICE while reporting // lifetime mistmatch error trait Fun { type Assoc; } trait MyTrait: for<'a> Fun {} //~^ ERROR binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types //~| ERROR binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types //~| ERROR binding for associated type `Assoc` references lifetime `'a`, which does not appear in the trait input types impl Fun> MyTrait for F {} //~^ ERROR binding for associated type `Assoc` references lifetime `'b`, which does not appear in the trait input types //~| ERROR mismatched types fn main() {} "} {"_id":"q-en-rust-85ca88d80b8d68a7af1f86b96ec766869a33bbe34864d256d93ccdb9c3546fe9","text":" #![allow(unused)] fn main() { let _foo = b'hello0'; //~^ ERROR character literal may only contain one codepoint //~| HELP if you meant to write a byte string literal, use double quotes let _bar = 'hello'; //~^ ERROR character literal may only contain one codepoint //~| HELP if you meant to write a `str` literal, use double quotes } "} {"_id":"q-en-rust-85f9b9de051d7a01a4043ebd9994421fbabf1df09c9c8d431412c5ecc713c609","text":"pub fn prepend(&mut self, line: usize, string: &str, style: Style) { self.ensure_lines(line); let string_len = string.len(); let string_len = string.chars().count(); // Push the old content over to make room for new content for _ in 0..string_len {"} {"_id":"q-en-rust-860be5024f128249db2a293b06a0296c5bce78297672f94e545126287530b12e","text":"return None; } } Some(i) if lines.is_empty() { None } else { Some(lines[0][..i].into()) } } let data_s = data.as_str();"} {"_id":"q-en-rust-8625e996f442ab991ca0899c8de61e9e4d8960706185d124aa28ee87b72cb757","text":" #![feature(prelude_import)] #![no_std] //@ check-pass //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; #[macro_use] extern crate another_proc_macro; use another_proc_macro::{pointee, AnotherMacro}; #[repr(transparent)] pub struct Ptr<'a, #[pointee] T: ?Sized> { data: &'a mut T, } #[automatically_derived] impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized> ::core::ops::DispatchFromDyn> for Ptr<'a, T> { } #[automatically_derived] impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized> ::core::ops::CoerceUnsized> for Ptr<'a, T> { } const _: () = { const POINTEE_MACRO_ATTR_DERIVED: () = (); }; #[pointee] struct MyStruct; const _: () = { const ANOTHER_MACRO_DERIVED: () = (); }; fn main() {} "} {"_id":"q-en-rust-863bd6bf9b16b28d4f30ead53f254b9c42b6de1da254f9fdcca627eaad3d46ba","text":" error[E0277]: expected a `std::ops::Fn<()>` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:24:10 | LL | fn call(f: impl Fn()) { | ---- required by this bound in `call` ... LL | call(foo); | ^^^ expected an `Fn<()>` closure, found `fn() {foo}` | = help: the trait `std::ops::Fn<()>` is not implemented for `fn() {foo}` = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error[E0277]: expected a `std::ops::FnMut<()>` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:25:14 | LL | fn call_mut(f: impl FnMut()) { | ------- required by this bound in `call_mut` ... LL | call_mut(foo); | ^^^ expected an `FnMut<()>` closure, found `fn() {foo}` | = help: the trait `std::ops::FnMut<()>` is not implemented for `fn() {foo}` = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:26:15 | LL | fn call_once(f: impl FnOnce()) { | -------- required by this bound in `call_once` ... LL | call_once(foo); | ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}` | = help: the trait `std::ops::FnOnce<()>` is not implemented for `fn() {foo}` = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error[E0277]: expected a `std::ops::Fn<()>` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:28:10 | LL | fn call(f: impl Fn()) { | ---- required by this bound in `call` ... LL | call(foo_unsafe); | ^^^^^^^^^^ expected an `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` | = help: the trait `std::ops::Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}` = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error[E0277]: expected a `std::ops::FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:30:14 | LL | fn call_mut(f: impl FnMut()) { | ------- required by this bound in `call_mut` ... LL | call_mut(foo_unsafe); | ^^^^^^^^^^ expected an `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` | = help: the trait `std::ops::FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}` = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:32:15 | LL | fn call_once(f: impl FnOnce()) { | -------- required by this bound in `call_once` ... LL | call_once(foo_unsafe); | ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` | = help: the trait `std::ops::FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}` = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ } = note: `#[target_feature]` functions do not implement the `Fn` traits error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-86461fb65ffc3fe3a7e36ddd6c5558c54845116b5652bb5588ef2ef8924fc36b","text":"} alloc0 (static: FOO, size: 8, align: 8) { ╾───────alloc3────────╼ │ ╾──────╼ ╾───────alloc9────────╼ │ ╾──────╼ } alloc3 (size: 180, align: 1) { alloc9 (size: 180, align: 1) { 0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................ 0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──alloc4── │ ............╾─── 0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............"} {"_id":"q-en-rust-866f02704766a0bfc9886e4a49d6a5115e41c37fd4260a36a574539810e2dd44","text":" use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetResult}; use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::windows_uwp_msvc_base::opts(); base.max_atomic_width = Some(64); base.has_elf_tls = true; // FIXME: this shouldn't be panic=abort, it should be panic=unwind base.panic_strategy = PanicStrategy::Abort; Ok(Target { llvm_target: \"aarch64-pc-windows-msvc\".to_string(), target_endian: \"little\".to_string(),"} {"_id":"q-en-rust-86704df67fbee7a75598b4ec01e5e5e9edae516161ee71f94318a14fe2ec230c","text":"COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/ RUN ./build-binutils.sh # libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS # only has 2.6.4, so build our own COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/ RUN ./build-cmake.sh # Need a newer version of gcc than centos has to compile LLVM nowadays # Need at least GCC 5.1 to compile LLVM nowadays COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/ RUN ./build-gcc.sh RUN ./build-gcc.sh && apt-get remove -y gcc g++ # CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+ # Debian 6 has Python 2.6 by default, but LLVM needs 2.7+ COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/ RUN ./build-python.sh # Now build LLVM+Clang 7, afterwards configuring further compilations to use the # LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4. COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/ RUN ./build-cmake.sh # Now build LLVM+Clang, afterwards configuring further compilations to use the # clang/clang++ compilers. COPY host-x86_64/dist-x86_64-linux/build-clang.sh host-x86_64/dist-x86_64-linux/llvm-project-centos.patch /tmp/ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ RUN ./build-clang.sh ENV CC=clang CXX=clang++ # Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for # cloning, so download and build it here. COPY host-x86_64/dist-x86_64-linux/build-git.sh /tmp/ RUN ./build-git.sh # for sanitizers, we need kernel headers files newer than the ones CentOS ships # with so we install newer ones here COPY host-x86_64/dist-x86_64-linux/build-headers.sh /tmp/ RUN ./build-headers.sh # OpenSSL requires a more recent version of perl # with so we install newer ones here COPY host-x86_64/dist-x86_64-linux/build-perl.sh /tmp/ RUN ./build-perl.sh COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh"} {"_id":"q-en-rust-8675003435a03df635cef3e05cc60dac199418165d8f0dbdbcedb0177f7520d2","text":"LL | fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: Debug { | ^^^^^^^^^^ error: aborting due to 6 previous errors error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:44:46 | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | help: consider further restricting `Self` | LL | trait Foo: Sized { | ^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:49:46 | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | help: consider further restricting `Self` | LL | trait Bar: std::fmt::Display + Sized { | ^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:54:46 | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | help: consider further restricting `Self` | LL | trait Baz: Sized where Self: std::fmt::Display { | ^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:59:46 | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | help: consider further restricting `Self` | LL | trait Qux: Sized where Self: std::fmt::Display { | ^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:64:46 | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | help: consider further restricting `Self` | LL | trait Bat: std::fmt::Display + Sized { | ^^^^^^^ error: aborting due to 11 previous errors For more information about this error, try `rustc --explain E0277`."} {"_id":"q-en-rust-86b2f2ef9bec4ccd7dd017bd2ff8a42e344810c7618a96bfdf42a439f7e9b60f","text":"// EMIT_MIR casts.roundtrip.InstSimplify.diff pub fn roundtrip(x: *const u8) -> *const u8 { // CHECK-LABEL: fn roundtrip( // CHECK: _3 = _1; // CHECK: _2 = move _3 as *mut u8 (PtrToPtr); // CHECK: _0 = move _2 as *const u8 (PointerCoercion(MutToConstPointer)); // CHECK: _4 = _1; // CHECK: _3 = move _4 as *mut u8 (PtrToPtr); // CHECK: _2 = move _3 as *const u8 (PointerCoercion(MutToConstPointer)); x as *mut u8 as *const u8 }"} {"_id":"q-en-rust-86c055fd5aca4955824d125ab486d4d2f2a78ec645b356e7144b55cfe261ac64","text":".suggestion = convert it to a `{$msg_code}` hir_analysis_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` hir_analysis_missing_parentheses_in_range = can't call method `{$method_name}` on type `{$ty_str}` hir_analysis_add_missing_parentheses_in_range = you must surround the range in parentheses to call its `{$func_name}` function "} {"_id":"q-en-rust-86ce7d6f17d73e800ace1329cfec154aa104707a7fb765ceed0496ac00ef44f0","text":"if instance.def.is_inline(cx.tcx) { attributes::inline(lldecl, attributes::InlineAttr::Hint); } attributes::from_fn_attrs(cx, lldecl, instance.def.def_id()); attributes::from_fn_attrs(cx, lldecl, Some(instance.def.def_id())); cx.instances.borrow_mut().insert(instance, lldecl); }"} {"_id":"q-en-rust-86e4edd5af71892c4de1afa19b3a4c5cdff479c18de0b4a8ef691b8aec340bfb","text":" error: attribute must be of the form `#[deprecated]` or `#[deprecated(/*opt*/ since = \"version\", /*opt*/ note = \"reason)]` or `#[deprecated = \"reason\"]` --> $DIR/invalid-literal.rs:1:1 | LL | #[deprecated = b\"test\"] //~ ERROR attribute must be of the form | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error "} {"_id":"q-en-rust-870c43376f58283e70686d84c0cc24e0b9e63263472539b8c6be44193b072c72","text":"} #[test] #[allow(deprecated)] fn stream_smoke_test_ip6() { let server_ip = next_test_ip6(); let client_ip = next_test_ip6();"} {"_id":"q-en-rust-870ce879593ae7623d6d809035fa451d5e992662fe7f2ab00037adadee677021","text":"use rustc_ast as ast; use rustc_attr as attr; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::intern::{Interned, WithStableHash}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::tagged_ptr::CopyTaggedPtr;"} {"_id":"q-en-rust-87195f175d4d5b8ad024112ee279620c4840c888c065f66e224fe0df686814cd","text":"/// any methods, but instead is used to gate access to data. /// /// FIXME. Better documentation needed here! pub trait MarkerTrait : PhantomFn { } pub trait MarkerTrait : PhantomFn { } // ~~~~~ <-- FIXME(#22806)? // // Marker trait has been made invariant so as to avoid inf recursion, // but we should ideally solve the underlying problem. That's a bit // complicated. impl MarkerTrait for T { } /// `PhantomFn` is a marker trait for use with traits that contain"} {"_id":"q-en-rust-874b241870e7c8fba419bec55cae1a19470bffa09e52ae3672cf45a4e23345d3","text":"/// Parses an enum declaration. fn parse_item_enum(&mut self) -> PResult<'a, ItemInfo> { if self.token.is_keyword(kw::Struct) { let mut err = self.struct_span_err( self.prev_token.span.to(self.token.span), \"`enum` and `struct` are mutually exclusive\", ); err.span_suggestion( self.prev_token.span.to(self.token.span), \"replace `enum struct` with\", \"enum\", Applicability::MachineApplicable, ); if self.look_ahead(1, |t| t.is_ident()) { self.bump(); err.emit(); } else { return Err(err); } } let id = self.parse_ident()?; let mut generics = self.parse_generics()?; generics.where_clause = self.parse_where_clause()?;"} {"_id":"q-en-rust-876c353a5ebd9d6d5e46e7e1ae0e48bd6ecff32a9de5d4f6df58b8bbe1c0015e","text":" use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; use core::task::{Poll, RawWaker, RawWakerVTable, Waker}; #[test] fn poll_const() {"} {"_id":"q-en-rust-87bafe726b249c0b2bc5c5f7879eb5ccf6d764649038b2383f2f2ba4d31115ff","text":"f.debug_tuple(\"Drain\") .field(&self.after_tail) .field(&self.after_head) .field(&self.iter) .field(&self.ring) .field(&self.tail) .field(&self.head) .finish() } }"} {"_id":"q-en-rust-8807c25251331f90affa366acb6df9b58d35b7c6941fcd5f3bc907a2a91dc2db","text":" error: index out of bounds: the len is 3 but the index is 4 --> $DIR/array-literal-index-oob.rs:2:7 | LL | &{[1, 2, 3][4]}; | ^^^^^^^^^^^^ | = note: #[deny(const_err)] on by default error: this expression will panic at runtime --> $DIR/array-literal-index-oob.rs:2:5 | LL | &{[1, 2, 3][4]}; | ^^^^^^^^^^^^^^^ index out of bounds: the len is 3 but the index is 4 error: reaching this expression at runtime will panic or abort --> $DIR/array-literal-index-oob.rs:2:7 | LL | &{[1, 2, 3][4]}; | --^^^^^^^^^^^^- | | | index out of bounds: the len is 3 but the index is 4 error: aborting due to 3 previous errors "} {"_id":"q-en-rust-881b4d918cfa43b9b2e3174db03f17f99e9741b626b99d333659c9a80680879d","text":"crate_lint: CrateLint, ) -> PartialRes { tracing::debug!( \"smart_resolve_path_fragment(id={:?},qself={:?},path={:?}\", \"smart_resolve_path_fragment(id={:?}, qself={:?}, path={:?})\", id, qself, path"} {"_id":"q-en-rust-882e79459e1e05f58fb65549ac8c8228460306b5cf097cce569445b02d8f81e4","text":"} } } #[allow(improper_ctypes)] mod unknown_layout { mod a { extern \"C\" { pub fn generic(l: Link); } pub struct Link { pub item: T, pub next: *const Link, } } mod b { extern \"C\" { pub fn generic(l: Link); } pub struct Link { pub item: T, pub next: *const Link, } } } "} {"_id":"q-en-rust-8846dcbdefab553db5201764c5ffdf83d7affbd996a6eea201b4645343188a52","text":"let (bounds, lifetime_bound) = self.with_dyn_type_scope(true, |this| { let bounds = this.arena.alloc_from_iter(bounds.iter().filter_map(|bound| match bound { GenericBound::Trait( ty, TraitBoundModifiers { polarity: BoundPolarity::Positive | BoundPolarity::Negative(_), constness, }, ) => Some(this.lower_poly_trait_ref(ty, itctx, *constness)), // We can safely ignore constness here, since AST validation // will take care of invalid modifier combinations. GenericBound::Trait( _, TraitBoundModifiers { polarity: BoundPolarity::Maybe(_), .. }, ) => None, // We can safely ignore constness here since AST validation // takes care of rejecting invalid modifier combinations and // const trait bounds in trait object types. GenericBound::Trait(ty, modifiers) => match modifiers.polarity { BoundPolarity::Positive | BoundPolarity::Negative(_) => { Some(this.lower_poly_trait_ref( ty, itctx, // Still, don't pass along the constness here; we don't want to // synthesize any host effect args, it'd only cause problems. ast::BoundConstness::Never, )) } BoundPolarity::Maybe(_) => None, }, GenericBound::Outlives(lifetime) => { if lifetime_bound.is_none() { lifetime_bound = Some(this.lower_lifetime(lifetime));"} {"_id":"q-en-rust-887cfb20a4d728b33c8beaf6c8abd01e7142fece4020e7031c9f6e2f2f15228a","text":"// list. let argv = ARGV.load(Ordering::Relaxed); let argc = if argv.is_null() { 0 } else { ARGC.load(Ordering::Relaxed) }; (0..argc) .map(|i| { let cstr = CStr::from_ptr(*argv.offset(i) as *const libc::c_char); OsStringExt::from_vec(cstr.to_bytes().to_vec()) }) .collect() let mut args = Vec::with_capacity(argc as usize); for i in 0..argc { let ptr = *argv.offset(i) as *const libc::c_char; // Some C commandline parsers (e.g. GLib and Qt) are replacing already // handled arguments in `argv` with `NULL` and move them to the end. That // means that `argc` might be bigger than the actual number of non-`NULL` // pointers in `argv` at this point. // // To handle this we simply stop iterating at the first `NULL` argument. // // `argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments // after the first `NULL` can safely be ignored. if ptr.is_null() { break; } let cstr = CStr::from_ptr(ptr); args.push(OsStringExt::from_vec(cstr.to_bytes().to_vec())); } args } } }"} {"_id":"q-en-rust-88bc315a39e2932e86925bba971813da6795f1bfff3a3de183432fa283f1b739","text":" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s "} {"_id":"q-en-rust-88cc1c901e3e96f5b61cece8870e4a03f00eb82599d1adcdffaeb938261f991c","text":"pub use adt::*; pub use assoc::*; pub use generics::*; use hir::OpaqueTyOrigin; use rustc_ast as ast; use rustc_ast::node_id::NodeMap; use rustc_attr as attr;"} {"_id":"q-en-rust-890759b5c8f47cb4bc2e2bc51c344ae0010ed490e14237ee52c7a2c2d0a034cd","text":"} /// Derive macro generating impls of traits related to smart pointers. #[rustc_builtin_macro] #[rustc_builtin_macro(SmartPointer, attributes(pointee))] #[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize)] #[unstable(feature = \"derive_smart_pointer\", issue = \"123430\")] pub macro SmartPointer($item:item) {"} {"_id":"q-en-rust-89213ce0e095519ec3ef43fa083a1e7d6a7ecb31ec38b1a79588e38fe86e52ea","text":"use FfiResult::*; if def.repr.transparent() { // Can assume that only one field is not a ZST, so only check // Can assume that at most one field is not a ZST, so only check // that field's type for FFI-safety. if let Some(field) = transparent_newtype_field(self.cx.tcx, variant) { self.check_field_type_for_ffi(cache, field, substs) } else { bug!(\"malformed transparent type\"); // All fields are ZSTs; this means that the type should behave // like (), which is FFI-unsafe FfiUnsafe { ty, reason: \"this struct contains only zero-sized fields\".into(), help: None, } } } else { // We can't completely trust repr(C) markings; make sure the fields are"} {"_id":"q-en-rust-8932d705183cac4bd1eb29ed037efa45b1bcbcb06061ac7db96121b0e0d6de01","text":"/// /// Additionally, `f32` can represent some special values: /// /// - −0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so −0.0 is a /// possible value. For comparison −0.0 = +0.0, but floating point operations can carry /// - −0.0: IEEE 754 floating-point numbers have a bit that indicates their sign, so −0.0 is a /// possible value. For comparison −0.0 = +0.0, but floating-point operations can carry /// the sign bit through arithmetic operations. This means −0.0 × +0.0 produces −0.0 and /// a negative number rounded to a value smaller than a float can represent also produces −0.0. /// - [∞](#associatedconstant.INFINITY) and"} {"_id":"q-en-rust-8967ce3f94d7568c543a3672851f541f90a8830421f4e9ff9e7ba2481c87f321","text":"impl<'tcx> OpaqueTypeExpander<'tcx> { fn expand_opaque_ty(&mut self, def_id: DefId, substs: SubstsRef<'tcx>) -> Option> { if self.found_recursion { if self.found_any_recursion { return None; } let substs = substs.fold_with(self);"} {"_id":"q-en-rust-89986d80e445dd0887033a387e71a27f5bd4a9d697ebef448fb73ec725f77e7e","text":"/// Options for rendering Markdown in the main body of documentation. pub(crate) fn opts() -> Options { Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES | Options::ENABLE_STRIKETHROUGH Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES | Options::ENABLE_STRIKETHROUGH | Options::ENABLE_TASKLISTS } /// A subset of [`opts()`] used for rendering summaries."} {"_id":"q-en-rust-89bd2f17aee8dae88a91c02c44e96102fd22bb9fcad5c3a78976b02d82ef9a4d","text":"- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1 - env: > RUST_CHECK_TARGET=dist RUST_CONFIGURE_ARGS=\"--enable-extended\" RUST_CONFIGURE_ARGS=\"--enable-extended --enable-profiler\" SRC=. DEPLOY_ALT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1"} {"_id":"q-en-rust-89bd7cda014205f0f05b50daa64d08f3af2e430a4f4b1678b95615399f623844","text":"# https://github.com/puppeteer/puppeteer/issues/375 # # We also specify the version in case we need to update it to go around cache limitations. RUN npm install -g browser-ui-test@0.2.12 --unsafe-perm=true RUN npm install -g browser-ui-test@0.2.14 --unsafe-perm=true ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu "} {"_id":"q-en-rust-89c464c3f1fe7e238f590f913a65364473c2f0588c9d1b472d3b9c8de2176b59","text":"use libc::{mmap, mprotect}; use libc::{MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE}; use crate::io; use crate::ops::Range; use crate::sync::atomic::{AtomicUsize, Ordering}; use crate::sys::os;"} {"_id":"q-en-rust-8a13af657d6c754e684ad75430f47cb41ccdd66590449bc54ac582e753d43f6b","text":"} } clean::ExternCrateItem(..) | clean::ImportItem(_) => { if i.visibility != Some(hir::Public) { return None } } clean::StructFieldItem(..) => { if i.visibility != Some(hir::Public) { return Some(clean::Item {"} {"_id":"q-en-rust-8a146d62449c1e827c176753588d05181defe9555939f329514d77bba6857180","text":"RelateOutputImplTypes(span) => span, MatchExpressionArm(match_span, _) => match_span, IfExpression(span) => span, IfExpressionWithNoElse(span) => span } } }"} {"_id":"q-en-rust-8a16b7aecde6a591241a8d3a5ad24c6abab4e1b188c263f02c67b01138531d42","text":" pub trait Ice { fn f(&self, _: ()); } impl Ice for () { fn f(&self, _: ()) {} } fn main() { ().f::<()>(()); //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied } "} {"_id":"q-en-rust-8a1792a3e73fb3250df683281a42ebbd383cd22c261597dc47e63a61d748845c","text":"kind_name, tcx.item_path_str(variant.did), field_names); if let Some((span, _)) = inexistent_fields.last() { if let Some((span, ident)) = inexistent_fields.last() { err.span_label(*span, format!(\"{} `{}` does not have {} field{}\", kind_name, tcx.item_path_str(variant.did), t, plural)); if plural == \"\" { let input = unmentioned_fields.iter().map(|field| &field.name); let suggested_name = find_best_match_for_name(input, &ident.name.as_str(), None); if let Some(suggested_name) = suggested_name { err.span_suggestion(*span, \"did you mean\", suggested_name.to_string()); // we don't want to throw `E0027` in case we have thrown `E0026` for them unmentioned_fields.retain(|&x| x.as_str() != suggested_name.as_str()); } } } if tcx.sess.teach(&err.get_code().unwrap()) { err.note("} {"_id":"q-en-rust-8a1e9be21c9db47faa3ed843f7fe82f7f60c3fae88b544d3a47d9c95f53b5ca6","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. trait Foo { type A; fn foo(&self) {} } impl Foo for usize { type A = usize; } struct Bar { inner: T::A } fn is_send() {} fn main() { is_send::>(); } "} {"_id":"q-en-rust-8a22fb84bc3e154586db4a41a887e71585a730fb0812f6d85eefe336fcfbb3d6","text":"fn to_radians(self) -> f64 { num::Float::to_radians(self) } #[inline] fn ldexp(x: f64, exp: int) -> f64 { unsafe { cmath::ldexp(x, exp as c_int) } fn ldexp(self, exp: isize) -> f64 { unsafe { cmath::ldexp(self, exp as c_int) } } /// Breaks the number into a normalized fraction and a base-2 exponent,"} {"_id":"q-en-rust-8a5ed59148fb27bf59f67a4a08f26aef0ddb723ba69ed54e6f0f1d0e593e8687","text":" error[E0599]: no method named `b` found for reference `&Self` in the current scope --> $DIR/issue-117794.rs:5:14 | LL | self.b(|| 0) | ^ help: there is a method with a similar name: `a` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0599`. "} {"_id":"q-en-rust-8a9df237481c7ac9387a849747e4b3cc493b4fc636d408bbf2562230ddd8beb1","text":"assert_eq!(\"ΑΣ''Α\".to_lowercase(), \"ασ''α\"); // https://github.com/rust-lang/rust/issues/124714 // input lengths around the boundary of the chunk size used by the ascii prefix optimization assert_eq!(\"abcdefghijklmnoΣ\".to_lowercase(), \"abcdefghijklmnoς\"); assert_eq!(\"abcdefghijklmnopΣ\".to_lowercase(), \"abcdefghijklmnopς\"); assert_eq!(\"abcdefghijklmnopqΣ\".to_lowercase(), \"abcdefghijklmnopqς\"); // a really long string that has it's lowercase form // even longer. this tests that implementations don't assume"} {"_id":"q-en-rust-8aa003d9f531cb2c1dfac12c4f8c389597bdb936b03f36ddda01e5962be8689f","text":" // check-pass // revisions: new old //[new] compile-flags: -Znext-solver //! This test checks that we can successfully infer //! the hidden type of `FooImpl` to be `Foo` //! and `ImplT` to be `i32`. This test used to fail, because //! we were unable to make the connection that the closure //! argument is the same as the first argument of `Foo`. #![feature(type_alias_impl_trait)] use std::fmt::Debug; use std::marker::PhantomData; struct Foo { f: F, _phantom: PhantomData, } type ImplT = impl Debug; type FooImpl = Foo; fn bar() -> FooImpl { Foo:: { f: |_| (), _phantom: PhantomData } } fn main() {} "} {"_id":"q-en-rust-8aa4ade865cce9808a8da23319818b1271e9a8bd10978946ea780bcf66a904cf","text":"/// A Terminal that knows how many colors it supports, with a reference to its /// parsed Terminfo database record. pub struct TerminfoTerminal { num_colors: u16, num_colors: u32, out: T, ti: TermInfo, }"} {"_id":"q-en-rust-8accce3db88399bb62ac1ead3ca55a20f04cabf97d000206d5e6fa27b0a27672","text":"#[must_use] #[inline] pub const fn from_waker(waker: &'a Waker) -> Self { Context { waker, _marker: PhantomData } Context { waker, _marker: PhantomData, _marker2: PhantomData } } /// Returns a reference to the [`Waker`] for the current task."} {"_id":"q-en-rust-8aecd7cac443c467e6c58a2eb9439424a5c4f74410063064df2f451121341dc2","text":"let err = Ty::new_error(self.tcx, guar); self.write_ty(hir_id, err); self.write_ty(pat.hir_id, err); let mut visitor = V { tcx: self.tcx, pat_hir_ids: vec![] }; let mut visitor = V { pat_hir_ids: vec![] }; hir::intravisit::walk_pat(&mut visitor, pat); // Mark all the subpatterns as `{type error}` as well. This allows errors for specific // subpatterns to be silenced."} {"_id":"q-en-rust-8b0793d0d4af9e0d28c7887b81ba909c181f3342c96308ace8d4e703bf15f396","text":"/// } /// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] pub fn copy(reader: &mut R, writer: &mut W) -> io::Result pub fn copy(reader: &mut R, writer: &mut W) -> Result where R: Read, W: Write,"} {"_id":"q-en-rust-8b68e3ab86d85198afd156d6f26ddb2983d40b93433b1a06c7ffe06a0ad45edf","text":"pub fn is_dir(&self) -> bool { self.0.is_dir() } /// Test whether this file type represents a regular file. /// The result is mutually exclusive to the results of /// [`is_dir`] and [`is_symlink`]; only zero or one of these /// tests may pass. /// /// [`is_dir`]: struct.FileType.html#method.is_dir /// [`is_symlink`]: struct.FileType.html#method.is_symlink /// /// # Examples ///"} {"_id":"q-en-rust-8b7262455d6bbfec257d805f6c679ee8abce97e49a56fc7587c043cb0d94e29b","text":"Abi::Rust ))); let llfn = declare::define_internal_fn(cx, name, rust_fn_ty); attributes::from_fn_attrs(cx, llfn, None); let bx = Builder::new_block(cx, llfn, \"entry-block\"); codegen(bx); llfn"} {"_id":"q-en-rust-8b9124e938d51ccddae61b44458f97886abd73491c2628bdd02b27e5e1f9e160","text":" #![deny(rustdoc::broken_intra_doc_links)] // Test intra-doc links on trait implementations with generics // regression test for issue #92662 use std::marker::PhantomData; pub trait Bar { fn bar(&self); } pub struct Foo(PhantomData); impl Bar for Foo { fn bar(&self) {} } // @has generic_trait_impl/fn.main.html '//a[@href=\"struct.Foo.html#method.bar\"]' 'Foo::bar' /// link to [`Foo::bar`] pub fn main() {} "} {"_id":"q-en-rust-8babc81a521e0790fbba1392c8f6887e04ee693e03f41e515d91d3699383133a","text":" // edition:2018 trait T { async fn foo() {} //~ ERROR trait fns cannot be declared `async` async fn bar(&self) {} //~ ERROR trait fns cannot be declared `async` } fn main() {} "} {"_id":"q-en-rust-8bc91d3f9439e79d63418145b669e183196731e488355158ef0a0b42d0406f5e","text":" error: cannot capture late-bound lifetime in constant --> $DIR/escaping_bound_vars.rs:11:35 | LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>, | -^ | | | lifetime defined here error: aborting due to previous error "} {"_id":"q-en-rust-8bf125453043bb6024ea7a1b0717f03edbaf63c1056c55d119d7cb767c6c80de","text":"fn print_poly_trait_ref(&mut self, t: &ast::PolyTraitRef) -> IoResult<()> { if !t.bound_lifetimes.is_empty() { try!(word(&mut self.s, \"for<\")); let mut comma = false; for lifetime_def in t.bound_lifetimes.iter() { if comma { try!(self.word_space(\",\")) } try!(self.print_lifetime_def(lifetime_def)); comma = true; } try!(word(&mut self.s, \">\")); }"} {"_id":"q-en-rust-8bf9c9d45b7f31e06b0b404ad3c3e5119466efb08d7c746599a7d57c2ce34e2f","text":"} } /// Constructs a new locked handle to the standard error of the current /// process. /// /// This handle is not buffered. /// /// ### Note: Windows Portability Consideration /// When operating in a console, the Windows implementation of this stream does not support /// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return /// an error. /// /// # Example /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Write}; /// /// fn main() -> io::Result<()> { /// let mut handle = io::stderr_locked(); /// /// handle.write_all(b\"hello world\")?; /// /// Ok(()) /// } /// ``` #[unstable(feature = \"stdio_locked\", issue = \"none\")] pub fn stderr_locked() -> StderrLock<'static> { stderr().into_locked() } impl Stderr { /// Locks this handle to the standard error stream, returning a writable /// guard."} {"_id":"q-en-rust-8c46550bbb852b19cf6b68855f14d7e657fa2074ea5b016de3a491b43f7b9f07","text":"if let Some(err) = self.finalize_import(import) { errors = true; if let SingleImport { source, ref result, .. } = import.subclass { if source.name == \"self\" { // Silence `unresolved import` error if E0429 is already emitted match result.value_ns.get() { Err(Determined) => continue, _ => {}, } } } // If the error is a single failed import then create a \"fake\" import // resolution for it so that later resolve stages won't complain. self.import_dummy_binding(import);"} {"_id":"q-en-rust-8c494de7b28dd1206a82004e8b73d5377cf4b9df85e3e174dc88183d61599e2e","text":" fn main() { let abs: i32 = 3i32.checked_abs(); //~^ ERROR mismatched types } "} {"_id":"q-en-rust-8c698dd235e31a18262f1572b67e78ead8ec5630fd38d5e34a77a8dab3cc2abc","text":" error[E0308]: mismatched types --> $DIR/issue-73553-misinterp-range-literal.rs:12:10 | LL | demo(tell(1)..tell(10)); | ^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&(tell(1)..tell(10))` | = note: expected reference `&std::ops::Range` found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/issue-73553-misinterp-range-literal.rs:14:10 | LL | demo(1..10); | ^^^^^ | | | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&(1..10)` | = note: expected reference `&std::ops::Range` found struct `std::ops::Range<{integer}>` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-8d0df5fe35f2f0451db53b9cb84088b748fea9dc990710fb73187ee5eb3b5c76","text":"#![feature(unsafe_cell_raw_get)] #![feature(unwind_attributes)] #![feature(vec_into_raw_parts)] #![feature(vec_spare_capacity)] #![feature(wake_trait)] // NB: the above list is sorted to minimize merge conflicts. #![default_lib_allocator]"} {"_id":"q-en-rust-8d61236fc38d250c2922248c56034563fb67f79021b4c9a16b5b342b736e81c2","text":"cx.span_lint(UNUSED_COMPARISONS, e.span, \"comparison is useless due to type limits\"); } if is_shift_binop(binop) { let opt_ty_bits = match ty::get(ty::expr_ty(cx.tcx, &**l)).sty { ty::ty_int(t) => Some(int_ty_bits(t)), ty::ty_uint(t) => Some(uint_ty_bits(t)), _ => None }; if let Some(bits) = opt_ty_bits { let exceeding = if let ast::ExprLit(ref lit) = r.node { if let ast::LitInt(shift, _) = lit.node { shift > bits } else { false } } else { match eval_const_expr_partial(cx.tcx, &**r) { Ok(const_int(shift)) => { shift as u64 > bits }, Ok(const_uint(shift)) => { shift > bits }, _ => { false } } }; if exceeding { cx.span_lint(EXCEEDING_BITSHIFTS, e.span, \"bitshift exceeds the type's number of bits\"); } }; } }, ast::ExprLit(ref lit) => { match ty::get(ty::expr_ty(cx.tcx, e)).sty {"} {"_id":"q-en-rust-8d6b95de5126572e9eea7131ca8fcbb9fa49216045fc47cf6511b17384c76f31","text":"ty = it.type_(), path = relpath ); if parentlen == 0 { // There is no sidebar-items.js beyond the crate root path // FIXME maybe dynamic crate loading can be merged here write!( buffer, \"\", relpath, cx.shared.resource_suffix ); } else { write!(buffer, \"\", path = relpath); write!(buffer, \"\", relpath); } // Closes sidebar-elems div. buffer.write_str(\"

Load for P { fn load() {} fn write(self) {} } // @has - \"$.index[*][?(@.name=='Wrapper')]\""} {"_id":"q-en-rust-49473dc135dd450101ba06fc77b0c56615a409a1220ef3ab606d1171169cba8b","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let command = \"a\"; match command { \"foo\" => println!(\"foo\"), _ => println!(\"{}\", command), } } "} {"_id":"q-en-rust-4955c3620c4ffd5d76f3937990a962f9d1305c9bc51125196fa23313771919c8","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_type = \"lib\"] #[macro_export] macro_rules! declare { () => ( pub fn aaa() {} pub mod bbb { use super::aaa; pub fn ccc() { aaa(); } } ) } "} {"_id":"q-en-rust-495eb813eb07e8b32e4048147425dc75fc12e7c5cfa88e27dfc6315eea8240fd","text":"} else if #[cfg(target_os = \"hermit\")] { #[path = \"hermit.rs\"] mod real_imp; } else if #[cfg(all(target_env = \"msvc\", target_arch = \"aarch64\"))] { #[path = \"dummy.rs\"] mod real_imp; } else if #[cfg(target_env = \"msvc\")] { #[path = \"seh.rs\"] mod real_imp;"} {"_id":"q-en-rust-4992020b919893d2e799021a874bbc89fbcf44c4a09daf3fddf536bc5184c9bf","text":"documentation: ~~~ #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk.png\", #[doc(html_logo_url = \"http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png\", html_favicon_url = \"http://www.rust-lang.org/favicon.ico\", html_root_url = \"http://static.rust-lang.org/doc/master\")]; ~~~"} {"_id":"q-en-rust-49d2057271117b8937cac199ef2a497c0532ec8c4ffcc5613805330fa1db1e00","text":" error: expected exactly one integer literal argument --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:3:1 | LL | #[rustc_layout_scalar_valid_range_start(u32::MAX)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected exactly one integer literal argument --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:6:1 | LL | #[rustc_layout_scalar_valid_range_end(1, 2)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected exactly one integer literal argument --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:9:1 | LL | #[rustc_layout_scalar_valid_range_end(a = \"a\")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: attribute should be applied to a struct --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:12:1 | LL | #[rustc_layout_scalar_valid_range_end(1)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | / enum E { LL | | X = 1, LL | | Y = 14, LL | | } | |_- not a struct error: aborting due to 4 previous errors "} {"_id":"q-en-rust-49e076bd1cd7c5c04944ee451e71da8e50e7ec101f36c97681e925e0d7ac3e9a","text":"pub(super) node_to_hir_id: IndexVec, macro_def_scopes: FxHashMap, expansions: FxHashMap, keys_created: FxHashSet, next_disambiguator: FxHashMap<(DefIndex, DefPathData), u32>, } // Unfortunately we have to provide a manual impl of Clone because of the"} {"_id":"q-en-rust-4a09586829fae00306099e0efc5d6d77679dd97d44900b73f10e4696299da462","text":" // compile-pass #[deny(warnings)] enum Empty { } trait Bar {} impl Bar for () {} fn boo() -> impl Bar {} fn main() { boo(); } "} {"_id":"q-en-rust-4a33834612b65ba9d87ba685c83e0d74ef439439e65869d3e294680a84dc5244","text":"} Some(BacktraceStyle::Off) => { if FIRST_PANIC.swap(false, Ordering::SeqCst) { if let Some(path) = path { let _ = writeln!( err, \"note: a backtrace for this error was stored at `{}`\", path.display(), ); } else { let _ = writeln!( err, \"note: run with `RUST_BACKTRACE=1` environment variable to display a let _ = writeln!( err, \"note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\" ); } ); } } // If backtraces aren't supported or are forced-off, do nothing."} {"_id":"q-en-rust-4a6d6dcd04fab12b59c427753beda3eabd4cea2ff9cb691f5b2161f124383963","text":"\"x86_64-pc-windows-gnu\", ]; static TOOLSTATE: &str = \"https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv\"; #[derive(Serialize)] #[serde(rename_all = \"kebab-case\")] struct Manifest {"} {"_id":"q-en-rust-4a880eb0d112a2c0f49c5be90738f6d9dd34a216547dcc6afebcf74f5198d143","text":" # Rustdoc in-doc settings Rustdoc's HTML output includes a settings menu, and this chapter describes what each setting in this menu does. It can be accessed by clicking on the gear button () in the upper right. ## Changing displayed theme It is possible to change the theme. If you pick the \"system preference\", you will be able to see two new sub-menus: \"Preferred light theme\" and \"Preferred dark theme\". It means that if your system preference is set to \"light\", then rustdoc will use the theme you selected in \"Preferred light theme\". ## Auto-hide item contents for large items If the type definition contains more than 12 items, and this setting is enabled, it'll collapse them by default. You can see them by clicking on the `[+]` button to expand them. A good example of this setting in use can be seen in the [`Iterator`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html) doc page: ![Collapsed long item](../images/collapsed-long-item.png) ## Auto-hide item methods' documentation If enabled, this setting will collapse all trait implementations blocks. It is convenient if you just want an overview of all the methods available. You can still see a method's documentation by expanding it. ## Auto-hide trait implementation documentation If enabled, this setting will collapse all trait implementations blocks (you can see them in the \"Trait Implementations\" section). It is convenient if you just want an overview of all the trait implemented on a type. You can still see a trait implementation's associated items by expanding it. Example: ![Collapsed trait implementations](../images/collapsed-trait-impls.png) ## Directly go to item in search if there is only one result If this setting is enabled, you will directly be taken to the result page if your search only returned one element. Useful if you know exactly what you're looking for and want to be taken there directly and not waste time selecting the only search result. ## Show line numbers on code examples If enabled, this setting will add line numbers to the code examples in the documentation. It provides a visual aide for the code reading. ## Disable keyboard shortcuts If this setting is enabled, the keyboard shortcuts will be disabled. It's useful in case some of these shortcuts are already used by a web extension you're using. To see the full list of the rustdoc keyboard shortcuts, you can open the help menu (the button with the question mark on the left of the setting menu button). "} {"_id":"q-en-rust-4ad029adda83cfde52717071d7e828ebbabf61aa0da01564474640954a265f35","text":"env, ffi::{OsStr, OsString}, fs::{self, File}, io::{BufRead, BufReader, ErrorKind}, io::{self, BufRead, BufReader, ErrorKind}, path::{Path, PathBuf}, process::{Command, Stdio}, };"} {"_id":"q-en-rust-4ad7766e15826a6323f75b1ecd14a73a2199957a1329e89de018511bceba6a73","text":"// We have a valid span in almost all cases, but we don't have one when linting a crate // name provided via the command line. if !ident.span.is_dummy() { let sc_ident = Ident::from_str_and_span(&sc, ident.span); let (message, suggestion) = if sc_ident.is_reserved() { // We shouldn't suggest a reserved identifier to fix non-snake-case identifiers. // Instead, recommend renaming the identifier entirely or, if permitted, // escaping it to create a raw identifier. if sc_ident.name.can_be_raw() { (\"rename the identifier or convert it to a snake case raw identifier\", sc_ident.to_string()) } else { err.note(&format!(\"`{}` cannot be used as a raw identifier\", sc)); (\"rename the identifier\", String::new()) } } else { (\"convert the identifier to snake case\", sc) }; err.span_suggestion( ident.span, \"convert the identifier to snake case\", sc, message, suggestion, Applicability::MaybeIncorrect, ); } else {"} {"_id":"q-en-rust-4afe5857f53f951490166aa76a1b7c29ce180c19c88275a9279183844654065a","text":"// be added explicitly if necessary, see the error in `fn link_rlib`) compiled // as an executable due to `--test`. Use whole-archive implicitly, like before // the introduction of native lib modifiers. || (bundle != Some(false) && sess.opts.test) || (whole_archive == None && bundle != Some(false) && sess.opts.test) { cmd.link_whole_staticlib( name,"} {"_id":"q-en-rust-4b0abd54b8a5c6526ca1b78a2ad5e3535fd467285a906a87afc408a109073b7c","text":"/// /// [`to_ascii_uppercase`]: Self::to_ascii_uppercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); }"} {"_id":"q-en-rust-4b162dd603ebd3821d69c1c6675be03b0673e37df2c9f6379cd946c0c43262ce","text":"} self.cx.borrowck_context.constraints.outlives_constraints.push(constraint) } for live_region in liveness_constraints.rows() { self.cx .borrowck_context .constraints .liveness_constraints .add_element(live_region, location); for region in liveness_constraints.rows() { // If the region is live at at least one location in the promoted MIR, // then add a liveness constraint to the main MIR for this region // at the location provided as an argument to this method if let Some(_) = liveness_constraints.get_elements(region).next() { self.cx .borrowck_context .constraints .liveness_constraints .add_element(region, location); } } if !closure_bounds.is_empty() {"} {"_id":"q-en-rust-4b1b85b830e5e09b588b2acabb84a96a79bb50fcd627b32350deafaa87719970","text":"param_env: ty::ParamEnv<'tcx>, cause: &ObligationCause<'tcx>, ) -> Option> { // Don't drop any candidates in intercrate mode, as it's incomplete. // (Not that it matters, since `Unsize` is not a stable trait.) if self.infcx.intercrate { return None; } let tcx = self.tcx(); if tcx.features().trait_upcasting { return None;"} {"_id":"q-en-rust-4b225942ba6f6ef447ab2c46650a514217443589412302e9d1c783d6f08c0b90","text":"#[stable(feature = \"rust1\", since = \"1.0.0\")] pub fn is_dir(&self) -> bool { self.file_type().is_dir() } /// Returns whether this metadata is for a regular file. /// Returns whether this metadata is for a regular file. The /// result is mutually exclusive to the result of /// [`is_dir`], and will be false for symlink metadata /// obtained from [`symlink_metadata`]. /// /// [`is_dir`]: struct.Metadata.html#method.is_dir /// [`symlink_metadata`]: fn.symlink_metadata.html /// /// # Examples ///"} {"_id":"q-en-rust-4b39e5b7cd0f2d3517519bd53dfbe735ba7409d0bf1ebfc72cb1aaca57a7fc3f","text":" // edition:2018 // aux-build:external_macro.rs // Ensure that CONST_ERR lint errors // are not silenced in external macros. // https://github.com/rust-lang/rust/issues/65300 extern crate external_macro; use external_macro::static_assert; fn main() { static_assert!(2 + 2 == 5); //~ ERROR } "} {"_id":"q-en-rust-4b5dd3ac62cfca71b55442acac5afbe69077ec04c931fb09c3df0111e18c4ff3","text":"ignore_unresolved_invocations: bool, record_used: Option) -> Result<&'a NameBinding<'a>, Determinacy> { let ident = ident.unhygienize(); self.populate_module_if_necessary(module); let resolution = self.resolution(module, ident, ns)"} {"_id":"q-en-rust-4b63c68c60afea78dfac19b478a3b1363dd8b760fcb6b423e8d2f3179cc97e5e","text":"#[inline] fn next(&mut self) -> Option<$elem> { // could be implemented with slices, but this avoids bounds checks if self.ptr == self.end { None } else { unsafe { if mem::size_of::() != 0 { ::intrinsics::assume(!self.ptr.is_null()); ::intrinsics::assume(!self.end.is_null()); } unsafe { if mem::size_of::() != 0 { assume(!self.ptr.is_null()); assume(!self.end.is_null()); } if self.ptr == self.end { None } else { let old = self.ptr; self.ptr = slice_offset!(self.ptr, 1); Some(slice_ref!(old))"} {"_id":"q-en-rust-4b6e0bebba756f77eb9fc09ba44f473a365ac2166f3aa2d411d5578bfe168024","text":"C([Box]), } fn c(c:char) -> A { B(c) //~ ERROR cannot move a value of type A: the size of A cannot be statically determined fn c(c:char) { B(c); //~^ ERROR cannot move a value of type A: the size of A cannot be statically determined } pub fn main() {}"} {"_id":"q-en-rust-4b6fa4386269ee87a9b12ea1d637faca1b5e137412479702242363d306f16896","text":"let mut is_valid = true; if let Some(mi) = attr.meta() && let Some(list) = mi.meta_item_list() { for (meta_index, meta) in list.into_iter().enumerate() { for meta in list { if let Some(i_meta) = meta.meta_item() { match i_meta.name_or_empty() { sym::alias"} {"_id":"q-en-rust-4b78a8edf4917c34202be60ba8343b377be5ce2c3368263a863bd7c0c1fe039a","text":" #![crate_type = \"lib\"] struct Apple((Apple, Option(Banana ? Citron))); //~^ ERROR invalid `?` in type //~| ERROR expected one of `)` or `,`, found `Citron` //~| ERROR cannot find type `Citron` in this scope [E0412] //~| ERROR parenthesized type parameters may only be used with a `Fn` trait [E0214] //~| ERROR recursive type `Apple` has infinite size [E0072] "} {"_id":"q-en-rust-4b7bc8db7856bed78f9929f52e1e0c5b667ce24c0848ed3544f404deb7485d2c","text":"declare_lint! { pub CONST_ERR, Deny, \"constant evaluation detected erroneous expression\" \"constant evaluation detected erroneous expression\", report_in_external_macro: true } declare_lint! {"} {"_id":"q-en-rust-4b85686eb84bc606dce3fd7062e30a7724c6d97abc7babd97e3ed6be53fc0b3b","text":"// ignore-sgx no libc // ignore-emscripten no processes // ignore-sgx no processes // ignore-android: FIXME(#85261) // ignore-fuchsia no fork #![feature(rustc_private)]"} {"_id":"q-en-rust-4ba4079847cbf09931156e634f1fbca5b5544241ac8048917e7ecec3a8d1299b","text":" // Regression test for issue 123710. // Tests that the we do not ICE in KnownPanicsLint // when a union contains an enum with an repr(packed), // which is a repr not supported for enums #[repr(packed)] //~^ ERROR attribute should be applied to a struct or union #[repr(u32)] enum E { A, B, C, } fn main() { union InvalidTag { int: u32, e: E, //~^ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union } let _invalid_tag = InvalidTag { int: 4 }; } "} {"_id":"q-en-rust-4ba56c5bdbb2816a2d4038fb40400b5aebd87b4a2fedfe506a560a74ebe9dd8e","text":"(self.generics.clean(cx), (&self.decl, self.body).clean(cx)) }); let did = cx.tcx.hir().local_def_id(self.id); let constness = if cx.tcx.is_min_const_fn(did) { hir::Constness::Const } else { hir::Constness::NotConst }; Item { name: Some(self.name.clean(cx)), attrs: self.attrs.clean(cx),"} {"_id":"q-en-rust-4bb04d4ad7c7b4b4d560fca3ae752b356a25582f3435649c361a216b8a23acba","text":"/// /// **Example:** /// ```rust /// // Bad /// println!(\"\"); /// /// // Good /// println!(); /// ``` pub PRINTLN_EMPTY_STRING, style,"} {"_id":"q-en-rust-4bd020103b9b30d63ef8d769e2f702ddd6246afe24ff491873a5cc734f4597a8","text":" // compile-flags:--test /// ``` /// assert!(true) /// ``` pub fn f() {} pub fn f() {} "} {"_id":"q-en-rust-4c068ee8d32d0adafd8abad1ce8876f4fc65d800e7def079956d26693c0c756c","text":" error[E0433]: failed to resolve: there are too many leading `super` keywords --> $DIR/issue-82156.rs:2:5 | LL | super(); | ^^^^^ there are too many leading `super` keywords error: aborting due to previous error For more information about this error, try `rustc --explain E0433`. "} {"_id":"q-en-rust-4c0ff28f90474c5d6dea4eaee01807778b719791d20e889a5fc284f003fb7d0f","text":"// Record, lower it to `$binding_mode $ident @ _`, and stop here. PatKind::Ident(ref bm, ident, Some(ref sub)) if sub.is_rest() => { prev_rest_span = Some(sub.span); let lower_sub = |this: &mut Self| Some(this.pat_wild_with_node_id_of(sub)); let node = self.lower_pat_ident(pat, bm, ident, lower_sub); slice = Some(self.pat_with_node_id_of(pat, node)); slice = Some(lower_rest_sub(self, pat, bm, ident, sub)); break; } // It was not a subslice pattern so lower it normally."} {"_id":"q-en-rust-4c122bb795acc9799fbd60f297daf4d75b3d2e27040da47f00c12d5944bbecd0","text":" error: unnecessary parentheses around assigned value --> $DIR/unused-parens-for-stmt-expr-attributes-issue-129833.rs:9:13 | LL | let _ = (#[inline] #[allow(dead_code)] || println!(\"Hello!\")); | ^ ^ | note: the lint level is defined here --> $DIR/unused-parens-for-stmt-expr-attributes-issue-129833.rs:6:9 | LL | #![deny(unused_parens)] | ^^^^^^^^^^^^^ help: remove these parentheses | LL - let _ = (#[inline] #[allow(dead_code)] || println!(\"Hello!\")); LL + let _ = #[inline] #[allow(dead_code)] || println!(\"Hello!\"); | error: unnecessary parentheses around block return value --> $DIR/unused-parens-for-stmt-expr-attributes-issue-129833.rs:10:5 | LL | (#[inline] #[allow(dead_code)] || println!(\"Hello!\")) | ^ ^ | help: remove these parentheses | LL - (#[inline] #[allow(dead_code)] || println!(\"Hello!\")) LL + #[inline] #[allow(dead_code)] || println!(\"Hello!\") | error: aborting due to 2 previous errors "} {"_id":"q-en-rust-4c6193467d51235a13833db9aa52dc662340c9b7af30d75e24acbff4d7c2951c","text":"LL | let _: Wow<{ A.0 }>; | + + error: expected type, found `]` --> $DIR/bad-const-generic-exprs.rs:16:17 | LL | let _: Wow<[]>; | ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ [] }>; | + + error: expected type, found `12` --> $DIR/bad-const-generic-exprs.rs:19:17 | LL | let _: Wow<[12]>; | ^^ expected type error[E0747]: type provided when a constant was expected error: invalid const generic expression --> $DIR/bad-const-generic-exprs.rs:19:16 | LL | let _: Wow<[12]>; | ^^^^ | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ [12] }>; | + + error: expected type, found `0` --> $DIR/bad-const-generic-exprs.rs:23:17 | LL | let _: Wow<[0, 1, 3]>; | ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ [0, 1, 3] }>; | + + error: expected type, found `0xff` --> $DIR/bad-const-generic-exprs.rs:26:17 | LL | let _: Wow<[0xff; 8]>; | ^^^^ expected type error: invalid const generic expression --> $DIR/bad-const-generic-exprs.rs:26:16 | LL | let _: Wow<[0xff; 8]>; | ^^^^^^^^^ | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ [0xff; 8] }>; | + + error: expected type, found `1` --> $DIR/bad-const-generic-exprs.rs:30:17 | LL | let _: Wow<[1, 2]>; // Regression test for issue #81698. | ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ [1, 2] }>; // Regression test for issue #81698. | + + error: expected type, found `0` --> $DIR/bad-const-generic-exprs.rs:33:17 | LL | let _: Wow<&0>; | ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ &0 }>; | + + error: expected type, found `\"\"` --> $DIR/bad-const-generic-exprs.rs:36:17 | LL | let _: Wow<(\"\", 0)>; | ^^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ (\"\", 0) }>; | + + error: expected type, found `1` --> $DIR/bad-const-generic-exprs.rs:39:17 | LL | let _: Wow<(1 + 2) * 3>; | ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL | let _: Wow<{ (1 + 2) * 3 }>; | + + error: expected one of `,` or `>`, found `0` --> $DIR/bad-const-generic-exprs.rs:43:17 | LL | let _: Wow; | - ^ expected one of `,` or `>` | | | while parsing the type for `_` | help: you might have meant to end the type parameters here | LL | let _: Wow0>; | + error: aborting due to 6 previous errors error: aborting due to 15 previous errors For more information about this error, try `rustc --explain E0747`. "} {"_id":"q-en-rust-4c6cc29e9fd2e8d8f87b0b286b4f0563dd8fd7891b6a2669c06a825c00511541","text":"| NonMutatingUse(NonMutatingUseContext::Move) | NonMutatingUse(NonMutatingUseContext::Inspect) | NonMutatingUse(NonMutatingUseContext::Projection) | NonMutatingUse(NonMutatingUseContext::PlaceMention) | NonUse(_) => {} // These could be propagated with a smarter analysis or just some careful thinking about"} {"_id":"q-en-rust-4c9bc413cf707e73d8298b36229c40b8716be55a63cb7ddcef4fa864e4c62028","text":"} } // FIXME(eddyb) do we need \"not promotable\" in anything // other than `Mode::Fn` by any chance? false Self::in_operand(cx, callee) || args.iter().any(|arg| Self::in_operand(cx, arg)) } }"} {"_id":"q-en-rust-4c9c500b282f08cd2da7c02e6a9b23c7baa8f2da0b4e7bd2a64c88bbbf20a823","text":"args: vec![Operand::Consume(data.value.clone())], destination: Some((unit_temp, target)), cleanup: None }); block } }"} {"_id":"q-en-rust-4cc5e2da4bd6da819a82fe15273ff0b7529144301feaadf6571cbfe4a5760645","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let f = || || 0; std::thread::spawn(f()); } "} {"_id":"q-en-rust-4cc5f09e85f3f7f22222276d2a275c2557eab526a07e75ab1301e8a13300fc50","text":"} } fn get_rustfmt_version(build: &Builder<'_>) -> Option<(String, PathBuf)> { let stamp_file = build.out.join(\"rustfmt.stamp\"); let mut cmd = Command::new(match build.initial_rustfmt() { Some(p) => p, None => return None, }); cmd.arg(\"--version\"); let output = match cmd.output() { Ok(status) => status, Err(_) => return None, }; if !output.status.success() { return None; } Some((String::from_utf8(output.stdout).unwrap(), stamp_file)) } /// Return whether the format cache can be reused. fn verify_rustfmt_version(build: &Builder<'_>) -> bool { let Some((version, stamp_file)) = get_rustfmt_version(build) else {return false;}; !program_out_of_date(&stamp_file, &version) } /// Updates the last rustfmt version used fn update_rustfmt_version(build: &Builder<'_>) { let Some((version, stamp_file)) = get_rustfmt_version(build) else {return;}; t!(std::fs::write(stamp_file, version)) } /// Returns the files modified between the `merge-base` of HEAD and /// rust-lang/master and what is now on the disk. /// /// Returns `None` if all files should be formatted. fn get_modified_files(build: &Builder<'_>) -> Option> { let Ok(remote) = get_rust_lang_rust_remote() else {return None;}; if !verify_rustfmt_version(build) { return None; } Some( output( build .config .git() .arg(\"diff-index\") .arg(\"--name-only\") .arg(\"--merge-base\") .arg(&format!(\"{remote}/master\")), ) .lines() .map(|s| s.trim().to_owned()) .collect(), ) } /// Finds the remote for rust-lang/rust. /// For example for these remotes it will return `upstream`. /// ```text /// origin https://github.com/Nilstrieb/rust.git (fetch) /// origin https://github.com/Nilstrieb/rust.git (push) /// upstream https://github.com/rust-lang/rust (fetch) /// upstream https://github.com/rust-lang/rust (push) /// ``` fn get_rust_lang_rust_remote() -> Result { let mut git = Command::new(\"git\"); git.args([\"config\", \"--local\", \"--get-regex\", \"remote..*.url\"]); let output = git.output().map_err(|err| format!(\"{err:?}\"))?; if !output.status.success() { return Err(\"failed to execute git config command\".to_owned()); } let stdout = String::from_utf8(output.stdout).map_err(|err| format!(\"{err:?}\"))?; let rust_lang_remote = stdout .lines() .find(|remote| remote.contains(\"rust-lang\")) .ok_or_else(|| \"rust-lang/rust remote not found\".to_owned())?; let remote_name = rust_lang_remote.split('.').nth(1).ok_or_else(|| \"remote name not found\".to_owned())?; Ok(remote_name.into()) } #[derive(serde::Deserialize)] struct RustfmtConfig { ignore: Vec,"} {"_id":"q-en-rust-4ce612650a2e0d28a445e8f23925e0e5bd388eb3e9cf88e9f448c125e310d6ae","text":" // error-pattern: this file contains an unclosed delimiter // error-pattern: this file contains an unclosed delimiter // error-pattern: expected pattern, found `=` // error-pattern: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` // error-pattern: expected item, found `]` fn main() {} fn p([=(} "} {"_id":"q-en-rust-4cf472e00290912dc216a0284fb7657ab70846c10ddb399db8778c7dabf849c1","text":"#[derive(Copy, Clone, Debug)] pub struct Discr<'tcx> { /// bit representation of the discriminant, so `-128i8` is `0xFF_u128` pub val: u128, pub ty: Ty<'tcx> } impl<'tcx> fmt::Display for Discr<'tcx> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { if self.ty.is_signed() { write!(fmt, \"{}\", self.val as i128) } else { write!(fmt, \"{}\", self.val) match self.ty.sty { ty::TyInt(ity) => { let bits = ty::tls::with(|tcx| { Integer::from_attr(tcx, SignedInt(ity)).size().bits() }); let x = self.val as i128; // sign extend the raw representation to be an i128 let x = (x << (128 - bits)) >> (128 - bits); write!(fmt, \"{}\", x) }, _ => write!(fmt, \"{}\", self.val), } } }"} {"_id":"q-en-rust-4d124dfc45e8af50a803e15a9682fcf834cd9872ea1b88543d36342535569258","text":"} enum XYZ { X, //~ ERROR variant is never used Y { //~ ERROR variant is never used X, //~ ERROR variant is never constructed Y { //~ ERROR variant is never constructed a: String, b: i32, c: i32,"} {"_id":"q-en-rust-4d3a9b065ab2c1e56c71e060826c8a544b66708350201e41bc62fdbb7aec16e6","text":" #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(u32::MAX)] //~ ERROR pub struct A(u32); #[rustc_layout_scalar_valid_range_end(1, 2)] //~ ERROR pub struct B(u8); #[rustc_layout_scalar_valid_range_end(a = \"a\")] //~ ERROR pub struct C(i32); #[rustc_layout_scalar_valid_range_end(1)] //~ ERROR enum E { X = 1, Y = 14, } fn main() { let _ = A(0); let _ = B(0); let _ = C(0); let _ = E::X; } "} {"_id":"q-en-rust-4d6e5fdd1db0a14c3e642d57adb28935d05458b22a0bffd8414aeb98906139bd","text":" error[E0277]: the trait bound `[T; _]: From<()>` is not satisfied --> $DIR/hash-tyvid-regression-1.rs:9:5 | LL | <[T; N.get()]>::try_from(()) | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<()>` is not implemented for `[T; _]` | = note: required because of the requirements on the impl of `Into<[T; _]>` for `()` = note: required because of the requirements on the impl of `TryFrom<()>` for `[T; _]` note: required by `try_from` --> $SRC_DIR/core/src/convert/mod.rs:LL:COL | LL | fn try_from(value: T) -> Result; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/hash-tyvid-regression-1.rs:9:5 | LL | <[T; N.get()]>::try_from(()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Result` | = note: expected unit type `()` found enum `Result<[T; _], Infallible>` help: consider using a semicolon here | LL | <[T; N.get()]>::try_from(()); | + help: try adding a return type | LL | -> Result<[T; _], Infallible> where | +++++++++++++++++++++++++++++ error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-4d80692b5e11e63a2bf3646d350de4c85073d4d47adcdf1d7c5e02dfdd64b4bb","text":"But it *does not* match `Result` or `Result>`. ### Changing displayed theme You can change the displayed theme by opening the settings menu (the gear icon in the upper right) and then pick a new one from there. ### Shortcuts Pressing `S` while focused elsewhere on the page will move focus to the"} {"_id":"q-en-rust-4d8d535e1cb0eb87ffbc0249f3f760f65cebdda80ec69405e665d60c0eb99b27","text":"nested: Vec>) -> VtableBuiltinData> { let derived_cause = self.derived_cause(obligation, BuiltinDerivedObligation); let obligations = nested.iter().map(|&bound_ty| { // the obligation might be higher-ranked, e.g. for<'a> &'a // int : Copy. In that case, we will wind up with // late-bound regions in the `nested` vector. So for each // one we instantiate to a skolemized region, do our work // to produce something like `&'0 int : Copy`, and then // re-bind it. This is a bit of busy-work but preserves // the invariant that we only manipulate free regions, not // bound ones. self.infcx.try(|snapshot| { let (skol_ty, skol_map) = self.infcx().skolemize_late_bound_regions(&ty::Binder(bound_ty), snapshot); let skol_predicate = util::predicate_for_builtin_bound( self.tcx(), derived_cause.clone(), bound, obligation.recursion_depth + 1, skol_ty); match skol_predicate { Ok(skol_predicate) => Ok(self.infcx().plug_leaks(skol_map, snapshot, &skol_predicate)), Err(ErrorReported) => Err(ErrorReported) } }) }).collect::>(); let obligations = match obligations { Ok(o) => o, Err(ErrorReported) => Vec::new(), let trait_def = match self.tcx().lang_items.from_builtin_kind(bound) { Ok(def_id) => def_id, Err(_) => { self.tcx().sess.bug(\"builtin trait definition not found\"); } }; let obligations = self.collect_predicates_for_types(obligation, trait_def, nested); let obligations = VecPerParamSpace::new(obligations, Vec::new(), Vec::new()); debug!(\"vtable_builtin_data: obligations={}\","} {"_id":"q-en-rust-4dd4cd3b1374b69e66fef020c1f9d8fccd2275bc936162ac3593f136de0b9ee8","text":"target_option_val!(exe_suffix); target_option_val!(staticlib_prefix); target_option_val!(staticlib_suffix); target_option_val!(os_family, \"target_family\"); target_option_val!(os_family, \"target-family\"); target_option_val!(abi_return_struct_as_int); target_option_val!(is_like_osx); target_option_val!(is_like_solaris);"} {"_id":"q-en-rust-4e0475c61ae6004c2ed012dbf18f3e83b516568b67f33a77afc0e54ea4274e20","text":" warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/cannot-infer-type-for-const-param.rs:1:12 | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ error[E0282]: type annotations needed --> $DIR/cannot-infer-type-for-const-param.rs:10:19 | LL | let _ = Foo::<3>([1, 2, 3]); | ^ cannot infer type for `{integer}` error: aborting due to previous error For more information about this error, try `rustc --explain E0282`. "} {"_id":"q-en-rust-4e4b78164a89e4736cc3f6c7a95e7eec1330141d0252f0152d8354d9a1a108e0","text":"/// # Examples /// /// ``` /// # #![feature(duration_as_u128)] /// use std::time::Duration; /// /// let duration = Duration::new(5, 730023852); /// assert_eq!(duration.as_micros(), 5730023); /// ``` #[unstable(feature = \"duration_as_u128\", issue = \"50202\")] #[stable(feature = \"duration_as_u128\", since = \"1.33.0\")] #[inline] pub const fn as_micros(&self) -> u128 { self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128"} {"_id":"q-en-rust-4e51347dabb7653344b473d8c938549280f5972452ab1099dc55ffa185f7b071","text":"use m::*; // The variant `Same` introduced by this import is not considered when resolving the prefix // `Same::` during import validation (issue #62767). use Same::Same; // The variant `Same` introduced by this import is also considered when resolving the prefix // `Same::` during import validation to avoid effects similar to time travel (#74556). use Same::Same; //~ ERROR unresolved import `Same` // Case from #74556. mod foo { pub mod bar { pub mod bar { pub fn foobar() {} } } } use foo::*; use bar::bar; //~ ERROR unresolved import `bar::bar` //~| ERROR inconsistent resolution for an import use bar::foobar; fn main() {}"} {"_id":"q-en-rust-4e53670da9a0f0a014e09c0398f751227c28c5dc72c10ca318afe52ff69308c5","text":"use std::collections::{HashMap, HashSet}; use std::env; use std::fs::{self, File}; use std::io; use std::io::ErrorKind; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio};"} {"_id":"q-en-rust-4e5c0f99617fc18ba95fa5f39f0cdf478e7b1004db904644d194e565863773f2","text":"-include ../tools.mk # This test makes sure that instrumented binaries record the right counts for # functions being called and branches being taken. We run an instrumented binary # with an argument that causes a know path through the program and then check # that the expected counts get added to the use-phase LLVM IR. # LLVM doesn't support instrumenting binaries that use SEH: # https://github.com/rust-lang/rust/issues/61002 # # Things work fine with -Cpanic=abort though. ifdef IS_MSVC COMMON_FLAGS=-Cpanic=abort endif # For some very small programs GNU ld seems to not properly handle # instrumentation sections correctly. Neither Gold nor LLD have that problem. ifeq ($(UNAME),Linux)"} {"_id":"q-en-rust-4e6bb400db9d6823162611bee7905d84fb600406a2d8eb77bc8971338f37e186","text":"#[cfg(host)] use std::{ any::Any, marker::PhantomData, mem::ManuallyDrop, num::NonZero, ptr::NonNull, rc::Rc, sync::Arc, any::Any, marker::PhantomData, mem::ManuallyDrop, num::NonZero, ptr::NonNull, rc::Rc, sync::Arc, }; /// To work cross-target this test must be no_core."} {"_id":"q-en-rust-4ec3538afe7b5c82748f7d28014fe3e3b7ec80a290f834a67aabc5dbbf22e9e8","text":":target { background: #FDFFD3; } pre.rust .kw { color: #cc782f; } pre.rust .kw-2 { color: #3bbb33; } pre.rust .prelude-ty { color: #3bbb33; } pre.rust .number { color: #c13928; } pre.rust .self { color: #c13928; } pre.rust .boolval { color: #c13928; } pre.rust .prelude-val { color: #c13928; } pre.rust .op { color: #cc782f; } pre.rust .comment { color: #533add; } pre.rust .doccomment { color: #d343d0; } pre.rust .macro { color: #d343d0; } pre.rust .macro-nonterminal { color: #d343d0; } pre.rust .string { color: #c13928; } pre.rust .lifetime { color: #d343d0; } pre.rust .attribute { color: #d343d0 !important; } pre.rust, pre.line-numbers { background-color: #FDFDFD; } /* Code Highlighting */ pre.rust .kw { color: #8959A8; } pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } pre.rust .number { color: #718C00; } pre.rust .self { color: #C13928; } pre.rust .boolval { color: #C13928; } pre.rust .prelude-val { color: #C13928; } pre.rust .comment { color: #8E908C; } pre.rust .doccomment { color: #4D4D4C; } pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999f; } pre.rust .string { color: #718C00; } pre.rust .lifetime { color: #C13928; } pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } "} {"_id":"q-en-rust-4ee8e38c19d4dd4ac6ef7386356e642ff25fa1920f2e9f621379ae838aae58d1","text":"/// Ok(()) /// } /// ``` #[unstable(feature = \"bufreader_buffer\", issue = \"45323\")] #[stable(feature = \"bufreader_buffer\", since = \"1.37.0\")] pub fn buffer(&self) -> &[u8] { &self.buf[self.pos..self.cap] }"} {"_id":"q-en-rust-4f11b9e62b85549433218664aa113b4dc2189b5abebdedb46cb2941d5724e4ca","text":"- Several unsupported `./configure` options have been removed: `optimize`, `parallel-compiler`. These can still be enabled with `--set`, although it isn't recommended. - `remote-test-server`'s `verbose` argument has been removed in favor of the `--verbose` flag - `remote-test-server`'s `remote` argument has been removed in favor of the `--bind` flag. Use `--bind 0.0.0.0:12345` to replicate the behavior of the `remote` argument. - `x.py fmt` now formats only files modified between the merge-base of HEAD and the last commit in the master branch of the rust-lang repository and the current working directory. To restore old behaviour, use `x.py fmt .`. The check mode is not affected by this change. [#105702](https://github.com/rust-lang/rust/pull/105702) ### Non-breaking changes"} {"_id":"q-en-rust-4f1d743f5158dd93e552209c2a41ff2475f613f966618883a24924d60cf3c381","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // aux-build:macro_with_super_1.rs #[macro_use] extern crate macro_with_super_1; declare!(); fn main() { bbb::ccc(); } "} {"_id":"q-en-rust-4f46de8676d6d548ef04ccb49a23210da22f0ed63f9edab0b40c73819e212d1c","text":"/// # Examples /// /// ```rust /// #![feature(slice_from_raw_parts)] /// use std::ptr; /// /// // create a slice pointer when starting out with a pointer to the first element /// let mut x = [5, 6, 7]; /// let ptr = &mut x[0] as *mut _; /// let slice = ptr::slice_from_raw_parts_mut(ptr, 3); /// let x = [5, 6, 7]; /// let ptr = x.as_ptr(); /// let slice = ptr::slice_from_raw_parts(ptr, 3); /// assert_eq!(unsafe { &*slice }[2], 7); /// ``` #[inline] #[unstable(feature = \"slice_from_raw_parts\", reason = \"recently added\", issue = \"36925\")] #[stable(feature = \"slice_from_raw_parts\", since = \"1.42.0\")] #[rustc_const_unstable(feature = \"const_slice_from_raw_parts\", issue = \"67456\")] pub const fn slice_from_raw_parts(data: *const T, len: usize) -> *const [T] { unsafe { Repr { raw: FatPtr { data, len } }.rust }"} {"_id":"q-en-rust-4f4ed48f0847c431f5fc093a5e37642f813fcc6c67491527068bbf0edc684385","text":" error[E0433]: failed to resolve: use of undeclared type `Baz` --> $DIR/issue-81508.rs:11:20 | LL | let Baz: &str = \"\"; | --- help: `Baz` is defined here, but is not a type LL | LL | println!(\"{}\", Baz::Bar); | ^^^ use of undeclared type `Baz` error[E0433]: failed to resolve: use of undeclared type `Foo` --> $DIR/issue-81508.rs:20:24 | LL | use super::Foo; | ---------- help: `Foo` is defined here, but is not a type LL | fn function() { LL | println!(\"{}\", Foo::Bar); | ^^^ use of undeclared type `Foo` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0433`. "} {"_id":"q-en-rust-4f82a1f13b733031466e594aea322964f4f3952afe2a8cf5150f8dfc0cf77b91","text":" error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/move-generic-to-trait-in-method-with-params.rs:14:7 | LL | 1.bar::(0); | ^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/move-generic-to-trait-in-method-with-params.rs:4:8 | LL | fn bar(&self, _: T); | ^^^ help: consider moving this generic argument to the `Foo` trait, which takes up to 1 argument | LL | Foo::::bar(1, 0); | ~~~~~~~~~~~~~~~~~~~~~ help: remove these generics | LL - 1.bar::(0); LL + 1.bar(0); | error: aborting due to previous error For more information about this error, try `rustc --explain E0107`. "} {"_id":"q-en-rust-4fdfa15654a64cfcadaa9b33a890fe0405ce5126501d704aef598646b728f704","text":"// Remember return type so that regionck can access it later. let fn_sig_tys: Vec = arg_tys.iter() .chain([ret_ty].iter()) .map(|&ty| ty) .collect(); arg_tys.iter().chain([ret_ty].iter()).map(|&ty| ty).collect(); debug!(\"fn-sig-map: fn_id={} fn_sig_tys={}\", fn_id, fn_sig_tys.repr(tcx)); inherited.fn_sig_map .borrow_mut() .insert(fn_id, fn_sig_tys); inherited.fn_sig_map.borrow_mut().insert(fn_id, fn_sig_tys); { let mut visit = GatherLocalsVisitor { fcx: &fcx, };"} {"_id":"q-en-rust-4ff7e25a835889d3f2b8a8b5362f8749bc8ee7bcc56d41eda0ae0513614d6e88","text":"\"arm\", \"avr\", \"bpf\", \"csky\", \"hexagon\", \"loongarch\", \"m68k\","} {"_id":"q-en-rust-50114ffa3de265fd3ddd5ceb67546629ef04cbf71a1f09daf12b3c23d4c57cf9","text":"// Additionally, the top bit of GLOBAL_PANIC_COUNT (GLOBAL_ALWAYS_ABORT_FLAG) // records whether panic::always_abort() has been called. This can only be // set, never cleared. // panic::always_abort() is usually called to prevent memory allocations done by // the panic handling in the child created by `libc::fork`. // Memory allocations performed in a child created with `libc::fork` are undefined // behavior in most operating systems. // Accessing LOCAL_PANIC_COUNT in a child created by `libc::fork` would lead to a memory // allocation. Only GLOBAL_PANIC_COUNT can be accessed in this situation. This is // sufficient because a child process will always have exactly one thread only. // See also #85261 for details. // // This could be viewed as a struct containing a single bit and an n-1-bit // value, but if we wrote it like that it would be more than a single word,"} {"_id":"q-en-rust-502dbdbade3b3f41b7d16d68dd56581a88b07de94266c7d0726408a91ac8bff5","text":"use char::CharExt; try!(write!(f, \"'\")); for c in self.escape_default() { try!(write!(f, \"{}\", c)); try!(f.write_char(c)) } write!(f, \"'\") }"} {"_id":"q-en-rust-505e90f778216c689b95a50e6c728eceb2763ba8efbbd4e1bf535c45fbbde00d","text":"//! conflicts between multiple such attributes attached to the same //! item. use rustc_ast::tokenstream::DelimSpan; use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MacArgs, MetaItemKind, NestedMetaItem}; use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::{pluralize, struct_span_err, Applicability, MultiSpan}; use rustc_expand::base::resolve_path;"} {"_id":"q-en-rust-50940b4d1d03ed026d89209e88f43a1e86693d7ba1589589e9e2449ce3d4f0c2","text":"5_000_000.times do count += 1 end count end end threads.each { |t| t.join } threads.each do |t| puts \"Thread finished with count=#{t.value}\" end puts \"done!\" ```"} {"_id":"q-en-rust-50c6c3a44af1448351b0f362d7ace11ae3fdc7743e84a76dbc526a2fde4273a8","text":" Subproject commit 69268fb75fdb452296caa9bc4aaeff1674279de2 Subproject commit e479ab26406ed8a473987e5f4a1f3be3e978e5d2 "} {"_id":"q-en-rust-51e12b209a89b716458279a0ce8335e323c1a12c35dbc1e9ca62a43407e8f14a","text":" //@ force-host //@ no-prefer-dynamic #![crate_type = \"proc-macro\"] #![feature(proc_macro_quote)] extern crate proc_macro; use proc_macro::{quote, TokenStream}; #[proc_macro_derive(AnotherMacro, attributes(pointee))] pub fn derive(_input: TokenStream) -> TokenStream { quote! { const _: () = { const ANOTHER_MACRO_DERIVED: () = (); }; } .into() } #[proc_macro_attribute] pub fn pointee( _attr: proc_macro::TokenStream, _item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { quote! { const _: () = { const POINTEE_MACRO_ATTR_DERIVED: () = (); }; } .into() } #[proc_macro_attribute] pub fn default( _attr: proc_macro::TokenStream, _item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { quote! { const _: () = { const DEFAULT_MACRO_ATTR_DERIVED: () = (); }; } .into() } "} {"_id":"q-en-rust-51f412163d6b26381ecc7b156e0ede2b2f6205a935f9317ad125a48759a10fd6","text":"} Operand::Constant(ref constant) => { if let Some(static_) = constant.check_static_ptr(cx.tcx) { Self::in_static(cx, static_) if constant.check_static_ptr(cx.tcx).is_some() { // `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. // // Note: this uses `constant.literal.ty` which is a reference or pointer to the // type of the actual `static` item. Self::in_any_value_of_ty(cx, constant.literal.ty) } else if let ty::ConstKind::Unevaluated(def_id, _) = constant.literal.val { // Don't peek inside trait associated constants. if cx.tcx.trait_of_item(def_id).is_some() {"} {"_id":"q-en-rust-521439f0047e4de854d76b5cbd68b4b9ff7edcae37ac01a4c648659c4e6a09c4","text":" fn thing() { let f = |_, _| (); f(f); //~ ERROR: closure/coroutine type that references itself //~^ ERROR: this function takes 2 arguments but 1 argument was supplied } fn main() {} "} {"_id":"q-en-rust-523b0cbe1561f4ed62528f5ab6304a9b749308d6a859d207201550ffd1e00fb6","text":"//! goes along from the output of the previous stage. use std::borrow::Cow; use std::collections::HashSet; use std::env; use std::fs; use std::io::prelude::*;"} {"_id":"q-en-rust-524557fed9d5af4b66814058d92634f6ecb04a98a141708e211b791d0c296bba","text":"#![feature(const_heap)] #![feature(const_index_range_slice_index)] #![feature(const_likely)] #![feature(const_make_ascii)] #![feature(const_nonnull_new)] #![feature(const_num_midpoint)] #![feature(const_option_ext)]"} {"_id":"q-en-rust-527fa7f4db4157cb1cff6d0b1f37dfd6d2533c7cbd0adda7dceaf52f916e467d","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(associated_consts)] impl A for i32 { type Foo = u32; } impl B for u32 { const BAR: i32 = 0; } trait A { type Foo: B; } trait B { const BAR: i32; } fn generic() { // This panics if the universal function call syntax is used as well println!(\"{}\", T::Foo::BAR); } fn main() {} "} {"_id":"q-en-rust-5284823c54db650ff03ce547b849e3526fdc462d18eaad89fe340b992b8b2bf3","text":"/// # Examples /// /// ```no_run /// #![feature(udp_peer_addr)] /// use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket}; /// /// let socket = UdpSocket::bind(\"127.0.0.1:34254\").expect(\"couldn't bind to address\");"} {"_id":"q-en-rust-52ac8ddd14dd95fc60b7252e3183a4652a7af9e34665736a21f94a99cbe06e44","text":"] [[package]] name = \"rustc-serialize\" version = \"0.3.24\" source = \"registry+https://github.com/rust-lang/crates.io-index\" checksum = \"dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda\" [[package]] name = \"rustc-std-workspace-alloc\" version = \"1.99.0\" dependencies = ["} {"_id":"q-en-rust-52c69f3bbc274df12a0e0e08874a5beab242ab29a5aaba5c4e11216671b44a04","text":" // compile-flags: -Zmir-opt-level=4 // build-pass // compile-flags: -Zmir-opt-level=3 --crate-type=lib pub fn bar(s: &'static mut ()) #![feature(trivial_bounds)] #![allow(trivial_bounds)] trait Foo { fn test(self); } fn baz() where &'static mut (): Clone, //~ ERROR the trait bound &'static str: Foo, { <&'static mut () as Clone>::clone(&s); \"Foo\".test() } fn main() {} "} {"_id":"q-en-rust-52e32ad4670935cf875758a1f811411c904ee6dd9ac9982c3236270c5b363ec1","text":"//! Runs rustfmt on the repository. use crate::builder::Builder; use crate::util::{output, t}; use crate::util::{output, program_out_of_date, t}; use ignore::WalkBuilder; use std::collections::VecDeque; use std::path::{Path, PathBuf};"} {"_id":"q-en-rust-52fea685ca55426f0862fa67e2504d82362b75c04e1fc7c2dce0ce549ab9e556","text":"Res::Def(DefKind::Ctor(_, CtorKind::Const), def_id) => { let user_provided_types = cx.tables.user_provided_types(); let user_provided_type = user_provided_types.get(expr.hir_id).copied(); debug!(\"convert_path_expr: user_provided_type={:?}\", user_provided_type); let user_ty = user_provided_types.get(expr.hir_id).copied(); let ty = cx.tables().node_type(expr.hir_id); match ty.kind { // A unit struct/variant which is used as a value."} {"_id":"q-en-rust-531c62deba75d8d477bdd7e12cc9d79f5825fb7b992ea1d1e1d827ff6c17c0d7","text":"} } let group = p.read_separator(':', i, |p| p.read_number(16, Some(4))); let group = p.read_separator(':', i, |p| p.read_number(16, Some(4), true)); match group { Some(g) => *slot = g,"} {"_id":"q-en-rust-532c6006d5cc163566be05b25939499a62458af8a79132184cbb67cb939161c6","text":" // check-fail // Ensure we don't error when emitting trait bound not satisfied when self type // has late bound var fn main() { test(&|| 0); //~ ERROR the trait bound } trait Trait {} fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {} "} {"_id":"q-en-rust-53409668660f1a58acc5ed8f4dd96653afadae2d6f2d6904dec2c183b5fa127e","text":" enum E { One(i32, i32), } fn main() { let var = E::One; if let E::One(var1, var2) = var { //~^ ERROR mismatched types //~| HELP use parentheses to construct this tuple variant println!(\"{var1} {var2}\"); } let Some(x) = Some; //~^ ERROR mismatched types //~| HELP use parentheses to construct this tuple variant } "} {"_id":"q-en-rust-53498d13b564eb96e628e0e1df4207a5a608067a0257b15b3e01cf2d7483c519","text":"expanded_cache: FxHashMap::default(), primary_def_id: None, found_recursion: false, found_any_recursion: false, check_recursion: false, tcx, };"} {"_id":"q-en-rust-536686b43c123488667b5db867f98a9be35ac64dcedcfe409c2ab9210122d36e","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct Zst; fn main() { unsafe { ::std::ptr::write_volatile(1 as *mut Zst, Zst) } } "} {"_id":"q-en-rust-538ef0579806c1cd6cb4132aec4123ea6b80f2714da15bb250b2fbcc594e3780","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(struct_variant)] mod a { pub enum Enum { EnumStructVariant { x: u8, y: u8, z: u8 } } pub fn get_enum_struct_variant() -> () { EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types: expected `()`, found `a::Enum` (expected (), found enum a::Enum) } } mod b { mod test { use a; fn test_enum_struct_variant() { let enum_struct_variant = ::a::get_enum_struct_variant(); match enum_struct_variant { a::EnumStructVariant { x, y, z } => { //~^ ERROR error: mismatched types: expected `()`, found a structure pattern } } } } } fn main() {} "} {"_id":"q-en-rust-544dabcca9c9e3a1becba4ca1a8b9303827aa6592d2541cbc9be5a116e1839d6","text":"/// /// # Safety /// /// The resulting pointer does not need to be in bounds, but it is /// potentially hazardous to dereference (which requires `unsafe`). /// This operation itself is always safe, but using the resulting pointer is not. /// /// The resulting pointer remains attached to the same allocated object that `self` points to. /// It may *not* be used to access a different allocated object. Note that in Rust, every /// (stack-allocated) variable is considered a separate allocated object. /// /// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z` /// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still /// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless /// `x` and `y` point into the same allocated object. /// /// In particular, the resulting pointer remains attached to the same allocated /// object that `self` points to. It may *not* be used to access a /// different allocated object. Note that in Rust, /// every (stack-allocated) variable is considered a separate allocated object. /// Compared to [`sub`], this method basically delays the requirement of staying within the /// same allocated object: [`sub`] is immediate Undefined Behavior when crossing object /// boundaries; `wrapping_sub` produces a pointer but still leads to Undefined Behavior if a /// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`sub`] /// can be optimized better and is thus preferable in performance-sensitive code. /// /// Compared to [`sub`], this method basically delays the requirement of staying /// within the same allocated object: [`sub`] is immediate Undefined Behavior when /// crossing object boundaries; `wrapping_sub` produces a pointer but still leads /// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized /// better and is thus preferable in performance-sensitive code. /// The delayed check only considers the value of the pointer that was dereferenced, not the /// intermediate values used during the computation of the final result. For example, /// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the /// allocated object and then re-entering it later is permitted. /// /// If you need to cross object boundaries, cast the pointer to an integer and /// do the arithmetic there."} {"_id":"q-en-rust-5458249eff8a8489bbb3960bb3a767e09de13f6fe95f18be695134379288d080","text":" error[E0517]: attribute should be applied to a struct or union --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:6:8 | LL | #[repr(packed)] | ^^^^^^ ... LL | / enum E { LL | | A, LL | | B, LL | | C, LL | | } | |_- not a struct or union error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:18:9 | LL | e: E, | ^^^^ | = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` help: wrap the field type in `ManuallyDrop<...>` | LL | e: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error: aborting due to 2 previous errors Some errors have detailed explanations: E0517, E0740. For more information about an error, try `rustc --explain E0517`. "} {"_id":"q-en-rust-546c5fb5eb1a48fba3f54e051cde4415cad0450dce16c6153cab30f0e29e5a85","text":"} fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) { self.sess.buffer_lint_with_diagnostic( builtin::BARE_TRAIT_OBJECTS, id, span, \"trait objects without an explicit `dyn` are deprecated\", builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global), ) // FIXME(davidtwco): This is a hack to detect macros which produce spans of the // call site which do not have a macro backtrace. See #61963. let is_macro_callsite = self.sess.source_map() .span_to_snippet(span) .map(|snippet| snippet.starts_with(\"#[\")) .unwrap_or(true); if !is_macro_callsite { self.sess.buffer_lint_with_diagnostic( builtin::BARE_TRAIT_OBJECTS, id, span, \"trait objects without an explicit `dyn` are deprecated\", builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global), ) } } fn wrap_in_try_constructor("} {"_id":"q-en-rust-54bdfd10919a4dab70db8fec3037e35f9df53a1d1f4f1a75e440ffc5415dd842","text":"} bb10: { _4 = const (); // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 // ty::Const // + ty: () // + val: Value(Scalar()) // mir::Constant // + span: $DIR/issue-49232.rs:10:25: 10:30 // + literal: Const { ty: (), val: Value(Scalar()) } unreachable; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 }"} {"_id":"q-en-rust-54d344af229ce5bc15c53b3cacf0604457cbbc8368c57cc58f67974baa6fa4c3","text":") -> io::Result<(Process, StdioPipes)> { let maybe_env = self.env.capture_if_changed(); let mut si = zeroed_startupinfo(); si.cb = mem::size_of::() as c::DWORD; si.dwFlags = c::STARTF_USESTDHANDLES; let child_paths = if let Some(env) = maybe_env.as_ref() { env.get(&EnvKey::new(\"PATH\")).map(|s| s.as_os_str()) } else {"} {"_id":"q-en-rust-54e2e5582793b1c87b5e2123f9b3c16ac3ef1f3240b43281a614dd40281c291f","text":"// from the CodeView line tables in the object files. self.cmd.arg(\"/DEBUG\"); // Default to emitting only the file name of the PDB file into // the binary instead of the full path. Emitting the full path // may leak private information (such as user names). // See https://github.com/rust-lang/rust/issues/87825. // // This default behavior can be overridden by explicitly passing // `-Clink-arg=/PDBALTPATH:...` to rustc. self.cmd.arg(\"/PDBALTPATH:%_PDB%\"); // This will cause the Microsoft linker to embed .natvis info into the PDB file let natvis_dir_path = self.sess.sysroot.join(\"librustlibetc\"); if let Ok(natvis_dir) = fs::read_dir(&natvis_dir_path) {"} {"_id":"q-en-rust-554dd4f8b3f237a54be4b4456a22a0439e65b3f0508fe470405c9da9d8732a20","text":"//@ revisions: m68k //@[m68k] compile-flags: --target m68k-unknown-linux-gnu //@[m68k] needs-llvm-components: m68k //@ revisions: csky //@[csky] compile-flags: --target csky-unknown-linux-gnuabiv2 //@[csky] needs-llvm-components: csky // FIXME: disabled on nvptx64 since the target ABI fails the sanity check // see https://github.com/rust-lang/rust/issues/117480 /* revisions: nvptx64 [nvptx64] compile-flags: --target nvptx64-nvidia-cuda [nvptx64] needs-llvm-components: nvptx */ // FIXME: disabled since it fails on CI saying the csky component is missing // see https://github.com/rust-lang/rust/issues/125697 /* revisions: csky [csky] compile-flags: --target csky-unknown-linux-gnuabiv2 [csky] needs-llvm-components: csky */ #![feature(rustc_attrs, unsized_fn_params, transparent_unions)] #![cfg_attr(not(host), feature(no_core, lang_items), no_std, no_core)] #![allow(unused, improper_ctypes_definitions, internal_features)]"} {"_id":"q-en-rust-558ab667c10f4c778a3b32930b0771abc7eb5cd0092ab9a0ab130188b3c61b69","text":" // This is a non-regression test for const-qualification of unstable items in libcore // as explained in issue #67053. // const-qualification could miss some `const fn`s if they were unstable and the feature // gate was not enabled in libcore. #![stable(feature = \"core\", since = \"1.6.0\")] #![feature(const_if_match)] #![feature(rustc_const_unstable)] #![feature(staged_api)] enum Opt { Some(T), None, } impl Opt { #[rustc_const_unstable(feature = \"foo\")] #[stable(feature = \"rust1\", since = \"1.0.0\")] const fn unwrap_or_else T>(self, f: F) -> T { //~^ ERROR destructors cannot be evaluated at compile-time //~| ERROR destructors cannot be evaluated at compile-time match self { Opt::Some(t) => t, Opt::None => f(), //~ ERROR E0015 } } } fn main() {} "} {"_id":"q-en-rust-56097c650b0982f3a528c6e4b9655de97751baf1c6333913329aee70628d9289","text":" error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper(f: F) LL | | LL | | LL | | LL | | where LL | | F:, LL | | for<'a> >::Output: Future + 'a, | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:10 | LL | async fn wrapper(f: F) | ^^^^^^^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:13:1 | LL | / { LL | | LL | | let mut i = 41; LL | | &mut i; LL | | } | |_^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper(f: F) LL | | LL | | LL | | LL | | where LL | | F:, LL | | for<'a> >::Output: Future + 'a, | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-562b3194f10b82581969658abe516fd5948d5a09bb5e88293bccf25118a45ee4","text":" // Regression test for . // This test ensures that only impl blocks are documented in bodies. #![crate_name = \"foo\"] // @has 'foo/index.html' // Checking there are only three sections. // @count - '//*[@id=\"main-content\"]/*[@class=\"small-section-header\"]' 3 // @has - '//*[@id=\"main-content\"]/*[@class=\"small-section-header\"]' 'Structs' // @has - '//*[@id=\"main-content\"]/*[@class=\"small-section-header\"]' 'Functions' // @has - '//*[@id=\"main-content\"]/*[@class=\"small-section-header\"]' 'Traits' // Checking that there are only three items. // @count - '//*[@id=\"main-content\"]//*[@class=\"item-name\"]' 3 // @has - '//*[@id=\"main-content\"]//a[@href=\"struct.Bar.html\"]' 'Bar' // @has - '//*[@id=\"main-content\"]//a[@href=\"fn.foo.html\"]' 'foo' // @has - '//*[@id=\"main-content\"]//a[@href=\"trait.Foo.html\"]' 'Foo' // Now checking that the `foo` method is visible in `Bar` page. // @has 'foo/struct.Bar.html' // @has - '//*[@id=\"method.foo\"]/*[@class=\"code-header\"]' 'pub fn foo()' // @has - '//*[@id=\"method.bar\"]/*[@class=\"code-header\"]' 'fn bar()' pub struct Bar; pub trait Foo { fn bar() {} } pub fn foo() { pub mod inaccessible {} pub fn inner() {} pub const BAR: u32 = 0; impl Bar { pub fn foo() {} } impl Foo for Bar {} } "} {"_id":"q-en-rust-562d6a4031707741588ac1158f5d5878626318e11e31e498dd12c704784c2ddc","text":"let cache = cache(); write!(w, \"

\"); }"} {"_id":"q-en-rust-8d8729a5979fc6b2d158fc2092edb2c931695a729f589c4d6a5e78c4338e041c","text":"Ok(Some((d, path))) => (path.trim(), Some(d)), Ok(None) => (link.trim(), None), Err((err_msg, relative_range)) => { let disambiguator_range = (no_backticks_range.start + relative_range.start) ..(no_backticks_range.start + relative_range.end); disambiguator_error(self.cx, &item, dox, disambiguator_range, &err_msg); if !should_ignore_link_with_disambiguators(link) { // Only report error if we would not have ignored this link. // See issue #83859. let disambiguator_range = (no_backticks_range.start + relative_range.start) ..(no_backticks_range.start + relative_range.end); disambiguator_error(self.cx, &item, dox, disambiguator_range, &err_msg); } return None; } }; if path_str.contains(|ch: char| !(ch.is_alphanumeric() || \":_<>, !*&;\".contains(ch))) { if should_ignore_link(path_str) { return None; }"} {"_id":"q-en-rust-8da4ee22b176098ae60b87001917ab559556b021495f0121444e0177c9fadcb5","text":"if self.filename { match self.path.filename() { None => ~\"\", Some(v) => from_utf8_with_replacement(v) Some(v) => str::from_utf8_lossy(v) } } else { from_utf8_with_replacement(self.path.as_vec()) str::from_utf8_lossy(self.path.as_vec()) } } }"} {"_id":"q-en-rust-8dcf043c0f26bf7dc9bacadd98b60aceef282296448dbf8ad2d016545561137d","text":"/// and surrogates as `u` followed by four hexadecimal digits. /// Example: `\"au{D800}\"` for a slice with code points [U+0061, U+D800] impl fmt::Debug for Wtf8 { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { fn write_str_escaped(f: &mut fmt::Formatter, s: &str) -> fmt::Result { use fmt::Write; for c in s.chars().flat_map(|c| c.escape_default()) { try!(f.write_char(c)) } Ok(()) } try!(formatter.write_str(\"\"\")); let mut pos = 0; loop { match self.next_surrogate(pos) { None => break, Some((surrogate_pos, surrogate)) => { try!(formatter.write_str(unsafe { // the data in this slice is valid UTF-8, transmute to &str mem::transmute(&self.bytes[pos .. surrogate_pos]) })); try!(write_str_escaped( formatter, unsafe { str::from_utf8_unchecked( &self.bytes[pos .. surrogate_pos] )}, )); try!(write!(formatter, \"u{{{:X}}}\", surrogate)); pos = surrogate_pos + 3; } } } try!(formatter.write_str(unsafe { // the data in this slice is valid UTF-8, transmute to &str mem::transmute(&self.bytes[pos..]) })); try!(write_str_escaped( formatter, unsafe { str::from_utf8_unchecked(&self.bytes[pos..]) }, )); formatter.write_str(\"\"\") } }"} {"_id":"q-en-rust-8deb8fdda823b79945f44f3db92107245e9285ec49952bc857f8795cc4c60468","text":"pub type LPBOOL = *mut BOOL; pub type LPBYTE = *mut BYTE; pub type LPCCH = *const CHAR; pub type LPCSTR = *const CHAR; pub type LPCWCH = *const WCHAR; pub type LPCWSTR = *const WCHAR; pub type LPCVOID = *const c_void; pub type LPDWORD = *mut DWORD; pub type LPHANDLE = *mut HANDLE; pub type LPOVERLAPPED = *mut OVERLAPPED; pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION; pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES; pub type LPSTARTUPINFO = *mut STARTUPINFO; pub type LPSTR = *mut CHAR; pub type LPVOID = *mut c_void; pub type LPCVOID = *const c_void; pub type LPWCH = *mut WCHAR; pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW; pub type LPWSADATA = *mut WSADATA;"} {"_id":"q-en-rust-8df64256d129f8141c93bdcbeb024a5f56bc1748608203859e4d3d07eedfda7b","text":"ENV NO_DOWNLOAD_CI_LLVM 1 ENV EXTERNAL_LLVM 1 # This is not the latest LLVM version, so some components required by tests may # be missing. ENV IS_NOT_LATEST_LLVM 1 # Using llvm-link-shared due to libffi issues -- see #34486 ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu "} {"_id":"q-en-rust-8e045a6d47f9e1b027a1c2dcccee4e7611f1f92f5233940524d465ee5ad6dea6","text":"fn super_ascribe_user_ty(&mut self, place: & $($mutability)? Place<'tcx>, _variance: $(& $mutability)? ty::Variance, variance: $(& $mutability)? ty::Variance, user_ty: & $($mutability)? UserTypeProjection, location: Location) { self.visit_place( place, PlaceContext::NonUse(NonUseContext::AscribeUserTy), PlaceContext::NonUse(NonUseContext::AscribeUserTy($(* &$mutability *)? variance)), location ); self.visit_user_type_projection(user_ty);"} {"_id":"q-en-rust-8e57ea8cfb073f3fc057cf2f4e8a06841bf0d4fb9def948057946ffedd0c2620","text":"# \"alternate\" deployment, see .travis.yml for more info - MSYS_BITS: 64 RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler SCRIPT: python x.py dist DEPLOY_ALT: 1"} {"_id":"q-en-rust-8e7252d7d65d0aac735628a24bd17bbd9fbafd51bd7dcc2e19996640a654a332","text":"/// Ending a storage live range. StorageDead, /// User type annotation assertions for NLL. AscribeUserTy, AscribeUserTy(ty::Variance), /// The data of a user variable, for debug info. VarDebugInfo, }"} {"_id":"q-en-rust-8ea7b2f8cb4d5c52603bf292e9a1b7124ac02a32e03624d2c7f976e4fe2379bc","text":"version = \"0.1.0\" dependencies = [ \"serde\", \"serde_json\", \"toml\", ]"} {"_id":"q-en-rust-8ebbd18b7595738d2bf5bf1d6e8f9a4fff225678dc8cd0ecc0328191edce81f6","text":"visit.visit_block(body); } fcx.require_type_is_sized(ret_ty, decl.output.span, traits::ReturnType); check_block_with_expected(&fcx, body, ExpectHasType(ret_ty));"} {"_id":"q-en-rust-8ebbd5026cb072e9046fb015b6f15aaedfc77c441aa7030d87c5610425ad6abb","text":" error: expected a pattern, found an expression --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:31 | LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^^^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns error[E0412]: cannot find type `T` in this scope --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:55 | LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^ not found in this scope error[E0109]: type and const arguments are not allowed on builtin type `str` --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:15 | LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ type and const arguments not allowed | | | not allowed on builtin type `str` | help: primitive type `str` doesn't have generic parameters | LL - let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; LL + let str::as_bytes; | error[E0533]: expected unit struct, unit variant or constant, found associated function `str<, T>::as_bytes` --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:9 | LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant error: aborting due to 4 previous errors Some errors have detailed explanations: E0109, E0412, E0533. For more information about an error, try `rustc --explain E0109`. "} {"_id":"q-en-rust-8ed2cbb1d986be7be00b9f3d371be3c8c76999d42aa976188e401ffa7c88cba1","text":"pat: &'tcx hir::Pat<'tcx>, ty: Ty<'tcx>, ) { struct V<'tcx> { tcx: TyCtxt<'tcx>, struct V { pat_hir_ids: Vec, } impl<'tcx> Visitor<'tcx> for V<'tcx> { type NestedFilter = rustc_middle::hir::nested_filter::All; fn nested_visit_map(&mut self) -> Self::Map { self.tcx.hir() } impl<'tcx> Visitor<'tcx> for V { fn visit_pat(&mut self, p: &'tcx hir::Pat<'tcx>) { self.pat_hir_ids.push(p.hir_id); hir::intravisit::walk_pat(self, p);"} {"_id":"q-en-rust-8f8384a33b76bb06f5cc342e66225fa052d1cbfbfbf21ba11bb896fee5ca50e7","text":" // check-pass #![deny(improper_ctypes_definitions)] #[repr(C)] pub struct Wrap(T); #[repr(transparent)] pub struct TransparentWrap(T); pub extern \"C\" fn f() -> Wrap<()> { todo!() } const _: extern \"C\" fn() -> Wrap<()> = f; pub extern \"C\" fn ff() -> Wrap> { todo!() } const _: extern \"C\" fn() -> Wrap> = ff; pub extern \"C\" fn g() -> TransparentWrap<()> { todo!() } const _: extern \"C\" fn() -> TransparentWrap<()> = g; pub extern \"C\" fn gg() -> TransparentWrap> { todo!() } const _: extern \"C\" fn() -> TransparentWrap> = gg; fn main() {} "} {"_id":"q-en-rust-8f9ae8864f61ffa68f35f34687a7474385552654320bf1fde27b76f7c3686e25","text":"param_span: Span, }, } #[derive(Diagnostic)] pub(crate) enum LateBoundInApit { #[diag(hir_analysis_late_bound_type_in_apit)] Type { #[primary_span] span: Span, #[label] param_span: Span, }, #[diag(hir_analysis_late_bound_const_in_apit)] Const { #[primary_span] span: Span, #[label] param_span: Span, }, #[diag(hir_analysis_late_bound_lifetime_in_apit)] Lifetime { #[primary_span] span: Span, #[label] param_span: Span, }, } "} {"_id":"q-en-rust-8fb78beaf826eae51154114cba362d288503e49fa4e78f695f6c5266d31fbb7b","text":"euv::AddrOf | euv::RefBinding | euv::AutoRef | euv::ForLoop => { euv::ForLoop | euv::MatchDiscriminant => { format!(\"cannot borrow {} as mutable\", descr) } euv::ClosureInvocation => {"} {"_id":"q-en-rust-8fd7c1d72a27c8363ab0fa3e04662ee96b23721858cbe8d9fa782c2d72fb2256","text":"let mir_opaque_ty = tcx.mir_borrowck(owner_def_id).concrete_opaque_types.get(&def_id).copied(); if let Some(mir_opaque_ty) = mir_opaque_ty { if mir_opaque_ty.references_error() { return mir_opaque_ty.ty; } let scope = tcx.local_def_id_to_hir_id(owner_def_id); debug!(?scope); let mut locator = RpitConstraintChecker { def_id, tcx, found: mir_opaque_ty };"} {"_id":"q-en-rust-8ff4d95185778590a0ba347201a7810aa22439f24a03cec280d3e66490dd5adb","text":" Subproject commit df4109151b6870cdb6d170326d1c099746990ea8 Subproject commit c8f51fc5a772a125f3b3ad7fe46609a4638ca509 "} {"_id":"q-en-rust-900fb0c37366561fbe97f86c27d866d2fe0fbb21b740c725996544dafad5234f","text":"[dependencies] toml = \"0.5\" serde = { version = \"1.0\", features = [\"derive\"] } serde_json = \"1.0\" reqwest = \"0.9\" "} {"_id":"q-en-rust-9013b42f337175fa47302325f2d3b5bdbbdb65faba1cbb8ec602d953ee250dda","text":".ok() .expect(\"Failed to read line\"); println!(\"You guessed: {}\", input); println!(\"You guessed: {}\", guess); } ```"} {"_id":"q-en-rust-902c109f7fa7c9351386f6f4fc80be9c1f669b2d4756e8f0825d0b7f0977ac26","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // min-llvm-version 3.9 use std::ops::Deref; fn main() {"} {"_id":"q-en-rust-904198e38d7cd495071a5dc8a0a19a82c1b69de51cb15b9f5ef35425d96147f8","text":" // check-pass #![feature(exhaustive_patterns)] enum Void {} fn main() { let a: Option = None; let None = a; } "} {"_id":"q-en-rust-9062a438e96cf53ae3e9c0516d1034ae9ca20f37b3458425a1739559fcc7c439","text":"use lint::{LateContext, LintContext, LintArray}; use lint::{LintPass, LateLintPass}; use syntax::abi::Abi; use syntax::ast; use syntax::attr; use syntax_pos::Span;"} {"_id":"q-en-rust-90643e3296da18ba02c1504104e02e5e64058cd9de48e29d66f53e4fd5dc521f","text":"fn stability(&self, def: DefId) -> Option; fn deprecation(&self, def: DefId) -> Option; fn visibility(&self, def: DefId) -> ty::Visibility; fn visible_parent_map<'a>(&'a self) -> ::std::cell::RefMut<'a, DefIdMap>; fn visible_parent_map<'a>(&'a self) -> ::std::cell::Ref<'a, DefIdMap>; fn item_generics_cloned(&self, def: DefId) -> ty::Generics; fn item_attrs(&self, def_id: DefId) -> Vec; fn fn_arg_names(&self, did: DefId) -> Vec;"} {"_id":"q-en-rust-90694249ad3dd690bff941609cc03d544031fa497b0831ca99c7393531401a68","text":" pub struct Stuff { inner: *mut (), } pub struct Wrap(T); fn fun(t: T) -> Wrap { todo!() } pub trait Trait<'de> { fn do_stuff(_: Wrap<&'de mut Self>); } impl<'a> Trait<'a> for () { fn do_stuff(_: Wrap<&'a mut Self>) {} } fn fun2(t: &mut Stuff) -> () { let Stuff { inner, .. } = t; Trait::do_stuff({ fun(&mut *inner) }); //~^ ERROR the trait bound `*mut (): Trait<'_>` is not satisfied } fn main() {} "} {"_id":"q-en-rust-90b1d01c323ddb0a9ce545bb7f2cefc22731e4d4a52cf5d4e863248da9940544","text":"// a missing surrogate can be produced (and also because of the UTF-8 validation above), // write the missing surrogate out now. // Buffering it would mean we have to lie about the number of bytes written. let first_char_remaining = utf16[written]; if first_char_remaining >= 0xDCEE && first_char_remaining <= 0xDFFF { let first_code_unit_remaining = utf16[written]; if first_code_unit_remaining >= 0xDCEE && first_code_unit_remaining <= 0xDFFF { // low surrogate // We just hope this works, and give up otherwise let _ = write_u16s(handle, &utf16[written..written + 1]);"} {"_id":"q-en-rust-90bdb397e5c6d1fac402541aacf9b144ba116531a890bcc9baed4098d9b9d315","text":"rustc_middle = { path = \"../rustc_middle\", optional = true } rustc_span = { path = \"../rustc_span\", optional = true } tracing = \"0.1\" scoped-tls = \"1.0\" [features] default = ["} {"_id":"q-en-rust-90bffe52feb08de0c1b0f8f9ef179906e3bc31e98dc43cbc65d96c8531e62fc1","text":"/// } /// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] #[inline] pub fn kind(&self) -> ErrorKind { match self.repr { Repr::Os(code) => sys::decode_error_kind(code),"} {"_id":"q-en-rust-90c94b2807274319190d3f909b8c473d327b8271659e04882b05d97a82a1bbb5","text":"&self, obligation: &PredicateObligation<'tcx>, err: &mut DiagnosticBuilder<'_>, trait_ref: &ty::Binder<'tcx, ty::TraitRef<'tcx>>, poly_trait_ref: &ty::Binder<'tcx, ty::TraitRef<'tcx>>, has_custom_message: bool, ) -> bool { let span = obligation.cause.span;"} {"_id":"q-en-rust-90dd75cfbb427ad5a7598b1557244600378bc5a3ecbf58dd76a7f0ca09b80bc2","text":"/// assert_eq!(err.kind(), ErrorKind::WriteZero); /// assert_eq!(recovered_writer.buffer(), b\"t be actually written\"); /// ``` #[unstable(feature = \"io_into_inner_error_parts\", issue = \"79704\")] #[stable(feature = \"io_into_inner_error_parts\", since = \"1.55.0\")] pub fn into_parts(self) -> (Error, W) { (self.1, self.0) }"} {"_id":"q-en-rust-90f7624308960395a87a6ede4956ffd061f1f748554793bbe558effe9386e521","text":"StorageDead(_4); // scope 1 at $DIR/simple.rs:6:18: 6:19 StorageDead(_6); // scope 1 at $DIR/simple.rs:6:19: 6:20 StorageDead(_3); // scope 1 at $DIR/simple.rs:6:19: 6:20 - _0 = _2; // scope 1 at $DIR/simple.rs:7:5: 7:8 - StorageDead(_2); // scope 0 at $DIR/simple.rs:8:1: 8:2 + nop; // scope 1 at $DIR/simple.rs:7:5: 7:8 + nop; // scope 0 at $DIR/simple.rs:8:1: 8:2 _0 = _2; // scope 1 at $DIR/simple.rs:7:5: 7:8 StorageDead(_2); // scope 0 at $DIR/simple.rs:8:1: 8:2 return; // scope 0 at $DIR/simple.rs:8:2: 8:2 } }"} {"_id":"q-en-rust-911b4ae292d0da12d7a9df7c27781f770ac7c2d3774541da9cb3d3920f740a53","text":" #[derive(Debug)] struct Foo { #[cfg(all())] field: fn(($),), //~ ERROR expected pattern, found `$` //~^ ERROR expected pattern, found `$` } fn main() {} "} {"_id":"q-en-rust-913b2a73fa58126529b6e91029ccea2f7ef799fe5dfe6de99e7c2814b90bed44","text":"fn make_final_bounds( &self, ty_to_bounds: FxHashMap>, ty_to_fn: FxHashMap, Option)>, ty_to_fn: FxHashMap)>, lifetime_to_bounds: FxHashMap>, ) -> Vec { ty_to_bounds .into_iter() .flat_map(|(ty, mut bounds)| { if let Some(data) = ty_to_fn.get(&ty) { let (poly_trait, output) = (data.0.as_ref().unwrap().clone(), data.1.as_ref().cloned().map(Box::new)); if let Some((ref poly_trait, ref output)) = ty_to_fn.get(&ty) { let mut new_path = poly_trait.trait_.clone(); let last_segment = new_path.segments.pop().expect(\"segments were empty\");"} {"_id":"q-en-rust-9163efa337ecb40a810182817c0e5ce434463356324d4b0d169ac1f9decc839b","text":" Subproject commit 50ef22af522f2545295090cc1ad3e4bd4aa8632c Subproject commit b8f617897a66953b9026c02f7a8f93a2e9611f63 "} {"_id":"q-en-rust-9181f8c06acf7f5b737614e904b782ca720a8281bf0d868e06aab2378d904c03","text":"\"regex-syntax\", \"semver\", \"serde\", \"smallvec 0.6.10\", \"smallvec 1.0.0\", \"toml\", \"unicode-normalization\", \"url 2.1.0\","} {"_id":"q-en-rust-918333d41c367085224833b0150a0ceda491971528840086c930cb9092d616cc","text":"panic!(\"dist: Error calling canonicalize path `{}`: {}\", llvm_dylib_path.display(), e); }); builder.install(&llvm_dylib_path, &dst_libdir1, 0o644); builder.install(&llvm_dylib_path, &dst_libdir2, 0o644); builder.install(&llvm_dylib_path, dst_libdir, 0o644); } } /// Maybe add libLLVM.so to the target lib-dir for linking. pub fn maybe_install_llvm_target(builder: &Builder<'_>, target: Interned, sysroot: &Path) { let dst_libdir = sysroot.join(\"lib/rustlib\").join(&*target).join(\"lib\"); maybe_install_llvm(builder, target, &dst_libdir); } /// Maybe add libLLVM.so to the runtime lib-dir for rustc itself. pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: Interned, sysroot: &Path) { let dst_libdir = sysroot.join(builder.sysroot_libdir_relative(Compiler { stage: 1, host: target })); maybe_install_llvm(builder, target, &dst_libdir); } #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct LlvmTools { pub target: Interned,"} {"_id":"q-en-rust-919852695de445d22a129977fbbe060f99bcb4cb4b0784d9a82ec774ff1da83a","text":"h2, h3, h4 { border-bottom: 1px solid; } .impl, .method, .type:not(.container-rustdoc), .associatedconstant, .associatedtype { .impl, .impl-items .method, .impl-items .type, .impl-items .associatedconstant, .impl-items .associatedtype { flex-basis: 100%; font-weight: 600; margin-top: 16px;"} {"_id":"q-en-rust-91aa829566a5df7a09c8791c153248e9d3fbd45e1b398560fdad1754e8b5f6f6","text":" error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:16:16 | LL | take_range(std::ops::Range { start: 0, end: 1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }` | = note: expected type `&_` found type `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:21:16 | LL | take_range(::std::ops::Range { start: 0, end: 1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }` | = note: expected type `&_` found type `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:26:16 | LL | take_range(std::ops::RangeFrom { start: 1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeFrom` | help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }` | = note: expected type `&_` found type `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:31:16 | LL | take_range(::std::ops::RangeFrom { start: 1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeFrom` | help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }` | = note: expected type `&_` found type `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:36:16 | LL | take_range(std::ops::RangeFull {}); | ^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeFull` | help: consider borrowing here: `&std::ops::RangeFull {}` | = note: expected type `&_` found type `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:41:16 | LL | take_range(::std::ops::RangeFull {}); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeFull` | help: consider borrowing here: `&::std::ops::RangeFull {}` | = note: expected type `&_` found type `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:46:16 | LL | take_range(std::ops::RangeInclusive::new(0, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeInclusive` | help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)` | = note: expected type `&_` found type `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:51:16 | LL | take_range(::std::ops::RangeInclusive::new(0, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeInclusive` | help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)` | = note: expected type `&_` found type `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:56:16 | LL | take_range(std::ops::RangeTo { end: 5 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeTo` | help: consider borrowing here: `&std::ops::RangeTo { end: 5 }` | = note: expected type `&_` found type `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:61:16 | LL | take_range(::std::ops::RangeTo { end: 5 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeTo` | help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }` | = note: expected type `&_` found type `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:66:16 | LL | take_range(std::ops::RangeToInclusive { end: 5 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeToInclusive` | help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }` | = note: expected type `&_` found type `std::ops::RangeToInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:71:16 | LL | take_range(::std::ops::RangeToInclusive { end: 5 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected reference, found struct `std::ops::RangeToInclusive` | help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }` | = note: expected type `&_` found type `std::ops::RangeToInclusive<{integer}>` error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-91ba0238ac8f072352cbcf02e572b73514c3e418a877465ebb5fd35022beea27","text":"// integer literal, push to vector expression ast::LitIntUnsuffixed(v) => { if v > 0xFF { cx.span_err(expr.span, \"too large integer literal in bytes!\") cx.span_err(expr.span, \"too large integer literal in bytes!\"); err = true; } else if v < 0 { cx.span_err(expr.span, \"negative integer literal in bytes!\") cx.span_err(expr.span, \"negative integer literal in bytes!\"); err = true; } else { bytes.push(cx.expr_u8(expr.span, v as u8)); }"} {"_id":"q-en-rust-91d43e519bb70232a9c66e0f10be65340214e8f71313aca1acb7af02afd76973","text":" #![feature(const_generics)] #![allow(incomplete_features)] struct Test(); fn pass() { println!(\"Hello, world!\"); } impl Test { pub fn call_me(&self) { self.test::(); } fn test(&self) { //~^ ERROR: using function pointers as const generic parameters is forbidden FN(); } } fn main() { let x = Test(); x.call_me() } "} {"_id":"q-en-rust-91e15774a1c8a9fb690cd1cc01cba9d521ac34748308a5b16697683d621e9181","text":"_ => self.is_free(), } } pub fn is_var(self) -> bool { matches!(self.kind(), ty::ReVar(_)) } } /// Type utilities"} {"_id":"q-en-rust-91fafe4d8cc460d6251b6cce7170730fc39973b496dcfc2f2c9fb51358485859","text":" error: higher-ranked subtype error --> $DIR/issue-30906.rs:15:5 | LL | test(Compose(f, |_| {})); | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error "} {"_id":"q-en-rust-9209545df817adc4498e8d770b3c1796f12288c85bdc59535fa948369a0073fb","text":"fn expect_aborted(status: ExitStatus) { dbg!(status); let signal = status.signal().expect(\"expected child process to die of signal\"); #[cfg(not(target_os = \"android\"))] assert!(signal == libc::SIGABRT || signal == libc::SIGILL || signal == libc::SIGTRAP); #[cfg(target_os = \"android\")] { // Android signals an abort() call with SIGSEGV at address 0xdeadbaad // See e.g. https://groups.google.com/g/android-ndk/c/laW1CJc7Icc assert!(signal == libc::SIGSEGV); // Additional checks performed: // 1. Find last tombstone (similar to coredump but in text format) from the // same executable (path) as we are (must be because of usage of fork): // This ensures that we look into the correct tombstone. // 2. Cause of crash is a SIGSEGV with address 0xdeadbaad. // 3. libc::abort call is in one of top two functions on callstack. // The last two steps distinguish between a normal SIGSEGV and one caused // by libc::abort. let this_exe = std::env::current_exe().unwrap().into_os_string().into_string().unwrap(); let exe_string = format!(\">>> {this_exe} <<<\"); let tombstone = (0..100) .map(|n| format!(\"/data/tombstones/tombstone_{n:02}\")) .filter(|f| std::path::Path::new(&f).exists()) .map(|f| std::fs::read_to_string(&f).expect(\"Cannot read tombstone file\")) .filter(|f| f.contains(&exe_string)) .last() .expect(\"no tombstone found\"); println!(\"Content of tombstone:n{tombstone}\"); assert!( tombstone.contains(\"signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad\") ); let abort_on_top = tombstone .lines() .skip_while(|l| !l.contains(\"backtrace:\")) .skip(1) .take_while(|l| l.starts_with(\" #\")) .take(2) .any(|f| f.contains(\"/system/lib/libc.so (abort\")); assert!(abort_on_top); } } fn main() {"} {"_id":"q-en-rust-92236aa2c817c8318d1785a2ef95f0026c15ec295c51d1c638405e77c2c9ec1e","text":"use crate::TargetSelection; use crate::{t, VERSION}; use std::env::consts::EXE_SUFFIX; use std::fmt::Write as _; use std::path::{Path, PathBuf}; use std::fs::File; use std::path::{Path, PathBuf, MAIN_SEPARATOR}; use std::process::Command; use std::str::FromStr; use std::{"} {"_id":"q-en-rust-9237fcd464412085ecb5543329d6b34eff62186f97296da1b581aacc040b4aef","text":" // Regression test for #89469, where an extra non_snake_case warning was // reported for a shorthand field binding. // check-pass #![deny(non_snake_case)] #[allow(non_snake_case)] struct Entry { A: u16, a: u16 } fn foo() -> Entry {todo!()} pub fn f() { let Entry { A, a } = foo(); let _ = (A, a); } fn main() {} "} {"_id":"q-en-rust-925721e825d393e07fbe463a5599987283f1092f430a6e55920ca16853bdf1a8","text":" error[E0283]: type annotations needed --> $DIR/issue-80816.rs:49:38 | LL | let guard: Guard> = s.load(); | ^^^^ | note: multiple `impl`s satisfying `ArcSwapAny>: Access<_>` found --> $DIR/issue-80816.rs:35:1 | LL | impl Access for ArcSwapAny { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | impl Access for ArcSwapAny> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required for `Arc>>` to implement `Access<_>` --> $DIR/issue-80816.rs:31:45 | LL | impl, P: Deref> Access for P { | ^^^^^^^^^ ^ help: try using a fully qualified path to specify the expected types | LL | let guard: Guard> = >> as Access>::load(&s); | ++++++++++++++++++++++++++++++++++++++++++++++++++ ~ error: aborting due to previous error For more information about this error, try `rustc --explain E0283`. "} {"_id":"q-en-rust-9294330d50e9d6071d31e5854cd8c09886aadc0a98a24b9ac4692f47f2be3769","text":"pub use self::stdio::set_output_capture; #[stable(feature = \"rust1\", since = \"1.0.0\")] pub use self::stdio::{stderr, stdin, stdout, Stderr, Stdin, Stdout}; #[unstable(feature = \"stdio_locked\", issue = \"none\")] pub use self::stdio::{stderr_locked, stdin_locked, stdout_locked}; #[stable(feature = \"rust1\", since = \"1.0.0\")] pub use self::stdio::{StderrLock, StdinLock, StdoutLock}; #[unstable(feature = \"print_internals\", issue = \"none\")]"} {"_id":"q-en-rust-92bd9ec64ed9cf0d974a62463fd8b79eb4a5f99402ea96a3633f0d0f02979804","text":"} } } hir::ItemKind::Macro(ref macro_def) => { self.update_reachability_from_macro(item.def_id, macro_def); } // Visit everything, but foreign items have their own levels. hir::ItemKind::ForeignMod { items, .. } => { for foreign_item in items {"} {"_id":"q-en-rust-92c2b85c96e56db9d607e3118010bf8c305ba8356d386f25cdf4fcdc81e78f01","text":"}).peekable(); if let doctree::Plain = s.struct_type { if fields.peek().is_some() { write!(w, \"

Fields

\")?;
write!(w, \"

Fields

\")?;
for (field, ty) in fields { let id = derive_id(format!(\"{}.{}\", ItemType::StructField,"} {"_id":"q-en-rust-92d9db5bb6412bb74d32167054807c2e283d30f778508c7ae0305dcaa5a3df01","text":" // Regression test for #84632: Recursion limit is ignored // for builtin macros that eagerly expands. #![recursion_limit = \"15\"] macro_rules! a { () => (\"\"); (A) => (concat!(\"\", a!())); (A, $($A:ident),*) => (concat!(\"\", a!($($A),*))) //~^ ERROR recursion limit reached //~| HELP consider adding } fn main() { a!(A, A, A, A, A); a!(A, A, A, A, A, A, A, A, A, A, A); } "} {"_id":"q-en-rust-92f147f2422f5e4ca956d9e29c73a73440ea8a4e95a10c9c37cf981347635b62","text":"if let hir::Node::Pat(parent_pat) = cx.tcx.hir().get(cx.tcx.hir().get_parent_node(hid)) { if let PatKind::Struct(_, field_pats, _) = &parent_pat.kind { for field in field_pats.iter() { if field.ident != ident { // Only check if a new name has been introduced, to avoid warning // on both the struct definition and this pattern. self.check_snake_case(cx, \"variable\", &ident); } if field_pats .iter() .any(|field| !field.is_shorthand && field.pat.hir_id == p.hir_id) { // Only check if a new name has been introduced, to avoid warning // on both the struct definition and this pattern. self.check_snake_case(cx, \"variable\", &ident); } return; }"} {"_id":"q-en-rust-92fe64d4d20f36fa773f102b0c10addb82b3272606d97f3efb90b4d9b6d78974","text":"assert!(prev_predicates.is_none()); } fn ty_generics_for_type_or_impl<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty()) fn ty_generics_for_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty(), true) } fn ty_generics_for_impl<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics: &hir::Generics) -> ty::Generics<'tcx> { ty_generics(ccx, TypeSpace, generics, &ty::Generics::empty(), false) } fn ty_generic_predicates_for_type_or_impl<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,"} {"_id":"q-en-rust-9345a0bb5081fd40fcfafa648f9b385c3b581385f02761ab590cf02a2d004770","text":" // no-system-llvm // compile-flags: -O -C overflow-checks=on #![crate_type = \"lib\"] pub struct S1<'a> { data: &'a [u8], position: usize, } // CHECK-LABEL: @slice_no_index_order #[no_mangle] pub fn slice_no_index_order<'a>(s: &'a mut S1, n: usize) -> &'a [u8] { // CHECK-NOT: slice_index_order_fail let d = &s.data[s.position..s.position+n]; s.position += n; return d; } // CHECK-LABEL: @test_check #[no_mangle] pub fn test_check<'a>(s: &'a mut S1, x: usize, y: usize) -> &'a [u8] { // CHECK: slice_index_order_fail &s.data[x..y] } "} {"_id":"q-en-rust-93a774019249441d096053b2a132b8bcbc3a95b72d1e8565d76abbc2d4ef5905","text":"expr_span, scope, result, value.ty, expr.ty, ); }"} {"_id":"q-en-rust-93c5d7f2a630f97ac407877601acccd389796dd1dff540f8070f22652cbb7a0f","text":"/// # Example /// /// ```rust /// # #![allow(deprecated)] /// use url::Url; /// /// let raw = \"https://username@example.com:8080/foo/bar?baz=qux#quz\";"} {"_id":"q-en-rust-93d5f79b0b43b1dfe46b96de3b6d26a69441c5afc455d3f0a758eecf6b088eb3","text":"exact_paths: Default::default(), modules: vec![om], is_importable_from_parent: true, inside_body: false, } }"} {"_id":"q-en-rust-941a5bcaae25b8d6c5a7651e9ac1a2a66ee0b39634feb3b95b83a6c8d64ca355","text":" #![feature(unsize)] use std::marker::Unsize; use std::ops::Deref; trait Foo: Bar {} trait Bar {} impl Bar for T where dyn Foo: Unsize {} impl Bar for () {} //~^ ERROR conflicting implementations of trait `Bar` for type `()` fn main() {} "} {"_id":"q-en-rust-945ed25d597111e6502ab5a2c0d9195132035086a3750e2e2ec750213485a0a8","text":"// seemingly completely unrelated change. // Unfortunately, LLVM has no \"disable\" option for this, so we have to set // \"enable\" to 0 instead. // compile-flags:-g -Cllvm-args=-enable-tail-merge=0 // ignore-pretty as this critically relies on line numbers"} {"_id":"q-en-rust-94b314e710e59f5735d6e4bf461d6ffcc9f7938b076a3f9b6d2361a24af05189","text":"&self.buf } /// Returns a mutable reference to the internal buffer. /// /// This can be used to write data directly into the buffer without triggering writers /// to the underlying writer. /// /// That the buffer is a `Vec` is an implementation detail. /// Callers should not modify the capacity as there currently is no public API to do so /// and thus any capacity changes would be unexpected by the user. pub(in crate::io) fn buffer_mut(&mut self) -> &mut Vec { &mut self.buf } /// Returns the number of bytes the internal buffer can hold without flushing. /// /// # Examples"} {"_id":"q-en-rust-94e678d82531d8dfe8ca4b466957a8e3f60d04895a557e2ffd73f4d551bcbe11","text":" #![feature(const_generics)] pub struct Num; // Braces around const expression causes crash impl Num<{5}> { pub fn five(&self) { } } "} {"_id":"q-en-rust-951b062a7684667b6bed67f2c9d08d2b36a3955c8e81bc0b8b2fad743f49b207","text":"} pub fn foobar() {} pub type Alias = u32; pub struct Foo { pub x: Alias, } impl Foo { pub fn a_method(&self) {} } pub trait Trait { type X; const Y: u32; } impl Trait for Foo { type X = u32; const Y: u32 = 0; } "} {"_id":"q-en-rust-956236d378b8ecbe56c79b3ba61aadf72739a2ec79a3184555e94b8c8b70a4d5","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_type=\"lib\"] pub extern crate core; "} {"_id":"q-en-rust-95f67363c05a07d11ad38b3a11f6d80ca4d4434dabe747071df1522e4ff19ab0","text":"} /* Code highlighting */ .cm-s-default span.cm-keyword {color: #803C8D;} .cm-s-default span.cm-keyword {color: #8959A8;} .cm-s-default span.cm-atom {color: #219;} .cm-s-default span.cm-number {color: #2AA198;} .cm-s-default span.cm-def {color: #256EB8;} .cm-s-default span.cm-variable {color: black;} .cm-s-default span.cm-variable-2 {color: #817E61;} .cm-s-default span.cm-variable-3 {color: #085;} .cm-s-default span.cm-number {color: #3E999F;} .cm-s-default span.cm-def {color: #4271AE;} /*.cm-s-default span.cm-variable {color: #C82829;}*/ .cm-s-default span.cm-variable-2 {color: #6F906C;} .cm-s-default span.cm-variable-3 {color: #B76514;} .cm-s-default span.cm-property {color: black;} .cm-s-default span.cm-operator {color: black;} .cm-s-default span.cm-comment {color: #A82323;} .cm-s-default span.cm-string {color: #866544;} .cm-s-default span.cm-string-2 {color: #F50;} .cm-s-default span.cm-comment {color: #8E908C;} .cm-s-default span.cm-string {color: #718C00;} .cm-s-default span.cm-string-2 {color: #866544;} .cm-s-default span.cm-meta {color: #555;} /*.cm-s-default span.cm-error {color: #F00;}*/ .cm-s-default span.cm-qualifier {color: #555;} .cm-s-default span.cm-builtin {color: #30A;} .cm-s-default span.cm-bracket {color: #CC7;} .cm-s-default span.cm-tag {color: #170;} .cm-s-default span.cm-tag {color: #C82829;} .cm-s-default span.cm-attribute {color: #00C;} /* The rest"} {"_id":"q-en-rust-95f8174e409eb14948ae38b7be2278263b81f729e7edd8728f7dd6228ed70b7c","text":"/// as the compiler doesn't need to prove that it's sound to elide the /// copy. /// /// Unaligned values cannot be dropped in place, they must be copied to an aligned /// location first using [`ptr::read_unaligned`]. /// /// [`ptr::read`]: ../ptr/fn.read.html /// [`ptr::read_unaligned`]: ../ptr/fn.read_unaligned.html /// /// # Safety ///"} {"_id":"q-en-rust-9602aaaf9568f0a6e14b73c897ea554d07869e497a0b7c9d037405f2ded07d09","text":"pub const FILE_TYPE_PIPE: u32 = 3; pub const CP_UTF8: DWORD = 65001; pub const MB_ERR_INVALID_CHARS: DWORD = 0x08; pub const WC_ERR_INVALID_CHARS: DWORD = 0x80; #[repr(C)] #[derive(Copy)] pub struct WIN32_FIND_DATAW {"} {"_id":"q-en-rust-9619a628619f9cddf6c0065f81c1b28170de527fc907a1ee22528915bdd895cb","text":"// inferred in this method call. let arg = &args[i]; let arg_ty = self.node_ty(arg.hir_id); err.span_label( arg.span, &format!( \"this is of type `{arg_ty}`, which causes `{ident}` to be inferred as `{ty}`\", ), ); if !arg.span.overlaps(mismatch_span) { err.span_label( arg.span, &format!( \"this is of type `{arg_ty}`, which causes `{ident}` to be inferred as `{ty}`\", ), ); } param_args.insert(param_ty, (arg, arg_ty)); } }"} {"_id":"q-en-rust-961ae737335d238454454212b32b10c17004edd64ebe48a8dd59d12e5f656061","text":"} } fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) { if self .typeck_results() .expr_adjustments(expr) .iter() .any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(_))) { self.visit_expr(expr); } else if let hir::ExprKind::Field(base, ..) = expr.kind { // Ignore write to field self.handle_assign(base); } else { self.visit_expr(expr); } } fn handle_field_pattern_match( &mut self, lhs: &hir::Pat<'_>,"} {"_id":"q-en-rust-964c47af66daa0c54d4f44cf54a601c968f3052f4e9fa68c603933d15cfbb4fb","text":"rbml_w.wr_tagged_str(tag_crate_hash, hash.as_str()); } fn encode_rustc_version(rbml_w: &mut Encoder) { rbml_w.wr_tagged_str(tag_rustc_version, &rustc_version()); } fn encode_crate_name(rbml_w: &mut Encoder, crate_name: &str) { rbml_w.wr_tagged_str(tag_crate_crate_name, crate_name); }"} {"_id":"q-en-rust-966927011ed4577f751ec7616e477b720a677f0821fbb62cbbfa91c4c0c02471","text":" #![deny(warnings)] //! Email me at . //~^ ERROR unknown disambiguator `hello` //! This should *not* warn: . "} {"_id":"q-en-rust-967377bc971643eafe310c00fd42d239b0a9e2076cba8b3ff755552b66209d35","text":" // This used to cause an ICE for an internal index out of range due to simd_shuffle_indices being // passed the wrong Instance, causing issues with inlining. See #67557. // // run-pass // compile-flags: -Zmir-opt-level=3 #![feature(platform_intrinsics, repr_simd)] extern \"platform-intrinsic\" { fn simd_shuffle2(x: T, y: T, idx: [u32; 2]) -> U; } #[repr(simd)] #[derive(Debug, PartialEq)] struct Simd2(u8, u8); fn main() { unsafe { let _: Simd2 = inline_me(); } } #[inline(always)] unsafe fn inline_me() -> Simd2 { simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3]) } "} {"_id":"q-en-rust-967d4587c96ae89db5e0c8387e349918baf5ada2274601c0e8144cb481245981","text":"#[derive(Copy, Clone)] pub struct Quad { a: u64, b: u64, c: u64, d: u64 } #[derive(Copy, Clone)] pub struct QuadFloats { a: f32, b: f32, c: f32, d: f32 } #[repr(C)] #[derive(Copy, Clone)] pub struct Floats { a: f64, b: u8, c: f64 }"} {"_id":"q-en-rust-967d761536f9f624c4011cde0d78ec6de11d3bfb430c32fa3ba4d1795284d55c","text":"#[doc(keyword = \"CookieMonster\")] pub mod keyword {} /// Just some type alias. pub type SomeType = u32; "} {"_id":"q-en-rust-96f878071f8ed91f1beac421fd106df256abbceef9f2f69fe313e9311a1b31ca","text":"} }; if let Some(path) = path && let Ok(mut out) = crate::fs::File::options().create(true).append(true).open(&path) { write(&mut out, BacktraceStyle::full()); } if let Some(local) = set_output_capture(None) { write(&mut *local.lock().unwrap_or_else(|e| e.into_inner()), backtrace); write(&mut *local.lock().unwrap_or_else(|e| e.into_inner())); set_output_capture(Some(local)); } else if let Some(mut out) = panic_output() { write(&mut out, backtrace); write(&mut out); } }"} {"_id":"q-en-rust-96ff70d36f9a86a98fa88ffddf590b5f3da4877a3fd334d9c5652afabd8f8955","text":" // aux-build:issue-66286.rs // Regression test for #66286. extern crate issue_66286; #[issue_66286::vec_ice] pub extern fn foo(_: Vec(u32)) -> u32 { //~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait 0 } fn main() {} "} {"_id":"q-en-rust-97012b5169c70a71eb10017b06cb61561a0891dda569f4b730880695e4bf9d40","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-android: FIXME(#9116) Bus error use std::mem; #[repr(packed)]"} {"_id":"q-en-rust-9764cffd5b0ecfaa8f69fafdf87e473ee0145080a5513ac830ea2f67934abe06","text":"actual: Ty<'tcx>, ti: TopInfo<'tcx>, ) -> Option> { self.demand_eqtype_with_origin(&self.pattern_cause(ti, cause_span), expected, actual) let mut diag = self.demand_eqtype_with_origin(&self.pattern_cause(ti, cause_span), expected, actual)?; if let Some(expr) = ti.origin_expr { self.suggest_fn_call(&mut diag, expr, expected, |output| { self.can_eq(self.param_env, output, actual).is_ok() }); } Some(diag) } fn demand_eqtype_pat("} {"_id":"q-en-rust-9775b20ffe0eb9261b568f8560db36445c6cc50d082c9f3f781f6421d37d265a","text":"infer::RelateOutputImplTypes(_) => \"mismatched types\", infer::MatchExpressionArm(_, _) => \"match arms have incompatible types\", infer::IfExpression(_) => \"if and else have incompatible types\", infer::IfExpressionWithNoElse(_) => \"if may be missing an else clause\", }; self.tcx.sess.span_err("} {"_id":"q-en-rust-97920d9745b15a12b7d0d8a64c1afd68341cf0eee0df8b490bcbff5283a7e97d","text":" // The various #[inline(never)] annotations and std::hint::black_box calls are // an attempt to make unwinding as non-flaky as possible on i686-pc-windows-msvc. #[inline(never)] fn generate_backtrace(x: &u32) { std::hint::black_box(x); let bt = std::backtrace::Backtrace::force_capture(); println!(\"{}\", bt); std::hint::black_box(x); } #[inline(never)] fn fn_in_backtrace(x: &u32) { std::hint::black_box(x); generate_backtrace(x); std::hint::black_box(x); } fn main() { let x = &41; std::hint::black_box(x); fn_in_backtrace(x); std::hint::black_box(x); } "} {"_id":"q-en-rust-97d517284db96bebeca19834b53c5f62df229657d49964953ebf6a281fc3335d","text":"); } else { // Trivial case: `T` needs an extra bound: `T: Bound`. let (sp, suggestion) = match super_traits { None => predicate_constraint( let (sp, suggestion) = match ( generics .params .iter() .filter( |p| !matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), ..}), ) .next(), super_traits, ) { (_, None) => predicate_constraint( generics, trait_ref.without_const().to_predicate(tcx).to_string(), ), Some((ident, bounds)) => match bounds { [.., bound] => ( bound.span().shrink_to_hi(), format!(\" + {}\", trait_ref.print_only_trait_path().to_string()), ), [] => ( ident.span.shrink_to_hi(), format!(\": {}\", trait_ref.print_only_trait_path().to_string()), ), }, (None, Some((ident, []))) => ( ident.span.shrink_to_hi(), format!(\": {}\", trait_ref.print_only_trait_path().to_string()), ), (_, Some((_, [.., bounds]))) => ( bounds.span().shrink_to_hi(), format!(\" + {}\", trait_ref.print_only_trait_path().to_string()), ), (Some(_), Some((_, []))) => ( generics.span.shrink_to_hi(), format!(\": {}\", trait_ref.print_only_trait_path().to_string()), ), }; err.span_suggestion_verbose("} {"_id":"q-en-rust-97e50e8d079d3d8f8ceb0b52e286281de77e2d6d3c5104bfb081590e1e28c45e","text":"LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X_$(1)) LLVM_ALL_COMPONENTS_$(1)=$$(shell \"$$(LLVM_CONFIG_$(1))\" --components) LLVM_VERSION_$(1)=$$(shell \"$$(LLVM_CONFIG_$(1))\" --version) endef"} {"_id":"q-en-rust-97f2cbf2ad1edd12f89a181133c454920619a378555a9c679cee499e4a80362c","text":"/// assert_eq!(v.len(), 42); /// } /// ``` /// should be /// /// ```rust /// // should be /// fn foo(v: &[i32]) { /// assert_eq!(v.len(), 42); /// }"} {"_id":"q-en-rust-98027f8125565fc865c324caeadf90e86a033a026c5a00911403b7dbcda842c6","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(conservative_impl_trait)] fn foo() -> impl Copy { foo } fn main() { foo(); } "} {"_id":"q-en-rust-980d7f030d892694b33c3e08c636091011bde80e8752517ba81710c04e45de5e","text":"LL | foo::<_, L>([(); L + 1 + L]); | ^^^^^^^^^^^ error: aborting due to 5 previous errors error: unconstrained generic constant `{const expr}` --> $DIR/issue_114151.rs:17:5 | LL | foo::<_, L>([(); L + 1 + L]); | ^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors Some errors have detailed explanations: E0107, E0308. For more information about an error, try `rustc --explain E0107`."} {"_id":"q-en-rust-980fafab5248679656d839e562ce5656600a5c1cee7811b2a01ed8b0d84b5fbb","text":"target_os = \"openbsd\", target_arch = \"aarch64\", no_elf_tls))] #[doc(hidden)] mod imp { use prelude::v1::*;"} {"_id":"q-en-rust-981b13079f89610cb3380d7510b27ea87becc9cffe9e97da3d35926af069623e","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let mut array = [1, 2, 3]; //~^ ERROR cannot determine a type for this local variable: cannot determine the type of this integ let pie_slice = array.slice(1, 2); } "} {"_id":"q-en-rust-984c27af0f3b93ce3522f5f6e42b74dc1ced4ffca72ae381fd4f60adf5fbc84c","text":"// handled below clean::ModuleItem(..) => {} // impls/tymethods have no control over privacy clean::ImplItem(..) | clean::TyMethodItem(..) => {} // trait impls for private items should be stripped clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: ref for_id, .. }, .. }) => { if !self.exported_items.contains(for_id) { return None; } } clean::ImplItem(..) => {} // tymethods have no control over privacy clean::TyMethodItem(..) => {} } let fastreturn = match i.inner {"} {"_id":"q-en-rust-984c87334b2ef8517af776162a872d75140772d595f7ba1c81241b6b3d033f7d","text":" // Previously, in addition to the real cause of the problem as seen below, // the compiler would tell the user: // // ``` // error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or // predicates // ``` // // With this test, we check that only the relevant error is emitted. trait Foo {} impl Foo for Bar {} //~ ERROR cannot find type `Bar` in this scope fn main() {} "} {"_id":"q-en-rust-98747260d72fda2cced72558c85f638ff9b8219c32b1e8f6b2a7f29fe9757e2e","text":" pub trait MyTrait { type Assoc; } pub fn foo(_s: S, _t: T) where S: MyTrait, T: MyTrait, //~^ ERROR: expected one of `,` or `>`, found `==` //~| ERROR: this trait takes 0 generic arguments but 1 generic argument was supplied { } fn main() {} "} {"_id":"q-en-rust-98cb5d336ee7c1c17377245480c0b3c2fe28de3f89cec96455c085b1de348f54","text":"let tokens = match *nt { Nonterminal::NtItem(ref item) => prepend_attrs(sess, &item.attrs, nt, item.tokens.as_ref()), Nonterminal::NtBlock(ref block) => convert_tokens(block.tokens.as_ref()), Nonterminal::NtStmt(ref stmt) => prepend_attrs(sess, stmt.attrs(), nt, stmt.tokens()), Nonterminal::NtStmt(ref stmt) => { let do_prepend = |tokens| prepend_attrs(sess, stmt.attrs(), nt, tokens); if let ast::StmtKind::Empty = stmt.kind { let tokens: TokenStream = tokenstream::TokenTree::token(token::Semi, stmt.span).into(); do_prepend(Some(&LazyTokenStream::new(tokens))) } else { do_prepend(stmt.tokens()) } } Nonterminal::NtPat(ref pat) => convert_tokens(pat.tokens.as_ref()), Nonterminal::NtTy(ref ty) => convert_tokens(ty.tokens.as_ref()), Nonterminal::NtIdent(ident, is_raw) => {"} {"_id":"q-en-rust-98da410409623c2422723a5d235608ad82f0ef42b7b02db4fd69f46331593e11","text":"} bb0: { StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 _1 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 ((_3 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_1 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_1) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 _2 = ((_1 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 ((_3 as Some).0: i32) = _2; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 discriminant(_3) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 (_4.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_4.0: &i32) = &_2; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_4.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32"} {"_id":"q-en-rust-98ef3f188d5702529fce9353062d6979c18de5abd71a1f9f11f540bea37b3d0e","text":"// Create generics from the generics specified in the impl head. debug!(\"convert: ast_generics={:?}\", generics); let def_id = ccx.tcx.map.local_def_id(it.id); let ty_generics = ty_generics_for_type_or_impl(ccx, generics); let ty_generics = ty_generics_for_impl(ccx, generics); let mut ty_predicates = ty_generic_predicates_for_type_or_impl(ccx, generics); debug!(\"convert: impl_bounds={:?}\", ty_predicates);"} {"_id":"q-en-rust-98fd8470f0fa04f374dab8de32093ac13d46cc82e5151353b4ee66e3a9cfc39c","text":" // Test for #78438: ensure underline alignment with many tabs on the left, long line on the right // ignore-tidy-linelength // ignore-tidy-tab fn main() { let money = 42i32; match money { v @ 1 | 2 | 3 => panic!(\"You gave me too little money {}\", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT //~^ ERROR variable `v` is not bound in all patterns v => println!(\"Enough money {}\", v), } } "} {"_id":"q-en-rust-99435767189c6292b7f996e187992b261db742e5ecf70838937104b9863499e8","text":"#[stable(feature = \"rust1\", since = \"1.0.0\")] pub use self::mutex::{Mutex, MutexGuard}; #[stable(feature = \"rust1\", since = \"1.0.0\")] #[allow(deprecated)] pub use self::once::{Once, OnceState, ONCE_INIT}; #[stable(feature = \"rust1\", since = \"1.0.0\")] pub use crate::sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult};"} {"_id":"q-en-rust-995f9bd299b34b8865670ecc7f24a6abc3a21dc62436f45501ba4bfd4d024743","text":"let mut lifetime_to_bounds: FxHashMap<_, FxHashSet<_>> = Default::default(); let mut ty_to_traits: FxHashMap> = Default::default(); let mut ty_to_fn: FxHashMap, Option)> = Default::default(); let mut ty_to_fn: FxHashMap)> = Default::default(); for p in clean_where_predicates { let (orig_p, p) = (p, p.clean(self.cx));"} {"_id":"q-en-rust-998ce5a7fc5ed73a10b07a8b3a4a98420af6e34d65033f17b5cc9096023128a4","text":"if let mir::PlaceRef { base: &PlaceBase::Static(box Static { kind: StaticKind::Promoted(promoted, _), kind: StaticKind::Promoted(promoted, substs), ty, def_id: _, def_id, }), projection: &[], } = place.as_ref() { let c = bx.tcx().const_eval_promoted(self.instance, promoted); let c = bx.tcx().const_eval_promoted( Instance::new(def_id, self.monomorphize(&substs)), promoted, ); let (llval, ty) = self.simd_shuffle_indices( &bx, terminator.source_info.span,"} {"_id":"q-en-rust-999012b538eb07386801f970e976d709f9b01a8a370a52c0a89713dd16e224db","text":"use crate::errors::OpaqueHiddenTypeDiag; use crate::infer::{DefiningAnchor, InferCtxt, InferOk}; use crate::traits; use hir::def::DefKind; use hir::def_id::{DefId, LocalDefId}; use hir::{HirId, OpaqueTyOrigin}; use rustc_data_structures::sync::Lrc;"} {"_id":"q-en-rust-99a58b41e386ad42e1c1caf94bb987a25f615e80bb60350708b01c0f48fbbf7d","text":" struct RGB { g: f64, b: f64, } fn main() { let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); //~^ ERROR cannot find value `e` in this scope //~| ERROR cannot find value `e` in this scope //~| ERROR mismatched types let _ = RGB { r, g, b }; //~^ ERROR cannot find value `g` in this scope //~| ERROR struct `RGB` has no field named `r` //~| ERROR mismatched types } "} {"_id":"q-en-rust-99e8fdd487264f4961f91d4b1db0f3021a382901510efc39a03ff14b12418de7","text":" macro_rules! many_args { ([$($t:tt)*]#$($h:tt)*) => { many_args!{[$($t)*$($t)*]$($h)*} }; ([$($t:tt)*]) => { fn _f($($t: ()),*) {} //~ ERROR function can not have more than 65535 arguments } } many_args!{[_]########## ######} fn main() {} "} {"_id":"q-en-rust-99efb1d3836dfc4d88452875ba8fdddb45b56e7a96c462d4ea579d0f57b5e99c","text":"} item_mac(ref m) => { // FIXME #2888: we might actually want to do something here. item_mac(copy *m) // ... okay, we're doing something. It would probably be nicer // to add something to the ast_fold trait, but I'll defer // that work. item_mac(fold_mac_(m,fld)) } } }"} {"_id":"q-en-rust-99fe33717729c7a7cde21babe9bdddecc8c7cff6b96a039cd121ad5249dd4b83","text":" error: internal compiler error error: internal compiler error encountered ... with incompatible types: left-hand side has type: >::Item right-hand side has type: usize --> $DIR/select-param-env-instead-of-blanket.rs:42:5 | LL | let mut x: >::Item = bar::(); | ---------- in this inlined function call ... LL | 0usize | ^^^^^^ | = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:128:36 thread 'rustc' panicked "} {"_id":"q-en-rust-9a54589799f65ca17772a5911f76204ddba6361d869e2b6312b894d2960a6c93","text":"} } #[stable(feature = \"rust1\", since = \"1.0.0\")] impl Write for File { impl Write for &File { fn write(&mut self, buf: &[u8]) -> io::Result { self.inner.write(buf) }"} {"_id":"q-en-rust-9a70068f3c3b7f315509caa1b30288e6bb037254cb946fac7223167a489f50b5","text":" #![doc(html_logo_url = \"https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png\")] // Note: this test is paired with logo-class-default.rs. // @has logo_class/struct.SomeStruct.html '//*[@class=\"logo-container\"]/img[@src=\"https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png\"]' '' // @!has logo_class/struct.SomeStruct.html '//*[@class=\"logo-container\"]/img[@class=\"rust-logo\"]' '' // // @has logo_class/struct.SomeStruct.html '//*[@class=\"sub-logo-container\"]/img[@src=\"https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png\"]' '' // @!has logo_class/struct.SomeStruct.html '//*[@class=\"sub-logo-container\"]/img[@class=\"rust-logo\"]' '' pub struct SomeStruct; "} {"_id":"q-en-rust-9a72f6281b069ce56204eb6702e865405e1be5beabc98814d7c4b1e931a5a7e8","text":" warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/unifying-placeholders-in-query-response-2.rs:5:12 | LL | #![feature(non_lifetime_binders)] | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #108185 for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted "} {"_id":"q-en-rust-9a7fd2d89e1fad0c81cbdf730af0b05a6fa88fd16d9483a14beb2dd17330b8f8","text":" // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // The Computer Language Benchmarks Game // http://benchmarksgame.alioth.debian.org/ // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // contributed by the Rust Project Developers // Copyright (c) 2012-2014 The Rust Project Developers // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // - Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // - Neither the name of \"The Computer Language Benchmarks Game\" nor // the name of \"The Computer Language Shootout Benchmarks\" nor the // names of its contributors may be used to endorse or promote // products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. #![feature(phase)] #[phase(plugin)] extern crate green;"} {"_id":"q-en-rust-9aa747c886ba67ed723b04e24310fff65f219cd40a8cf045bdb8ebd0e53993e1","text":"} } // See comments in `interpolated_to_tokenstream` for why we care about // *probably* equal here rather than actual equality // // This is otherwise the same as `eq_unspanned`, only recursing with a // different method. pub fn probably_equal_for_proc_macro(&self, other: &TokenTree) -> bool { match (self, other) { (&TokenTree::Token(_, ref tk), &TokenTree::Token(_, ref tk2)) => { tk.probably_equal_for_proc_macro(tk2) } (&TokenTree::Delimited(_, ref dl), &TokenTree::Delimited(_, ref dl2)) => { dl.delim == dl2.delim && dl.stream().probably_equal_for_proc_macro(&dl2.stream()) } (_, _) => false, } } /// Retrieve the TokenTree's span. pub fn span(&self) -> Span { match *self {"} {"_id":"q-en-rust-9aadddc8e55230bea5a7f39939d643549395a2c39592ac3948c71d146c50416e","text":"let mut buf = [0; 2]; self.code_points.next().map(|code_point| { let c = unsafe { char::from_u32_unchecked(code_point.value) }; let n = c.encode_utf16(&mut buf).len(); let n = char::encode_utf16_raw(code_point.value, &mut buf).len(); if n == 2 { self.extra = buf[1]; }"} {"_id":"q-en-rust-9ac6cc83698af6f9c586bac34fb886ba0af73c21b32e918d510a9d5ca3f9e5b8","text":"#![omit_gdb_pretty_printer_section] // ignore-android: FIXME(#10381) // min-lldb-version: 310 // aux-build:cross_crate_spans.rs"} {"_id":"q-en-rust-9ad35718cef8166a1fd1e5ba251b14cfccb2c3d12ae631bd290960882905e9fd","text":"/// If the hash of the input doesn't match or no input is supplied via None, /// it is interpreted as an error and the corresponding enum variant is set. /// The return value signifies whether some kind of source is present. pub fn add_external_src(&self, src: Option) -> bool { pub fn add_external_src(&self, get_src: F) -> bool where F: FnOnce() -> Option { if *self.external_src.borrow() == ExternalSource::AbsentOk { let src = get_src(); let mut external_src = self.external_src.borrow_mut(); if let Some(src) = src { let mut hasher: StableHasher = StableHasher::new();"} {"_id":"q-en-rust-9ad6931871f8c5f486b1ce778c44c750f5b088ca206156ef6d6e45519986f200","text":" #![feature(const_generics)] #![allow(incomplete_features)] struct Test(*const usize); type PassArg = (); unsafe extern \"C\" fn pass(args: PassArg) { println!(\"Hello, world!\"); } impl Test { pub fn call_me(&self) { //~^ ERROR: using function pointers as const generic parameters is forbidden self.0 = Self::trampiline:: as _ } unsafe extern \"C\" fn trampiline< Args: Sized, const IDX: usize, const FN: unsafe extern \"C\" fn(Args), //~^ ERROR: using function pointers as const generic parameters is forbidden >( args: Args, ) { FN(args) } } fn main() { let x = Test(); x.call_me::() } "} {"_id":"q-en-rust-9af53743d4c0e3709a2bd747243c83639e44d503707124364dd744d82f116094","text":"#[stable(feature = \"unicode_encode_char\", since = \"1.15.0\")] #[inline] pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { let mut code = self as u32; // SAFETY: each arm checks whether there are enough bits to write into unsafe { if (code & 0xFFFF) == code && !dst.is_empty() { // The BMP falls through (assuming non-surrogate, as it should) *dst.get_unchecked_mut(0) = code as u16; slice::from_raw_parts_mut(dst.as_mut_ptr(), 1) } else if dst.len() >= 2 { // Supplementary planes break into surrogates. code -= 0x1_0000; *dst.get_unchecked_mut(0) = 0xD800 | ((code >> 10) as u16); *dst.get_unchecked_mut(1) = 0xDC00 | ((code as u16) & 0x3FF); slice::from_raw_parts_mut(dst.as_mut_ptr(), 2) } else { panic!( \"encode_utf16: need {} units to encode U+{:X}, but the buffer has {}\", from_u32_unchecked(code).len_utf16(), code, dst.len(), ) } } encode_utf16_raw(self as u32, dst) } /// Returns `true` if this `char` has the `Alphabetic` property."} {"_id":"q-en-rust-9b0e6cb5caa2c5a534fc7748fe8654e5c2d755ebcc0312dded109b0caa5e586d","text":".lifetime_ribs .iter() .rev() .take_while(|rib| !matches!(rib.kind, LifetimeRibKind::Item)) .take_while(|rib| { !matches!(rib.kind, LifetimeRibKind::Item | LifetimeRibKind::ConstParamTy) }) .flat_map(|rib| rib.bindings.iter()) .map(|(&ident, &res)| (ident, res)) .filter(|(ident, _)| ident.name != kw::UnderscoreLifetime)"} {"_id":"q-en-rust-9b24e04338b56b3bdc07a8eee5223e694c19dd35b54ae20344fb0b25a11572a6","text":"/// both arguments were negative, then it is -0.0. Subtraction `a - b` is /// regarded as a sum `a + (-b)`. /// /// For more information on floating point numbers, see [Wikipedia][wikipedia]. /// For more information on floating-point numbers, see [Wikipedia][wikipedia]. /// /// *[See also the `std::f32::consts` module](crate::f32::consts).* ///"} {"_id":"q-en-rust-9b66978004e6c3dd8adc6b45dead2b7f5a46767f3c972662e0499cd5828ae748","text":"\"num_cpus\", \"ordslice\", \"racer\", \"rand 0.6.1\", \"rand 0.7.0\", \"rayon\", \"regex\", \"rls-analysis\","} {"_id":"q-en-rust-9ba801badb2f99b1e076943b4b95922617ddd9ee9a6fb18165fe900dbb743b31","text":"AR_x86_64_pc_solaris=x86_64-pc-solaris2.10-ar CC_x86_64_pc_solaris=x86_64-pc-solaris2.10-gcc CXX_x86_64_pc_solaris=x86_64-pc-solaris2.10-g++ AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++ CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-8 CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-8 AR_x86_64_fortanix_unknown_sgx=ar "} {"_id":"q-en-rust-9bbda2951bd1d422a0299f321743b1ffc80223d3d2b4feb84ae91e1615131b62","text":" // edition:2018 use std::sync::{Arc, Mutex}; pub async fn f(_: ()) {} pub async fn run() { let x: Arc> = unimplemented!(); f(*x.lock().unwrap()).await; } "} {"_id":"q-en-rust-9bd02be5993ae69dcc6fc8a67da4388fd1f04a3f90abe5543b6da7551fd0a474","text":"E0242, // internal error looking up a definition E0245, // not a trait // E0246, // invalid recursive type // E0247, // E0319, // trait impls for defaulted traits allowed just for structs/enums E0320, // recursive overflow during dropck E0328, // cannot implement Unsize explicitly"} {"_id":"q-en-rust-9c2a02b70ad762a087fc107d73f3d567496a2772e37f2af11e76a1322ddd462f","text":" #![feature(inherent_associated_types)] #![allow(incomplete_features)] // Check that we don't crash when printing inherent projections in diagnostics. struct Foo(T); impl<'a> Foo { type Assoc = &'a (); } fn main(_: for<'a> fn(Foo::Assoc)) {} //~ ERROR `main` function has wrong type "} {"_id":"q-en-rust-9c38ffb4f1682791f9e4c52be21beb64a572a3715c82ce3e51fe7dc9539f2a27","text":"{ eprintln!( \" Couldn't find required command: ninja You should install ninja, or set `ninja=false` in config.toml in the `[llvm]` section. Couldn't find required command: ninja (or ninja-build) You should install ninja as described at , or set `ninja = false` in the `[llvm]` section of `config.toml`. Alternatively, set `download-ci-llvm = true` in that `[llvm]` section to download LLVM rather than building it. \" ); std::process::exit(1);"} {"_id":"q-en-rust-9c3d8dbdf4c94ca9946816f3289f9c8c98efa1a2a0ba3aaa8d41ea330f4a8c0a","text":"} } let inner = (self.inner)(); let prev = unsafe { let prev = self.inner.get(); self.inner.set(t as *const T as *mut T); let prev = inner.get(); inner.set(t as *const T as *mut T); prev }; let _reset = Reset { key: &self.inner, val: prev }; let _reset = Reset { key: inner, val: prev }; cb() }"} {"_id":"q-en-rust-9c41685c791a54d548dc0cc3b539baa069711c2b6d312d0da5700f30e66785cb","text":" error[E0185]: method `example` has a `&self` declaration in the impl, but not in the trait --> $DIR/argument_number_mismatch_ice.rs:8:5 | LL | fn example(val: ()); | -------------------- trait method declared without `&self` ... LL | fn example(&self, input: &i32) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl error[E0594]: cannot assign to `*input`, which is behind a `&` reference --> $DIR/argument_number_mismatch_ice.rs:10:9 | LL | *input = self.0; | ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written error: aborting due to 2 previous errors Some errors have detailed explanations: E0185, E0594. For more information about an error, try `rustc --explain E0185`. "} {"_id":"q-en-rust-9c7838ddd99d6cbfe697d6943ad5dad9600779f9b66223b84cfb63488ad713ca","text":" // Doc links in `Trait`'s methods are resolved because it has a local impl. // aux-build:issue-103463-aux.rs extern crate issue_103463_aux; use issue_103463_aux::Trait; pub struct LocalType; impl Trait for LocalType { fn method() {} } fn main() {} "} {"_id":"q-en-rust-9c973633c63d645c0de540c346f0fb7d566b555b01b7ffce3a078ac27910736e","text":" pub trait Bar: Super {} pub trait Super { type SuperAssoc; } pub trait Bound {} "} {"_id":"q-en-rust-9cb4e06e5de7b1053963f56b583e46b89ca1ac5cd753e9381625087643bfc1f0","text":"fn read_le_u16(r: &mut dyn io::Read) -> io::Result { let mut b = [0; 2]; let mut amt = 0; while amt < b.len() { match r.read(&mut b[amt..])? { 0 => return Err(io::Error::new(io::ErrorKind::Other, \"end of file\")), n => amt += n, } } r.read_exact(&mut b)?; Ok((b[0] as u16) | ((b[1] as u16) << 8)) } fn read_le_u32(r: &mut dyn io::Read) -> io::Result { let mut b = [0; 4]; r.read_exact(&mut b)?; Ok((b[0] as u32) | ((b[1] as u32) << 8) | ((b[2] as u32) << 16) | ((b[3] as u32) << 24)) } fn read_byte(r: &mut dyn io::Read) -> io::Result { match r.bytes().next() { Some(s) => s,"} {"_id":"q-en-rust-9cf02169926092446c27231c4f3c5b47b8a0683ae82af46a2e9ac1f56bba5d36","text":" // run-rustfix fn main() { for _ in 0..=255 as u8 {} //~ ERROR range endpoint is out of range for _ in 0..=(255 as u8) {} //~ ERROR range endpoint is out of range } "} {"_id":"q-en-rust-9d221e51cd2a362807ba193adf36eef93ab7adb905f4c53cfb296695da84de41","text":"}, lt_op: |region| { match region { // ignore static regions ty::ReStatic => region, // Skip static and bound regions: they don't // require substitution. ty::ReStatic | ty::ReLateBound(..) => region, _ => { trace!(\"checking {:?}\", region); for (subst, p) in opaque_defn.substs.iter().zip(&generics.params) {"} {"_id":"q-en-rust-9d2727da2c8464e422c1d1ca75c4404e61071660d0f9c6640c499dfd029d9a37","text":"// ensure struct variants get warning for their fields enum IJK { I, //~ ERROR variant is never used I, //~ ERROR variant is never constructed J { a: String, b: i32, //~ ERROR field is never used c: i32, //~ ERROR field is never used }, K //~ ERROR variant is never used K //~ ERROR variant is never constructed }"} {"_id":"q-en-rust-9d4d9387ff864fe8cb730a2278b496141e29ce8c5776435a0c79168ff86a952f","text":" // run-rustfix pub enum struct Range { //~^ ERROR `enum` and `struct` are mutually exclusive Valid { begin: u32, len: u32, }, Out, } fn main() { } "} {"_id":"q-en-rust-9dafe07c40f13e96791b3a04046d97cfd28a1a25152b8adeaf9edfe6e09f6411","text":" Subproject commit d1ddc34c4b23468f6d2bf553084834b104e16dde Subproject commit 8b6b5014fdad3a750f7242a6bfdcad83619498d4 "} {"_id":"q-en-rust-9db789eb9ce0ad62e91b3e3b6ce649e5337381d0570b1f7163831c4db438eac9","text":"wShowWindow: 0, cbReserved2: 0, lpReserved2: ptr::null_mut(), hStdInput: c::INVALID_HANDLE_VALUE, hStdOutput: c::INVALID_HANDLE_VALUE, hStdError: c::INVALID_HANDLE_VALUE, hStdInput: ptr::null_mut(), hStdOutput: ptr::null_mut(), hStdError: ptr::null_mut(), } }"} {"_id":"q-en-rust-9dcc9ff277f06ccc2008d1625a654ebe523c73b6526a464826f796ea179f3274","text":"// The first byte is special, only want bottom 5 bits for width 2, 4 bits // for width 3, and 3 bits for width 4 macro_rules! utf8_first_byte( ($byte:expr, $width:expr) => (($byte & (0x7F >> $width)) as uint) ($byte:expr, $width:expr) => (($byte & (0x7F >> $width)) as u32) ) // return the value of $ch updated with continuation byte $byte macro_rules! utf8_acc_cont_byte( ($ch:expr, $byte:expr) => (($ch << 6) | ($byte & 63u8) as uint) ($ch:expr, $byte:expr) => (($ch << 6) | ($byte & 63u8) as u32) ) static TAG_CONT_U8: u8 = 128u8; /// Converts a vector of bytes to a new utf-8 string. /// Any invalid utf-8 sequences are replaced with U+FFFD REPLACEMENT CHARACTER. /// /// # Example /// /// ```rust /// let input = bytes!(\"Hello \", 0xF0, 0x90, 0x80, \"World\"); /// let output = std::str::from_utf8_lossy(input); /// assert_eq!(output, ~\"Hello uFFFDWorld\"); /// ``` pub fn from_utf8_lossy(v: &[u8]) -> ~str { static REPLACEMENT: &'static [u8] = bytes!(0xEF, 0xBF, 0xBD); // U+FFFD in UTF-8 let mut i = 0u; let mut lastgood = 0u; let total = v.len(); fn unsafe_get(xs: &[u8], i: uint) -> u8 { unsafe { *xs.unsafe_ref(i) } } fn safe_get(xs: &[u8], i: uint, total: uint) -> u8 { if i >= total { 0 } else { unsafe_get(xs, i) } } let mut res = with_capacity(total); while i < total { let i_ = i; let byte = unsafe_get(v, i); i += 1; macro_rules! error(() => { unsafe { if lastgood != i_ { raw::push_bytes(&mut res, v.slice(lastgood, i_)); } lastgood = i; raw::push_bytes(&mut res, REPLACEMENT); } }) if byte < 128u8 { // lastgood handles this } else { let w = utf8_char_width(byte); match w { 2 => { if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } 3 => { match (byte, safe_get(v, i, total)) { (0xE0 , 0xA0 .. 0xBF) => (), (0xE1 .. 0xEC, 0x80 .. 0xBF) => (), (0xED , 0x80 .. 0x9F) => (), (0xEE .. 0xEF, 0x80 .. 0xBF) => (), _ => { error!(); continue; } } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } 4 => { match (byte, safe_get(v, i, total)) { (0xF0 , 0x90 .. 0xBF) => (), (0xF1 .. 0xF3, 0x80 .. 0xBF) => (), (0xF4 , 0x80 .. 0x8F) => (), _ => { error!(); continue; } } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; if safe_get(v, i, total) & 192u8 != TAG_CONT_U8 { error!(); continue; } i += 1; } _ => { error!(); continue; } } } } unsafe { raw::push_bytes(&mut res, v.slice(lastgood, total)) }; res } /// Unsafe operations pub mod raw { use cast;"} {"_id":"q-en-rust-9deb1b537161fb32e5ac314f2f8baba9428729c556265e3a50c13618a83dc80c","text":"debug!(\"Checking must_not_suspend for {}\", ty); match *ty.kind() { ty::Adt(..) if ty.is_box() => { let boxed_ty = ty.boxed_ty(); let descr_pre = &format!(\"{}boxed \", data.descr_pre); ty::Adt(_, args) if ty.is_box() => { let boxed_ty = args.type_at(0); let allocator_ty = args.type_at(1); check_must_not_suspend_ty( tcx, boxed_ty, hir_id, param_env, SuspendCheckData { descr_pre, ..data }, SuspendCheckData { descr_pre: &format!(\"{}boxed \", data.descr_pre), ..data }, ) || check_must_not_suspend_ty( tcx, allocator_ty, hir_id, param_env, SuspendCheckData { descr_pre: &format!(\"{}allocator \", data.descr_pre), ..data }, ) } ty::Adt(def, _) => check_must_not_suspend_def(tcx, def.did(), hir_id, data),"} {"_id":"q-en-rust-9df88eaffe91b521d61220300e1a52154b9993dffab4f01fa30139bf8c1526cf","text":"impl_from!(u32 => f64, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]); // float -> float impl_from!(f16 => f32, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]); impl_from!(f16 => f64, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]); // FIXME(f16_f128): adding additional `From` impls for existing types breaks inference. See // impl_from!(f16 => f128, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]); impl_from!(f32 => f64, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]); impl_from!(f32 => f128, #[stable(feature = \"lossless_float_conv\", since = \"1.6.0\")]);"} {"_id":"q-en-rust-9e02bfd478cef885fdfb27a53903ed3fafaf91a4c6f6548454ccb39262c540c7","text":"{ let start_len = buf.len(); let mut g = Guard { len: buf.len(), buf }; let ret; loop { if g.len == g.buf.len() { unsafe {"} {"_id":"q-en-rust-9e0b9f540292e20bad7e5ba704e6ef639832edbe29830cdd82cdd0c2444d331c","text":"lint_improper_ctypes_char_reason = the `char` type has no C equivalent lint_improper_ctypes_dyn = trait objects have no C equivalent lint_improper_ctypes_enum_phantomdata = this enum contains a PhantomData field lint_improper_ctypes_enum_repr_help = consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum"} {"_id":"q-en-rust-9e162534e483d8a9ca655cd19b09f3c2f78682a786d205bea9e8d4c1f2b84c87","text":"# riscv targets currently do not need a C compiler, as compiler_builtins # doesn't currently have it enabled, and the riscv gcc compiler is not # installed. ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc ENV CFLAGS_armv5te_unknown_linux_musleabi=\"-march=armv5te -marm -mfloat-abi=soft\" CFLAGS_arm_unknown_linux_musleabi=\"-march=armv6 -marm\" CFLAGS_arm_unknown_linux_musleabihf=\"-march=armv6 -marm -mfpu=vfp\" CFLAGS_armv7_unknown_linux_musleabihf=\"-march=armv7-a\" CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc CC_mips64_unknown_linux_muslabi64=mips64-linux-gnuabi64-gcc "} {"_id":"q-en-rust-9e1d2a2303c81f7073398861f0abde8db72ebbba6b953f8bd2a9e0940764d146","text":"// option. This file may not be copied, modified, or distributed // except according to those terms. // error-pattern:mismatched types: expected `()`, found `bool` extern crate debug; fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause: expected `()`, found `bool` (expected (), found bool) println!(\"{:?}\", a); }"} {"_id":"q-en-rust-9e25c16645d7fa93b937e53d96af3f86fcaff1d7f42a23f6d4e9206af25912f9","text":"use rustc_ast as ast; use rustc_ast::expand::allocator::AllocatorKind; use rustc_attr as attr; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::steal::Steal; use rustc_data_structures::svh::Svh; use rustc_data_structures::sync::Lrc;"} {"_id":"q-en-rust-9e3779ba40badfef10340e5a4878404bd118f489f87b3f18b3c8188c14387641","text":" running 1 test test $DIR/test-no_std.rs - f (line 9) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out "} {"_id":"q-en-rust-9e597d288eb14fbc0185e3cab9554952acdf160c23579bcb59f08cd7e6036992","text":"#[stable(feature = \"rust1\", since = \"1.0.0\")] impl fmt::Debug for RangeFull { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(\"..\", fmt) write!(fmt, \"..\") } }"} {"_id":"q-en-rust-9e995627b614b1514bc0bcdc62ed1fd83f4912bc8029ef00bda261ab49664b6c","text":"// `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | PlaceContext::NonUse(NonUseContext::AscribeUserTy) | PlaceContext::NonUse(NonUseContext::AscribeUserTy(_)) | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) | PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) |"} {"_id":"q-en-rust-9ed2e894b2f1a2985970a396be7e2ff4b3804c52b0250cb45c0db472edaeb412","text":"/// static START: Once = ONCE_INIT; /// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] #[rustc_deprecated( since = \"1.38.0\", reason = \"the `new` function is now preferred\", suggestion = \"Once::new()\", )] pub const ONCE_INIT: Once = Once::new(); // Four states that a Once can be in, encoded into the lower bits of `state` in"} {"_id":"q-en-rust-9ef16e66879a654ef86eecc14ed9f4d9b998a77e3329b46560ba17bde9758bbe","text":"// are contravariant while return-position lifetimes are // covariant). _marker: PhantomData &'a ()>, // Ensure `Context` is `!Send` and `!Sync` in order to allow // for future `!Send` and / or `!Sync` fields. _marker2: PhantomData<*mut ()>, } impl<'a> Context<'a> {"} {"_id":"q-en-rust-9ef6fdfa556b1d5716330a69bc5fdc85764b2cee730bd9be3b411d08a531996f","text":"self.check_pat_walk(&field.pat, field_ty, def_bm, true); } let mut unmentioned_fields = variant.fields .iter() .map(|field| field.ident.modern()) .filter(|ident| !used_fields.contains_key(&ident)) .collect::>(); if inexistent_fields.len() > 0 { let (field_names, t, plural) = if inexistent_fields.len() == 1 { (format!(\"a field named `{}`\", inexistent_fields[0].1), \"this\", \"\")"} {"_id":"q-en-rust-9f0119031c9d620cbcea28fb07b638038f6e3eb7b5ad7dcb5819292030e05dce","text":" // check-fail // edition:2021 // known-bug: #88908 // This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] use std::future::Future; trait Stream { type Item; } struct Empty(T); impl Stream for Empty { type Item = (); } fn empty() -> Empty { todo!() } trait X { type LineStream<'a, Repr>: Stream where Self: 'a; type LineStreamFut<'a,Repr>: Future> where Self: 'a; fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream; type LineStreamFut<'a, Repr> = impl Future> ; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { async {empty()} } } fn main() {} "} {"_id":"q-en-rust-9f372f31ec69d526d9fdb12227489f63bf93abe5300f1f97c60a202f2ef7899e","text":"use crate::traits; use rustc_hir as hir; use rustc_hir::lang_items::LangItem; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{ self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, }; use rustc_middle::ty::{GenericArg, GenericArgKind, GenericArgsRef}; use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; use rustc_span::{Span, DUMMY_SP};"} {"_id":"q-en-rust-9f8657ce201782376359767d0f5e600e1ccca258700562f5e12566c7ff95aa43","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Regression test for issue #22655: This test should not lead to // infinite recursion. unsafe impl Send for Unique { } pub struct Unique { pointer: *const T, } pub struct Node { vals: V, edges: Unique>, } fn is_send() {} fn main() { is_send::>(); } "} {"_id":"q-en-rust-9f8e8ddd3f235f52b25404a9e0c43690a9d6568e5615ec7734ea541cdba34b63","text":"ClosureKind::Coroutine(CoroutineKind::Desugared(_, CoroutineSource::Block)), .. } = move_spans && can_suggest_clone { self.suggest_cloning(err, ty, expr, None, Some(move_spans)); } else if self.suggest_hoisting_call_outside_loop(err, expr) { } else if self.suggest_hoisting_call_outside_loop(err, expr) && can_suggest_clone { // The place where the type moves would be misleading to suggest clone. // #121466 self.suggest_cloning(err, ty, expr, None, Some(move_spans));"} {"_id":"q-en-rust-9f9cfac09ad524a283bcbccb6f17892aa9c139abd26d35f11be30ca9a74a8cde","text":"} fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result { debug_assert!(!utf8.is_empty()); let mut utf16 = [MaybeUninit::::uninit(); MAX_BUFFER_SIZE / 2]; let mut len_utf16 = 0; for (chr, dest) in utf8.encode_utf16().zip(utf16.iter_mut()) { *dest = MaybeUninit::new(chr); len_utf16 += 1; } // Safety: We've initialized `len_utf16` values. let utf16: &[u16] = unsafe { MaybeUninit::slice_assume_init_ref(&utf16[..len_utf16]) }; let utf8 = &utf8[..utf8.floor_char_boundary(utf16.len())]; let utf16: &[u16] = unsafe { // Note that this theoretically checks validity twice in the (most common) case // where the underlying byte sequence is valid utf-8 (given the check in `write()`). let result = c::MultiByteToWideChar( c::CP_UTF8, // CodePage c::MB_ERR_INVALID_CHARS, // dwFlags utf8.as_ptr() as c::LPCCH, // lpMultiByteStr utf8.len() as c::c_int, // cbMultiByte utf16.as_mut_ptr() as c::LPWSTR, // lpWideCharStr utf16.len() as c::c_int, // cchWideChar ); assert!(result != 0, \"Unexpected error in MultiByteToWideChar\"); // Safety: MultiByteToWideChar initializes `result` values. MaybeUninit::slice_assume_init_ref(&utf16[..result as usize]) }; let mut written = write_u16s(handle, &utf16)?;"} {"_id":"q-en-rust-9fa6f3fe4415c30270e5b0de6bf1d9a34e99a2cca7882d379bd969ab4c7a14b6","text":" trait Trait { type Type; fn one(&self, val: impl Trait); //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied fn two>(&self) -> T; //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied fn three(&self) -> T where T: Trait,; //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied } fn main() {} "} {"_id":"q-en-rust-9fb7959aaca6d8886413c002395593625e538149e9dbed7020fc062595436655","text":"/// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase #[stable(feature = \"ascii_methods_on_intrinsics\", since = \"1.23.0\")] #[rustc_const_unstable(feature = \"const_make_ascii\", issue = \"130698\")] #[rustc_const_stable(feature = \"const_make_ascii\", since = \"CURRENT_RUSTC_VERSION\")] #[inline] #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] pub const fn make_ascii_lowercase(&mut self) { // FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions. let mut i = 0;"} {"_id":"q-en-rust-9fb7b75c2924864535fc897059b384145df86fb4aec291b115fa8e80c15f56b6","text":" fn main() { super(); //~ ERROR failed to resolve: there are too many leading `super` keywords } "} {"_id":"q-en-rust-9fc77912db91afbebab269877be6b0626295fc1531b29f91c40e96a8721190d0","text":"safety: Safety::Safe, }), }); let source_info = SourceInfo { span, scope: OUTERMOST_SOURCE_SCOPE }; // Some MIR passes will expect the number of parameters to match the // function declaration. for _ in 0..num_params { local_decls.push(LocalDecl::with_source_info(ty, source_info)); } cfg.terminate(START_BLOCK, source_info, TerminatorKind::Unreachable); let mut body = Body::new( MirSource::item(def.to_def_id()), MirSource::item(def_id.to_def_id()), cfg.basic_blocks, source_scopes, local_decls, IndexVec::new(), num_params, inputs.len(), vec![], span, coroutine_kind, Some(err), Some(guar), ); body.coroutine.as_mut().map(|gen| gen.yield_ty = Some(ty)); body.coroutine.as_mut().map(|gen| gen.yield_ty = yield_ty); body }"} {"_id":"q-en-rust-a00840a7caacf7682f470ca6b4350c2322113fe752d3a67a2121c208b482ee49","text":"Ok(amount as usize) } #[allow(unused)] fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result { let mut written = 0; for chr in char::decode_utf16(utf16.iter().cloned()) { match chr { Ok(chr) => { chr.encode_utf8(&mut utf8[written..]); written += chr.len_utf8(); } Err(_) => { // We can't really do any better than forget all data and return an error. return Err(io::const_io_error!( io::ErrorKind::InvalidData, \"Windows stdin in console mode does not support non-UTF-16 input; encountered unpaired surrogate\", )); } } debug_assert!(utf16.len() <= c::c_int::MAX as usize); debug_assert!(utf8.len() <= c::c_int::MAX as usize); let result = unsafe { c::WideCharToMultiByte( c::CP_UTF8, // CodePage c::WC_ERR_INVALID_CHARS, // dwFlags utf16.as_ptr(), // lpWideCharStr utf16.len() as c::c_int, // cchWideChar utf8.as_mut_ptr() as c::LPSTR, // lpMultiByteStr utf8.len() as c::c_int, // cbMultiByte ptr::null(), // lpDefaultChar ptr::null_mut(), // lpUsedDefaultChar ) }; if result == 0 { // We can't really do any better than forget all data and return an error. Err(io::const_io_error!( io::ErrorKind::InvalidData, \"Windows stdin in console mode does not support non-UTF-16 input; encountered unpaired surrogate\", )) } else { Ok(result as usize) } Ok(written) } impl IncompleteUtf8 {"} {"_id":"q-en-rust-a0351748c9cbf73d77aeccbb984243628302e70247d814c6850fe281764deec1","text":" error: expected one of `!` or `::`, found `` --> $DIR/test-compile-fail2.rs:3:1 | 3 | fail | ^^^^ expected one of `!` or `::` error: aborting due to previous error "} {"_id":"q-en-rust-a04376a1f97b3f4d17a60a41d76f50be034dedd773e47ee7a991ac377c13ff07","text":"assert_eq!(nread, 1); assert_eq!(buf[0], 99); } Err(..) => fail!() Err(..) => fail!(), } } Err(..) => fail!()"} {"_id":"q-en-rust-a062f7ce3b2b9a7bdac0fb4fef749dd2202138acbf0eade4624a3641b8e67b4c","text":"false } } fn ignore_llvm(config: &Config, line: &str) -> bool { if let Some(ref actual_version) = config.llvm_version { if line.contains(\"min-llvm-version\") { let min_version = line.trim() .split(' ') .last() .expect(\"Malformed llvm version directive\"); // Ignore if actual version is smaller the minimum required // version &actual_version[..] < min_version } else { false } } else { false } } } }"} {"_id":"q-en-rust-a091d78f815bb06de57744cdfa326e57cfaf6f8c8a33a01a5707afbaea99d807","text":"// resolve Self::Foo, at the moment we can't resolve the former because // we don't have the trait information around, which is just sad. if !base_segments.is_empty() { let id_node = tcx.map.as_local_node_id(id).unwrap(); span_err!(tcx.sess, span, E0247, \"found module name used as a type: {}\", tcx.map.node_to_user_string(id_node)); return this.tcx().types.err; } assert!(base_segments.is_empty()); opt_self_ty.expect(\"missing T in ::a::b::c\") }"} {"_id":"q-en-rust-a0df95f6c0155d1f330f444e6806b5c0ea06795206b068bd61f0d3707a12ce86","text":"use back::svh::Svh; use session::{config, Session}; use session::search_paths::PathKind; use metadata::common::rustc_version; use metadata::cstore; use metadata::cstore::{CStore, CrateSource, MetadataBlob}; use metadata::decoder;"} {"_id":"q-en-rust-a0e58996ffd8f8577fa88f608132d77e514da3cb89e702eccb49e1446ebad497","text":"curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | tar xzf - --strip-components=1 yum install -y patch patch -Np1 < ../llvm-project-centos.patch mkdir clang-build cd clang-build"} {"_id":"q-en-rust-a1362e96a8a083fc5b3f54b71abc29c89f21f7fc4965bf129e6fec78aecbe612","text":"/// # } /// ``` #[stable(feature = \"rust1\", since = \"1.0.0\")] #[inline] pub fn from_raw_os_error(code: i32) -> Error { Error { repr: Repr::Os(code) } }"} {"_id":"q-en-rust-a156ca6ee613c9794abd139882a75ae03bd140a97d632d595ecbbbc440ccdd60","text":"LitKind::Int(_, LitIntType::Unsuffixed) => \"\", _ => bug!(), }; cx.emit_spanned_lint( OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { ty, suggestion: struct_expr.span, let sub_sugg = if expr.span.lo() == lit_span.lo() { let Ok(start) = cx.sess().source_map().span_to_snippet(eps[0].span) else { return false }; UseInclusiveRange::WithoutParen { sugg: struct_expr.span.shrink_to_lo().to(lit_span.shrink_to_hi()), start, literal: lit_val - 1, suffix, }, } } else { UseInclusiveRange::WithParen { eq_sugg: expr.span.shrink_to_lo(), lit_sugg: lit_span, literal: lit_val - 1, suffix, } }; cx.emit_spanned_lint( OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { ty, sub: sub_sugg }, ); // We've just emitted a lint, special cased for `(...)..MAX+1` ranges,"} {"_id":"q-en-rust-a1ad6bfc925b78163dbc90c83afc69899ba8d4f5ed1e48fd9f78997a3598189e","text":"std::env::set_var(\"RUST_BACKTRACE\", \"full\"); } panic::set_hook(Box::new(move |info| { // If the error was caused by a broken pipe then this is not a bug. // Write the error and return immediately. See #98700. #[cfg(windows)] if let Some(msg) = info.payload().downcast_ref::() { if msg.starts_with(\"failed printing to stdout: \") && msg.ends_with(\"(os error 232)\") { // the error code is already going to be reported when the panic unwinds up the stack let handler = EarlyErrorHandler::new(ErrorOutputType::default()); let _ = handler.early_error_no_abort(msg.clone()); return; } }; // Invoke the default handler, which prints the actual panic message and optionally a backtrace // Don't do this for delayed bugs, which already emit their own more useful backtrace. if !info.payload().is::() { std::panic_hook_with_disk_dump(info, ice_path().as_deref()); panic::update_hook(Box::new( move |default_hook: &(dyn Fn(&PanicInfo<'_>) + Send + Sync + 'static), info: &PanicInfo<'_>| { // If the error was caused by a broken pipe then this is not a bug. // Write the error and return immediately. See #98700. #[cfg(windows)] if let Some(msg) = info.payload().downcast_ref::() { if msg.starts_with(\"failed printing to stdout: \") && msg.ends_with(\"(os error 232)\") { // the error code is already going to be reported when the panic unwinds up the stack let handler = EarlyErrorHandler::new(ErrorOutputType::default()); let _ = handler.early_error_no_abort(msg.clone()); return; } }; // Separate the output with an empty line eprintln!(); } // Invoke the default handler, which prints the actual panic message and optionally a backtrace // Don't do this for delayed bugs, which already emit their own more useful backtrace. if !info.payload().is::() { default_hook(info); // Separate the output with an empty line eprintln!(); if let Some(ice_path) = ice_path() && let Ok(mut out) = File::options().create(true).append(true).open(&ice_path) { // The current implementation always returns `Some`. let location = info.location().unwrap(); let msg = match info.payload().downcast_ref::<&'static str>() { Some(s) => *s, None => match info.payload().downcast_ref::() { Some(s) => &s[..], None => \"Box\", }, }; let thread = std::thread::current(); let name = thread.name().unwrap_or(\"\"); let _ = write!( &mut out, \"thread '{name}' panicked at {location}:n {msg}n stack backtrace:n {:#}\", std::backtrace::Backtrace::force_capture() ); } } // Print the ICE message report_ice(info, bug_report_url, extra_info); })); // Print the ICE message report_ice(info, bug_report_url, extra_info); }, )); } /// Prints the ICE message, including query stack, but without backtrace."} {"_id":"q-en-rust-a1b0fa200d84ba83e99606ef7f40981ddfd4aaa3ad49018c878121957d5eef1b","text":"match expr.kind { hir::ExprKind::Index(ref base_expr, ref index_expr) => { let index_expr_ty = self.node_ty(index_expr.hir_id); // We need to get the final type in case dereferences were needed for the trait // to apply (#72002). let index_expr_ty = self.tables.borrow().expr_ty_adjusted(index_expr); self.convert_place_op_to_mutable( PlaceOp::Index, expr,"} {"_id":"q-en-rust-a1c625df8c84dbb665cbe7a694ffc00b2ce70665d0e14f4bf290a3542918c55a","text":"/// /// # Safety /// /// The resulting pointer does not need to be in bounds, but it is /// potentially hazardous to dereference (which requires `unsafe`). /// This operation itself is always safe, but using the resulting pointer is not. /// /// The resulting pointer remains attached to the same allocated object that `self` points to. /// It may *not* be used to access a different allocated object. Note that in Rust, every /// (stack-allocated) variable is considered a separate allocated object. /// /// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z` /// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still /// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless /// `x` and `y` point into the same allocated object. /// /// In particular, the resulting pointer remains attached to the same allocated /// object that `self` points to. It may *not* be used to access a /// different allocated object. Note that in Rust, /// every (stack-allocated) variable is considered a separate allocated object. /// Compared to [`add`], this method basically delays the requirement of staying within the /// same allocated object: [`add`] is immediate Undefined Behavior when crossing object /// boundaries; `wrapping_add` produces a pointer but still leads to Undefined Behavior if a /// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`add`] /// can be optimized better and is thus preferable in performance-sensitive code. /// /// Compared to [`add`], this method basically delays the requirement of staying /// within the same allocated object: [`add`] is immediate Undefined Behavior when /// crossing object boundaries; `wrapping_add` produces a pointer but still leads /// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized /// better and is thus preferable in performance-sensitive code. /// The delayed check only considers the value of the pointer that was dereferenced, not the /// intermediate values used during the computation of the final result. For example, /// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the /// allocated object and then re-entering it later is permitted. /// /// If you need to cross object boundaries, cast the pointer to an integer and /// do the arithmetic there."} {"_id":"q-en-rust-a1c6539819c0f1f94754b5a3eb686e9b97609f45881bc83b20dc50993772bef1","text":"if trait_.def_id() == tcx.lang_items().deref_trait() { super::build_deref_target_impls(cx, &trait_items, ret); } // Return if the trait itself or any types of the generic parameters are doc(hidden). let mut stack: Vec<&Type> = trait_.iter().collect(); stack.push(&for_); while let Some(ty) = stack.pop() { if let Some(did) = ty.def_id() { if cx.tcx.get_attrs(did).lists(sym::doc).has_word(sym::hidden) { return; } } if let Some(generics) = ty.generics() { stack.extend(generics); } } if let Some(trait_did) = trait_.def_id() { record_extern_trait(cx, trait_did); }"} {"_id":"q-en-rust-a202f8e24f8e25c61374d279d035679124a1fb6b954935bb0b64706eea015826","text":"}, }; let mut prev = eraser.fold_ty(ty); let mut prev_span = None; let mut prev_span: Option = None; for binding in expr_finder.uses { // In every expression where the binding is referenced, we will look at that"} {"_id":"q-en-rust-a20e428af82974c83f78bc77be7d3742355f82d8e1b5e272ac1a9a76d2299ca6","text":"sp } fn ensure_filemap_source_present(&self, file_map: Rc) -> bool { let src = self.file_loader.read_file(Path::new(&file_map.name)).ok(); return file_map.add_external_src(src) file_map.add_external_src( || self.file_loader.read_file(Path::new(&file_map.name)).ok() ) } }"} {"_id":"q-en-rust-a21b3b2d7da3c6ac1a55eb64b0948da421e3f1d35ced17110c2299866f1b1c3e","text":" error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/unstable-const-fn-in-libcore.rs:24:26 | LL | Opt::None => f(), | ^^^ error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/unstable-const-fn-in-libcore.rs:19:53 | LL | const fn unwrap_or_else T>(self, f: F) -> T { | ^ constant functions cannot evaluate destructors error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/unstable-const-fn-in-libcore.rs:19:47 | LL | const fn unwrap_or_else T>(self, f: F) -> T { | ^^^^ constant functions cannot evaluate destructors error: aborting due to 3 previous errors Some errors have detailed explanations: E0015, E0493. For more information about an error, try `rustc --explain E0015`. "} {"_id":"q-en-rust-a24efe13733f807c953f2ae13733f92aa4a5c44a888fbec83cdf3ad2346b5982","text":"return noop_visit_attribute(at, self); } let filename = self.cx.resolve_path(&*file.as_str(), it.span()); let filename = match self.cx.resolve_path(&*file.as_str(), it.span()) { Ok(filename) => filename, Err(mut err) => { err.emit(); continue; } }; match self.cx.source_map().load_file(&filename) { Ok(source_file) => { let src = source_file.src.as_ref()"} {"_id":"q-en-rust-a25e8ba0316bf14b24c0f114cd5cddfe4a2a25708fc2210c9c4c2820a4ff6279","text":"14 | println!(\"Hello, World!\"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expands to `println! { \"Hello, World!\" }` = note: expands to `print! { concat ! ( \"Hello, World!\" , \"/n\" ) }` = note: expanding `println! { \"Hello, World!\" }` = note: to `print ! ( concat ! ( \"Hello, World!\" , \"/n\" ) )` = note: expanding `print! { concat ! ( \"Hello, World!\" , \"/n\" ) }` = note: to `$crate :: io :: _print ( format_args ! ( concat ! ( \"Hello, World!\" , \"/n\" ) ) )` "} {"_id":"q-en-rust-a2758b9b1e22620c729fe6690090f83f342f595604fa09e3d46d6773f68ed07e","text":"ulimit -c unlimited fi # There was a bad interaction between \"old\" 32-bit binaries on current 64-bit # kernels with selinux enabled, where ASLR mmap would sometimes choose a low # address and then block it for being below `vm.mmap_min_addr` -> `EACCES`. # This is probably a kernel bug, but setting `ulimit -Hs` works around it. # See also `dist-i686-linux` where this setting is enabled. if [ \"$SET_HARD_RLIMIT_STACK\" = \"1\" ]; then rlimit_stack=$(ulimit -Ss) if [ \"$rlimit_stack\" != \"\" ]; then ulimit -Hs \"$rlimit_stack\" fi fi ci_dir=`cd $(dirname $0) && pwd` source \"$ci_dir/shared.sh\""} {"_id":"q-en-rust-a2d8a07a286c14fc71dae175038c828db4b391b45d3cb9a878cfe685114c7d2e","text":"checksum = \"d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd\" [[package]] name = \"semver\" version = \"1.0.17\" source = \"registry+https://github.com/rust-lang/crates.io-index\" checksum = \"bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed\" [[package]] name = \"serde\" version = \"1.0.137\" source = \"registry+https://github.com/rust-lang/crates.io-index\""} {"_id":"q-en-rust-a311852b364fe2dac282a4d1f8036a3fcda72dbef374dd374ab3caa364470496","text":" error[E0026]: variant `A::A` does not have a field named `fob` --> $DIR/issue-52717.rs:19:12 | LL | A::A { fob } => { println!(\"{}\", fob); } | ^^^ | | | variant `A::A` does not have this field | help: did you mean: `foo` error: aborting due to previous error For more information about this error, try `rustc --explain E0026`. "} {"_id":"q-en-rust-a336b5a22fcac3c36893dfabf8f6280f322a414d3b5d00078fe562a5f3f5d818","text":"} }; let yielded = opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span)); if is_async_gen { // `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`. // This ensures that we store our resumed `ResumeContext` correctly, and also that"} {"_id":"q-en-rust-a34b1dfbe4301ed4092cc4baaf5dcaff2e179fc99332d7e1cbb45b31e3745f98","text":"ty::Dynamic(ref data, ..) if data.principal_def_id().is_some() => { self.check_def_id(item, data.principal_def_id().unwrap()); } ty::Dynamic(..) => { struct_span_err!( self.tcx.sess, ty.span, E0785, \"cannot define inherent `impl` for a dyn auto trait\" ) .span_label(ty.span, \"impl requires at least one non-auto trait\") .note(\"define and implement a new trait or type instead\") .emit(); } ty::Bool => { self.check_primitive_impl( item.def_id,"} {"_id":"q-en-rust-a34c9a4ac6e1de46093ac365a471622d84df5cb6b25d9839c4f0e9b4058cff30","text":"Some((destination, success)) }, from_hir_call, fn_span fn_span, }, ); success.unit()"} {"_id":"q-en-rust-a34d2c0d6a763fb3fc97c408518257707d5152e95c9c53a3fd3d95e161890260","text":"/// # Example /// /// ```rust /// # #![allow(deprecated)] /// use url::encode; /// /// let url = encode(\"https://example.com/Rust (programming language)\");"} {"_id":"q-en-rust-a4122a8f311d07af58ab34f8cbb37adc19bd4e7abce959975f7b868a0039f465","text":"} } fn int_ty_bits(int_ty: ast::IntTy) -> u64 { match int_ty { ast::TyI => int::BITS as u64, ast::TyI8 => i8::BITS as u64, ast::TyI16 => i16::BITS as u64, ast::TyI32 => i32::BITS as u64, ast::TyI64 => i64::BITS as u64 } } fn uint_ty_bits(uint_ty: ast::UintTy) -> u64 { match uint_ty { ast::TyU => uint::BITS as u64, ast::TyU8 => u8::BITS as u64, ast::TyU16 => u16::BITS as u64, ast::TyU32 => u32::BITS as u64, ast::TyU64 => u64::BITS as u64 } } fn check_limits(tcx: &ty::ctxt, binop: ast::BinOp, l: &ast::Expr, r: &ast::Expr) -> bool { let (lit, expr, swap) = match (&l.node, &r.node) {"} {"_id":"q-en-rust-a4183c9880daa283f11bda1ba84ce9adcd47d8dfc53f9012549f5ee9e84da5d0","text":"/// # Example /// /// ```rust /// # #![allow(deprecated)] /// let query = vec![(\"title\".to_string(), \"The Village\".to_string()), /// (\"north\".to_string(), \"52.91\".to_string()), /// (\"west\".to_string(), \"4.10\".to_string())];"} {"_id":"q-en-rust-a425ff874269111b610557605c028df4befcde41f3fbcd9ed7d5daa683605032","text":"synth_provided, } } else { let num_missing_args = expected_max - provided; // Check if associated type bounds are incorrectly written in impl block header like: // ``` // trait Foo {} // impl Foo for u8 {} // ``` let parent_is_impl_block = cx .tcx() .hir() .parent_owner_iter(seg.hir_id) .next() .is_some_and(|(_, owner_node)| owner_node.is_impl_block()); if parent_is_impl_block { let constraint_names: Vec<_> = gen_args.constraints.iter().map(|b| b.ident.name).collect(); let param_names: Vec<_> = gen_params .own_params .iter() .filter(|param| !has_self || param.index != 0) // Assumes `Self` will always be the first parameter .map(|param| param.name) .collect(); if constraint_names == param_names { // We set this to true and delay emitting `WrongNumberOfGenericArgs` // to provide a succinct error for cases like issue #113073 all_params_are_binded = true; }; } let constraint_names: Vec<_> = gen_args.constraints.iter().map(|b| b.ident.name).collect(); let param_names: Vec<_> = gen_params .own_params .iter() .filter(|param| !has_self || param.index != 0) // Assumes `Self` will always be the first parameter .map(|param| param.name) .collect(); if constraint_names == param_names { // We set this to true and delay emitting `WrongNumberOfGenericArgs` // to provide a succinct error for cases like issue #113073 all_params_are_binded = true; }; let num_missing_args = expected_max - provided; GenericArgsInfo::MissingTypesOrConsts { num_missing_args,"} {"_id":"q-en-rust-a467c84f6561ef952ebed0664b51aa7186171d4cb7f1efc2f9c57508f272323b","text":"//@aux-build:proc_macro_attr.rs:proc-macro // Flaky test, see https://github.com/rust-lang/rust/issues/113585. //@ignore-32bit //@ignore-64bit #![warn(clippy::needless_arbitrary_self_type)]"} {"_id":"q-en-rust-a46b547357d3d5565e8b68008765a8692161e3e371a8e25b99f855c695403eff","text":" error[E0308]: mismatched types --> $DIR/issue-117669.rs:2:20 | LL | let abs: i32 = 3i32.checked_abs(); | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found `Option` | | | expected due to this | = note: expected type `i32` found enum `Option` help: consider using `Option::expect` to unwrap the `Option` value, panicking if the value is an `Option::None` | LL | let abs: i32 = 3i32.checked_abs().expect(\"REASON\"); | +++++++++++++++++ error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. "} {"_id":"q-en-rust-a47ad4e589120bd32b7bd3f7ddb0980ee482ec66ef6a1652390f2bad3f4fb853","text":"/// # Examples /// /// ```no_run /// # #![feature(bufreader_buffer)] /// use std::io::{BufReader, BufRead}; /// use std::fs::File; ///"} {"_id":"q-en-rust-a497242f111f376b5d82038348f459aebf21277bb68683b74471fbaaff1e129a","text":"traits::RepeatVec => { tcx.sess.span_note( obligation.cause.span, format!( \"the `Copy` trait is required because the repeated element will be copied\").as_slice()); \"the `Copy` trait is required because the repeated element will be copied\"); } traits::VariableType(_) => { tcx.sess.span_note( obligation.cause.span, \"all local variables must have a statically known size\"); } traits::ReturnType => { tcx.sess.span_note( obligation.cause.span, \"the return type of a function must have a statically known size\"); } traits::AssignmentLhsSized => { tcx.sess.span_note( obligation.cause.span,"} {"_id":"q-en-rust-a4b62f2358e76a720fb1dd618135492f69bd3e5c06065130b921396d7c45c8f9","text":"let f1: f32 = FromStrRadix::from_str_radix(\"1p-123\", 16).unwrap(); let f2: f32 = FromStrRadix::from_str_radix(\"1p-111\", 16).unwrap(); let f3: f32 = FromStrRadix::from_str_radix(\"1.Cp-12\", 16).unwrap(); assert_eq!(Float::ldexp(1f32, -123), f1); assert_eq!(Float::ldexp(1f32, -111), f2); assert_eq!(1f32.ldexp(-123), f1); assert_eq!(1f32.ldexp(-111), f2); assert_eq!(Float::ldexp(1.75f32, -12), f3); assert_eq!(Float::ldexp(0f32, -123), 0f32);"} {"_id":"q-en-rust-a4e8dc88c78e407d670fe28e937b4afb373df6532700562b27f721282c08b0b7","text":" error: an inner attribute is not permitted in this context --> $DIR/issue-89971-outer-attr-following-inner-attr-ice.rs:11:1 | LL | #![deny(missing_docs)] | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | struct Mew(); | ------------- the inner attribute doesn't annotate this struct | = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files help: to annotate the struct, change the attribute from inner to outer style | LL - #![deny(missing_docs)] LL + #[deny(missing_docs)] | error: aborting due to previous error "} {"_id":"q-en-rust-a5261fce819135d2e62386b006710dc10c88fb761e13852cd7a21c4da565b082","text":" // run-rustfix // Regression test for changes introduced while fixing #54505 // This test uses non-literals for Ranges // (expecting no parens with borrow suggestion) use std::ops::RangeBounds; // take a reference to any built-in range fn take_range(_r: &impl RangeBounds) {} fn main() { take_range(&std::ops::Range { start: 0, end: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::Range { start: 0, end: 1 } take_range(&::std::ops::Range { start: 0, end: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::Range { start: 0, end: 1 } take_range(&std::ops::RangeFrom { start: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeFrom { start: 1 } take_range(&::std::ops::RangeFrom { start: 1 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeFrom { start: 1 } take_range(&std::ops::RangeFull {}); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeFull {} take_range(&::std::ops::RangeFull {}); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeFull {} take_range(&std::ops::RangeInclusive::new(0, 1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeInclusive::new(0, 1) take_range(&::std::ops::RangeInclusive::new(0, 1)); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeInclusive::new(0, 1) take_range(&std::ops::RangeTo { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeTo { end: 5 } take_range(&::std::ops::RangeTo { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeTo { end: 5 } take_range(&std::ops::RangeToInclusive { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &std::ops::RangeToInclusive { end: 5 } take_range(&::std::ops::RangeToInclusive { end: 5 }); //~^ ERROR mismatched types [E0308] //~| HELP consider borrowing here //~| SUGGESTION &::std::ops::RangeToInclusive { end: 5 } } "} {"_id":"q-en-rust-a59b55158a5dc95af18830535c9a5b67b71ebc36b21683f3a0abd8ccd90dff66","text":" error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:4:30 | LL | fn one(&self, val: impl Trait); | ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait { | ^^^^^ ---- help: add missing generic argument | LL | fn one(&self, val: impl Trait); | +++++ error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:7:15 | LL | fn two>(&self) -> T; | ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait { | ^^^^^ ---- help: add missing generic argument | LL | fn two>(&self) -> T; | +++++ error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/name-same-as-generic-type-issue-128249.rs:11:12 | LL | T: Trait,; | ^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Type` --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7 | LL | trait Trait { | ^^^^^ ---- help: add missing generic argument | LL | T: Trait,; | +++++ error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0107`. "} {"_id":"q-en-rust-a5b01cc1350dd90d729b4df8d842cd3fe0a568cb45ae72dee075af8602658761","text":".emit(); } EscapeError::MoreThanOneChar => { let msg = if mode.is_bytes() { \"if you meant to write a byte string literal, use double quotes\" } else { \"if you meant to write a `str` literal, use double quotes\" }; handler .struct_span_err( span_with_quotes,"} {"_id":"q-en-rust-a5b534aecad274f798d8c37383a0bb35eba267e6b48b2d0b9df28b7745288e9b","text":"#[stable(feature = \"ip_u32\", since = \"1.1.0\")] impl From for u32 { /// It performs the conversion in network order (big-endian). fn from(ip: Ipv4Addr) -> u32 { let ip = ip.octets(); ((ip[0] as u32) << 24) + ((ip[1] as u32) << 16) + ((ip[2] as u32) << 8) + (ip[3] as u32)"} {"_id":"q-en-rust-a5be1f5f338d7407f11783dd269bc2d0937f2ae62b22f12a1ea33b6a961d3aa3","text":"// it. We do not write to `self` nor reborrow to a mutable reference. // Hence the raw pointer we created above, for `deque`, remains valid. let ring = self.buffer_as_slice(); let iter = Iter::new(ring, drain_tail, drain_head); Drain::new(drain_head, head, iter, deque) Drain::new(drain_head, head, ring, drain_tail, drain_head, deque) } }"} {"_id":"q-en-rust-a641f4fc59fccff35daff2ae299ead667d74991b740c6c53db940648d7ea4397","text":".map(|v| v.parse().expect(\"failed to parse rust.llvm-libunwind\")); if let Some(ref backends) = rust.codegen_backends { config.rust_codegen_backends = backends.iter().map(|s| INTERNER.intern_str(s)).collect(); let available_backends = vec![\"llvm\", \"cranelift\", \"gcc\"]; config.rust_codegen_backends = backends.iter().map(|s| { if let Some(backend) = s.strip_prefix(CODEGEN_BACKEND_PREFIX) { if available_backends.contains(&backend) { panic!(\"Invalid value '{s}' for 'rust.codegen-backends'. Instead, please use '{backend}'.\"); } else { println!(\"help: '{s}' for 'rust.codegen-backends' might fail. Codegen backends are mostly defined without the '{CODEGEN_BACKEND_PREFIX}' prefix. In this case, it would be referred to as '{backend}'.\"); } } INTERNER.intern_str(s) }).collect(); } config.rust_codegen_units = rust.codegen_units.map(threads_from_config);"} {"_id":"q-en-rust-a6695d432205e8cc61092c1778722c67b744bc1cc35c142a733f14d57cca7010","text":"[[package]] name = \"backtrace\" version = \"0.3.25\" version = \"0.3.29\" source = \"registry+https://github.com/rust-lang/crates.io-index\" dependencies = [ \"autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)\","} {"_id":"q-en-rust-a66c4a786fbd89b1e7522a77fefd0c8f58f47b611a4fed29ef1fae21cf179499","text":"// Private support modules mod panicking; #[unstable(feature = \"ice_to_disk\", issue = \"none\")] pub use panicking::panic_hook_with_disk_dump; #[path = \"../../backtrace/src/lib.rs\"] #[allow(dead_code, unused_attributes, fuzzy_provenance_casts)] mod backtrace_rs;"} {"_id":"q-en-rust-a6899b34f310834c2ab7c29a421ce77e0e53837f059afdf8a41aea6ce2de669d","text":"b, index: 0, // unused len: 0, // unused a_len: 0, // unused } }"} {"_id":"q-en-rust-a6a5a26251df1cd5f28925023780f503ae1ad1119392bf0ae439f58f1f25abc6","text":"let codegen_options = CodegenOptions::build(early_dcx, matches); let unstable_opts = UnstableOptions::build(early_dcx, matches); let force_unstable_if_unmarked = unstable_opts.force_unstable_if_unmarked; let dcx = new_dcx(error_format, None, diagnostic_width, &unstable_opts);"} {"_id":"q-en-rust-a6a7fc8c47a0b6d30a2c080967fe5cf7900d031a436b2048a4a8be21516eeae3","text":"// This zip may have several times the same lifetime in `substs` paired with a different // lifetime from `id_substs`. Simply `collect`ing the iterator is the correct behaviour: // it will pick the last one, which is the one we introduced in the impl-trait desugaring. let map = substs.iter().zip(id_substs); let map: FxHashMap, GenericArg<'tcx>> = match origin { // HACK: The HIR lowering for async fn does not generate // any `+ Captures<'x>` bounds for the `impl Future<...>`, so all async fns with lifetimes // would now fail to compile. We should probably just make hir lowering fill this in properly. OpaqueTyOrigin::AsyncFn(_) => map.collect(), OpaqueTyOrigin::FnReturn(_) | OpaqueTyOrigin::TyAlias => { // Opaque types may only use regions that are bound. So for // ```rust // type Foo<'a, 'b, 'c> = impl Trait<'a> + 'b; // ``` // we may not use `'c` in the hidden type. let variances = tcx.variances_of(def_id); debug!(?variances); map.filter(|(_, v)| { let ty::GenericArgKind::Lifetime(lt) = v.unpack() else { return true }; let ty::ReEarlyBound(ebr) = lt.kind() else { bug!() }; variances[ebr.index as usize] == ty::Variance::Invariant }) .collect() } }; let map = substs.iter().zip(id_substs).collect(); debug!(\"map = {:#?}\", map); // Convert the type from the function into a type valid outside"} {"_id":"q-en-rust-a6ad57d02fb54f58efc21ba60f89dbfc0e2e77bcba44faad4f53dd9a243895f4","text":"} #[test] fn test_line_buffer_fail_flush() { // Issue #32085 struct FailFlushWriter<'a>(&'a mut Vec); impl<'a> Write for FailFlushWriter<'a> { fn write(&mut self, buf: &[u8]) -> io::Result { self.0.extend_from_slice(buf); Ok(buf.len()) } fn flush(&mut self) -> io::Result<()> { Err(io::Error::new(io::ErrorKind::Other, \"flush failed\")) } } let mut buf = Vec::new(); { let mut writer = LineWriter::new(FailFlushWriter(&mut buf)); let to_write = b\"abcndef\"; if let Ok(written) = writer.write(to_write) { assert!(written < to_write.len(), \"didn't flush on new line\"); // PASS return; } } assert!(buf.is_empty(), \"write returned an error but wrote data\"); } #[test] fn test_line_buffer() { let mut writer = LineWriter::new(Vec::new()); writer.write(&[0]).unwrap();"} {"_id":"q-en-rust-a6b47e44c72f8ac1c20c09a095ad68eb29f899635579d088c0a8aeb6eb3fed2a","text":"} #[test] #[allow(deprecated)] fn stream_smoke_test_ip4() { let server_ip = next_test_ip4(); let client_ip = next_test_ip4(); let dummy_ip = next_test_ip4(); let (tx1, rx1) = channel(); let (tx2, rx2) = channel(); spawn(proc() { match UdpSocket::bind(client_ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); rx1.recv(); stream.write([99]).unwrap(); let send_as = |ip, val: &[u8]| { match UdpSocket::bind(ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); stream.write(val).unwrap(); } Err(..) => fail!() } Err(..) => fail!() } }; rx1.recv(); send_as(dummy_ip, [98]); send_as(client_ip, [99]); tx2.send(()); });"} {"_id":"q-en-rust-a6c7853d1847da828602f36304f5a58f058cda1ac8faa52c55874f6f26ae9a64","text":"} } // This is only used by a test which asserts that the initialization-tracking is correct. #[cfg(test)] impl BufReader { pub fn initialized(&self) -> usize { self.buf.initialized() } } impl BufReader { /// Seeks relative to the current position. If the new position lies within the buffer, /// the buffer will not be flushed, allowing for more efficient seeks."} {"_id":"q-en-rust-a6ca8761a61f277d2f2ef4b5a2b0537700d74007d41f12d2f3c382b157a95b88","text":" //@ run-rustfix #![allow(unused_mut)] use std::borrow::{Borrow, BorrowMut}; use std::convert::{AsMut, AsRef}; struct Bar; impl AsRef for Bar { fn as_ref(&self) -> &Bar { self } } impl AsMut for Bar { fn as_mut(&mut self) -> &mut Bar { self } } fn foo>(_: T) {} fn qux>(_: T) {} fn bat>(_: T) {} fn baz>(_: T) {} pub fn main() { let bar = Bar; foo(bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; qux(bar); let _baa = bar; //~ ERROR use of moved value let bar = Bar; bat(bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; baz(bar); let _baa = bar; //~ ERROR use of moved value } "} {"_id":"q-en-rust-a6e8e45403841d1ed285102c9d40a9be25c34289ade7c46e4216edd0e8484902","text":"/// consolidate multiple unresolved import errors into a single diagnostic. fn finalize_import(&mut self, import: &'b Import<'b>) -> Option { let orig_vis = import.vis.replace(ty::Visibility::Invisible); let orig_unusable_binding = match &import.kind { ImportKind::Single { target_bindings, .. } => { Some(mem::replace(&mut self.r.unusable_binding, target_bindings[TypeNS].get())) } _ => None, }; let prev_ambiguity_errors_len = self.r.ambiguity_errors.len(); let path_res = self.r.resolve_path( &import.module_path,"} {"_id":"q-en-rust-a6ec901edd2543d49f483c15447b28d14c4244dda8e8bdb0e1a4b72cd20e92c9","text":" #![allow(unused)] fn main() { let arr = &[0,1,2,3]; for _i in 0..arr.len().rev() { //~ERROR not an iterator // The above error used to say “the method `rev` exists for type `usize`”. // This regression test ensures it doesn't say that any more. } let arr = &[0, 1, 2, 3]; for _i in 0..arr.len().rev() { //~^ ERROR can't call method //~| surround the range in parentheses // The above error used to say “the method `rev` exists for type `usize`”. // This regression test ensures it doesn't say that any more. } // Test for #102396 for i in 1..11.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } let end: usize = 10; for i in 1..end.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } for i in 1..(end + 1).rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } if 1..(end + 1).is_empty() { //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses } if 1..(end + 1).is_sorted() { //~^ ERROR mismatched types [E0308] //~| ERROR can't call method //~| HELP surround the range in parentheses } let _res: i32 = 3..6.take(2).sum(); //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses let _sum: i32 = 3..6.sum(); //~^ ERROR can't call method //~| ERROR mismatched types [E0308] //~| HELP surround the range in parentheses let a = 1 as usize; let b = 10 as usize; for _a in a..=b.rev() { //~^ ERROR can't call method //~| HELP surround the range in parentheses } let _res = ..10.contains(3); //~^ ERROR can't call method //~| HELP surround the range in parentheses if 1..end.error_method() { //~^ ERROR no method named `error_method` //~| ERROR mismatched types [E0308] // Won't suggest } let _res = b.take(1)..a; //~^ ERROR `usize` is not an iterator let _res: i32 = ..6.take(2).sum(); //~^ can't call method `take` on ambiguous numeric type //~| ERROR mismatched types [E0308] //~| HELP you must specify a concrete type for this numeric value // Won't suggest because `RangeTo` dest not implemented `take` }"} {"_id":"q-en-rust-a6fea38aec291864f55cae4a4acd7a80176bb348738d48645824b9508951c00e","text":"crate emit: Vec, /// If `true`, HTML source pages will generate links for items to their definition. crate generate_link_to_definition: bool, /// Set of function-call locations to include as examples crate call_locations: AllCallLocations, /// If `true`, Context::init will not emit shared files. crate no_emit_shared: bool, } #[derive(Copy, Clone, Debug, PartialEq, Eq)]"} {"_id":"q-en-rust-a74bad89483bd7e8e73cb77f8b98cc73eb0a7c71ad19f50c25bc60a1dfd282f7","text":" // revisions: cfail #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // regression test for #77650 fn c() where [T; N.get()]: Sized, { use std::convert::TryFrom; <[T; N.get()]>::try_from(()) //~^ error: the trait bound //~^^ error: mismatched types } fn main() {} "} {"_id":"q-en-rust-a756100aa1e091872d689f5e4b3f7174080537d2a4f831541a16b996bb9dcd2a","text":"use polonius_engine::Atom; pub use rustc_ast::ast::Mutability; use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::dominators::{dominators, Dominators}; use rustc_data_structures::graph::{self, GraphSuccessors};"} {"_id":"q-en-rust-a7967a88c4d0098cfeaaeb5e5f767c9bc002f67274e5694dc6a1efced5dad39a","text":"pub enum TrailingToken { None, Semi, Gt, /// If the trailing token is a comma, then capture it /// Otherwise, ignore the trailing token MaybeComma,"} {"_id":"q-en-rust-a7adfb1c7c056c78fa7da54ff57485a8ba2191f3f40ea3daf26a9d5b40e20a19","text":"/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to: /// /// ```rust /// #![feature(generic_assert_internals)] /// let elem = 1; /// { /// #[allow(unused_imports)]"} {"_id":"q-en-rust-a7b148cc86dcaeeebda9e04db9087e776f1ecbb6119e31d5b6ba7ef6c6e12f4a","text":"\"only the last field of a struct or enum variant may have a dynamically sized type\") } traits::ObjectSized => { span_note!(tcx.sess, obligation.cause.span, \"only sized types can be made into objects\"); } } }"} {"_id":"q-en-rust-a7b8dbaba928493572c6cc88c9613e1b7ed610519428dd696a0452d44828351a","text":" error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:14:1 | LL | impl !Marker1 for dyn Object + Marker2 { } //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:16:1 | LL | impl !Marker2 for dyn Object + Marker2 { } //~ ERROR E0371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` error[E0117]: only traits defined in the current crate can be implemented for arbitrary types --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:22:1 | LL | impl !Send for dyn Marker2 {} //~ ERROR E0117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate | = note: the impl does not reference only types defined in this crate = note: define and implement a trait or new type instead error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:26:1 | LL | impl !Send for dyn Object {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:27:1 | LL | impl !Send for dyn Object + Marker2 {} //~ ERROR E0321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type error: aborting due to 5 previous errors Some errors occurred: E0117, E0321, E0371. For more information about an error, try `rustc --explain E0117`. "} {"_id":"q-en-rust-a7c5c149d4abfd8cc06e29e0493f1564eb52271e79596d5b850db0501195c316","text":"let prefix = default_path(&builder.config.prefix, \"/usr/local\"); let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, \"/etc\")); let destdir_env = env::var_os(\"DESTDIR\").map(PathBuf::from); // Sanity check for the user write access on prefix and sysconfdir assert!( is_dir_writable_for_user(&prefix), \"User doesn't have write access on `install.prefix` path in the `config.toml`.\", ); assert!( is_dir_writable_for_user(&sysconfdir), \"User doesn't have write access on `install.sysconfdir` path in `config.toml`.\" ); // Sanity checks on the write access of user. // // When the `DESTDIR` environment variable is present, there is no point to // check write access for `prefix` and `sysconfdir` individually, as they // are combined with the path from the `DESTDIR` environment variable. In // this case, we only need to check the `DESTDIR` path, disregarding the // `prefix` and `sysconfdir` paths. if let Some(destdir) = &destdir_env { assert!(is_dir_writable_for_user(destdir), \"User doesn't have write access on DESTDIR.\"); } else { assert!( is_dir_writable_for_user(&prefix), \"User doesn't have write access on `install.prefix` path in the `config.toml`.\", ); assert!( is_dir_writable_for_user(&sysconfdir), \"User doesn't have write access on `install.sysconfdir` path in `config.toml`.\" ); } let datadir = prefix.join(default_path(&builder.config.datadir, \"share\")); let docdir = prefix.join(default_path(&builder.config.docdir, \"share/doc/rust\"));"} {"_id":"q-en-rust-a7d302e34dae77f0621458222fc96c8a97e5e25c0a01273f05673f5775cc27ea","text":"issued_borrow.borrowed_place, &issued_spans, ); self.explain_iterator_advancement_in_for_loop_if_applicable( &mut err, span, &issued_spans, ); err }"} {"_id":"q-en-rust-a8266228840571877ce67d129f0d314203375893e6ae50dfb6373aab737469d1","text":" // This test certify that we can mix attribute macros from Rust and external proc-macros. // For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(SmartPointer)]` uses // `#[pointee]`. // The scoping rule should allow the use of the said two attributes when external proc-macros // are in scope. //@ check-pass //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] #[macro_use] extern crate another_proc_macro; #[pointee] fn f() {} #[default] fn g() {} "} {"_id":"q-en-rust-a848de6c518c74dfdaef72e3c8b059fd5ddd43f8819fb633f48fd741a8f933ca","text":"/// This function should maybe change to /// `new_const(kind: ErrorKind)` /// in the future, when const generics allow that. #[inline] pub(crate) const fn new_const(kind: ErrorKind, message: &'static &'static str) -> Error { Self { repr: Repr::SimpleMessage(kind, message) } }"} {"_id":"q-en-rust-a860c6134cbd2b7ca24c2c4c586d9812b6bc90925e53e3fa4af42feb06fb72a4","text":"} } pub mod signal { use libc::types::os::arch::c95::c_int; use libc::types::os::common::posix01::sighandler_t; #[cfg(not(target_os = \"android\"))] extern { pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } #[cfg(target_os = \"android\")] extern { #[link_name = \"bsd_signal\"] pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } } pub mod wait { use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::posix88::{pid_t};"} {"_id":"q-en-rust-a872fb42ffe43eb21cf16d7db6b9638ee0f2925b6dba6969fcb7a4d4c19a1bc1","text":" // Regression test for #54779, checks if the diagnostics are confusing. #![feature(nll)] trait DebugWith { fn debug_with<'me>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> { DebugCxPair { value: self, cx } } fn fmt_with(&self, cx: &Cx, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result; } struct DebugCxPair<'me, Value: ?Sized, Cx: ?Sized> where Value: DebugWith, { value: &'me Value, cx: &'me Cx, } trait DebugContext {} struct Foo { bar: Bar, } impl DebugWith for Foo { fn fmt_with( &self, cx: &dyn DebugContext, fmt: &mut std::fmt::Formatter<'_>, ) -> std::fmt::Result { let Foo { bar } = self; bar.debug_with(cx); //~ ERROR: lifetime may not live long enough Ok(()) } } struct Bar {} impl DebugWith for Bar { fn fmt_with( &self, cx: &dyn DebugContext, fmt: &mut std::fmt::Formatter<'_>, ) -> std::fmt::Result { Ok(()) } } fn main() {} "} {"_id":"q-en-rust-a87b5dc9864ec0603961abd3192588722a6c0f1b0ccf1243988b63c863dd3a21","text":" // aux-build:issue-99221-aux.rs // build-aux-docs // ignore-cross-compile #![crate_name = \"foo\"] #[macro_use] extern crate issue_99221_aux; pub use issue_99221_aux::*; // @count foo/index.html '//a[@class=\"macro\"]' 1 mod inner { #[macro_export] macro_rules! print { () => () } } "} {"_id":"q-en-rust-a883e47e5ac4d9174aa323358f5fd6b6d651f3a83593a026970f424506e48f2d","text":"map.insert(\"required-associated-consts\".into(), 1); map.insert(\"required-methods\".into(), 1); map.insert(\"provided-methods\".into(), 1); map.insert(\"object-safety\".into(), 1); map.insert(\"implementors\".into(), 1); map.insert(\"synthetic-implementors\".into(), 1); map.insert(\"implementations-list\".into(), 1);"} {"_id":"q-en-rust-a895643a2276eb7400ca7779c6c8de14acf00ab72007b9735d6c3b5cf08c89d1","text":"}) { let (child_field_idx, child_capture) = child_captures.next().unwrap(); // This analysis only makes sense if the parent capture is a // prefix of the child capture. assert!( child_capture.place.projections.len() >= parent_capture.place.projections.len(), \"parent capture ({parent_capture:#?}) expected to be prefix of child capture ({child_capture:#?})\" ); // Store this set of additional projections (fields and derefs). // We need to re-apply them later. let child_precise_captures ="} {"_id":"q-en-rust-a8b80d969187c47a560980fd8c57f81132695ae314daf2a2c044f58e2169fd41","text":"/// } /// ``` #[inline] #[unstable(feature = \"needs_drop\", issue = \"41890\")] #[stable(feature = \"needs_drop\", since = \"1.22.0\")] pub fn needs_drop() -> bool { unsafe { intrinsics::needs_drop::() } }"} {"_id":"q-en-rust-a8dac9e526f96da062429e057607ef6c880cb8bb91a85d99a29d47df5408b89a","text":"let tcx = self.infcx.tcx; let generics = tcx.generics_of(self.mir_def_id); let param = generics.type_param(¶m_ty, tcx); if let Some(generics) = tcx.hir().get_generics(self.mir_def_id) { if let Some(generics) = tcx.hir().get_generics(tcx.closure_base_def_id(self.mir_def_id)) { suggest_constraining_type_param( generics, &mut err,"} {"_id":"q-en-rust-a919ec585ebe6224098f2026de45a856f6002fb1acaab3f1fff29d4bcffae705","text":"//////////////////////////////////////////////////////////////////////////////// #[macro_use] mod local; #[macro_use] mod scoped; #[macro_use] mod scoped_tls; #[stable(feature = \"rust1\", since = \"1.0.0\")] pub use self::local::{LocalKey, LocalKeyState};"} {"_id":"q-en-rust-a92641155e779c079e0d3cbe6eb1c3423533440673db4deef99c6bfe858c980e","text":" error[E0277]: expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` --> $DIR/issue-100690.rs:37:23 | LL | real_dispatch(f) | ------------- ^ expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` | | | required by a bound introduced by this call | = note: expected a closure with arguments `(&mut UIView<'a, T>,)` found a closure with arguments `(&mut UIView<'_, T>,)` note: required by a bound in `real_dispatch` --> $DIR/issue-100690.rs:9:8 | LL | fn real_dispatch(f: F) -> Result<(), io::Error> | ------------- required by a bound in this ... LL | F: FnOnce(&mut UIView) -> Result<(), io::Error> + Send + 'static, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `real_dispatch` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-a94cc2406c728317c04a8433d955d2cce5cc3cfc17521d8cceec2faf03e33b81","text":" error: unexpected closing delimiter: `}` --> $DIR/issue-98601-delimiter-error-1.rs:7:1 | LL | fn foo() { | - this delimiter might not be properly closed... LL | match 0 { LL | _ => {} | -- block is empty, you might have not meant to close it ... LL | } | - ...as it matches this but it has different indentation LL | } | ^ unexpected closing delimiter error: aborting due to previous error "} {"_id":"q-en-rust-a95916736b6952835bc751d521231c339e1fa221b89acc9e5a687e459b5e4370","text":"// compile-flags: -O // min-llvm-version: 15.0 #![crate_type=\"lib\"] #![crate_type = \"lib\"] use std::mem::MaybeUninit;"} {"_id":"q-en-rust-a9a535b96910ace0612d9b3f3be766525dbc2257295de46d1b159ef3ea79a83f","text":"println!(\"`x.py` will now use the configuration at {}\", include_path.display()); let build = TargetSelection::from_user(&env!(\"BUILD_TRIPLE\")); let stage_path = [\"build\", build.rustc_target_arg(), \"stage1\"].join(\"/\"); let stage_path = [\"build\", build.rustc_target_arg(), \"stage1\"].join(&MAIN_SEPARATOR.to_string()); println!();"} {"_id":"q-en-rust-a9a9086cff5c19af200060c23a275d5c6ffe346e13b0272b4d581953280a504b","text":"let result_subst = CanonicalVarValues { var_values: self.tcx.mk_args_from_iter( query_response.variables.iter().enumerate().map(|(index, info)| { if info.is_existential() { if info.universe() != ty::UniverseIndex::ROOT { // A variable from inside a binder of the query. While ideally these shouldn't // exist at all, we have to deal with them for now. self.instantiate_canonical_var(cause.span, info, |u| { universe_map[u.as_usize()] }) } else if info.is_existential() { match opt_values[BoundVar::new(index)] { Some(k) => k, None => self.instantiate_canonical_var(cause.span, info, |u| {"} {"_id":"q-en-rust-a9acced614468e7a414888121ccd85e5be9deb168ee45bed4d9e8c264afe1269","text":"/// ```rust /// # use std::fmt::Write; /// # let mut buf = String::new(); /// /// // Bad /// writeln!(buf, \"\"); /// /// // Good /// writeln!(buf); /// ``` pub WRITELN_EMPTY_STRING, style,"} {"_id":"q-en-rust-a9b1c088366f84feee45d9b557079a97b1437cd930e93f0c149eb84d08137550","text":"assert!(plan.iter().any(|s| s.name.contains(\"-ui\"))); assert!(plan.iter().any(|s| s.name.contains(\"cfail\"))); assert!(plan.iter().any(|s| s.name.contains(\"cfail\"))); assert!(plan.iter().any(|s| s.name.contains(\"cfail-full\"))); assert!(plan.iter().any(|s| s.name.contains(\"codegen-units\"))); assert!(plan.iter().any(|s| s.name.contains(\"debuginfo\")));"} {"_id":"q-en-rust-a9ba99f6c62d1c70b69db07480947fd301cae9b901b4920531c51f18875f345f","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_type=\"lib\"] pub enum Foo { FooV { data: () } } "} {"_id":"q-en-rust-a9ca8411b09add0d0d3d0b8691d417026186cfaff2dfd8853324f016ae64ed8d","text":" // Regression test of #43913. // run-rustfix #![feature(trait_alias)] #![allow(bare_trait_objects, dead_code)] trait Strings = Iterator; struct Struct(S); //~^ ERROR: expected trait, found type alias `Strings` fn main() {} "} {"_id":"q-en-rust-aa224cdaaea961464ddbdbea21d6a62317446716a7519ccd098f28b0b3e92d0a","text":"i -= 1u; } let mut val = s[i] as uint; let mut val = s[i] as u32; let w = UTF8_CHAR_WIDTH[val] as uint; assert!((w != 0));"} {"_id":"q-en-rust-aa4701f5bbb64fdc4345002998c0ca2700a7c6f990bcc0e91265b368826afb29","text":" #![feature(inherent_associated_types)] #![allow(dead_code, incomplete_features)] #![crate_type = \"lib\"] #![deny(unused_attributes)] // run-rustfix pub trait Trait { type It; const IT: (); fn it0(); fn it1(); fn it2(); } pub struct Implementor; impl Implementor { #[doc(hidden)] // no error type Inh = (); #[doc(hidden)] // no error const INH: () = (); #[doc(hidden)] // no error fn inh() {} } impl Trait for Implementor { #[doc(hidden)] type It = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted #[doc(hidden)] const IT: () = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted #[doc(hidden, alias = \"aka\")] fn it0() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted #[doc(alias = \"this\", hidden,)] fn it1() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted #[doc(hidden, hidden)] fn it2() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted //~| ERROR `#[doc(hidden)]` is ignored //~| WARNING this was previously accepted } "} {"_id":"q-en-rust-aa4c6961c19014ed2a38940a5bedb539f1dd112924fa30083603817356be1b29","text":"debug!(\"ty_generics_for_trait(trait_id={:?}, substs={:?})\", ccx.tcx.map.local_def_id(trait_id), substs); let mut generics = ty_generics_for_type_or_impl(ccx, ast_generics); let mut generics = ty_generics_for_type(ccx, ast_generics); // Add in the self type parameter. //"} {"_id":"q-en-rust-aa4e55b7dfbe54b9ebe12d0bba980fcbaddf40e96294fc5404b53d297c301565","text":"self.verbose > 0 } pub fn symlink_file, Q: AsRef>(&self, src: P, link: Q) -> io::Result<()> { #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file; if !self.dry_run() { symlink_file(src.as_ref(), link.as_ref()) } else { Ok(()) } } pub(crate) fn create(&self, path: &Path, s: &str) { if self.dry_run() { return;"} {"_id":"q-en-rust-aa60999b60ef951cb0d27cfc4163727739ff5398f4b0c4d39e837d7a4b2c475a","text":" error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:13:61 | LL | pub fn call_me(&self) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:21:19 | LL | const FN: unsafe extern \"C\" fn(Args), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors "} {"_id":"q-en-rust-aa64e440a391a92ca020c79f3eeb86df0632c36eb8ad35ebb8db167497e09b52","text":"dependencies = [ \"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)\", \"new_debug_unreachable 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)\", \"phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)\", \"phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)\", \"precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)\", \"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)\", \"string_cache_codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)\","} {"_id":"q-en-rust-aa87b23809c31e14e4964918d5a00bbbac1433b335c0fd8fd50ff215a1d48b28","text":"impl DoubleEndedIterator for Drain<'_, T, A> { #[inline] fn next_back(&mut self) -> Option { self.iter.next_back().map(|elt| unsafe { ptr::read(elt) }) if self.tail == self.head { return None; } self.head = wrap_index(self.head.wrapping_sub(1), self.ring.len()); // Safety: // - `self.head` in a ring buffer is always a valid index. // - `self.head` and `self.tail` equality is checked above. unsafe { Some(ptr::read(self.ring.as_ptr().get_unchecked_mut(self.head))) } } }"} {"_id":"q-en-rust-aaaf6e28f391e78c55f198a21d1174913aa4e2111b6b48cb6d5d6889c905f882","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. use std::borrow::{ToOwned, Cow}; fn assert_send(_: T) {} fn main() { assert_send(Cow::Borrowed(\"foo\")); } "} {"_id":"q-en-rust-aaeb17f85c2bd5a21dffe682286ce0eb2288bfb3ee8d2eb9c9dae2f47478ca69","text":"} } if !unnormalized_trait_sig.output().references_error() { debug_assert!( !collector.types.is_empty(), \"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`\" ); } // FIXME: This has the same issue as #108544, but since this isn't breaking // existing code, I'm not particularly inclined to do the same hack as above // where we process wf obligations manually. This can be fixed in a forward-"} {"_id":"q-en-rust-ab11b5a6ce34573d28c19791712b66abc54994e7857eece002e2f593f7b8bfe8","text":".param_env .and(type_op::implied_outlives_bounds::ImpliedOutlivesBounds { ty }) .fully_perform(self.infcx, DUMMY_SP) .unwrap_or_else(|_| bug!(\"failed to compute implied bounds {:?}\", ty)); .map_err(|_: ErrorGuaranteed| debug!(\"failed to compute implied bounds {:?}\", ty)) .ok()?; debug!(?bounds, ?constraints); self.add_outlives_bounds(bounds); constraints"} {"_id":"q-en-rust-ab1428a392980dbbd29baeafd894776229fc82df3ab286349129af27e298149f","text":"} // We probe again, taking all traits into account (not only those in scope). let candidates = match self.lookup_probe( let mut candidates = match self.lookup_probe( span, segment.ident, self_ty,"} {"_id":"q-en-rust-ab15e233b2f649e48de2920cebe535d878d98410fd6a506cb014fde623306da2","text":"if instance.def.is_inline(tcx) { attributes::inline(llfn, attributes::InlineAttr::Hint); } attributes::from_fn_attrs(cx, llfn, instance.def.def_id()); attributes::from_fn_attrs(cx, llfn, Some(instance.def.def_id())); let instance_def_id = instance.def_id();"} {"_id":"q-en-rust-abab567c97db0886c94d52f73e3fb4b3fbfbb2f02e122a14d4e5e8f45765c510","text":"..(ori_link.range.start + before_second_backtick_group) } /// Returns true if we should ignore `link` due to it being unlikely /// that it is an intra-doc link. `link` should still have disambiguators /// if there were any. /// /// The difference between this and [`should_ignore_link()`] is that this /// check should only be used on links that still have disambiguators. fn should_ignore_link_with_disambiguators(link: &str) -> bool { link.contains(|ch: char| !(ch.is_alphanumeric() || \":_<>, !*&;@()\".contains(ch))) } /// Returns true if we should ignore `path_str` due to it being unlikely /// that it is an intra-doc link. fn should_ignore_link(path_str: &str) -> bool { path_str.contains(|ch: char| !(ch.is_alphanumeric() || \":_<>, !*&;\".contains(ch))) } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] /// Disambiguators for a link. crate enum Disambiguator {"} {"_id":"q-en-rust-abbb3c48aa40d5e584e25c8b8418d96bad1986ba9c0ed12096a61f6b704aec52","text":"use rustc_hir::{HirId, HirIdSet, Node}; use rustc_middle::lint::LintDiagnosticBuilder; use rustc_middle::ty::subst::{GenericArgKind, Subst}; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::ty::{self, layout::LayoutError, Ty, TyCtxt}; use rustc_session::lint::FutureIncompatibleInfo; use rustc_session::Session; use rustc_span::edition::Edition;"} {"_id":"q-en-rust-abd225d65ad91846b08db70c6b6f3bec87fab06e91fa6f38f63274faf7bbeba0","text":"} #[test] fn wtf8_show() { let mut string = Wtf8Buf::from_str(\"aé 💩\"); string.push(CodePoint::from_u32(0xD800).unwrap()); assert_eq!(format!(\"{:?}\", string), r#\"\"aé 💩u{D800}\"\"#); fn wtf8buf_show_str() { let text = \"até 💩r\"; let mut string = Wtf8Buf::from_str(text); assert_eq!(format!(\"{:?}\", text), format!(\"{:?}\", string)); } #[test]"} {"_id":"q-en-rust-ac1083511a9ab52da4e865d9302c9ddd7310bf2236040782d04c5fe89c359a65","text":"extern crate issue_76736_2; // @has foo/struct.Foo.html // @has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' // @!has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' pub struct Foo; // @has foo/struct.Bar.html // @has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' // @!has - '//*[@class=\"impl\"]//h3[@class=\"code-header\"]' 'MaybeResult' pub use issue_76736_2::Bar;"} {"_id":"q-en-rust-ac1448df037274683b65793a53cf343d7593325341bc8fb51fe8748635051174","text":"size: (1100, 800) // We check that \".item-info\" is bigger than its content. assert-css: (\".item-info\", {\"width\": \"807px\"}) assert-css: (\".item-info .stab\", {\"width\": \"343px\"}) assert-css: (\".item-info .stab\", {\"width\": \"341px\"}) "} {"_id":"q-en-rust-ac3e034f30e0ff6561018f81c05b742363b2ff21a6576eb91b66d7674722726f","text":"}); debug!(\"instantiate_method_substs: user_type_annotation={:?}\", user_type_annotation); self.fcx.write_user_type_annotation(self.call_expr.hir_id, user_type_annotation); if !self.skip_record_for_diagnostics { self.fcx.write_user_type_annotation(self.call_expr.hir_id, user_type_annotation); } } self.normalize(self.span, substs)"} {"_id":"q-en-rust-ac596ed5080e8a31917294b363e6ab7428eb6a438d7920ca6d6c64a39c7d4b37","text":" fn main() { extern { static symbol: [usize]; //~ ERROR: the size for values of type } println!(\"{}\", symbol[0]); } "} {"_id":"q-en-rust-ad0a48a9ea6517408dd6d366f76ef6aad13f8150fdf6b42fa42dcd5deaa41e68","text":"stabilizing its interface\")] impl ScopedKey { #[doc(hidden)] pub const fn new() -> ScopedKey { ScopedKey { inner: imp::KeyInner::new() } pub const fn new(inner: fn() -> &'static imp::KeyInner) -> ScopedKey { ScopedKey { inner: inner } } /// Inserts a value into this scoped thread local storage slot for a"} {"_id":"q-en-rust-ad10fa8ded0f1018f7017240d50ea8db8549f193f4fd4a5b2f0874bcca145229","text":"/// Pushes all the predicates needed to validate that `ty` is WF into `out`. #[instrument(level = \"debug\", skip(self))] fn compute(&mut self, arg: GenericArg<'tcx>) { let mut walker = arg.walk(); let param_env = self.param_env; let depth = self.recursion_depth; while let Some(arg) = walker.next() { debug!(?arg, ?self.out); let ty = match arg.unpack() { GenericArgKind::Type(ty) => ty, // No WF constraints for lifetimes being present, any outlives // obligations are handled by the parent (e.g. `ty::Ref`). GenericArgKind::Lifetime(_) => continue, GenericArgKind::Const(ct) => { match ct.kind() { ty::ConstKind::Unevaluated(uv) => { if !ct.has_escaping_bound_vars() { let obligations = self.nominal_obligations(uv.def, uv.args); self.out.extend(obligations); let predicate = ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::ConstEvaluatable(ct), )); let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, predicate, )); } } ty::ConstKind::Infer(_) => { let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::WellFormed(ct.into()), )), )); } ty::ConstKind::Expr(_) => { // FIXME(generic_const_exprs): this doesn't verify that given `Expr(N + 1)` the // trait bound `typeof(N): Add` holds. This is currently unnecessary // as `ConstKind::Expr` is only produced via normalization of `ConstKind::Unevaluated` // which means that the `DefId` would have been typeck'd elsewhere. However in // the future we may allow directly lowering to `ConstKind::Expr` in which case // we would not be proving bounds we should. let predicate = ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::ConstEvaluatable(ct), )); let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, self.param_env, predicate, )); } ty::ConstKind::Error(_) | ty::ConstKind::Param(_) | ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(..) => { // These variants are trivially WF, so nothing to do here. } ty::ConstKind::Value(..) => { // FIXME: Enforce that values are structurally-matchable. } } continue; } }; debug!(\"wf bounds for ty={:?} ty.kind={:#?}\", ty, ty.kind()); match *ty.kind() { ty::Bool | ty::Char | ty::Int(..) | ty::Uint(..) | ty::Float(..) | ty::Error(_) | ty::Str | ty::CoroutineWitness(..) | ty::Never | ty::Param(_) | ty::Bound(..) | ty::Placeholder(..) | ty::Foreign(..) => { // WfScalar, WfParameter, etc } // Can only infer to `ty::Int(_) | ty::Uint(_)`. ty::Infer(ty::IntVar(_)) => {} // Can only infer to `ty::Float(_)`. ty::Infer(ty::FloatVar(_)) => {} ty::Slice(subty) => { self.require_sized(subty, traits::SliceOrArrayElem); } ty::Array(subty, _) => { self.require_sized(subty, traits::SliceOrArrayElem); // Note that we handle the len is implicitly checked while walking `arg`. } ty::Tuple(tys) => { if let Some((_last, rest)) = tys.split_last() { for &elem in rest { self.require_sized(elem, traits::TupleElem); } } } ty::RawPtr(_) => { // Simple cases that are WF if their type args are WF. } ty::Alias(ty::Projection, data) => { walker.skip_current_subtree(); // Subtree handled by compute_projection. self.compute_projection(data); } ty::Alias(ty::Inherent, data) => { walker.skip_current_subtree(); // Subtree handled by compute_inherent_projection. self.compute_inherent_projection(data); } ty::Adt(def, args) => { // WfNominalType let obligations = self.nominal_obligations(def.did(), args); self.out.extend(obligations); } ty::FnDef(did, args) => { let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::Ref(r, rty, _) => { // WfReference if !r.has_escaping_bound_vars() && !rty.has_escaping_bound_vars() { let cause = self.cause(traits::ReferenceOutlivesReferent(ty)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, depth, param_env, ty::Binder::dummy(ty::PredicateKind::Clause( ty::ClauseKind::TypeOutlives(ty::OutlivesPredicate(rty, r)), )), )); } } ty::Coroutine(did, args, ..) => { // Walk ALL the types in the coroutine: this will // include the upvar types as well as the yield // type. Note that this is mildly distinct from // the closure case, where we have to be careful // about the signature of the closure. We don't // have the problem of implied bounds here since // coroutines don't take arguments. let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::Closure(did, args) => { // Only check the upvar types for WF, not the rest // of the types within. This is needed because we // capture the signature and it may not be WF // without the implied bounds. Consider a closure // like `|x: &'a T|` -- it may be that `T: 'a` is // not known to hold in the creator's context (and // indeed the closure may not be invoked by its // creator, but rather turned to someone who *can* // verify that). // // The special treatment of closures here really // ought not to be necessary either; the problem // is related to #25860 -- there is no way for us // to express a fn type complete with the implied // bounds that it is assuming. I think in reality // the WF rules around fn are a bit messed up, and // that is the rot problem: `fn(&'a T)` should // probably always be WF, because it should be // shorthand for something like `where(T: 'a) { // fn(&'a T) }`, as discussed in #25860. walker.skip_current_subtree(); // subtree handled below // FIXME(eddyb) add the type to `walker` instead of recursing. self.compute(args.as_closure().tupled_upvars_ty().into()); // Note that we cannot skip the generic types // types. Normally, within the fn // body where they are created, the generics will // always be WF, and outside of that fn body we // are not directly inspecting closure types // anyway, except via auto trait matching (which // only inspects the upvar types). // But when a closure is part of a type-alias-impl-trait // then the function that created the defining site may // have had more bounds available than the type alias // specifies. This may cause us to have a closure in the // hidden type that is not actually well formed and // can cause compiler crashes when the user abuses unsafe // code to procure such a closure. // See tests/ui/type-alias-impl-trait/wf_check_closures.rs let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::CoroutineClosure(did, args) => { // See the above comments. The same apply to coroutine-closures. walker.skip_current_subtree(); self.compute(args.as_coroutine_closure().tupled_upvars_ty().into()); let obligations = self.nominal_obligations(did, args); self.out.extend(obligations); } ty::FnPtr(_) => { // let the loop iterate into the argument/return // types appearing in the fn signature } ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => { // All of the requirements on type parameters // have already been checked for `impl Trait` in // return position. We do need to check type-alias-impl-trait though. if self.tcx().is_type_alias_impl_trait(def_id) { let obligations = self.nominal_obligations(def_id, args); self.out.extend(obligations); } } ty::Alias(ty::Weak, ty::AliasTy { def_id, args, .. }) => { let obligations = self.nominal_obligations(def_id, args); self.out.extend(obligations); } ty::Dynamic(data, r, _) => { // WfObject // // Here, we defer WF checking due to higher-ranked // regions. This is perhaps not ideal. self.from_object_ty(ty, data, r); // FIXME(#27579) RFC also considers adding trait // obligations that don't refer to Self and // checking those let defer_to_coercion = self.tcx().features().object_safe_for_dispatch; if !defer_to_coercion { if let Some(principal) = data.principal_def_id() { self.out.push(traits::Obligation::with_depth( self.tcx(), self.cause(traits::WellFormed(None)), depth, param_env, ty::Binder::dummy(ty::PredicateKind::ObjectSafe(principal)), )); } } } // Inference variables are the complicated case, since we don't // know what type they are. We do two things: // // 1. Check if they have been resolved, and if so proceed with // THAT type. // 2. If not, we've at least simplified things (e.g., we went // from `Vec<$0>: WF` to `$0: WF`), so we can // register a pending obligation and keep // moving. (Goal is that an \"inductive hypothesis\" // is satisfied to ensure termination.) // See also the comment on `fn obligations`, describing \"livelock\" // prevention, which happens before this can be reached. ty::Infer(_) => { let cause = self.cause(traits::WellFormed(None)); self.out.push(traits::Obligation::with_depth( self.tcx(), cause, self.recursion_depth, param_env, ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::WellFormed( ty.into(), ))), )); } } debug!(?self.out); } arg.visit_with(self); debug!(?self.out); } #[instrument(level = \"debug\", skip(self))]"} {"_id":"q-en-rust-ad8daa086d15069c90da1107d8141ba7e025a003745d12aaeff128188e8f6f8f","text":"CHECK: [[DEFINE_INTERNAL]] { {{.*}} } @_R{{[a-zA-Z0-9_]+}}testprog14will_be_called() unnamed_addr #{{[0-9]+}} { CHECK-NEXT: start: CHECK-NOT: [[DEFINE_INTERNAL]] CHECK: %pgocount = load i64, {{i64*|ptr}} CHECK: atomicrmw add ptr CHECK-SAME: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called, CHECK: declare void @llvm.instrprof.increment({{i8*|ptr}}, i64, i32, i32) #[[LLVM_INSTRPROF_INCREMENT_ATTR:[0-9]+]]"} {"_id":"q-en-rust-adafee5d15302c6d91732c092dc936e3abc2d92fc40890dfecd7da9618540936","text":"ty::Closure(..) => Abi::RustCall, ty::CoroutineClosure(..) => Abi::RustCall, ty::Coroutine(..) => Abi::Rust, // No need to do MIR validation on error bodies ty::Error(_) => return, _ => { span_bug!(body.span, \"unexpected body ty: {:?} phase {:?}\", body_ty, mir_phase) }"} {"_id":"q-en-rust-addb0786d00f90c34220aaffadff1d1e722622543e04e64c0adbc23fb6a51c18","text":"target_option_val!(limit_rdylib_exports); target_option_val!(override_export_symbols); target_option_val!(merge_functions); target_option_val!(mcount, \"target_mcount\"); target_option_val!(mcount, \"target-mcount\"); target_option_val!(llvm_abiname); target_option_val!(relax_elf_relocations); target_option_val!(llvm_args);"} {"_id":"q-en-rust-adff4a978196666cc4e8dfdc46f9eec1c6f577f5a5920158a6f88d7f7c435c3e","text":"} impl Attribute { #[inline] pub fn has_name(&self, name: Symbol) -> bool { match self.kind { AttrKind::Normal(ref item, _) => item.path == name,"} {"_id":"q-en-rust-ae099a772cef77390ad53c2308b1ad96b7304e727cc1f2da1675830d5aaeb72d","text":"let s = str::from_utf8(&out.stderr).unwrap(); // loosened the following from double::h to double:: due to // spurious failures on mac, 32bit, optimized assert!(s.contains(\"stack backtrace\") && s.contains(\"double::\"), assert!(s.contains(\"stack backtrace\") && s.contains(\" - double\"), \"bad output3: {}\", s); // Make sure a stack trace isn't printed too many times"} {"_id":"q-en-rust-ae2783b6086fd68ad38af95fc6a95d5c03d7c4b66c171703540a729594d4abd4","text":" fn main() { x::<#[a]y::> //~^ ERROR invalid const generic expression //~| ERROR cannot find value `x` in this scope } "} {"_id":"q-en-rust-ae8509aecb74e3615f125737f7c8789c7194ae01c9c30221b67079955361fb4e","text":"/// ``` #[unstable(feature = \"std_misc\", reason = \"pending integer conventions\")] fn ldexp(x: Self, exp: isize) -> Self; fn ldexp(self, exp: isize) -> Self; /// Breaks the number into a normalized fraction and a base-2 exponent, /// satisfying: ///"} {"_id":"q-en-rust-ae8614c41503837e835e06016c8fa623cad131bc8cf17315746ee7067770fa41","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // https://github.com/rust-lang/rust/issues/49181 #[derive(Eq, PartialEq)] #[repr(i8)] pub enum A { B = -1, C = 1, } pub const D: A = A::B; fn main() { match A::C { D => {}, _ => {} } } "} {"_id":"q-en-rust-aeab86e28d63c18f894d03636ab43225a59bb79c3bc1c8d2a6278dab36453233","text":"cx.stats.borrow_mut().n_closures += 1; // The `uwtable` attribute according to LLVM is: // // This attribute indicates that the ABI being targeted requires that an // unwind table entry be produced for this function even if we can show // that no exceptions passes by it. This is normally the case for the // ELF x86-64 abi, but it can be disabled for some compilation units. // // Typically when we're compiling with `-C panic=abort` (which implies this // `no_landing_pads` check) we don't need `uwtable` because we can't // generate any exceptions! On Windows, however, exceptions include other // events such as illegal instructions, segfaults, etc. This means that on // Windows we end up still needing the `uwtable` attribute even if the `-C // panic=abort` flag is passed. // // You can also find more info on why Windows is whitelisted here in: // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 if !cx.sess().no_landing_pads() || cx.sess().target.target.options.requires_uwtable { attributes::emit_uwtable(lldecl, true); } let mir = cx.tcx.instance_mir(instance.def); mir::codegen_mir(cx, lldecl, &mir, instance, sig); }"} {"_id":"q-en-rust-aeaf9350318a4bb3663bf6f1cc32436b9ac77bf894497db0416c3d8a83d46eed","text":"// there's no need to do dep-graph tracking for any of it. tcx.dep_graph.assert_ignored(); join( || encode_metadata_impl(tcx, path), || { if tcx.sess.threads() == 1 { return; } // Prefetch some queries used by metadata encoding. // This is not necessary for correctness, but is only done for performance reasons. // It can be removed if it turns out to cause trouble or be detrimental to performance. join(|| prefetch_mir(tcx), || tcx.exported_symbols(LOCAL_CRATE)); }, ); } if tcx.sess.threads() != 1 { // Prefetch some queries used by metadata encoding. // This is not necessary for correctness, but is only done for performance reasons. // It can be removed if it turns out to cause trouble or be detrimental to performance. join(|| prefetch_mir(tcx), || tcx.exported_symbols(LOCAL_CRATE)); } fn encode_metadata_impl(tcx: TyCtxt<'_>, path: &Path) { let mut encoder = opaque::FileEncoder::new(path) .unwrap_or_else(|err| tcx.sess.emit_fatal(FailCreateFileEncoder { err })); encoder.emit_raw_bytes(METADATA_HEADER);"} {"_id":"q-en-rust-aeb18219a96ac9199eb7c49527670516788cf7d286a7bbdd340ce719ca5618db","text":"pub struct Zip { a: A, b: B, // index and len are only used by the specialized version of zip // index, len and a_len are only used by the specialized version of zip index: usize, len: usize, a_len: usize, } impl Zip { pub(in crate::iter) fn new(a: A, b: B) -> Zip {"} {"_id":"q-en-rust-aeb8d49cf132fd72786da5dd8ccb9823dfd8094ffa65643cc5c55915ffa5914e","text":" // run-pass // compile-flags: -C opt-level=1 // Make sure LLVM does not miscompile this match. fn main() { enum Bits { None = 0x00, Low = 0x40, High = 0x80, Both = 0xC0, } let value = Box::new(0x40u8); let mut out = Box::new(0u8); let bits = match *value { 0x00 => Bits::None, 0x40 => Bits::Low, 0x80 => Bits::High, 0xC0 => Bits::Both, _ => return, }; match bits { Bits::None | Bits::Low => { *out = 1; } _ => (), } assert_eq!(*out, 1); } "} {"_id":"q-en-rust-aebccc02f91188fb85b1298f4e892a5f5fe778b59079b0aad21e11120ad90f28","text":" // check-pass use std::ops::Deref; struct Data { boxed: Box<&'static i32> } impl Data { fn use_data(&self, user: impl for <'a> FnOnce( as Deref>::Target)) { user(*self.boxed) } } fn main() {} "} {"_id":"q-en-rust-aec02db580e94011cfa1c7319e85d114038a23fc699d0ab84d389212af9fe804","text":"#[cfg(target_os = \"macos\")] pub mod sysconf { use types::os::arch::c95::c_int; pub static _SC_ARG_MAX : c_int = 1; pub static _SC_CHILD_MAX : c_int = 2; pub static _SC_CLK_TCK : c_int = 3; pub static _SC_NGROUPS_MAX : c_int = 4; pub static _SC_OPEN_MAX : c_int = 5; pub static _SC_JOB_CONTROL : c_int = 6; pub static _SC_SAVED_IDS : c_int = 7; pub static _SC_VERSION : c_int = 8; pub static _SC_BC_BASE_MAX : c_int = 9; pub static _SC_BC_DIM_MAX : c_int = 10; pub static _SC_BC_SCALE_MAX : c_int = 11; pub static _SC_BC_STRING_MAX : c_int = 12; pub static _SC_COLL_WEIGHTS_MAX : c_int = 13; pub static _SC_EXPR_NEST_MAX : c_int = 14; pub static _SC_LINE_MAX : c_int = 15; pub static _SC_RE_DUP_MAX : c_int = 16; pub static _SC_2_VERSION : c_int = 17; pub static _SC_2_C_BIND : c_int = 18; pub static _SC_2_C_DEV : c_int = 19; pub static _SC_2_CHAR_TERM : c_int = 20; pub static _SC_2_FORT_DEV : c_int = 21; pub static _SC_2_FORT_RUN : c_int = 22; pub static _SC_2_LOCALEDEF : c_int = 23; pub static _SC_2_SW_DEV : c_int = 24; pub static _SC_2_UPE : c_int = 25; pub static _SC_STREAM_MAX : c_int = 26; pub static _SC_TZNAME_MAX : c_int = 27; pub static _SC_ASYNCHRONOUS_IO : c_int = 28; pub static _SC_PAGESIZE : c_int = 29; pub static _SC_MEMLOCK : c_int = 30; pub static _SC_MEMLOCK_RANGE : c_int = 31; pub static _SC_MEMORY_PROTECTION : c_int = 32; pub static _SC_MESSAGE_PASSING : c_int = 33; pub static _SC_PRIORITIZED_IO : c_int = 34; pub static _SC_PRIORITY_SCHEDULING : c_int = 35; pub static _SC_REALTIME_SIGNALS : c_int = 36; pub static _SC_SEMAPHORES : c_int = 37; pub static _SC_FSYNC : c_int = 38; pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39; pub static _SC_SYNCHRONIZED_IO : c_int = 40; pub static _SC_TIMERS : c_int = 41; pub static _SC_AIO_LISTIO_MAX : c_int = 42; pub static _SC_AIO_MAX : c_int = 43; pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44; pub static _SC_DELAYTIMER_MAX : c_int = 45; pub static _SC_MQ_OPEN_MAX : c_int = 46; pub static _SC_MAPPED_FILES : c_int = 47; pub static _SC_RTSIG_MAX : c_int = 48; pub static _SC_SEM_NSEMS_MAX : c_int = 49; pub static _SC_SEM_VALUE_MAX : c_int =50; pub static _SC_SIGQUEUE_MAX : c_int = 51; pub static _SC_TIMER_MAX : c_int = 52; pub static _SC_NPROCESSORS_CONF : c_int = 57; pub static _SC_NPROCESSORS_ONLN : c_int = 58; pub static _SC_2_PBS : c_int = 59; pub static _SC_2_PBS_ACCOUNTING : c_int = 60; pub static _SC_2_PBS_CHECKPOINT : c_int = 61; pub static _SC_2_PBS_LOCATE : c_int = 62; pub static _SC_2_PBS_MESSAGE : c_int = 63; pub static _SC_2_PBS_TRACK : c_int = 64; pub static _SC_ADVISORY_INFO : c_int = 65; pub static _SC_BARRIERS : c_int = 66; pub static _SC_CLOCK_SELECTION : c_int = 67; pub static _SC_CPUTIME : c_int = 68; pub static _SC_FILE_LOCKING : c_int = 69; pub static _SC_GETGR_R_SIZE_MAX : c_int = 70; pub static _SC_GETPW_R_SIZE_MAX : c_int = 71; pub static _SC_HOST_NAME_MAX : c_int = 72; pub static _SC_LOGIN_NAME_MAX : c_int = 73; pub static _SC_MONOTONIC_CLOCK : c_int = 74; pub static _SC_MQ_PRIO_MAX : c_int = 75; pub static _SC_READER_WRITER_LOCKS : c_int = 76; pub static _SC_REGEXP : c_int = 77; pub static _SC_SHELL : c_int = 78; pub static _SC_SPAWN : c_int = 79; pub static _SC_SPIN_LOCKS : c_int = 80; pub static _SC_SPORADIC_SERVER : c_int = 81; pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82; pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83; pub static _SC_THREAD_CPUTIME : c_int = 84; pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85; pub static _SC_THREAD_KEYS_MAX : c_int = 86; pub static _SC_THREAD_PRIO_INHERIT : c_int = 87; pub static _SC_THREAD_PRIO_PROTECT : c_int = 88; pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89; pub static _SC_THREAD_PROCESS_SHARED : c_int = 90; pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91; pub static _SC_THREAD_SPORADIC_SERVER : c_int = 92; pub static _SC_THREAD_STACK_MIN : c_int = 93; pub static _SC_THREAD_THREADS_MAX : c_int = 94; pub static _SC_TIMEOUTS : c_int = 95; pub static _SC_THREADS : c_int = 96; pub static _SC_TRACE : c_int = 97; pub static _SC_TRACE_EVENT_FILTER: c_int = 98; pub static _SC_TRACE_INHERIT: c_int = 99; pub static _SC_TRACE_LOG: c_int = 100; pub static _SC_TTY_NAME_MAX: c_int = 101; pub static _SC_TYPED_MEMORY_OBJECTS: c_int = 102; pub static _SC_V6_ILP32_OFF32: c_int = 103; pub static _SC_V6_ILP32_OFFBIG: c_int = 104; pub static _SC_V6_LP64_OFF64: c_int = 105; pub static _SC_V6_LPBIG_OFFBIG: c_int = 106; pub static _SC_IPV6: c_int = 118; pub static _SC_RAW_SOCKETS: c_int = 119; pub static _SC_SYMLOOP_MAX: c_int = 120; pub static _SC_ATEXIT_MAX: c_int = 107; pub static _SC_IOV_MAX: c_int = 56; pub static _SC_PAGE_SIZE: cint = _SC_PAGESIZE; pub static _SC_XOPEN_CRYPT: c_int = 108; pub static _SC_XOPEN_ENH_I18N: c_int = 109; pub static _SC_XOPEN_LEGACY: c_int = 110; pub static _SC_XOPEN_REALTIME: c_int = 111; pub static _SC_XOPEN_REALTIME_THREADS: c_int = 112; pub static _SC_XOPEN_SHM: c_int = 113; pub static _SC_XOPEN_STREAMS: c_int = 114; pub static _SC_XOPEN_UNIX: c_int = 115; pub static _SC_XOPEN_VERSION: c_int = 116; pub static _SC_XOPEN_XCU_VERSION: c_int = 121; pub static _SC_XBS5_ILP32_OFF32: c_int = 122; pub static _SC_XBS5_ILP32_OFFBIG: c_int = 123; pub static _SC_XBS5_LP64_OFF64: c_int = 124; pub static _SC_XBS5_LPBIG_OFFBIG: c_int = 125; pub static _SC_SS_REPL_MAX: c_int = 126; pub static _SC_TRACE_EVENT_NAME_MAX: c_int = 127; pub static _SC_TRACE_NAME_MAX: c_int = 128; pub static _SC_TRACE_SYS_MAX: c_int = 129; pub static _SC_TRACE_USER_EVENT_MAX: c_int = 130; pub static _SC_PASS_MAX: c_int = 131; } #[cfg(target_os = \"android\")]"} {"_id":"q-en-rust-aec32b56935ec4a496586113e95d6d4c264fb6fc6d2e00f0dd2efc512fa7f8c1","text":"type Wub = !; //~ ERROR type is experimental } fn look_ma_no_feature_gate !>() {} //~ ERROR type is experimental fn tadam(f: &dyn Fn() -> !) {} //~ ERROR type is experimental fn panic() -> ! { panic!(); } fn toudoum() -> impl Fn() -> ! { //~ ERROR type is experimental panic } fn main() { }"} {"_id":"q-en-rust-aec89039b787258708cc5d0e6a17f70af6178f65c1112e440ec1a21d3d078fff","text":"//! are elements, and once they've all been exhausted, will return `None` to //! indicate that iteration is finished. Individual iterators may choose to //! resume iteration, and so calling [`next`] again may or may not eventually //! start returning `Some(Item)` again at some point. //! start returning `Some(Item)` again at some point (for example, see [`TryIter`]). //! //! [`Iterator`]'s full definition includes a number of other methods as well, //! but they are default methods, built on top of [`next`], and so you get"} {"_id":"q-en-rust-af014605f378b124084b3168c7fa1ef9df82bf2bc2cf50e25d3839aed2d45d6f","text":" goto: file://|DOC_PATH|/test_docs/type.SomeType.html assert-all: (\".top-block .docblock p\", {\"font-weight\": \"400\"}) "} {"_id":"q-en-rust-af025ac3ad1b6f759c7902f979dd0f7e006857456e8675299784f169b003f359","text":"use crate::cache::{Interned, INTERNER}; use crate::cc_detect::{ndk_compiler, Language}; use crate::channel::{self, GitInfo}; use crate::compile::CODEGEN_BACKEND_PREFIX; pub use crate::flags::Subcommand; use crate::flags::{Color, Flags, Warnings}; use crate::util::{exe, output, t};"} {"_id":"q-en-rust-af5f579ea69006f99d8e78fed2af8e3601746a4b21963d1c5a9ccfd0e7afeb90","text":"// Ignore the notification. None } else { print!( \"failed to decode compiler output as json: line: {}noutput: {}\", line, output ); panic!() // This function is called for both compiler and non-compiler output, // so if the line isn't recognized as JSON from the compiler then // just print it as-is. Some(format!(\"{line}n\")) } } else { // preserve non-JSON lines, such as ICEs"} {"_id":"q-en-rust-af717099e7487e13ce07320ebea014721043b90534f9823af568e42a9374f47c","text":"// 'Deprecated$' #[deprecated] pub struct W; // @matches deprecated/struct.X.html '//*[@class=\"stab deprecated\"]' // 'Deprecated: shorthand reason$' #[deprecated = \"shorthand reason\"] pub struct X; "} {"_id":"q-en-rust-af858c9f28c560a3919af8b5991b63455c8f25c08acdfaf192a26a960ce582f3","text":" error[E0277]: the trait bound `*mut (): Trait<'_>` is not satisfied --> $DIR/issue-101623.rs:21:21 | LL | Trait::do_stuff({ fun(&mut *inner) }); | --------------- ^^----------------^^ | | | | | the trait `Trait<'_>` is not implemented for `*mut ()` | required by a bound introduced by this call | = help: the trait `Trait<'a>` is implemented for `()` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. "} {"_id":"q-en-rust-af8cb0dfa16a8ad9dc6a6d7cbdeb35deb7857eaa9dc1722e397a0ba96050de95","text":"} } } // Visit everything, but enum variants have their own levels. hir::ItemKind::Enum(ref def, _) => { if item_level.is_some() { self.reach(item.def_id, item_level).generics().predicates(); } let enum_level = self.get(item.def_id); for variant in def.variants { let variant_level = self.update_with_hir_id(variant.id, enum_level); let variant_level = self.get(self.tcx.hir().local_def_id(variant.id)); if variant_level.is_some() { if let Some(ctor_id) = variant.data.ctor_hir_id() { self.update_with_hir_id(ctor_id, variant_level); } for field in variant.data.fields() { self.reach(self.tcx.hir().local_def_id(field.hir_id), variant_level) .ty();"} {"_id":"q-en-rust-afd7b6544685e0bf4dfb517a21a7c66085f6f602ac3102ba4269706a2044ff0d","text":"tcx: TyCtxt<'tcx>, // typeck errors have subpar spans for opaque types, so delay error reporting until borrowck. ignore_errors: bool, origin: OpaqueTyOrigin, ) -> Self { let OpaqueTypeKey { def_id, substs } = opaque_type_key;"} {"_id":"q-en-rust-b0a4fc36f2d2163a9b0cccaf614f538b3a8e828825e08a1606290e5ab2eb7200","text":"//! in this case, if one uses the format string `{:.*}`, then the `` part refers //! to the *value* to print, and the `precision` must come in the input preceding ``. //! //! For example, these: //! For example, the following calls all print the same thing `Hello x is 0.01000`: //! //! ``` //! // Hello {arg 0 (x)} is {arg 1 (0.01) with precision specified inline (5)} //! // Hello {arg 0 (\"x\")} is {arg 1 (0.01) with precision specified inline (5)} //! println!(\"Hello {0} is {1:.5}\", \"x\", 0.01); //! //! // Hello {arg 1 (x)} is {arg 2 (0.01) with precision specified in arg 0 (5)} //! // Hello {arg 1 (\"x\")} is {arg 2 (0.01) with precision specified in arg 0 (5)} //! println!(\"Hello {1} is {2:.0$}\", 5, \"x\", 0.01); //! //! // Hello {arg 0 (x)} is {arg 2 (0.01) with precision specified in arg 1 (5)} //! // Hello {arg 0 (\"x\")} is {arg 2 (0.01) with precision specified in arg 1 (5)} //! println!(\"Hello {0} is {2:.1$}\", \"x\", 5, 0.01); //! //! // Hello {next arg (x)} is {second of next two args (0.01) with precision //! // Hello {next arg (\"x\")} is {second of next two args (0.01) with precision //! // specified in first of next two args (5)} //! println!(\"Hello {} is {:.*}\", \"x\", 5, 0.01); //! //! // Hello {next arg (x)} is {arg 2 (0.01) with precision //! // Hello {next arg (\"x\")} is {arg 2 (0.01) with precision //! // specified in its predecessor (5)} //! println!(\"Hello {} is {2:.*}\", \"x\", 5, 0.01); //! //! // Hello {next arg (x)} is {arg \"number\" (0.01) with precision specified //! // Hello {next arg (\"x\")} is {arg \"number\" (0.01) with precision specified //! // in arg \"prec\" (5)} //! println!(\"Hello {} is {number:.prec$}\", \"x\", prec = 5, number = 0.01); //! ``` //! //! All print the same thing: //! //! ```text //! Hello x is 0.01000 //! ``` //! //! While these: //! //! ```"} {"_id":"q-en-rust-b0b4fbc9f696dbd65e5a131221802669b695a84809d872a0e7b24109b46d008c","text":"pub use idx::Idx; pub use rustc_index_macros::newtype_index; pub use slice::IndexSlice; #[doc(no_inline)] pub use vec::IndexVec; /// Type size assertion. The first argument is a type and the second argument is its expected size."} {"_id":"q-en-rust-b0bf09e7e8cb60dad83632b61102d5b1c43ae7ba04d38cb09e3930a2797c1e7b","text":" fn foo(t: T) { || { t; t; }; //~ ERROR: use of moved value } fn main() {} "} {"_id":"q-en-rust-b10b6ef5edbfb1e73e112bf8f5fa49cf5699c698bbbdbc8086a67d78d7fed805","text":"placeholder_type_error(tcx, None, &[], visitor.0, false); } hir::TraitItemKind::Type(_, None) => {} hir::TraitItemKind::Type(_, None) => { // #74612: Visit and try to find bad placeholders // even if there is no concrete type. let mut visitor = PlaceholderHirTyCollector::default(); visitor.visit_trait_item(trait_item); placeholder_type_error(tcx, None, &[], visitor.0, false); } }; tcx.ensure().predicates_of(def_id);"} {"_id":"q-en-rust-b111cee88113aab44e0e7a620b5688b5e609d8d74eabb1430ecdb1a13081dc57","text":" // check-pass // ignore-emscripten no llvm_asm! support #![feature(llvm_asm)] pub fn boot(addr: Option) { unsafe { llvm_asm!(\"mov sp, $0\"::\"r\" (addr)); } } fn main() {} "} {"_id":"q-en-rust-b150561dce4936de3f9b2917ae2d470e867c109fb77d83add17d145cb221d65b","text":" error[E0658]: attributes on expressions are experimental --> $DIR/issue-88476.rs:20:13 | LL | let x = #[rustc_capture_analysis] move || { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #15701 for more information = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable error[E0658]: attributes on expressions are experimental --> $DIR/issue-88476.rs:47:13 | LL | let c = #[rustc_capture_analysis] move || { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #15701 for more information = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable error: First Pass analysis includes: --> $DIR/issue-88476.rs:20:39 | LL | let x = #[rustc_capture_analysis] move || { | _______________________________________^ LL | | LL | | LL | | ... | LL | | LL | | }; | |_____^ | note: Capturing f[(0, 0)] -> ImmBorrow --> $DIR/issue-88476.rs:25:26 | LL | println!(\"{:?}\", f.0); | ^^^ error: Min Capture analysis includes: --> $DIR/issue-88476.rs:20:39 | LL | let x = #[rustc_capture_analysis] move || { | _______________________________________^ LL | | LL | | LL | | ... | LL | | LL | | }; | |_____^ | note: Min Capture f[] -> ByValue --> $DIR/issue-88476.rs:25:26 | LL | println!(\"{:?}\", f.0); | ^^^ error: First Pass analysis includes: --> $DIR/issue-88476.rs:47:39 | LL | let c = #[rustc_capture_analysis] move || { | _______________________________________^ LL | | LL | | LL | | ... | LL | | LL | | }; | |_____^ | note: Capturing character[(0, 0)] -> ImmBorrow --> $DIR/issue-88476.rs:52:24 | LL | println!(\"{}\", character.hp) | ^^^^^^^^^^^^ error: Min Capture analysis includes: --> $DIR/issue-88476.rs:47:39 | LL | let c = #[rustc_capture_analysis] move || { | _______________________________________^ LL | | LL | | LL | | ... | LL | | LL | | }; | |_____^ | note: Min Capture character[(0, 0)] -> ByValue --> $DIR/issue-88476.rs:52:24 | LL | println!(\"{}\", character.hp) | ^^^^^^^^^^^^ error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0658`. "} {"_id":"q-en-rust-b15d9a86303e4228816f3fdf91c20ab0a22b4314015bcbf15925ebba1bc682d4","text":"build::CondBr(bcx, cond.immediate(), lltrue, llfalse, DebugLoc::None); } mir::Terminator::Switch { .. } => { unimplemented!() mir::Terminator::Switch { ref discr, ref adt_def, ref targets } => { let adt_ty = bcx.tcx().lookup_item_type(adt_def.did).ty; let represented_ty = adt::represent_type(bcx.ccx(), adt_ty); let discr_lvalue = self.trans_lvalue(bcx, discr); let discr = adt::trans_get_discr(bcx, &represented_ty, discr_lvalue.llval, None); // The else branch of the Switch can't be hit, so branch to an unreachable // instruction so LLVM knows that // FIXME it might be nice to have just one such block (created lazilly), we could // store it in the \"MIR trans\" state. let unreachable_blk = bcx.fcx.new_temp_block(\"enum-variant-unreachable\"); build::Unreachable(unreachable_blk); let switch = build::Switch(bcx, discr, unreachable_blk.llbb, targets.len()); assert_eq!(adt_def.variants.len(), targets.len()); for (adt_variant, target) in adt_def.variants.iter().zip(targets) { let llval = adt::trans_case(bcx, &*represented_ty, adt_variant.disr_val); let llbb = self.llblock(*target); build::AddCase(switch, llval, llbb) } } mir::Terminator::SwitchInt { ref discr, switch_ty, ref values, ref targets } => {"} {"_id":"q-en-rust-b16257fbc770c45eec8f10d6d2c4a71bf60d4db5ac1f737e8320d3cd0fae3bd7","text":" // 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 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(rustc_attrs)] use std::fmt; // CoerceUnsized is not implemented for tuples. You can still create // an unsized tuple by transmuting a trait object. fn any() -> T { unreachable!() } #[rustc_error] fn main() { //~ ERROR compilation successful let t: &(u8, fmt::Debug) = any(); println!(\"{:?}\", &t.1); } "} {"_id":"q-en-rust-b16296d0a68eed85009cffa1d376aa88987cf5379552ab91a4bc6f42c97efc75","text":"None } Err(ErrorHandled::TooGeneric) => { span_bug!(tcx.def_span(expr_did), \"enum discriminant depends on generic arguments\",) tcx.sess.delay_span_bug( tcx.def_span(expr_did), \"enum discriminant depends on generic arguments\", ); None } } }"} {"_id":"q-en-rust-b1b095e85bf1b3308a31f36d6f7ced4c1a54ecc7462fa110dc0cb6652f293963","text":"unsafe { Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) } } else if A::MAY_HAVE_SIDE_EFFECT && self.index < self.a.size() { } else if A::MAY_HAVE_SIDE_EFFECT && self.index < self.a_len { let i = self.index; self.index += 1; self.len += 1;"} {"_id":"q-en-rust-b1b14bc488a8c4bff9e3e5dd145163c0f1c24ddf33f8250c77daf55bfe79ec27","text":" // check that we don't forget to drop the Box if we early return before // initializing it // ignore-tidy-linelength // ignore-wasm32-bare compiled with panic=abort by default #![feature(box_syntax)] fn test() -> Option> { Some(box (None?)) } fn main() { test(); } // END RUST SOURCE // START rustc.test.ElaborateDrops.before.mir // fn test() -> std::option::Option> { // ... // bb0: { // StorageLive(_1); // StorageLive(_2); // _2 = Box(u32); // StorageLive(_3); // StorageLive(_4); // _4 = std::option::Option::::None; // _3 = const as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // } // bb1 (cleanup): { // resume; // } // bb2: { // StorageDead(_4); // _5 = discriminant(_3); // switchInt(move _5) -> [0isize: bb10, 1isize: bb5, otherwise: bb4]; // } // bb3 (cleanup): { // drop(_2) -> bb1; // } // bb4: { // unreachable; // } // bb5: { // StorageLive(_6); // _6 = ((_3 as Err).0: std::option::NoneError); // StorageLive(_8); // StorageLive(_9); // _9 = _6; // _8 = const >::from(move _9) -> [return: bb7, unwind: bb3]; // } // bb6: { // return; // } // bb7: { // StorageDead(_9); // _0 = const > as std::ops::Try>::from_error(move _8) -> [return: bb8, unwind: bb3]; // } // bb8: { // StorageDead(_8); // StorageDead(_6); // drop(_2) -> bb9; // } // bb9: { // StorageDead(_2); // StorageDead(_1); // StorageDead(_3); // goto -> bb6; // } // bb10: { // StorageLive(_10); // _10 = ((_3 as Ok).0: u32); // (*_2) = _10; // StorageDead(_10); // _1 = move _2; // drop(_2) -> [return: bb12, unwind: bb11]; // } // bb11 (cleanup): { // drop(_1) -> bb1; // } // bb12: { // StorageDead(_2); // _0 = std::option::Option::>::Some(move _1,); // drop(_1) -> bb13; // } // bb13: { // StorageDead(_1); // StorageDead(_3); // goto -> bb6; // } // } // END rustc.test.ElaborateDrops.before.mir "} {"_id":"q-en-rust-b1d860b4cb49a04447681ff7432a5ab91887dab094170c2dd40bd98b5b5e71e5","text":"} } /// Constructs a new locked handle to the standard output of the current /// process. /// /// Each handle returned is a guard granting locked access to a shared /// global buffer whose access is synchronized via a mutex. If you need /// more explicit control over locking, for example, in a multi-threaded /// program, use the [`io::stdout`] function to obtain an unlocked handle, /// along with the [`Stdout::lock`] method. /// /// The lock is released when the returned guard goes out of scope. The /// returned guard also implements the [`Write`] trait for writing data. /// /// ### Note: Windows Portability Consideration /// When operating in a console, the Windows implementation of this stream does not support /// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return /// an error. /// /// # Examples /// /// ```no_run /// #![feature(stdio_locked)] /// use std::io::{self, Write}; /// /// fn main() -> io::Result<()> { /// let mut handle = io::stdout_locked(); /// /// handle.write_all(b\"hello world\")?; /// /// Ok(()) /// } /// ``` #[unstable(feature = \"stdio_locked\", issue = \"none\")] pub fn stdout_locked() -> StdoutLock<'static> { stdout().into_locked() } pub fn cleanup() { if let Some(instance) = STDOUT.get() { // Flush the data and disable buffering during shutdown"} {"_id":"q-en-rust-b1f61d197db48232fc35fb1848b361c2e24073056936683e7d15d35c11259016","text":"#![feature(inherent_associated_types)] #![allow(incomplete_features)] #![deny(single_use_lifetimes)] struct Foo(T);"} {"_id":"q-en-rust-b21eaad0d9b587eda69f4d3819fdce4ea65545a15f2fb7d0aa43c5b4012da202","text":"| help: try using `=` instead | LL - let x == 2; LL + let x = 2; | LL | let x = 2; | ~ error: aborting due to 1 previous error"} {"_id":"q-en-rust-b251542ee486f9a814240c9cfc82a335e62dd1662ae3ef59a4153cdf1502e2e9","text":"use rustc::hir; use rustc::hir::itemlikevisit::ItemLikeVisitor; use rustc::hir::def_id::DefId; use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt, TypeFoldable}; use rustc::ty::query::Providers; use rustc::util::nodemap::{FxHashMap, FxHashSet}; use std::collections::hash_map::Entry::{Occupied, Vacant};"} {"_id":"q-en-rust-b25a2f9e9e87ef57d63f2de2a695e16e63e0e6c77f1cd42e075dc7586478859e","text":"match *seq_tt { TokenTree::MetaVarDecl(_, _, id) => id.name == \"vis\", TokenTree::Sequence(_, ref sub_seq) => sub_seq.op == quoted::KleeneOp::ZeroOrMore, sub_seq.op == quoted::KleeneOp::ZeroOrMore || sub_seq.op == quoted::KleeneOp::ZeroOrOne, _ => false, } }) {"} {"_id":"q-en-rust-b261837cd593a472d8892a52cfdb6ab070dff316a68adca710e797d7a6ed0184","text":"{{- layout.external_html.before_content | safe -}} {#- -#}
{#- -#}
{#- -#}
{#- -#} {#- -#} logo {#- -#} {#- -#} {%- if layout.logo -%} \"logo\" {%- else -%} \"logo\" {%- endif -%} {#- -#}