diff --git a/.github/ISSUE_TEMPLATE/ice.md b/.github/ISSUE_TEMPLATE/ice.md new file mode 100644 index 0000000000000..2afcd210a6eb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ice.md @@ -0,0 +1,49 @@ +--- +name: Internal Compiler Error +about: Create a report for an internal compiler error in rustc. +labels: C-bug, I-ICE, T-compiler +--- + + +### Code + +```Rust + +``` + + +### Meta + + +`rustc --version --verbose`: +``` + +``` + +### Error output + +``` + +``` + + +
Backtrace +

+ +``` + +``` + +

+
diff --git a/.github/ISSUE_TEMPLATE/ice.yaml b/.github/ISSUE_TEMPLATE/ice.yaml index 54136cc6d439d..8d25bb41c0806 100644 --- a/.github/ISSUE_TEMPLATE/ice.yaml +++ b/.github/ISSUE_TEMPLATE/ice.yaml @@ -1,5 +1,5 @@ -name: Internal Compiler Error -description: Create a report for an internal compiler error in `rustc` +name: Internal Compiler Error (Structured form) +description: For now, you'll want to use the other ICE template, as GitHub forms have strict limits on the size of fields so backtraces cannot be pasted directly. labels: ["C-bug", "I-ICE", "T-compiler"] title: "[ICE]: " body: @@ -79,4 +79,4 @@ body: label: Anything else? description: If you have more details you want to give us to reproduce this issue, please add it here validations: - required: false \ No newline at end of file + required: false diff --git a/Cargo.lock b/Cargo.lock index b35892ccd523e..14758d0f07ef3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,7 +342,7 @@ dependencies = [ [[package]] name = "cargo" -version = "0.69.0" +version = "0.70.0" dependencies = [ "anyhow", "base64", diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index fe65ad9c6cb0e..5af6206c0bb80 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -1456,6 +1456,8 @@ pub enum PointerKind { UniqueOwned, } +/// Note that this information is advisory only, and backends are free to ignore it. +/// It can only be used to encode potential optimizations, but no critical information. #[derive(Copy, Clone, Debug)] pub struct PointeeInfo { pub size: Size, diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 275ed02c2b9f7..eece99a3eef03 100644 --- a/compiler/rustc_ast/src/util/comments.rs +++ b/compiler/rustc_ast/src/util/comments.rs @@ -58,23 +58,24 @@ pub fn beautify_doc_string(data: Symbol, kind: CommentKind) -> Symbol { // In case we have doc comments like `/**` or `/*!`, we want to remove stars if they are // present. However, we first need to strip the empty lines so they don't get in the middle // when we try to compute the "horizontal trim". - let lines = if kind == CommentKind::Block { - // Whatever happens, we skip the first line. - let mut i = lines - .get(0) - .map(|l| if l.trim_start().starts_with('*') { 0 } else { 1 }) - .unwrap_or(0); - let mut j = lines.len(); - - while i < j && lines[i].trim().is_empty() { - i += 1; - } - while j > i && lines[j - 1].trim().is_empty() { - j -= 1; + let lines = match kind { + CommentKind::Block => { + // Whatever happens, we skip the first line. + let mut i = lines + .get(0) + .map(|l| if l.trim_start().starts_with('*') { 0 } else { 1 }) + .unwrap_or(0); + let mut j = lines.len(); + + while i < j && lines[i].trim().is_empty() { + i += 1; + } + while j > i && lines[j - 1].trim().is_empty() { + j -= 1; + } + &lines[i..j] } - &lines[i..j] - } else { - lines + CommentKind::Line => lines, }; for line in lines { diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 6a8064b0e874e..fa8567eac6090 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -131,7 +131,7 @@ pub fn print_crate<'a>( // Currently, in Rust 2018 we don't have `extern crate std;` at the crate // root, so this is not needed, and actually breaks things. - if edition == Edition::Edition2015 { + if edition.rust_2015() { // `#![no_std]` let fake_attr = attr::mk_attr_word(g, ast::AttrStyle::Inner, sym::no_std, DUMMY_SP); s.print_attribute(&fake_attr); diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 45b15c2c5bd70..40f518b33cfb6 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -344,7 +344,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { } else { err.span_help(source_info.span, "try removing `&mut` here"); } - } else if decl.mutability == Mutability::Not { + } else if decl.mutability.is_not() { if matches!( decl.local_info, Some(box LocalInfo::User(ClearCrossCrate::Set(BindingForm::ImplicitSelf( diff --git a/compiler/rustc_borrowck/src/diagnostics/region_name.rs b/compiler/rustc_borrowck/src/diagnostics/region_name.rs index 9233287cf3a75..2440f20502ab1 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_name.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_name.rs @@ -187,6 +187,12 @@ impl Display for RegionName { } } +impl rustc_errors::IntoDiagnosticArg for RegionName { + fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { + self.to_string().into_diagnostic_arg() + } +} + impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { pub(crate) fn mir_def_id(&self) -> hir::def_id::LocalDefId { self.body.source.def_id().expect_local() diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs index b2d92d0dba7a4..c71413e8e7c04 100644 --- a/compiler/rustc_borrowck/src/nll.rs +++ b/compiler/rustc_borrowck/src/nll.rs @@ -369,6 +369,8 @@ pub(super) fn dump_mir_results<'tcx>( }; } +#[allow(rustc::diagnostic_outside_of_impl)] +#[allow(rustc::untranslatable_diagnostic)] pub(super) fn dump_annotation<'tcx>( infcx: &InferCtxt<'tcx>, body: &Body<'tcx>, diff --git a/compiler/rustc_borrowck/src/session_diagnostics.rs b/compiler/rustc_borrowck/src/session_diagnostics.rs index 23acf159240fa..13199d0385255 100644 --- a/compiler/rustc_borrowck/src/session_diagnostics.rs +++ b/compiler/rustc_borrowck/src/session_diagnostics.rs @@ -1,4 +1,4 @@ -use rustc_errors::{IntoDiagnosticArg, MultiSpan}; +use rustc_errors::MultiSpan; use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; use rustc_middle::ty::{GenericArg, Ty}; use rustc_span::Span; @@ -128,18 +128,6 @@ pub(crate) enum LifetimeReturnCategoryErr<'a> { }, } -impl IntoDiagnosticArg for &RegionName { - fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { - format!("{}", self).into_diagnostic_arg() - } -} - -impl IntoDiagnosticArg for RegionName { - fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { - format!("{}", self).into_diagnostic_arg() - } -} - #[derive(Subdiagnostic)] pub(crate) enum RequireStaticErr { #[note(borrowck_used_impl_require_static)] diff --git a/compiler/rustc_borrowck/src/type_check/canonical.rs b/compiler/rustc_borrowck/src/type_check/canonical.rs index 11729e2c83f0b..2b81a35052d7b 100644 --- a/compiler/rustc_borrowck/src/type_check/canonical.rs +++ b/compiler/rustc_borrowck/src/type_check/canonical.rs @@ -181,9 +181,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { user_ty: ty::UserType<'tcx>, span: Span, ) { - // FIXME: Ideally MIR types are normalized, but this is not always true. - let mir_ty = self.normalize(mir_ty, Locations::All(span)); - self.fully_perform_op( Locations::All(span), ConstraintCategory::Boring, @@ -217,7 +214,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { return; } + // FIXME: Ideally MIR types are normalized, but this is not always true. let mir_ty = self.normalize(mir_ty, Locations::All(span)); + let cause = ObligationCause::dummy_with_span(span); let param_env = self.param_env; let op = |infcx: &'_ _| { diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 06087b0c579d8..2605a1491fb35 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -2028,7 +2028,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { } }; - if ty_to_mut == Mutability::Mut && ty_mut == Mutability::Not { + if ty_to_mut.is_mut() && ty_mut.is_not() { span_mirbug!( self, rvalue, diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index bf1da38312f7d..5ab87feb98b11 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -200,6 +200,7 @@ unsafe impl Sync for GccContext {} impl WriteBackendMethods for GccCodegenBackend { type Module = GccContext; type TargetMachine = (); + type TargetMachineError = (); type ModuleBuffer = ModuleBuffer; type ThinData = (); type ThinBuffer = ThinBuffer; diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index 6c0faf37a63ce..d2e01708a37bc 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -1,5 +1,7 @@ use crate::back::write::{self, save_temp_bitcode, DiagnosticHandlers}; -use crate::errors::DynamicLinkingWithLTO; +use crate::errors::{ + DynamicLinkingWithLTO, LlvmError, LtoBitcodeFromRlib, LtoDisallowed, LtoDylib, +}; use crate::llvm::{self, build_string}; use crate::{LlvmCodegenBackend, ModuleLlvm}; use object::read::archive::ArchiveFile; @@ -77,15 +79,12 @@ fn prepare_lto( // Make sure we actually can run LTO for crate_type in cgcx.crate_types.iter() { if !crate_type_allows_lto(*crate_type) { - let e = diag_handler.fatal( - "lto can only be run for executables, cdylibs and \ - static library outputs", - ); - return Err(e); + diag_handler.emit_err(LtoDisallowed); + return Err(FatalError); } else if *crate_type == CrateType::Dylib { if !cgcx.opts.unstable_opts.dylib_lto { - return Err(diag_handler - .fatal("lto cannot be used for `dylib` crate type without `-Zdylib-lto`")); + diag_handler.emit_err(LtoDylib); + return Err(FatalError); } } } @@ -127,7 +126,10 @@ fn prepare_lto( let module = SerializedModule::FromRlib(data.to_vec()); upstream_modules.push((module, CString::new(name).unwrap())); } - Err(msg) => return Err(diag_handler.fatal(&msg)), + Err(e) => { + diag_handler.emit_err(e); + return Err(FatalError); + } } } } @@ -140,7 +142,7 @@ fn prepare_lto( Ok((symbols_below_threshold, upstream_modules)) } -fn get_bitcode_slice_from_object_data(obj: &[u8]) -> Result<&[u8], String> { +fn get_bitcode_slice_from_object_data(obj: &[u8]) -> Result<&[u8], LtoBitcodeFromRlib> { let mut len = 0; let data = unsafe { llvm::LLVMRustGetBitcodeSliceFromObjectData(obj.as_ptr(), obj.len(), &mut len) }; @@ -155,8 +157,9 @@ fn get_bitcode_slice_from_object_data(obj: &[u8]) -> Result<&[u8], String> { Ok(bc) } else { assert!(len == 0); - let msg = llvm::last_error().unwrap_or_else(|| "unknown LLVM error".to_string()); - Err(format!("failed to get bitcode from object file for LTO ({})", msg)) + Err(LtoBitcodeFromRlib { + llvm_err: llvm::last_error().unwrap_or_else(|| "unknown LLVM error".to_string()), + }) } } @@ -328,10 +331,9 @@ fn fat_lto( }); info!("linking {:?}", name); let data = bc_decoded.data(); - linker.add(data).map_err(|()| { - let msg = format!("failed to load bitcode of module {:?}", name); - write::llvm_err(diag_handler, &msg) - })?; + linker + .add(data) + .map_err(|()| write::llvm_err(diag_handler, LlvmError::LoadBitcode { name }))?; serialized_bitcode.push(bc_decoded); } drop(linker); @@ -489,7 +491,7 @@ fn thin_lto( symbols_below_threshold.as_ptr(), symbols_below_threshold.len() as u32, ) - .ok_or_else(|| write::llvm_err(diag_handler, "failed to prepare thin LTO context"))?; + .ok_or_else(|| write::llvm_err(diag_handler, LlvmError::PrepareThinLtoContext))?; let data = ThinData(data); @@ -562,8 +564,7 @@ fn thin_lto( // session, overwriting the previous serialized data (if any). if let Some(path) = key_map_path { if let Err(err) = curr_key_map.save_to_file(&path) { - let msg = format!("Error while writing ThinLTO key data: {}", err); - return Err(write::llvm_err(diag_handler, &msg)); + return Err(write::llvm_err(diag_handler, LlvmError::WriteThinLtoKey { err })); } } @@ -689,8 +690,7 @@ pub unsafe fn optimize_thin_module( let module_name = &thin_module.shared.module_names[thin_module.idx]; let tm_factory_config = TargetMachineFactoryConfig::new(cgcx, module_name.to_str().unwrap()); - let tm = - (cgcx.tm_factory)(tm_factory_config).map_err(|e| write::llvm_err(&diag_handler, &e))?; + let tm = (cgcx.tm_factory)(tm_factory_config).map_err(|e| write::llvm_err(&diag_handler, e))?; // Right now the implementation we've got only works over serialized // modules, so we create a fresh new LLVM context and parse the module @@ -717,8 +717,7 @@ pub unsafe fn optimize_thin_module( let mut cu2 = ptr::null_mut(); llvm::LLVMRustThinLTOGetDICompileUnit(llmod, &mut cu1, &mut cu2); if !cu2.is_null() { - let msg = "multiple source DICompileUnits found"; - return Err(write::llvm_err(&diag_handler, msg)); + return Err(write::llvm_err(&diag_handler, LlvmError::MultipleSourceDiCompileUnit)); } // Up next comes the per-module local analyses that we do for Thin LTO. @@ -733,8 +732,7 @@ pub unsafe fn optimize_thin_module( let _timer = cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_rename", thin_module.name()); if !llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) { - let msg = "failed to prepare thin LTO module"; - return Err(write::llvm_err(&diag_handler, msg)); + return Err(write::llvm_err(&diag_handler, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-rename"); } @@ -744,8 +742,7 @@ pub unsafe fn optimize_thin_module( .prof .generic_activity_with_arg("LLVM_thin_lto_resolve_weak", thin_module.name()); if !llvm::LLVMRustPrepareThinLTOResolveWeak(thin_module.shared.data.0, llmod) { - let msg = "failed to prepare thin LTO module"; - return Err(write::llvm_err(&diag_handler, msg)); + return Err(write::llvm_err(&diag_handler, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-resolve"); } @@ -755,8 +752,7 @@ pub unsafe fn optimize_thin_module( .prof .generic_activity_with_arg("LLVM_thin_lto_internalize", thin_module.name()); if !llvm::LLVMRustPrepareThinLTOInternalize(thin_module.shared.data.0, llmod) { - let msg = "failed to prepare thin LTO module"; - return Err(write::llvm_err(&diag_handler, msg)); + return Err(write::llvm_err(&diag_handler, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-internalize"); } @@ -765,8 +761,7 @@ pub unsafe fn optimize_thin_module( let _timer = cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_import", thin_module.name()); if !llvm::LLVMRustPrepareThinLTOImport(thin_module.shared.data.0, llmod, target) { - let msg = "failed to prepare thin LTO module"; - return Err(write::llvm_err(&diag_handler, msg)); + return Err(write::llvm_err(&diag_handler, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-import"); } @@ -886,11 +881,7 @@ pub fn parse_module<'a>( diag_handler: &Handler, ) -> Result<&'a llvm::Module, FatalError> { unsafe { - llvm::LLVMRustParseBitcodeForLTO(cx, data.as_ptr(), data.len(), name.as_ptr()).ok_or_else( - || { - let msg = "failed to parse bitcode for LTO module"; - write::llvm_err(diag_handler, msg) - }, - ) + llvm::LLVMRustParseBitcodeForLTO(cx, data.as_ptr(), data.len(), name.as_ptr()) + .ok_or_else(|| write::llvm_err(diag_handler, LlvmError::ParseBitcode)) } } diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index b2af9f31e4494..38f8733763dfa 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -5,6 +5,9 @@ use crate::back::profiling::{ use crate::base; use crate::common; use crate::consts; +use crate::errors::{ + CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, WithLlvmError, WriteBytecode, +}; use crate::llvm::{self, DiagnosticInfo, PassManager}; use crate::llvm_util; use crate::type_::Type; @@ -37,10 +40,10 @@ use std::slice; use std::str; use std::sync::Arc; -pub fn llvm_err(handler: &rustc_errors::Handler, msg: &str) -> FatalError { +pub fn llvm_err<'a>(handler: &rustc_errors::Handler, err: LlvmError<'a>) -> FatalError { match llvm::last_error() { - Some(err) => handler.fatal(&format!("{}: {}", msg, err)), - None => handler.fatal(msg), + Some(llvm_err) => handler.emit_almost_fatal(WithLlvmError(err, llvm_err)), + None => handler.emit_almost_fatal(err), } } @@ -85,10 +88,9 @@ pub fn write_output_file<'ll>( } } - result.into_result().map_err(|()| { - let msg = format!("could not write output to {}", output.display()); - llvm_err(handler, &msg) - }) + result + .into_result() + .map_err(|()| llvm_err(handler, LlvmError::WriteOutput { path: output })) } } @@ -98,7 +100,7 @@ pub fn create_informational_target_machine(sess: &Session) -> &'static mut llvm: // system/tcx is set up. let features = llvm_util::global_llvm_features(sess, false); target_machine_factory(sess, config::OptLevel::No, &features)(config) - .unwrap_or_else(|err| llvm_err(sess.diagnostic(), &err).raise()) + .unwrap_or_else(|err| llvm_err(sess.diagnostic(), err).raise()) } pub fn create_target_machine(tcx: TyCtxt<'_>, mod_name: &str) -> &'static mut llvm::TargetMachine { @@ -117,7 +119,7 @@ pub fn create_target_machine(tcx: TyCtxt<'_>, mod_name: &str) -> &'static mut ll tcx.backend_optimization_level(()), tcx.global_backend_features(()), )(config) - .unwrap_or_else(|err| llvm_err(tcx.sess.diagnostic(), &err).raise()) + .unwrap_or_else(|err| llvm_err(tcx.sess.diagnostic(), err).raise()) } pub fn to_llvm_opt_settings( @@ -240,9 +242,7 @@ pub fn target_machine_factory( ) }; - tm.ok_or_else(|| { - format!("Could not create LLVM TargetMachine for triple: {}", triple.to_str().unwrap()) - }) + tm.ok_or_else(|| LlvmError::CreateTargetMachine { triple: triple.clone() }) }) } @@ -355,25 +355,28 @@ unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void }; if enabled { - diag_handler.note_without_error(&format!( - "{}:{}:{}: {}: {}", - opt.filename, opt.line, opt.column, opt.pass_name, opt.message, - )); + diag_handler.emit_note(FromLlvmOptimizationDiag { + filename: &opt.filename, + line: opt.line, + column: opt.column, + pass_name: &opt.pass_name, + message: &opt.message, + }); } } llvm::diagnostic::PGO(diagnostic_ref) | llvm::diagnostic::Linker(diagnostic_ref) => { - let msg = llvm::build_string(|s| { + let message = llvm::build_string(|s| { llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s) }) .expect("non-UTF8 diagnostic"); - diag_handler.warn(&msg); + diag_handler.emit_warning(FromLlvmDiag { message }); } llvm::diagnostic::Unsupported(diagnostic_ref) => { - let msg = llvm::build_string(|s| { + let message = llvm::build_string(|s| { llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s) }) .expect("non-UTF8 diagnostic"); - diag_handler.err(&msg); + diag_handler.emit_err(FromLlvmDiag { message }); } llvm::diagnostic::UnknownDiagnostic(..) => {} } @@ -494,7 +497,7 @@ pub(crate) unsafe fn llvm_optimize( llvm_plugins.as_ptr().cast(), llvm_plugins.len(), ); - result.into_result().map_err(|()| llvm_err(diag_handler, "failed to run LLVM passes")) + result.into_result().map_err(|()| llvm_err(diag_handler, LlvmError::RunLlvmPasses)) } // Unsafe due to LLVM calls. @@ -547,8 +550,7 @@ pub(crate) fn link( let _timer = cgcx.prof.generic_activity_with_arg("LLVM_link_module", &*module.name); let buffer = ModuleBuffer::new(module.module_llvm.llmod()); linker.add(buffer.data()).map_err(|()| { - let msg = format!("failed to serialize module {:?}", module.name); - llvm_err(diag_handler, &msg) + llvm_err(diag_handler, LlvmError::SerializeModule { name: &module.name }) })?; } drop(linker); @@ -626,9 +628,8 @@ pub(crate) unsafe fn codegen( let _timer = cgcx .prof .generic_activity_with_arg("LLVM_module_codegen_emit_bitcode", &*module.name); - if let Err(e) = fs::write(&bc_out, data) { - let msg = format!("failed to write bytecode to {}: {}", bc_out.display(), e); - diag_handler.err(&msg); + if let Err(err) = fs::write(&bc_out, data) { + diag_handler.emit_err(WriteBytecode { path: &bc_out, err }); } } @@ -678,10 +679,9 @@ pub(crate) unsafe fn codegen( record_artifact_size(&cgcx.prof, "llvm_ir", &out); } - result.into_result().map_err(|()| { - let msg = format!("failed to write LLVM IR to {}", out.display()); - llvm_err(diag_handler, &msg) - })?; + result + .into_result() + .map_err(|()| llvm_err(diag_handler, LlvmError::WriteIr { path: &out }))?; } if config.emit_asm { @@ -749,8 +749,8 @@ pub(crate) unsafe fn codegen( EmitObj::Bitcode => { debug!("copying bitcode {:?} to obj {:?}", bc_out, obj_out); - if let Err(e) = link_or_copy(&bc_out, &obj_out) { - diag_handler.err(&format!("failed to copy bitcode to object file: {}", e)); + if let Err(err) = link_or_copy(&bc_out, &obj_out) { + diag_handler.emit_err(CopyBitcode { err }); } if !config.emit_bc { diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 32cd3a4efa227..c0b23585d3a77 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -150,17 +150,14 @@ pub unsafe fn create_module<'ll>( target_data_layout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32" .to_string(); - } - if sess.target.arch == "wasm32" { + } else if sess.target.arch == "wasm32" { target_data_layout = target_data_layout.replace("-p10:8:8-p20:8:8", ""); } } if llvm_version < (16, 0, 0) { if sess.target.arch == "s390x" { target_data_layout = target_data_layout.replace("-v128:64", ""); - } - - if sess.target.arch == "riscv64" { + } else if sess.target.arch == "riscv64" { target_data_layout = target_data_layout.replace("-n32:64-", "-n64-"); } } diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs index 001d1ce93d8b4..81072edc475c4 100644 --- a/compiler/rustc_codegen_llvm/src/errors.rs +++ b/compiler/rustc_codegen_llvm/src/errors.rs @@ -1,10 +1,11 @@ use std::borrow::Cow; +use std::ffi::CString; +use std::path::Path; -use rustc_errors::fluent; -use rustc_errors::DiagnosticBuilder; -use rustc_errors::ErrorGuaranteed; -use rustc_errors::Handler; -use rustc_errors::IntoDiagnostic; +use rustc_data_structures::small_c_str::SmallCStr; +use rustc_errors::{ + fluent, DiagnosticBuilder, EmissionGuarantee, ErrorGuaranteed, Handler, IntoDiagnostic, +}; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::Span; @@ -81,10 +82,18 @@ pub(crate) struct DlltoolFailImportLibrary<'a> { #[note] pub(crate) struct DynamicLinkingWithLTO; -#[derive(Diagnostic)] -#[diag(codegen_llvm_fail_parsing_target_machine_config_to_target_machine)] -pub(crate) struct FailParsingTargetMachineConfigToTargetMachine { - pub error: String, +pub(crate) struct ParseTargetMachineConfig<'a>(pub LlvmError<'a>); + +impl IntoDiagnostic<'_, EM> for ParseTargetMachineConfig<'_> { + fn into_diagnostic(self, sess: &'_ Handler) -> DiagnosticBuilder<'_, EM> { + let diag: DiagnosticBuilder<'_, EM> = self.0.into_diagnostic(sess); + let (message, _) = diag.styled_message().first().expect("`LlvmError` with no message"); + let message = sess.eagerly_translate_to_string(message.clone(), diag.args()); + + let mut diag = sess.struct_diagnostic(fluent::codegen_llvm_parse_target_machine_config); + diag.set_arg("error", message); + diag + } } pub(crate) struct TargetFeatureDisableOrEnable<'a> { @@ -110,3 +119,99 @@ impl IntoDiagnostic<'_, ErrorGuaranteed> for TargetFeatureDisableOrEnable<'_> { diag } } + +#[derive(Diagnostic)] +#[diag(codegen_llvm_lto_disallowed)] +pub(crate) struct LtoDisallowed; + +#[derive(Diagnostic)] +#[diag(codegen_llvm_lto_dylib)] +pub(crate) struct LtoDylib; + +#[derive(Diagnostic)] +#[diag(codegen_llvm_lto_bitcode_from_rlib)] +pub(crate) struct LtoBitcodeFromRlib { + pub llvm_err: String, +} + +#[derive(Diagnostic)] +pub enum LlvmError<'a> { + #[diag(codegen_llvm_write_output)] + WriteOutput { path: &'a Path }, + #[diag(codegen_llvm_target_machine)] + CreateTargetMachine { triple: SmallCStr }, + #[diag(codegen_llvm_run_passes)] + RunLlvmPasses, + #[diag(codegen_llvm_serialize_module)] + SerializeModule { name: &'a str }, + #[diag(codegen_llvm_write_ir)] + WriteIr { path: &'a Path }, + #[diag(codegen_llvm_prepare_thin_lto_context)] + PrepareThinLtoContext, + #[diag(codegen_llvm_load_bitcode)] + LoadBitcode { name: CString }, + #[diag(codegen_llvm_write_thinlto_key)] + WriteThinLtoKey { err: std::io::Error }, + #[diag(codegen_llvm_multiple_source_dicompileunit)] + MultipleSourceDiCompileUnit, + #[diag(codegen_llvm_prepare_thin_lto_module)] + PrepareThinLtoModule, + #[diag(codegen_llvm_parse_bitcode)] + ParseBitcode, +} + +pub(crate) struct WithLlvmError<'a>(pub LlvmError<'a>, pub String); + +impl IntoDiagnostic<'_, EM> for WithLlvmError<'_> { + fn into_diagnostic(self, sess: &'_ Handler) -> DiagnosticBuilder<'_, EM> { + use LlvmError::*; + let msg_with_llvm_err = match &self.0 { + WriteOutput { .. } => fluent::codegen_llvm_write_output_with_llvm_err, + CreateTargetMachine { .. } => fluent::codegen_llvm_target_machine_with_llvm_err, + RunLlvmPasses => fluent::codegen_llvm_run_passes_with_llvm_err, + SerializeModule { .. } => fluent::codegen_llvm_serialize_module_with_llvm_err, + WriteIr { .. } => fluent::codegen_llvm_write_ir_with_llvm_err, + PrepareThinLtoContext => fluent::codegen_llvm_prepare_thin_lto_context_with_llvm_err, + LoadBitcode { .. } => fluent::codegen_llvm_load_bitcode_with_llvm_err, + WriteThinLtoKey { .. } => fluent::codegen_llvm_write_thinlto_key_with_llvm_err, + MultipleSourceDiCompileUnit => { + fluent::codegen_llvm_multiple_source_dicompileunit_with_llvm_err + } + PrepareThinLtoModule => fluent::codegen_llvm_prepare_thin_lto_module_with_llvm_err, + ParseBitcode => fluent::codegen_llvm_parse_bitcode_with_llvm_err, + }; + let mut diag = self.0.into_diagnostic(sess); + diag.set_primary_message(msg_with_llvm_err); + diag.set_arg("llvm_err", self.1); + diag + } +} + +#[derive(Diagnostic)] +#[diag(codegen_llvm_from_llvm_optimization_diag)] +pub(crate) struct FromLlvmOptimizationDiag<'a> { + pub filename: &'a str, + pub line: std::ffi::c_uint, + pub column: std::ffi::c_uint, + pub pass_name: &'a str, + pub message: &'a str, +} + +#[derive(Diagnostic)] +#[diag(codegen_llvm_from_llvm_diag)] +pub(crate) struct FromLlvmDiag { + pub message: String, +} + +#[derive(Diagnostic)] +#[diag(codegen_llvm_write_bytecode)] +pub(crate) struct WriteBytecode<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(codegen_llvm_copy_bitcode)] +pub(crate) struct CopyBitcode { + pub err: std::io::Error, +} diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 246e82545c874..111d14b265cde 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -5,11 +5,12 @@ //! This API is completely unstable and subject to change. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![feature(extern_types)] #![feature(hash_raw_entry)] +#![feature(iter_intersperse)] #![feature(let_chains)] -#![feature(extern_types)] +#![feature(never_type)] #![feature(once_cell)] -#![feature(iter_intersperse)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] #![deny(rustc::untranslatable_diagnostic)] @@ -22,7 +23,7 @@ extern crate tracing; use back::write::{create_informational_target_machine, create_target_machine}; -use errors::FailParsingTargetMachineConfigToTargetMachine; +use errors::ParseTargetMachineConfig; pub use llvm_util::target_features; use rustc_ast::expand::allocator::AllocatorKind; use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule}; @@ -169,6 +170,7 @@ impl WriteBackendMethods for LlvmCodegenBackend { type Module = ModuleLlvm; type ModuleBuffer = back::lto::ModuleBuffer; type TargetMachine = &'static mut llvm::TargetMachine; + type TargetMachineError = crate::errors::LlvmError<'static>; type ThinData = back::lto::ThinData; type ThinBuffer = back::lto::ThinBuffer; fn print_pass_timings(&self) { @@ -416,8 +418,7 @@ impl ModuleLlvm { let tm = match (cgcx.tm_factory)(tm_factory_config) { Ok(m) => m, Err(e) => { - handler.emit_err(FailParsingTargetMachineConfigToTargetMachine { error: e }); - return Err(FatalError); + return Err(handler.emit_almost_fatal(ParseTargetMachineConfig(e))); } }; diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 9f1614af7b16c..8508ab87532c2 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -305,8 +305,12 @@ impl TargetMachineFactoryConfig { } pub type TargetMachineFactoryFn = Arc< - dyn Fn(TargetMachineFactoryConfig) -> Result<::TargetMachine, String> - + Send + dyn Fn( + TargetMachineFactoryConfig, + ) -> Result< + ::TargetMachine, + ::TargetMachineError, + > + Send + Sync, >; diff --git a/compiler/rustc_codegen_ssa/src/traits/write.rs b/compiler/rustc_codegen_ssa/src/traits/write.rs index e0e8ffa89ed15..9826256a4c5d5 100644 --- a/compiler/rustc_codegen_ssa/src/traits/write.rs +++ b/compiler/rustc_codegen_ssa/src/traits/write.rs @@ -8,6 +8,7 @@ use rustc_middle::dep_graph::WorkProduct; pub trait WriteBackendMethods: 'static + Sized + Clone { type Module: Send + Sync; type TargetMachine; + type TargetMachineError; type ModuleBuffer: ModuleBufferMethods; type ThinData: Send + Sync; type ThinBuffer: ThinBufferMethods; diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index a5bc121485d8c..d865d5bc974e0 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -622,10 +622,9 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, let alloc = alloc.inner(); if is_write { // Write access. These are never allowed, but we give a targeted error message. - if alloc.mutability == Mutability::Not { - Err(err_ub!(WriteToReadOnly(alloc_id)).into()) - } else { - Err(ConstEvalErrKind::ModifiedGlobal.into()) + match alloc.mutability { + Mutability::Not => Err(err_ub!(WriteToReadOnly(alloc_id)).into()), + Mutability::Mut => Err(ConstEvalErrKind::ModifiedGlobal.into()), } } else { // Read access. These are usually allowed, with some exceptions. diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 54528b1dbf4a0..301bfcef78a55 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -30,15 +30,15 @@ use super::{ use crate::const_eval; pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine< - 'mir, - 'tcx, - MemoryKind = T, - Provenance = AllocId, - ExtraFnVal = !, - FrameExtra = (), - AllocExtra = (), - MemoryMap = FxIndexMap, Allocation)>, ->; + 'mir, + 'tcx, + MemoryKind = T, + Provenance = AllocId, + ExtraFnVal = !, + FrameExtra = (), + AllocExtra = (), + MemoryMap = FxIndexMap, Allocation)>, + >; struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>> { /// The ectx from which we intern. diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 291bfb2b55896..a87ce0053e8a0 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -304,7 +304,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { .into()); }; - if alloc.mutability == Mutability::Not { + if alloc.mutability.is_not() { throw_ub_format!("deallocating immutable allocation {alloc_id:?}"); } if alloc_kind != kind { @@ -631,7 +631,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } let (_kind, alloc) = self.memory.alloc_map.get_mut(id).unwrap(); - if alloc.mutability == Mutability::Not { + if alloc.mutability.is_not() { throw_ub!(WriteToReadOnly(id)) } Ok((alloc, &mut self.machine)) diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index a2f2457487a4f..72f456138ef56 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -754,7 +754,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { // FIXME(JakobDegen) The validator should check that `self.mir_phase < // DropsLowered`. However, this causes ICEs with generation of drop shims, which // seem to fail to set their `MirPhase` correctly. - if *kind == RetagKind::Raw || *kind == RetagKind::TwoPhase { + if matches!(kind, RetagKind::Raw | RetagKind::TwoPhase) { self.fail(location, format!("explicit `{:?}` is forbidden", kind)); } } diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs index dda422c6dd07e..16f401f2057d1 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs @@ -95,10 +95,7 @@ pub trait ForestObligation: Clone + Debug { pub trait ObligationProcessor { type Obligation: ForestObligation; type Error: Debug; - type OUT: OutcomeTrait< - Obligation = Self::Obligation, - Error = Error, - >; + type OUT: OutcomeTrait>; fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool; diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index ccefd6adaf14b..02e0b042ad263 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -43,7 +43,6 @@ use rustc_span::source_map::{FileLoader, FileName}; use rustc_span::symbol::sym; use rustc_target::json::ToJson; -use std::borrow::Cow; use std::cmp::max; use std::env; use std::ffi::OsString; @@ -1205,29 +1204,20 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) { handler.emit_diagnostic(&mut d); } - let mut xs: Vec> = vec![ - "the compiler unexpectedly panicked. this is a bug.".into(), - format!("we would appreciate a bug report: {bug_report_url}").into(), - format!( - "rustc {} running on {}", - util::version_str!().unwrap_or("unknown_version"), - config::host_triple() - ) - .into(), - ]; + handler.emit_note(session_diagnostics::Ice); + handler.emit_note(session_diagnostics::IceBugReport { bug_report_url }); + handler.emit_note(session_diagnostics::IceVersion { + version: util::version_str!().unwrap_or("unknown_version"), + triple: config::host_triple(), + }); if let Some((flags, excluded_cargo_defaults)) = extra_compiler_flags() { - xs.push(format!("compiler flags: {}", flags.join(" ")).into()); - + handler.emit_note(session_diagnostics::IceFlags { flags: flags.join(" ") }); if excluded_cargo_defaults { - xs.push("some of the compiler flags provided by cargo are hidden".into()); + handler.emit_note(session_diagnostics::IceExcludeCargoDefaults); } } - for note in &xs { - handler.note_without_error(note.as_ref()); - } - // If backtraces are enabled, also print the query stack let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0"); diff --git a/compiler/rustc_driver/src/session_diagnostics.rs b/compiler/rustc_driver/src/session_diagnostics.rs index c1bc10891144c..a7aef9cbc2c8a 100644 --- a/compiler/rustc_driver/src/session_diagnostics.rs +++ b/compiler/rustc_driver/src/session_diagnostics.rs @@ -38,3 +38,30 @@ pub(crate) struct UnprettyDumpFail { pub path: String, pub err: String, } + +#[derive(Diagnostic)] +#[diag(driver_ice)] +pub(crate) struct Ice; + +#[derive(Diagnostic)] +#[diag(driver_ice_bug_report)] +pub(crate) struct IceBugReport<'a> { + pub bug_report_url: &'a str, +} + +#[derive(Diagnostic)] +#[diag(driver_ice_version)] +pub(crate) struct IceVersion<'a> { + pub version: &'a str, + pub triple: &'a str, +} + +#[derive(Diagnostic)] +#[diag(driver_ice_flags)] +pub(crate) struct IceFlags { + pub flags: String, +} + +#[derive(Diagnostic)] +#[diag(driver_ice_exclude_cargo_defaults)] +pub(crate) struct IceExcludeCargoDefaults; diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index 4ae372bb90432..072b0f2fcceab 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -5,7 +5,7 @@ // /!\ IMPORTANT /!\ // // Error messages' format must follow the RFC 1567 available here: -// https://github.com/rust-lang/rfcs/pull/1567 +// https://rust-lang.github.io/rfcs/1567-long-error-codes-explanation-normalization.html register_diagnostics! { E0001: include_str!("./error_codes/E0001.md"), @@ -510,6 +510,7 @@ E0789: include_str!("./error_codes/E0789.md"), E0790: include_str!("./error_codes/E0790.md"), E0791: include_str!("./error_codes/E0791.md"), E0792: include_str!("./error_codes/E0792.md"), +E0793: include_str!("./error_codes/E0793.md"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard diff --git a/compiler/rustc_error_codes/src/error_codes/E0793.md b/compiler/rustc_error_codes/src/error_codes/E0793.md new file mode 100644 index 0000000000000..b2e51e24e141f --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0793.md @@ -0,0 +1,64 @@ +An unaligned references to a field of a [packed] struct got created. + +Erroneous code example: + +```compile_fail,E0793 +#[repr(packed)] +pub struct Foo { + field1: u64, + field2: u8, +} + +unsafe { + let foo = Foo { field1: 0, field2: 0 }; + // Accessing the field directly is fine. + let val = foo.field1; + // A reference to a packed field causes a error. + let val = &foo.field1; // ERROR + // An implicit `&` is added in format strings, causing the same error. + println!("{}", foo.field1); // ERROR +} +``` + +Creating a reference to an insufficiently aligned packed field is +[undefined behavior] and therefore disallowed. Using an `unsafe` block does not +change anything about this. Instead, the code should do a copy of the data in +the packed field or use raw pointers and unaligned accesses. + +``` +#[repr(packed)] +pub struct Foo { + field1: u64, + field2: u8, +} + +unsafe { + let foo = Foo { field1: 0, field2: 0 }; + + // Instead of a reference, we can create a raw pointer... + let ptr = std::ptr::addr_of!(foo.field1); + // ... and then (crucially!) access it in an explicitly unaligned way. + let val = unsafe { ptr.read_unaligned() }; + // This would *NOT* be correct: + // let val = unsafe { *ptr }; // Undefined Behavior due to unaligned load! + + // For formatting, we can create a copy to avoid the direct reference. + let copy = foo.field1; + println!("{}", copy); + // Creating a copy can be written in a single line with curly braces. + // (This is equivalent to the two lines above.) + println!("{}", { foo.field1 }); +} +``` + +### Additional information + +Note that this error is specifically about *references* to packed fields. +Direct by-value access of those fields is fine, since then the compiler has +enough information to generate the correct kind of access. + +See [issue #82523] for more information. + +[packed]: https://doc.rust-lang.org/reference/type-layout.html#the-alignment-modifiers +[undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html +[issue #82523]: https://github.com/rust-lang/rust/issues/82523 diff --git a/compiler/rustc_error_messages/locales/en-US/codegen_llvm.ftl b/compiler/rustc_error_messages/locales/en-US/codegen_llvm.ftl index b82c903290b9a..e5df417370bb9 100644 --- a/compiler/rustc_error_messages/locales/en-US/codegen_llvm.ftl +++ b/compiler/rustc_error_messages/locales/en-US/codegen_llvm.ftl @@ -39,5 +39,51 @@ codegen_llvm_dynamic_linking_with_lto = cannot prefer dynamic linking when performing LTO .note = only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO -codegen_llvm_fail_parsing_target_machine_config_to_target_machine = +codegen_llvm_parse_target_machine_config = failed to parse target machine config to target machine: {$error} + +codegen_llvm_lto_disallowed = lto can only be run for executables, cdylibs and static library outputs + +codegen_llvm_lto_dylib = lto cannot be used for `dylib` crate type without `-Zdylib-lto` + +codegen_llvm_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$llvm_err}) + +codegen_llvm_write_output = could not write output to {$path} +codegen_llvm_write_output_with_llvm_err = could not write output to {$path}: {$llvm_err} + +codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$triple} +codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err} + +codegen_llvm_run_passes = failed to run LLVM passes +codegen_llvm_run_passes_with_llvm_err = failed to run LLVM passes: {$llvm_err} + +codegen_llvm_serialize_module = failed to serialize module {$name} +codegen_llvm_serialize_module_with_llvm_err = failed to serialize module {$name}: {$llvm_err} + +codegen_llvm_write_ir = failed to write LLVM IR to {$path} +codegen_llvm_write_ir_with_llvm_err = failed to write LLVM IR to {$path}: {$llvm_err} + +codegen_llvm_prepare_thin_lto_context = failed to prepare thin LTO context +codegen_llvm_prepare_thin_lto_context_with_llvm_err = failed to prepare thin LTO context: {$llvm_err} + +codegen_llvm_load_bitcode = failed to load bitcode of module "{$name}" +codegen_llvm_load_bitcode_with_llvm_err = failed to load bitcode of module "{$name}": {$llvm_err} + +codegen_llvm_write_thinlto_key = error while writing ThinLTO key data: {$err} +codegen_llvm_write_thinlto_key_with_llvm_err = error while writing ThinLTO key data: {$err}: {$llvm_err} + +codegen_llvm_multiple_source_dicompileunit = multiple source DICompileUnits found +codegen_llvm_multiple_source_dicompileunit_with_llvm_err = multiple source DICompileUnits found: {$llvm_err} + +codegen_llvm_prepare_thin_lto_module = failed to prepare thin LTO module +codegen_llvm_prepare_thin_lto_module_with_llvm_err = failed to prepare thin LTO module: {$llvm_err} + +codegen_llvm_parse_bitcode = failed to parse bitcode for LTO module +codegen_llvm_parse_bitcode_with_llvm_err = failed to parse bitcode for LTO module: {$llvm_err} + +codegen_llvm_from_llvm_optimization_diag = {$filename}:{$line}:{$column} {$pass_name}: {$message} +codegen_llvm_from_llvm_diag = {$message} + +codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err} + +codegen_llvm_copy_bitcode = failed to copy bitcode to object file: {$err} diff --git a/compiler/rustc_error_messages/locales/en-US/driver.ftl b/compiler/rustc_error_messages/locales/en-US/driver.ftl index 8ad198c86c933..79ffc82c6c67d 100644 --- a/compiler/rustc_error_messages/locales/en-US/driver.ftl +++ b/compiler/rustc_error_messages/locales/en-US/driver.ftl @@ -11,3 +11,9 @@ driver_rlink_rustc_version_mismatch = .rlink file was produced by rustc version driver_rlink_no_a_file = rlink must be a file driver_unpretty_dump_fail = pretty-print failed to write `{$path}` due to error `{$err}` + +driver_ice = the compiler unexpectedly panicked. this is a bug. +driver_ice_bug_report = we would appreciate a bug report: {$bug_report_url} +driver_ice_version = rustc {$version} running on {$triple} +driver_ice_flags = compiler flags: {$flags} +driver_ice_exclude_cargo_defaults = some of the compiler flags provided by cargo are hidden diff --git a/compiler/rustc_error_messages/locales/en-US/expand.ftl b/compiler/rustc_error_messages/locales/en-US/expand.ftl index df0e8ae5dd8f5..dbd80954382db 100644 --- a/compiler/rustc_error_messages/locales/en-US/expand.ftl +++ b/compiler/rustc_error_messages/locales/en-US/expand.ftl @@ -127,3 +127,5 @@ expand_module_file_not_found = expand_module_multiple_candidates = file for module `{$name}` found at both "{$default_path}" and "{$secondary_path}" .help = delete or rename one of them to remove the ambiguity + +expand_trace_macro = trace_macro diff --git a/compiler/rustc_error_messages/locales/en-US/incremental.ftl b/compiler/rustc_error_messages/locales/en-US/incremental.ftl new file mode 100644 index 0000000000000..4852ee0d9595c --- /dev/null +++ b/compiler/rustc_error_messages/locales/en-US/incremental.ftl @@ -0,0 +1,118 @@ +incremental_unrecognized_depnode = unrecognized `DepNode` variant: {$name} + +incremental_missing_depnode = missing `DepNode` variant + +incremental_missing_if_this_changed = no `#[rustc_if_this_changed]` annotation detected + +incremental_no_path = no path from `{$source}` to `{$target}` + +incremental_ok = OK + +incremental_unknown_reuse_kind = unknown cgu-reuse-kind `{$kind}` specified + +incremental_missing_query_depgraph = + found CGU-reuse attribute but `-Zquery-dep-graph` was not specified + +incremental_malformed_cgu_name = + found malformed codegen unit name `{$user_path}`. codegen units names must always start with the name of the crate (`{$crate_name}` in this case). + +incremental_no_module_named = + no module named `{$user_path}` (mangled: {$cgu_name}). available modules: {$cgu_names} + +incremental_field_associated_value_expected = associated value expected for `{$name}` + +incremental_no_field = no field `{$name}` + +incremental_assertion_auto = + `except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\" + +incremental_undefined_clean_dirty_assertions_item = + clean/dirty auto-assertions not yet defined for Node::Item.node={$kind} + +incremental_undefined_clean_dirty_assertions = + clean/dirty auto-assertions not yet defined for {$kind} + +incremental_repeated_depnode_label = dep-node label `{$label}` is repeated + +incremental_unrecognized_depnode_label = dep-node label `{$label}` not recognized + +incremental_not_dirty = `{$dep_node_str}` should be dirty but is not + +incremental_not_clean = `{$dep_node_str}` should be clean but is not + +incremental_not_loaded = `{$dep_node_str}` should have been loaded from disk but it was not + +incremental_unknown_item = unknown item `{$name}` + +incremental_no_cfg = no cfg attribute + +incremental_associated_value_expected_for = associated value expected for `{$ident}` + +incremental_associated_value_expected = expected an associated value + +incremental_unchecked_clean = found unchecked `#[rustc_clean]` attribute + +incremental_delete_old = unable to delete old {$name} at `{$path}`: {$err} + +incremental_create_new = failed to create {$name} at `{$path}`: {$err} + +incremental_write_new = failed to write {$name} to `{$path}`: {$err} + +incremental_canonicalize_path = incremental compilation: error canonicalizing path `{$path}`: {$err} + +incremental_create_incr_comp_dir = + could not create incremental compilation {$tag} directory `{$path}`: {$err} + +incremental_create_lock = + incremental compilation: could not create session directory lock file: {$lock_err} +incremental_lock_unsupported = + the filesystem for the incremental path at {$session_dir} does not appear to support locking, consider changing the incremental path to a filesystem that supports locking or disable incremental compilation +incremental_cargo_help_1 = + incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental) +incremental_cargo_help_2 = + the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir) + +incremental_delete_lock = + error deleting lock file for incremental compilation session directory `{$path}`: {$err} + +incremental_hard_link_failed = + hard linking files in the incremental compilation cache failed. copying files instead. consider moving the cache directory to a file system which supports hard linking in session dir `{$path}` + +incremental_delete_partial = failed to delete partly initialized session dir `{$path}`: {$err} + +incremental_delete_full = error deleting incremental compilation session directory `{$path}`: {$err} + +incremental_finalize = error finalizing incremental compilation session directory `{$path}`: {$err} + +incremental_invalid_gc_failed = + failed to garbage collect invalid incremental compilation session directory `{$path}`: {$err} + +incremental_finalized_gc_failed = + failed to garbage collect finalized incremental compilation session directory `{$path}`: {$err} + +incremental_session_gc_failed = + failed to garbage collect incremental compilation session directory `{$path}`: {$err} + +incremental_assert_not_loaded = + we asserted that the incremental cache should not be loaded, but it was loaded + +incremental_assert_loaded = + we asserted that an existing incremental cache directory should be successfully loaded, but it was not + +incremental_delete_incompatible = + failed to delete invalidated or incompatible incremental compilation session directory contents `{$path}`: {$err} + +incremental_load_dep_graph = could not load dep-graph from `{$path}`: {$err} + +incremental_decode_incr_cache = could not decode incremental cache: {$err} + +incremental_write_dep_graph = failed to write dependency graph to `{$path}`: {$err} + +incremental_move_dep_graph = failed to move dependency graph from `{$from}` to `{$to}`: {$err} + +incremental_create_dep_graph = failed to create dependency graph at `{$path}`: {$err} + +incremental_copy_workproduct_to_cache = + error copying object file `{$from}` to incremental directory as `{$to}`: {$err} + +incremental_delete_workproduct = file-system error deleting outdated file `{$path}`: {$err} diff --git a/compiler/rustc_error_messages/locales/en-US/interface.ftl b/compiler/rustc_error_messages/locales/en-US/interface.ftl index 688b044722260..a7bc0e7af1fe9 100644 --- a/compiler/rustc_error_messages/locales/en-US/interface.ftl +++ b/compiler/rustc_error_messages/locales/en-US/interface.ftl @@ -44,3 +44,13 @@ interface_failed_writing_file = interface_proc_macro_crate_panic_abort = building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic + +interface_unsupported_crate_type_for_target = + dropping unsupported crate type `{$crate_type}` for target `{$target_triple}` + +interface_multiple_output_types_adaption = + due to multiple output types requested, the explicitly specified output file name will be adapted for each output type + +interface_ignoring_extra_filename = ignoring -C extra-filename flag due to -o flag + +interface_ignoring_out_dir = ignoring --out-dir flag due to -o flag diff --git a/compiler/rustc_error_messages/locales/en-US/monomorphize.ftl b/compiler/rustc_error_messages/locales/en-US/monomorphize.ftl index 243d10bfa0621..6cea6a603f336 100644 --- a/compiler/rustc_error_messages/locales/en-US/monomorphize.ftl +++ b/compiler/rustc_error_messages/locales/en-US/monomorphize.ftl @@ -24,3 +24,9 @@ monomorphize_large_assignments = monomorphize_couldnt_dump_mono_stats = unexpected error occurred while dumping monomorphization stats: {$error} + +monomorphize_encountered_error_while_instantiating = + the above error was encountered while instantiating `{$formatted_item}` + +monomorphize_unknown_cgu_collection_mode = + unknown codegen-item collection mode '{$mode}', falling back to 'lazy' mode diff --git a/compiler/rustc_error_messages/locales/en-US/passes.ftl b/compiler/rustc_error_messages/locales/en-US/passes.ftl index 0c2ab3d08f9de..6ebb188288f00 100644 --- a/compiler/rustc_error_messages/locales/en-US/passes.ftl +++ b/compiler/rustc_error_messages/locales/en-US/passes.ftl @@ -731,3 +731,5 @@ passes_proc_macro_missing_args = mismatched {$kind} signature passes_proc_macro_invalid_abi = proc macro functions may not be `extern "{$abi}"` passes_proc_macro_unsafe = proc macro functions may not be `unsafe` + +passes_skipping_const_checks = skipping const checks diff --git a/compiler/rustc_error_messages/locales/en-US/session.ftl b/compiler/rustc_error_messages/locales/en-US/session.ftl index bc37d91a7c6af..5984c201af0d0 100644 --- a/compiler/rustc_error_messages/locales/en-US/session.ftl +++ b/compiler/rustc_error_messages/locales/en-US/session.ftl @@ -89,3 +89,5 @@ session_int_literal_too_large = integer literal is too large session_invalid_int_literal_width = invalid width `{$width}` for integer literal .help = valid widths are 8, 16, 32, 64 and 128 + +session_optimization_fuel_exhausted = optimization-fuel-exhausted: {$msg} diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index f053bdc3809be..1882d4b698e61 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -52,6 +52,7 @@ fluent_messages! { expand => "../locales/en-US/expand.ftl", hir_analysis => "../locales/en-US/hir_analysis.ftl", hir_typeck => "../locales/en-US/hir_typeck.ftl", + incremental => "../locales/en-US/incremental.ftl", infer => "../locales/en-US/infer.ftl", interface => "../locales/en-US/interface.ftl", lint => "../locales/en-US/lint.ftl", diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 4ad24c1400d69..df949e46fbde5 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -1051,6 +1051,7 @@ impl Diagnostic { ) -> ( &Level, &[(DiagnosticMessage, Style)], + Vec<(&Cow<'static, str>, &DiagnosticArgValue<'static>)>, &Option, &MultiSpan, &Result, SuggestionsDisabled>, @@ -1059,6 +1060,7 @@ impl Diagnostic { ( &self.level, &self.message, + self.args().collect(), &self.code, &self.span, &self.suggestions, diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index cbfee582d871f..c9d662ad43fe5 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -408,6 +408,59 @@ impl EmissionGuarantee for ! { } } +impl<'a> DiagnosticBuilder<'a, rustc_span::fatal_error::FatalError> { + /// Convenience function for internal use, clients should use one of the + /// `struct_*` methods on [`Handler`]. + #[track_caller] + pub(crate) fn new_almost_fatal( + handler: &'a Handler, + message: impl Into, + ) -> Self { + let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message); + Self::new_diagnostic_almost_fatal(handler, diagnostic) + } + + /// Creates a new `DiagnosticBuilder` with an already constructed + /// diagnostic. + pub(crate) fn new_diagnostic_almost_fatal( + handler: &'a Handler, + diagnostic: Diagnostic, + ) -> Self { + debug!("Created new diagnostic"); + Self { + inner: DiagnosticBuilderInner { + state: DiagnosticBuilderState::Emittable(handler), + diagnostic: Box::new(diagnostic), + }, + _marker: PhantomData, + } + } +} + +impl EmissionGuarantee for rustc_span::fatal_error::FatalError { + fn diagnostic_builder_emit_producing_guarantee(db: &mut DiagnosticBuilder<'_, Self>) -> Self { + match db.inner.state { + // First `.emit()` call, the `&Handler` is still available. + DiagnosticBuilderState::Emittable(handler) => { + db.inner.state = DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation; + + handler.emit_diagnostic(&mut db.inner.diagnostic); + } + // `.emit()` was previously called, disallowed from repeating it. + DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation => {} + } + // Then fatally error.. + rustc_span::fatal_error::FatalError + } + + fn make_diagnostic_builder( + handler: &Handler, + msg: impl Into, + ) -> DiagnosticBuilder<'_, Self> { + DiagnosticBuilder::new_almost_fatal(handler, msg) + } +} + /// In general, the `DiagnosticBuilder` uses deref to allow access to /// the fields and methods of the embedded `diagnostic` in a /// transparent way. *However,* many of the methods are intended to diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index dad5e98aac021..7a94ce3777a29 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -36,6 +36,12 @@ impl<'a, T: fmt::Display> From<&'a T> for DiagnosticArgFromDisplay<'a> { } } +impl<'a, T: Clone + IntoDiagnosticArg> IntoDiagnosticArg for &'a T { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + self.clone().into_diagnostic_arg() + } +} + macro_rules! into_diagnostic_arg_using_display { ($( $ty:ty ),+ $(,)?) => { $( @@ -153,12 +159,6 @@ impl IntoDiagnosticArg for ast::Path { } } -impl IntoDiagnosticArg for &ast::Path { - fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { - DiagnosticArgValue::Str(Cow::Owned(pprust::path_to_string(self))) - } -} - impl IntoDiagnosticArg for ast::token::Token { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { DiagnosticArgValue::Str(pprust::token_to_string(&self)) @@ -177,6 +177,18 @@ impl IntoDiagnosticArg for type_ir::FloatTy { } } +impl IntoDiagnosticArg for std::ffi::CString { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + DiagnosticArgValue::Str(Cow::Owned(self.to_string_lossy().into_owned())) + } +} + +impl IntoDiagnosticArg for rustc_data_structures::small_c_str::SmallCStr { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + DiagnosticArgValue::Str(Cow::Owned(self.to_string_lossy().into_owned())) + } +} + impl IntoDiagnosticArg for Level { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { DiagnosticArgValue::Str(Cow::Borrowed(self.to_cmd_flag())) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 628e199992152..faeaa54861970 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2113,30 +2113,38 @@ impl EmitterWriter { } } for sugg in suggestions { - if sugg.style == SuggestionStyle::CompletelyHidden { - // do not display this suggestion, it is meant only for tools - } else if sugg.style == SuggestionStyle::HideCodeAlways { - if let Err(e) = self.emit_message_default( - &MultiSpan::new(), - &[(sugg.msg.to_owned(), Style::HeaderMsg)], - args, - &None, - &Level::Help, - max_line_num_len, - true, - None, - ) { - panic!("failed to emit error: {}", e); + match sugg.style { + SuggestionStyle::CompletelyHidden => { + // do not display this suggestion, it is meant only for tools } - } else if let Err(e) = self.emit_suggestion_default( - span, - sugg, - args, - &Level::Help, - max_line_num_len, - ) { - panic!("failed to emit error: {}", e); - }; + SuggestionStyle::HideCodeAlways => { + if let Err(e) = self.emit_message_default( + &MultiSpan::new(), + &[(sugg.msg.to_owned(), Style::HeaderMsg)], + args, + &None, + &Level::Help, + max_line_num_len, + true, + None, + ) { + panic!("failed to emit error: {}", e); + } + } + SuggestionStyle::HideCodeInline + | SuggestionStyle::ShowCode + | SuggestionStyle::ShowAlways => { + if let Err(e) = self.emit_suggestion_default( + span, + sugg, + args, + &Level::Help, + max_line_num_len, + ) { + panic!("failed to emit error: {}", e); + } + } + } } } } diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index d076fc08b0e2f..ec04e865d53b1 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -617,22 +617,24 @@ impl Handler { } } - /// Translate `message` eagerly with `args`. + /// Translate `message` eagerly with `args` to `SubdiagnosticMessage::Eager`. pub fn eagerly_translate<'a>( &self, message: DiagnosticMessage, args: impl Iterator>, ) -> SubdiagnosticMessage { + SubdiagnosticMessage::Eager(self.eagerly_translate_to_string(message, args)) + } + + /// Translate `message` eagerly with `args` to `String`. + pub fn eagerly_translate_to_string<'a>( + &self, + message: DiagnosticMessage, + args: impl Iterator>, + ) -> String { let inner = self.inner.borrow(); let args = crate::translation::to_fluent_args(args); - SubdiagnosticMessage::Eager( - inner - .emitter - .translate_message(&message, &args) - .map_err(Report::new) - .unwrap() - .to_string(), - ) + inner.emitter.translate_message(&message, &args).map_err(Report::new).unwrap().to_string() } // This is here to not allow mutation of flags; @@ -1010,6 +1012,7 @@ impl Handler { } #[track_caller] + #[rustc_lint_diagnostics] pub fn span_note_without_error( &self, span: impl Into, @@ -1019,6 +1022,7 @@ impl Handler { } #[track_caller] + #[rustc_lint_diagnostics] pub fn span_note_diag( &self, span: Span, @@ -1030,19 +1034,23 @@ impl Handler { } // NOTE: intentionally doesn't raise an error so rustc_codegen_ssa only reports fatal errors in the main thread + #[rustc_lint_diagnostics] pub fn fatal(&self, msg: impl Into) -> FatalError { self.inner.borrow_mut().fatal(msg) } + #[rustc_lint_diagnostics] pub fn err(&self, msg: impl Into) -> ErrorGuaranteed { self.inner.borrow_mut().err(msg) } + #[rustc_lint_diagnostics] pub fn warn(&self, msg: impl Into) { let mut db = DiagnosticBuilder::new(self, Warning(None), msg); db.emit(); } + #[rustc_lint_diagnostics] pub fn note_without_error(&self, msg: impl Into) { DiagnosticBuilder::new(self, Note, msg).emit(); } @@ -1059,6 +1067,7 @@ impl Handler { pub fn has_errors(&self) -> Option { if self.inner.borrow().has_errors() { Some(ErrorGuaranteed(())) } else { None } } + pub fn has_errors_or_lint_errors(&self) -> Option { if self.inner.borrow().has_errors_or_lint_errors() { Some(ErrorGuaranteed::unchecked_claim_error_was_emitted()) @@ -1132,6 +1141,20 @@ impl Handler { self.create_warning(warning).emit() } + pub fn create_almost_fatal<'a>( + &'a self, + fatal: impl IntoDiagnostic<'a, FatalError>, + ) -> DiagnosticBuilder<'a, FatalError> { + fatal.into_diagnostic(self) + } + + pub fn emit_almost_fatal<'a>( + &'a self, + fatal: impl IntoDiagnostic<'a, FatalError>, + ) -> FatalError { + self.create_almost_fatal(fatal).emit() + } + pub fn create_fatal<'a>( &'a self, fatal: impl IntoDiagnostic<'a, !>, @@ -1157,6 +1180,17 @@ impl Handler { self.create_bug(bug).emit() } + pub fn emit_note<'a>(&'a self, note: impl IntoDiagnostic<'a, Noted>) -> Noted { + self.create_note(note).emit() + } + + pub fn create_note<'a>( + &'a self, + note: impl IntoDiagnostic<'a, Noted>, + ) -> DiagnosticBuilder<'a, Noted> { + note.into_diagnostic(self) + } + fn emit_diag_at_span( &self, mut diag: Diagnostic, diff --git a/compiler/rustc_errors/src/styled_buffer.rs b/compiler/rustc_errors/src/styled_buffer.rs index 9abdb5fc97c63..9aa14e1f21485 100644 --- a/compiler/rustc_errors/src/styled_buffer.rs +++ b/compiler/rustc_errors/src/styled_buffer.rs @@ -142,7 +142,7 @@ impl StyledBuffer { pub fn set_style(&mut self, line: usize, col: usize, style: Style, overwrite: bool) { if let Some(ref mut line) = self.lines.get_mut(line) { if let Some(StyledChar { style: s, .. }) = line.get_mut(col) { - if overwrite || *s == Style::NoStyle || *s == Style::Quotation { + if overwrite || matches!(s, Style::NoStyle | Style::Quotation) { *s = style; } } diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index 951d59246785d..5a48473d5b07c 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -4,7 +4,7 @@ use crate::errors::{ ArgumentNotAttributes, AttrNoArguments, AttributeMetaItem, AttributeSingleWord, AttributesWrongForm, CannotBeNameOfMacro, ExpectedCommaInList, HelperAttributeNameInvalid, MacroBodyStability, MacroConstStability, NotAMetaItem, OnlyOneArgument, OnlyOneWord, - ResolveRelativePath, TakesNoArguments, + ResolveRelativePath, TakesNoArguments, TraceMacro, }; use crate::expand::{self, AstFragment, Invocation}; use crate::module::DirOwnership; @@ -1142,8 +1142,8 @@ impl<'a> ExtCtxt<'a> { self.sess.parse_sess.span_diagnostic.span_bug(sp, msg); } pub fn trace_macros_diag(&mut self) { - for (sp, notes) in self.expansions.iter() { - let mut db = self.sess.parse_sess.span_diagnostic.span_note_diag(*sp, "trace_macro"); + for (span, notes) in self.expansions.iter() { + let mut db = self.sess.parse_sess.create_note(TraceMacro { span: *span }); for note in notes { db.note(note); } diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index afe5169d3f5c0..9b9697ab13d26 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -368,3 +368,10 @@ pub(crate) struct ModuleMultipleCandidates { pub default_path: String, pub secondary_path: String, } + +#[derive(Diagnostic)] +#[diag(expand_trace_macro)] +pub struct TraceMacro { + #[primary_span] + pub span: Span, +} diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs index 2e199541b92b4..283e68a68b5df 100644 --- a/compiler/rustc_expand/src/mbe/macro_parser.rs +++ b/compiler/rustc_expand/src/mbe/macro_parser.rs @@ -503,7 +503,7 @@ impl TtParser { mp.push_match(metavar_idx, seq_depth, MatchedSeq(vec![])); } - if op == KleeneOp::ZeroOrMore || op == KleeneOp::ZeroOrOne { + if matches!(op, KleeneOp::ZeroOrMore | KleeneOp::ZeroOrOne) { // Try zero matches of this sequence, by skipping over it. self.cur_mps.push(MatcherPos { idx: idx_first_after, diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index aab4b604fad42..e064e87a59a4e 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -49,7 +49,7 @@ declare_features! ( /// Allows `#[target_feature(...)]` on aarch64 platforms (accepted, aarch64_target_feature, "1.61.0", Some(44839), None), /// Allows using the `efiapi` ABI. - (accepted, abi_efiapi, "CURRENT_RUSTC_VERSION", Some(65815), None), + (accepted, abi_efiapi, "1.68.0", Some(65815), None), /// Allows the sysV64 ABI to be specified on all platforms /// instead of just the platforms on which it is the C ABI. (accepted, abi_sysv64, "1.24.0", Some(36167), None), @@ -129,7 +129,7 @@ declare_features! ( /// Allows `crate` in paths. (accepted, crate_in_paths, "1.30.0", Some(45477), None), /// Allows rustc to inject a default alloc_error_handler - (accepted, default_alloc_error_handler, "CURRENT_RUSTC_VERSION", Some(66741), None), + (accepted, default_alloc_error_handler, "1.68.0", Some(66741), None), /// Allows using assigning a default type to type parameters in algebraic data type definitions. (accepted, default_type_params, "1.0.0", None, None), /// Allows `#[deprecated]` attribute. @@ -164,7 +164,7 @@ declare_features! ( /// Allows access to crate names passed via `--extern` through prelude. (accepted, extern_prelude, "1.30.0", Some(44660), None), /// Allows using F16C intrinsics from `core::arch::{x86, x86_64}`. - (accepted, f16c_target_feature, "CURRENT_RUSTC_VERSION", Some(44839), None), + (accepted, f16c_target_feature, "1.68.0", Some(44839), None), /// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions. (accepted, field_init_shorthand, "1.17.0", Some(37340), None), /// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940). diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index af9c40a3ba522..323f5a368fc09 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -342,7 +342,7 @@ declare_features! ( /// Allows `async {}` expressions in const contexts. (active, const_async_blocks, "1.53.0", Some(85368), None), /// Allows `const || {}` closures in const contexts. - (incomplete, const_closures, "CURRENT_RUSTC_VERSION", Some(106003), None), + (incomplete, const_closures, "1.68.0", Some(106003), None), /// Allows limiting the evaluation steps of const expressions (active, const_eval_limit, "1.43.0", Some(67217), None), /// Allows the definition of `const extern fn` and `const unsafe extern fn`. diff --git a/compiler/rustc_hir_analysis/src/astconv/generics.rs b/compiler/rustc_hir_analysis/src/astconv/generics.rs index 7a499327dbf24..5e8f727df69da 100644 --- a/compiler/rustc_hir_analysis/src/astconv/generics.rs +++ b/compiler/rustc_hir_analysis/src/astconv/generics.rs @@ -385,10 +385,9 @@ pub fn check_generic_arg_count_for_call( ) -> GenericArgCountResult { let empty_args = hir::GenericArgs::none(); let gen_args = seg.args.unwrap_or(&empty_args); - let gen_pos = if is_method_call == IsMethodCall::Yes { - GenericArgPosition::MethodCall - } else { - GenericArgPosition::Value + let gen_pos = match is_method_call { + IsMethodCall::Yes => GenericArgPosition::MethodCall, + IsMethodCall::No => GenericArgPosition::Value, }; let has_self = generics.parent.is_none() && generics.has_self; diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index 6f4ebc987e6a9..47eace961be55 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -442,6 +442,7 @@ fn check_opaque_meets_bounds<'tcx>( match ocx.eq(&misc_cause, param_env, opaque_ty, hidden_ty) { Ok(()) => {} Err(ty_err) => { + let ty_err = ty_err.to_string(tcx); tcx.sess.delay_span_bug( span, &format!("could not unify `{hidden_ty}` with revealed type:\n{ty_err}"), @@ -605,59 +606,66 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) { }; check_abi(tcx, it.hir_id(), it.span, abi); - if abi == Abi::RustIntrinsic { - for item in items { - let item = tcx.hir().foreign_item(item.id); - intrinsic::check_intrinsic_type(tcx, item); - } - } else if abi == Abi::PlatformIntrinsic { - for item in items { - let item = tcx.hir().foreign_item(item.id); - intrinsic::check_platform_intrinsic_type(tcx, item); + match abi { + Abi::RustIntrinsic => { + for item in items { + let item = tcx.hir().foreign_item(item.id); + intrinsic::check_intrinsic_type(tcx, item); + } } - } else { - for item in items { - let def_id = item.id.owner_id.def_id; - let generics = tcx.generics_of(def_id); - let own_counts = generics.own_counts(); - if generics.params.len() - own_counts.lifetimes != 0 { - let (kinds, kinds_pl, egs) = match (own_counts.types, own_counts.consts) { - (_, 0) => ("type", "types", Some("u32")), - // We don't specify an example value, because we can't generate - // a valid value for any type. - (0, _) => ("const", "consts", None), - _ => ("type or const", "types or consts", None), - }; - struct_span_err!( - tcx.sess, - item.span, - E0044, - "foreign items may not have {kinds} parameters", - ) - .span_label(item.span, &format!("can't have {kinds} parameters")) - .help( - // FIXME: once we start storing spans for type arguments, turn this - // into a suggestion. - &format!( - "replace the {} parameters with concrete {}{}", - kinds, - kinds_pl, - egs.map(|egs| format!(" like `{}`", egs)).unwrap_or_default(), - ), - ) - .emit(); + + Abi::PlatformIntrinsic => { + for item in items { + let item = tcx.hir().foreign_item(item.id); + intrinsic::check_platform_intrinsic_type(tcx, item); } + } - let item = tcx.hir().foreign_item(item.id); - match &item.kind { - hir::ForeignItemKind::Fn(fn_decl, _, _) => { - require_c_abi_if_c_variadic(tcx, fn_decl, abi, item.span); + _ => { + for item in items { + let def_id = item.id.owner_id.def_id; + let generics = tcx.generics_of(def_id); + let own_counts = generics.own_counts(); + if generics.params.len() - own_counts.lifetimes != 0 { + let (kinds, kinds_pl, egs) = match (own_counts.types, own_counts.consts) + { + (_, 0) => ("type", "types", Some("u32")), + // We don't specify an example value, because we can't generate + // a valid value for any type. + (0, _) => ("const", "consts", None), + _ => ("type or const", "types or consts", None), + }; + struct_span_err!( + tcx.sess, + item.span, + E0044, + "foreign items may not have {kinds} parameters", + ) + .span_label(item.span, &format!("can't have {kinds} parameters")) + .help( + // FIXME: once we start storing spans for type arguments, turn this + // into a suggestion. + &format!( + "replace the {} parameters with concrete {}{}", + kinds, + kinds_pl, + egs.map(|egs| format!(" like `{}`", egs)).unwrap_or_default(), + ), + ) + .emit(); } - hir::ForeignItemKind::Static(..) => { - check_static_inhabited(tcx, def_id); - check_static_linkage(tcx, def_id); + + let item = tcx.hir().foreign_item(item.id); + match &item.kind { + hir::ForeignItemKind::Fn(fn_decl, _, _) => { + require_c_abi_if_c_variadic(tcx, fn_decl, abi, item.span); + } + hir::ForeignItemKind::Static(..) => { + check_static_inhabited(tcx, def_id); + check_static_linkage(tcx, def_id); + } + _ => {} } - _ => {} } } } diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs index 3115f5f464a09..21e7004181050 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs @@ -1930,7 +1930,7 @@ pub(super) fn check_type_bounds<'tcx>( smallvec::SmallVec::with_capacity(defs.count()); InternalSubsts::fill_single(&mut substs, defs, &mut |param, _| match param.kind { GenericParamDefKind::Type { .. } => { - let kind = ty::BoundTyKind::Param(param.name); + let kind = ty::BoundTyKind::Param(param.def_id, param.name); let bound_var = ty::BoundVariableKind::Ty(kind); bound_vars.push(bound_var); tcx.mk_ty(ty::Bound( diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index f74c551a45b66..7dcf9d8299f14 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -9,9 +9,7 @@ use rustc_ast_pretty::pp::{self, Breaks}; use rustc_ast_pretty::pprust::{Comments, PrintState}; use rustc_hir as hir; use rustc_hir::LifetimeParamKind; -use rustc_hir::{ - BindingAnnotation, ByRef, GenericArg, GenericParam, GenericParamKind, Mutability, Node, Term, -}; +use rustc_hir::{BindingAnnotation, ByRef, GenericArg, GenericParam, GenericParamKind, Node, Term}; use rustc_hir::{GenericBound, PatKind, RangeEnd, TraitBoundModifier}; use rustc_span::source_map::SourceMap; use rustc_span::symbol::{kw, Ident, IdentPrinter, Symbol}; @@ -1746,7 +1744,7 @@ impl<'a> State<'a> { if by_ref == ByRef::Yes { self.word_nbsp("ref"); } - if mutbl == Mutability::Mut { + if mutbl.is_mut() { self.word_nbsp("mut"); } self.print_ident(ident); diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index 329b69eff54a3..90c4e5b6540b0 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -15,6 +15,7 @@ use rustc_middle::ty::visit::TypeVisitable; use rustc_middle::ty::{self, Ty, TypeSuperVisitable, TypeVisitor}; use rustc_span::def_id::LocalDefId; use rustc_span::source_map::Span; +use rustc_span::sym; use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits; use rustc_trait_selection::traits::error_reporting::ArgKind; @@ -288,21 +289,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let trait_def_id = projection.trait_def_id(tcx); let is_fn = tcx.is_fn_trait(trait_def_id); - let gen_trait = tcx.require_lang_item(LangItem::Generator, cause_span); - let is_gen = gen_trait == trait_def_id; + + let gen_trait = tcx.lang_items().gen_trait(); + let is_gen = gen_trait == Some(trait_def_id); + if !is_fn && !is_gen { debug!("not fn or generator"); return None; } - if is_gen { - // Check that we deduce the signature from the `<_ as std::ops::Generator>::Return` - // associated item and not yield. - let return_assoc_item = self.tcx.associated_item_def_ids(gen_trait)[1]; - if return_assoc_item != projection.projection_def_id() { - debug!("not return assoc item of generator"); - return None; - } + // Check that we deduce the signature from the `<_ as std::ops::Generator>::Return` + // associated item and not yield. + if is_gen && self.tcx.associated_item(projection.projection_def_id()).name != sym::Return { + debug!("not `Return` assoc item of `Generator`"); + return None; } let input_tys = if is_fn { diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index a355a54d6959a..237142acca660 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -454,8 +454,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { None if let Some(e) = self.tainted_by_errors() => self.tcx.ty_error_with_guaranteed(e), None => { bug!( - "no type for node {}: {} in fcx {}", - id, + "no type for node {} in fcx {}", self.tcx.hir().node_to_string(id), self.tag() ); diff --git a/compiler/rustc_hir_typeck/src/mem_categorization.rs b/compiler/rustc_hir_typeck/src/mem_categorization.rs index 48c75cde9a5fc..92240b66eb1d4 100644 --- a/compiler/rustc_hir_typeck/src/mem_categorization.rs +++ b/compiler/rustc_hir_typeck/src/mem_categorization.rs @@ -155,8 +155,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> { None if self.is_tainted_by_errors() => Err(()), None => { bug!( - "no type for node {}: {} in mem_categorization", - id, + "no type for node {} in mem_categorization", self.tcx().hir().node_to_string(id) ); } diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 9fc4c16fb071d..0b30bf957a3d3 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -1354,13 +1354,12 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { return Some(Err(MethodError::Ambiguity(sources))); } - applicable_candidates.pop().map(|(probe, status)| { - if status == ProbeResult::Match { + applicable_candidates.pop().map(|(probe, status)| match status { + ProbeResult::Match => { Ok(probe .to_unadjusted_pick(self_ty, unstable_candidates.cloned().unwrap_or_default())) - } else { - Err(MethodError::BadReturnType) } + ProbeResult::NoMatch | ProbeResult::BadReturnType => Err(MethodError::BadReturnType), }) } } diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index 31d55a41d8a31..54890489f8b8f 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -259,7 +259,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let mode = no_match_data.mode; let tcx = self.tcx; let rcvr_ty = self.resolve_vars_if_possible(rcvr_ty); - let ty_str = with_forced_trimmed_paths!(self.ty_to_string(rcvr_ty)); + let (ty_str, ty_file) = tcx.short_ty_string(rcvr_ty); + let short_ty_str = with_forced_trimmed_paths!(rcvr_ty.to_string()); let is_method = mode == Mode::MethodCall; let unsatisfied_predicates = &no_match_data.unsatisfied_predicates; let similar_candidate = no_match_data.similar_candidate; @@ -276,11 +277,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } }; - if self.suggest_wrapping_range_with_parens(tcx, rcvr_ty, source, span, item_name, &ty_str) - || self.suggest_constraining_numerical_ty( - tcx, rcvr_ty, source, span, item_kind, item_name, &ty_str, - ) - { + // We could pass the file for long types into these two, but it isn't strictly necessary + // given how targetted they are. + if self.suggest_wrapping_range_with_parens( + tcx, + rcvr_ty, + source, + span, + item_name, + &short_ty_str, + ) || self.suggest_constraining_numerical_ty( + tcx, + rcvr_ty, + source, + span, + item_kind, + item_name, + &short_ty_str, + ) { return None; } span = item_name.span; @@ -319,6 +333,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { rcvr_ty.prefix_string(self.tcx), ty_str_reported, ); + let ty_str = if short_ty_str.len() < ty_str.len() && ty_str.len() > 10 { + short_ty_str + } else { + ty_str + }; + if let Some(file) = ty_file { + err.note(&format!("the full type name has been written to '{}'", file.display(),)); + } if rcvr_ty.references_error() { err.downgrade_to_delayed_bug(); } @@ -826,7 +848,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let primary_message = primary_message.unwrap_or_else(|| { format!( "the {item_kind} `{item_name}` exists for {actual_prefix} `{ty_str}`, \ - but its trait bounds were not satisfied" + but its trait bounds were not satisfied" ) }); err.set_primary_message(&primary_message); diff --git a/compiler/rustc_hir_typeck/src/op.rs b/compiler/rustc_hir_typeck/src/op.rs index 78cea1f4d8d3e..67769fe4478a2 100644 --- a/compiler/rustc_hir_typeck/src/op.rs +++ b/compiler/rustc_hir_typeck/src/op.rs @@ -335,7 +335,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { format!("cannot divide `{lhs_ty}` by `{rhs_ty}`") } hir::BinOpKind::Rem => { - format!("cannot mod `{lhs_ty}` by `{rhs_ty}`") + format!( + "cannot calculate the remainder of `{lhs_ty}` divided by `{rhs_ty}`" + ) } hir::BinOpKind::BitAnd => { format!("no implementation for `{lhs_ty} & {rhs_ty}`") diff --git a/compiler/rustc_incremental/src/assert_dep_graph.rs b/compiler/rustc_incremental/src/assert_dep_graph.rs index 6703d53f3805c..22bd12f2e6361 100644 --- a/compiler/rustc_incremental/src/assert_dep_graph.rs +++ b/compiler/rustc_incremental/src/assert_dep_graph.rs @@ -33,6 +33,7 @@ //! fn baz() { foo(); } //! ``` +use crate::errors; use rustc_ast as ast; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::implementation::{Direction, NodeIndex, INCOMING, OUTGOING}; @@ -133,12 +134,10 @@ impl<'tcx> IfThisChanged<'tcx> { Some(n) => { match DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash) { Ok(n) => n, - Err(()) => { - self.tcx.sess.span_fatal( - attr.span, - &format!("unrecognized DepNode variant {:?}", n), - ); - } + Err(()) => self.tcx.sess.emit_fatal(errors::UnrecognizedDepNode { + span: attr.span, + name: n, + }), } } }; @@ -149,16 +148,14 @@ impl<'tcx> IfThisChanged<'tcx> { Some(n) => { match DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash) { Ok(n) => n, - Err(()) => { - self.tcx.sess.span_fatal( - attr.span, - &format!("unrecognized DepNode variant {:?}", n), - ); - } + Err(()) => self.tcx.sess.emit_fatal(errors::UnrecognizedDepNode { + span: attr.span, + name: n, + }), } } None => { - self.tcx.sess.span_fatal(attr.span, "missing DepNode variant"); + self.tcx.sess.emit_fatal(errors::MissingDepNode { span: attr.span }); } }; self.then_this_would_need.push(( @@ -204,7 +201,7 @@ fn check_paths<'tcx>(tcx: TyCtxt<'tcx>, if_this_changed: &Sources, then_this_wou // Return early here so as not to construct the query, which is not cheap. if if_this_changed.is_empty() { for &(target_span, _, _, _) in then_this_would_need { - tcx.sess.span_err(target_span, "no `#[rustc_if_this_changed]` annotation detected"); + tcx.sess.emit_err(errors::MissingIfThisChanged { span: target_span }); } return; } @@ -213,16 +210,13 @@ fn check_paths<'tcx>(tcx: TyCtxt<'tcx>, if_this_changed: &Sources, then_this_wou let dependents = query.transitive_predecessors(source_dep_node); for &(target_span, ref target_pass, _, ref target_dep_node) in then_this_would_need { if !dependents.contains(&target_dep_node) { - tcx.sess.span_err( - target_span, - &format!( - "no path from `{}` to `{}`", - tcx.def_path_str(source_def_id), - target_pass - ), - ); + tcx.sess.emit_err(errors::NoPath { + span: target_span, + source: tcx.def_path_str(source_def_id), + target: *target_pass, + }); } else { - tcx.sess.span_err(target_span, "OK"); + tcx.sess.emit_err(errors::Ok { span: target_span }); } } } diff --git a/compiler/rustc_incremental/src/assert_module_sources.rs b/compiler/rustc_incremental/src/assert_module_sources.rs index 89d419bc8e90f..2968a0e1203a9 100644 --- a/compiler/rustc_incremental/src/assert_module_sources.rs +++ b/compiler/rustc_incremental/src/assert_module_sources.rs @@ -22,6 +22,7 @@ //! allows for doing a more fine-grained check to see if pre- or post-lto data //! was re-used. +use crate::errors; use rustc_ast as ast; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def_id::LOCAL_CRATE; @@ -66,10 +67,9 @@ impl<'tcx> AssertModuleSource<'tcx> { sym::post_dash_lto => (CguReuse::PostLto, ComparisonKind::Exact), sym::any => (CguReuse::PreLto, ComparisonKind::AtLeast), other => { - self.tcx.sess.span_fatal( - attr.span, - &format!("unknown cgu-reuse-kind `{}` specified", other), - ); + self.tcx + .sess + .emit_fatal(errors::UnknownReuseKind { span: attr.span, kind: other }); } } } else { @@ -77,10 +77,7 @@ impl<'tcx> AssertModuleSource<'tcx> { }; if !self.tcx.sess.opts.unstable_opts.query_dep_graph { - self.tcx.sess.span_fatal( - attr.span, - "found CGU-reuse attribute but `-Zquery-dep-graph` was not specified", - ); + self.tcx.sess.emit_fatal(errors::MissingQueryDepGraph { span: attr.span }); } if !self.check_config(attr) { @@ -92,13 +89,11 @@ impl<'tcx> AssertModuleSource<'tcx> { let crate_name = self.tcx.crate_name(LOCAL_CRATE).to_string(); if !user_path.starts_with(&crate_name) { - let msg = format!( - "Found malformed codegen unit name `{}`. \ - Codegen units names must always start with the name of the \ - crate (`{}` in this case).", - user_path, crate_name - ); - self.tcx.sess.span_fatal(attr.span, &msg); + self.tcx.sess.emit_fatal(errors::MalformedCguName { + span: attr.span, + user_path, + crate_name, + }); } // Split of the "special suffix" if there is one. @@ -125,15 +120,12 @@ impl<'tcx> AssertModuleSource<'tcx> { let mut cgu_names: Vec<&str> = self.available_cgus.iter().map(|cgu| cgu.as_str()).collect(); cgu_names.sort(); - self.tcx.sess.span_err( - attr.span, - &format!( - "no module named `{}` (mangled: {}). Available modules: {}", - user_path, - cgu_name, - cgu_names.join(", ") - ), - ); + self.tcx.sess.emit_err(errors::NoModuleNamed { + span: attr.span, + user_path, + cgu_name, + cgu_names: cgu_names.join(", "), + }); } self.tcx.sess.cgu_reuse_tracker.set_expectation( @@ -151,15 +143,15 @@ impl<'tcx> AssertModuleSource<'tcx> { if let Some(value) = item.value_str() { return value; } else { - self.tcx.sess.span_fatal( - item.span(), - &format!("associated value expected for `{}`", name), - ); + self.tcx.sess.emit_fatal(errors::FieldAssociatedValueExpected { + span: item.span(), + name, + }); } } } - self.tcx.sess.span_fatal(attr.span, &format!("no field `{}`", name)); + self.tcx.sess.emit_fatal(errors::NoField { span: attr.span, name }); } /// Scan for a `cfg="foo"` attribute and check whether we have a diff --git a/compiler/rustc_incremental/src/errors.rs b/compiler/rustc_incremental/src/errors.rs new file mode 100644 index 0000000000000..deb8767836543 --- /dev/null +++ b/compiler/rustc_incremental/src/errors.rs @@ -0,0 +1,364 @@ +use rustc_macros::Diagnostic; +use rustc_span::{symbol::Ident, Span, Symbol}; +use std::path::{Path, PathBuf}; + +#[derive(Diagnostic)] +#[diag(incremental_unrecognized_depnode)] +pub struct UnrecognizedDepNode { + #[primary_span] + pub span: Span, + pub name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(incremental_missing_depnode)] +pub struct MissingDepNode { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_missing_if_this_changed)] +pub struct MissingIfThisChanged { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_ok)] +pub struct Ok { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_no_path)] +pub struct NoPath { + #[primary_span] + pub span: Span, + pub target: Symbol, + pub source: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_unknown_reuse_kind)] +pub struct UnknownReuseKind { + #[primary_span] + pub span: Span, + pub kind: Symbol, +} + +#[derive(Diagnostic)] +#[diag(incremental_missing_query_depgraph)] +pub struct MissingQueryDepGraph { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_malformed_cgu_name)] +pub struct MalformedCguName { + #[primary_span] + pub span: Span, + pub user_path: String, + pub crate_name: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_no_module_named)] +pub struct NoModuleNamed<'a> { + #[primary_span] + pub span: Span, + pub user_path: &'a str, + pub cgu_name: Symbol, + pub cgu_names: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_field_associated_value_expected)] +pub struct FieldAssociatedValueExpected { + #[primary_span] + pub span: Span, + pub name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(incremental_no_field)] +pub struct NoField { + #[primary_span] + pub span: Span, + pub name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(incremental_assertion_auto)] +pub struct AssertionAuto<'a> { + #[primary_span] + pub span: Span, + pub name: &'a str, + pub e: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_undefined_clean_dirty_assertions_item)] +pub struct UndefinedCleanDirtyItem { + #[primary_span] + pub span: Span, + pub kind: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_undefined_clean_dirty_assertions)] +pub struct UndefinedCleanDirty { + #[primary_span] + pub span: Span, + pub kind: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_repeated_depnode_label)] +pub struct RepeatedDepNodeLabel<'a> { + #[primary_span] + pub span: Span, + pub label: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_unrecognized_depnode_label)] +pub struct UnrecognizedDepNodeLabel<'a> { + #[primary_span] + pub span: Span, + pub label: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_not_dirty)] +pub struct NotDirty<'a> { + #[primary_span] + pub span: Span, + pub dep_node_str: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_not_clean)] +pub struct NotClean<'a> { + #[primary_span] + pub span: Span, + pub dep_node_str: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_not_loaded)] +pub struct NotLoaded<'a> { + #[primary_span] + pub span: Span, + pub dep_node_str: &'a str, +} + +#[derive(Diagnostic)] +#[diag(incremental_unknown_item)] +pub struct UnknownItem { + #[primary_span] + pub span: Span, + pub name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(incremental_no_cfg)] +pub struct NoCfg { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_associated_value_expected_for)] +pub struct AssociatedValueExpectedFor { + #[primary_span] + pub span: Span, + pub ident: Ident, +} + +#[derive(Diagnostic)] +#[diag(incremental_associated_value_expected)] +pub struct AssociatedValueExpected { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_unchecked_clean)] +pub struct UncheckedClean { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(incremental_delete_old)] +pub struct DeleteOld<'a> { + pub name: &'a str, + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_create_new)] +pub struct CreateNew<'a> { + pub name: &'a str, + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_write_new)] +pub struct WriteNew<'a> { + pub name: &'a str, + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_canonicalize_path)] +pub struct CanonicalizePath { + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_create_incr_comp_dir)] +pub struct CreateIncrCompDir<'a> { + pub tag: &'a str, + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_create_lock)] +pub struct CreateLock<'a> { + pub lock_err: std::io::Error, + pub session_dir: &'a Path, + #[note(incremental_lock_unsupported)] + pub is_unsupported_lock: Option<()>, + #[help(incremental_cargo_help_1)] + #[help(incremental_cargo_help_2)] + pub is_cargo: Option<()>, +} + +#[derive(Diagnostic)] +#[diag(incremental_delete_lock)] +pub struct DeleteLock<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_hard_link_failed)] +pub struct HardLinkFailed<'a> { + pub path: &'a Path, +} + +#[derive(Diagnostic)] +#[diag(incremental_delete_partial)] +pub struct DeletePartial<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_delete_full)] +pub struct DeleteFull<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_finalize)] +pub struct Finalize<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_invalid_gc_failed)] +pub struct InvalidGcFailed<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_finalized_gc_failed)] +pub struct FinalizedGcFailed<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_session_gc_failed)] +pub struct SessionGcFailed<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_assert_not_loaded)] +pub struct AssertNotLoaded; + +#[derive(Diagnostic)] +#[diag(incremental_assert_loaded)] +pub struct AssertLoaded; + +#[derive(Diagnostic)] +#[diag(incremental_delete_incompatible)] +pub struct DeleteIncompatible { + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_load_dep_graph)] +pub struct LoadDepGraph { + pub path: PathBuf, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_decode_incr_cache)] +pub struct DecodeIncrCache { + pub err: String, +} + +#[derive(Diagnostic)] +#[diag(incremental_write_dep_graph)] +pub struct WriteDepGraph<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_move_dep_graph)] +pub struct MoveDepGraph<'a> { + pub from: &'a Path, + pub to: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_create_dep_graph)] +pub struct CreateDepGraph<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_copy_workproduct_to_cache)] +pub struct CopyWorkProductToCache<'a> { + pub from: &'a Path, + pub to: &'a Path, + pub err: std::io::Error, +} + +#[derive(Diagnostic)] +#[diag(incremental_delete_workproduct)] +pub struct DeleteWorkProduct<'a> { + pub path: &'a Path, + pub err: std::io::Error, +} diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index 83dd9a67e61bc..3c58cfa38f280 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -2,8 +2,11 @@ #![deny(missing_docs)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![feature(never_type)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] +#![deny(rustc::untranslatable_diagnostic)] +#![deny(rustc::diagnostic_outside_of_impl)] #[macro_use] extern crate rustc_middle; @@ -12,6 +15,7 @@ extern crate tracing; mod assert_dep_graph; pub mod assert_module_sources; +mod errors; mod persist; use assert_dep_graph::assert_dep_graph; diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs index ed7b272b13d17..c6e63998c7935 100644 --- a/compiler/rustc_incremental/src/persist/dirty_clean.rs +++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs @@ -19,6 +19,7 @@ //! Errors are reported if we are in the suitable configuration but //! the required condition is not met. +use crate::errors; use rustc_ast::{self as ast, Attribute, NestedMetaItem}; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def_id::LocalDefId; @@ -196,11 +197,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { let loaded_from_disk = self.loaded_from_disk(attr); for e in except.iter() { if !auto.remove(e) { - let msg = format!( - "`except` specified DepNodes that can not be affected for \"{}\": \"{}\"", - name, e - ); - self.tcx.sess.span_fatal(attr.span, &msg); + self.tcx.sess.emit_fatal(errors::AssertionAuto { span: attr.span, name, e }); } } Assertion { clean: auto, dirty: except, loaded_from_disk } @@ -282,14 +279,10 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { // An implementation, eg `impl Trait for Foo { .. }` HirItem::Impl { .. } => ("ItemKind::Impl", LABELS_IMPL), - _ => self.tcx.sess.span_fatal( - attr.span, - &format!( - "clean/dirty auto-assertions not yet defined \ - for Node::Item.node={:?}", - item.kind - ), - ), + _ => self.tcx.sess.emit_fatal(errors::UndefinedCleanDirtyItem { + span: attr.span, + kind: format!("{:?}", item.kind), + }), } } HirNode::TraitItem(item) => match item.kind { @@ -302,10 +295,10 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_IN_IMPL), ImplItemKind::Type(..) => ("NodeImplType", LABELS_CONST_IN_IMPL), }, - _ => self.tcx.sess.span_fatal( - attr.span, - &format!("clean/dirty auto-assertions not yet defined for {:?}", node), - ), + _ => self.tcx.sess.emit_fatal(errors::UndefinedCleanDirty { + span: attr.span, + kind: format!("{:?}", node), + }), }; let labels = Labels::from_iter(labels.iter().flat_map(|s| s.iter().map(|l| (*l).to_string()))); @@ -318,16 +311,15 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { let label = label.trim(); if DepNode::has_label_string(label) { if out.contains(label) { - self.tcx.sess.span_fatal( - item.span(), - &format!("dep-node label `{}` is repeated", label), - ); + self.tcx + .sess + .emit_fatal(errors::RepeatedDepNodeLabel { span: item.span(), label }); } out.insert(label.to_string()); } else { self.tcx .sess - .span_fatal(item.span(), &format!("dep-node label `{}` not recognized", label)); + .emit_fatal(errors::UnrecognizedDepNodeLabel { span: item.span(), label }); } } out @@ -348,7 +340,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { let dep_node_str = self.dep_node_str(&dep_node); self.tcx .sess - .span_err(item_span, &format!("`{}` should be dirty but is not", dep_node_str)); + .emit_err(errors::NotDirty { span: item_span, dep_node_str: &dep_node_str }); } } @@ -359,7 +351,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { let dep_node_str = self.dep_node_str(&dep_node); self.tcx .sess - .span_err(item_span, &format!("`{}` should be clean but is not", dep_node_str)); + .emit_err(errors::NotClean { span: item_span, dep_node_str: &dep_node_str }); } } @@ -368,10 +360,9 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { if !self.tcx.dep_graph.debug_was_loaded_from_disk(dep_node) { let dep_node_str = self.dep_node_str(&dep_node); - self.tcx.sess.span_err( - item_span, - &format!("`{}` should have been loaded from disk but it was not", dep_node_str), - ); + self.tcx + .sess + .emit_err(errors::NotLoaded { span: item_span, dep_node_str: &dep_node_str }); } } @@ -412,12 +403,12 @@ fn check_config(tcx: TyCtxt<'_>, attr: &Attribute) -> bool { debug!("check_config: searching for cfg {:?}", value); cfg = Some(config.contains(&(value, None))); } else if !(item.has_name(EXCEPT) || item.has_name(LOADED_FROM_DISK)) { - tcx.sess.span_err(attr.span, &format!("unknown item `{}`", item.name_or_empty())); + tcx.sess.emit_err(errors::UnknownItem { span: attr.span, name: item.name_or_empty() }); } } match cfg { - None => tcx.sess.span_fatal(attr.span, "no cfg attribute"), + None => tcx.sess.emit_fatal(errors::NoCfg { span: attr.span }), Some(c) => c, } } @@ -426,13 +417,11 @@ fn expect_associated_value(tcx: TyCtxt<'_>, item: &NestedMetaItem) -> Symbol { if let Some(value) = item.value_str() { value } else { - let msg = if let Some(ident) = item.ident() { - format!("associated value expected for `{}`", ident) + if let Some(ident) = item.ident() { + tcx.sess.emit_fatal(errors::AssociatedValueExpectedFor { span: item.span(), ident }); } else { - "expected an associated value".to_string() - }; - - tcx.sess.span_fatal(item.span(), &msg); + tcx.sess.emit_fatal(errors::AssociatedValueExpected { span: item.span() }); + } } } @@ -456,7 +445,7 @@ impl<'tcx> FindAllAttrs<'tcx> { fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet) { for attr in &self.found_attrs { if !checked_attrs.contains(&attr.id) { - self.tcx.sess.span_err(attr.span, "found unchecked `#[rustc_clean]` attribute"); + self.tcx.sess.emit_err(errors::UncheckedClean { span: attr.span }); checked_attrs.insert(attr.id); } } diff --git a/compiler/rustc_incremental/src/persist/file_format.rs b/compiler/rustc_incremental/src/persist/file_format.rs index 2dbd4b6bce85a..dc981c6179eeb 100644 --- a/compiler/rustc_incremental/src/persist/file_format.rs +++ b/compiler/rustc_incremental/src/persist/file_format.rs @@ -9,15 +9,15 @@ //! compiler versions don't change frequently for the typical user, being //! conservative here practically has no downside. -use std::env; -use std::fs; -use std::io::{self, Read}; -use std::path::{Path, PathBuf}; - +use crate::errors; use rustc_data_structures::memmap::Mmap; use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; use rustc_serialize::Encoder; use rustc_session::Session; +use std::env; +use std::fs; +use std::io::{self, Read}; +use std::path::{Path, PathBuf}; /// The first few bytes of files generated by incremental compilation. const FILE_MAGIC: &[u8] = b"RSIC"; @@ -60,12 +60,7 @@ where } Err(err) if err.kind() == io::ErrorKind::NotFound => (), Err(err) => { - sess.err(&format!( - "unable to delete old {} at `{}`: {}", - name, - path_buf.display(), - err - )); + sess.emit_err(errors::DeleteOld { name, path: path_buf, err }); return; } } @@ -73,7 +68,7 @@ where let mut encoder = match FileEncoder::new(&path_buf) { Ok(encoder) => encoder, Err(err) => { - sess.err(&format!("failed to create {} at `{}`: {}", name, path_buf.display(), err)); + sess.emit_err(errors::CreateNew { name, path: path_buf, err }); return; } }; @@ -90,7 +85,7 @@ where debug!("save: data written to disk successfully"); } Err(err) => { - sess.err(&format!("failed to write {} to `{}`: {}", name, path_buf.display(), err)); + sess.emit_err(errors::WriteNew { name, path: path_buf, err }); } } } diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs index 1fd2b9b0d7b7b..73d7e3becab48 100644 --- a/compiler/rustc_incremental/src/persist/fs.rs +++ b/compiler/rustc_incremental/src/persist/fs.rs @@ -103,6 +103,7 @@ //! unsupported file system and emit a warning in that case. This is not yet //! implemented. +use crate::errors; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::svh::Svh; use rustc_data_structures::{base_n, flock}; @@ -225,12 +226,7 @@ pub fn prepare_session_directory( let crate_dir = match crate_dir.canonicalize() { Ok(v) => v, Err(err) => { - let reported = sess.err(&format!( - "incremental compilation: error canonicalizing path `{}`: {}", - crate_dir.display(), - err - )); - return Err(reported); + return Err(sess.emit_err(errors::CanonicalizePath { path: crate_dir, err })); } }; @@ -273,14 +269,7 @@ pub fn prepare_session_directory( debug!("successfully copied data from: {}", source_directory.display()); if !allows_links { - sess.warn(&format!( - "Hard linking files in the incremental \ - compilation cache failed. Copying files \ - instead. Consider moving the cache \ - directory to a file system which supports \ - hard linking in session dir `{}`", - session_dir.display() - )); + sess.emit_warning(errors::HardLinkFailed { path: &session_dir }); } sess.init_incr_comp_session(session_dir, directory_lock, true); @@ -295,12 +284,7 @@ pub fn prepare_session_directory( // Try to remove the session directory we just allocated. We don't // know if there's any garbage in it from the failed copy action. if let Err(err) = safe_remove_dir_all(&session_dir) { - sess.warn(&format!( - "Failed to delete partly initialized \ - session dir `{}`: {}", - session_dir.display(), - err - )); + sess.emit_warning(errors::DeletePartial { path: &session_dir, err }); } delete_session_dir_lock_file(sess, &lock_file_path); @@ -332,12 +316,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Svh) { ); if let Err(err) = safe_remove_dir_all(&*incr_comp_session_dir) { - sess.warn(&format!( - "Error deleting incremental compilation \ - session directory `{}`: {}", - incr_comp_session_dir.display(), - err - )); + sess.emit_warning(errors::DeleteFull { path: &incr_comp_session_dir, err }); } let lock_file_path = lock_file_path(&*incr_comp_session_dir); @@ -380,12 +359,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Svh) { } Err(e) => { // Warn about the error. However, no need to abort compilation now. - sess.warn(&format!( - "Error finalizing incremental compilation \ - session directory `{}`: {}", - incr_comp_session_dir.display(), - e - )); + sess.emit_warning(errors::Finalize { path: &incr_comp_session_dir, err: e }); debug!("finalize_session_directory() - error, marking as invalid"); // Drop the file lock, so we can garage collect @@ -488,16 +462,7 @@ fn create_dir(sess: &Session, path: &Path, dir_tag: &str) -> Result<(), ErrorGua debug!("{} directory created successfully", dir_tag); Ok(()) } - Err(err) => { - let reported = sess.err(&format!( - "Could not create incremental compilation {} \ - directory `{}`: {}", - dir_tag, - path.display(), - err - )); - Err(reported) - } + Err(err) => Err(sess.emit_err(errors::CreateIncrCompDir { tag: dir_tag, path, err })), } } @@ -518,46 +483,20 @@ fn lock_directory( // the lock should be exclusive Ok(lock) => Ok((lock, lock_file_path)), Err(lock_err) => { - let mut err = sess.struct_err(&format!( - "incremental compilation: could not create \ - session directory lock file: {}", - lock_err - )); - if flock::Lock::error_unsupported(&lock_err) { - err.note(&format!( - "the filesystem for the incremental path at {} \ - does not appear to support locking, consider changing the \ - incremental path to a filesystem that supports locking \ - or disable incremental compilation", - session_dir.display() - )); - if std::env::var_os("CARGO").is_some() { - err.help( - "incremental compilation can be disabled by setting the \ - environment variable CARGO_INCREMENTAL=0 (see \ - https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)", - ); - err.help( - "the entire build directory can be changed to a different \ - filesystem by setting the environment variable CARGO_TARGET_DIR \ - to a different path (see \ - https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)", - ); - } - } - Err(err.emit()) + let is_unsupported_lock = flock::Lock::error_unsupported(&lock_err).then_some(()); + Err(sess.emit_err(errors::CreateLock { + lock_err, + session_dir, + is_unsupported_lock, + is_cargo: std::env::var_os("CARGO").map(|_| ()), + })) } } } fn delete_session_dir_lock_file(sess: &Session, lock_file_path: &Path) { if let Err(err) = safe_remove_file(&lock_file_path) { - sess.warn(&format!( - "Error deleting lock file for incremental \ - compilation session directory `{}`: {}", - lock_file_path.display(), - err - )); + sess.emit_warning(errors::DeleteLock { path: lock_file_path, err }); } } @@ -774,12 +713,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> { if !lock_file_to_session_dir.values().any(|dir| *dir == directory_name) { let path = crate_directory.join(directory_name); if let Err(err) = safe_remove_dir_all(&path) { - sess.warn(&format!( - "Failed to garbage collect invalid incremental \ - compilation session directory `{}`: {}", - path.display(), - err - )); + sess.emit_warning(errors::InvalidGcFailed { path: &path, err }); } } } @@ -885,12 +819,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> { debug!("garbage_collect_session_directories() - deleting `{}`", path.display()); if let Err(err) = safe_remove_dir_all(&path) { - sess.warn(&format!( - "Failed to garbage collect finalized incremental \ - compilation session directory `{}`: {}", - path.display(), - err - )); + sess.emit_warning(errors::FinalizedGcFailed { path: &path, err }); } else { delete_session_dir_lock_file(sess, &lock_file_path(&path)); } @@ -907,11 +836,7 @@ fn delete_old(sess: &Session, path: &Path) { debug!("garbage_collect_session_directories() - deleting `{}`", path.display()); if let Err(err) = safe_remove_dir_all(&path) { - sess.warn(&format!( - "Failed to garbage collect incremental compilation session directory `{}`: {}", - path.display(), - err - )); + sess.emit_warning(errors::SessionGcFailed { path: &path, err }); } else { delete_session_dir_lock_file(sess, &lock_file_path(&path)); } diff --git a/compiler/rustc_incremental/src/persist/load.rs b/compiler/rustc_incremental/src/persist/load.rs index 1c5fd91690230..d5097065dda2e 100644 --- a/compiler/rustc_incremental/src/persist/load.rs +++ b/compiler/rustc_incremental/src/persist/load.rs @@ -1,5 +1,6 @@ //! Code to save/load the dep-graph from files. +use crate::errors; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::memmap::Mmap; use rustc_middle::dep_graph::{SerializedDepGraph, WorkProduct, WorkProductId}; @@ -8,7 +9,7 @@ use rustc_serialize::opaque::MemDecoder; use rustc_serialize::Decodable; use rustc_session::config::IncrementalStateAssertion; use rustc_session::Session; -use std::path::Path; +use std::path::{Path, PathBuf}; use super::data::*; use super::file_format; @@ -27,11 +28,10 @@ pub enum LoadResult { }, /// The file either didn't exist or was produced by an incompatible compiler version. DataOutOfDate, - /// An error occurred. - Error { - #[allow(missing_docs)] - message: String, - }, + /// Loading the dep graph failed. + LoadDepGraph(PathBuf, std::io::Error), + /// Decoding loaded incremental cache failed. + DecodeIncrCache(Box), } impl LoadResult { @@ -40,36 +40,31 @@ impl LoadResult { // Check for errors when using `-Zassert-incremental-state` match (sess.opts.assert_incr_state, &self) { (Some(IncrementalStateAssertion::NotLoaded), LoadResult::Ok { .. }) => { - sess.fatal( - "We asserted that the incremental cache should not be loaded, \ - but it was loaded.", - ); + sess.emit_fatal(errors::AssertNotLoaded); } ( Some(IncrementalStateAssertion::Loaded), - LoadResult::Error { .. } | LoadResult::DataOutOfDate, + LoadResult::LoadDepGraph(..) + | LoadResult::DecodeIncrCache(..) + | LoadResult::DataOutOfDate, ) => { - sess.fatal( - "We asserted that an existing incremental cache directory should \ - be successfully loaded, but it was not.", - ); + sess.emit_fatal(errors::AssertLoaded); } _ => {} }; match self { - LoadResult::Error { message } => { - sess.warn(&message); + LoadResult::LoadDepGraph(path, err) => { + sess.emit_warning(errors::LoadDepGraph { path, err }); + Default::default() + } + LoadResult::DecodeIncrCache(err) => { + sess.emit_warning(errors::DecodeIncrCache { err: format!("{err:?}") }); Default::default() } LoadResult::DataOutOfDate => { if let Err(err) = delete_all_session_dir_contents(sess) { - sess.err(&format!( - "Failed to delete invalidated or incompatible \ - incremental compilation session directory contents `{}`: {}.", - dep_graph_path(sess).display(), - err - )); + sess.emit_err(errors::DeleteIncompatible { path: dep_graph_path(sess), err }); } Default::default() } @@ -90,9 +85,7 @@ fn load_data( // compiler version. Neither is an error. LoadResult::DataOutOfDate } - Err(err) => LoadResult::Error { - message: format!("could not load dep-graph from `{}`: {}", path.display(), err), - }, + Err(err) => LoadResult::LoadDepGraph(path.to_path_buf(), err), } } @@ -114,9 +107,9 @@ impl MaybeAsync> { pub fn open(self) -> LoadResult { match self { MaybeAsync::Sync(result) => result, - MaybeAsync::Async(handle) => handle.join().unwrap_or_else(|e| LoadResult::Error { - message: format!("could not decode incremental cache: {:?}", e), - }), + MaybeAsync::Async(handle) => { + handle.join().unwrap_or_else(|e| LoadResult::DecodeIncrCache(e)) + } } } } @@ -185,7 +178,8 @@ pub fn load_dep_graph(sess: &Session) -> DepGraphFuture { match load_data(report_incremental_info, &path, nightly_build) { LoadResult::DataOutOfDate => LoadResult::DataOutOfDate, - LoadResult::Error { message } => LoadResult::Error { message }, + LoadResult::LoadDepGraph(path, err) => LoadResult::LoadDepGraph(path, err), + LoadResult::DecodeIncrCache(err) => LoadResult::DecodeIncrCache(err), LoadResult::Ok { data: (bytes, start_pos) } => { let mut decoder = MemDecoder::new(&bytes, start_pos); let prev_commandline_args_hash = u64::decode(&mut decoder); diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index 6e9dcdd981ec4..27be56eac6f99 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -1,3 +1,4 @@ +use crate::errors; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sync::join; use rustc_middle::dep_graph::{DepGraph, SerializedDepGraph, WorkProduct, WorkProductId}; @@ -59,19 +60,14 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) { move || { sess.time("incr_comp_persist_dep_graph", || { if let Err(err) = tcx.dep_graph.encode(&tcx.sess.prof) { - sess.err(&format!( - "failed to write dependency graph to `{}`: {}", - staging_dep_graph_path.display(), - err - )); + sess.emit_err(errors::WriteDepGraph { path: &staging_dep_graph_path, err }); } if let Err(err) = fs::rename(&staging_dep_graph_path, &dep_graph_path) { - sess.err(&format!( - "failed to move dependency graph from `{}` to `{}`: {}", - staging_dep_graph_path.display(), - dep_graph_path.display(), - err - )); + sess.emit_err(errors::MoveDepGraph { + from: &staging_dep_graph_path, + to: &dep_graph_path, + err, + }); } }); }, @@ -163,11 +159,7 @@ pub fn build_dep_graph( let mut encoder = match FileEncoder::new(&path_buf) { Ok(encoder) => encoder, Err(err) => { - sess.err(&format!( - "failed to create dependency graph at `{}`: {}", - path_buf.display(), - err - )); + sess.emit_err(errors::CreateDepGraph { path: &path_buf, err }); return None; } }; diff --git a/compiler/rustc_incremental/src/persist/work_product.rs b/compiler/rustc_incremental/src/persist/work_product.rs index 2f1853c441eee..dc98fbeb0d166 100644 --- a/compiler/rustc_incremental/src/persist/work_product.rs +++ b/compiler/rustc_incremental/src/persist/work_product.rs @@ -2,6 +2,7 @@ //! //! [work products]: WorkProduct +use crate::errors; use crate::persist::fs::*; use rustc_data_structures::fx::FxHashMap; use rustc_fs_util::link_or_copy; @@ -28,12 +29,11 @@ pub fn copy_cgu_workproduct_to_incr_comp_cache_dir( let _ = saved_files.insert(ext.to_string(), file_name); } Err(err) => { - sess.warn(&format!( - "error copying object file `{}` to incremental directory as `{}`: {}", - path.display(), - path_in_incr_dir.display(), - err - )); + sess.emit_warning(errors::CopyWorkProductToCache { + from: &path, + to: &path_in_incr_dir, + err, + }); } } } @@ -49,11 +49,7 @@ pub fn delete_workproduct_files(sess: &Session, work_product: &WorkProduct) { for (_, path) in &work_product.saved_files { let path = in_incr_comp_dir_sess(sess, path); if let Err(err) = std_fs::remove_file(&path) { - sess.warn(&format!( - "file-system error deleting outdated file `{}`: {}", - path.display(), - err - )); + sess.emit_warning(errors::DeleteWorkProduct { path: &path, err }); } } } diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index b11db8396c920..554a70265d43c 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -67,6 +67,7 @@ use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::lang_items::LangItem; use rustc_hir::Node; use rustc_middle::dep_graph::DepContext; +use rustc_middle::ty::print::with_forced_trimmed_paths; use rustc_middle::ty::relate::{self, RelateResult, TypeRelation}; use rustc_middle::ty::{ self, error::TypeError, List, Region, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable, @@ -1612,16 +1613,31 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { { format!("expected this to be `{}`", expected) } else { - terr.to_string() + terr.to_string(self.tcx).to_string() }; label_or_note(sp, &terr); label_or_note(span, &msg); } else { - label_or_note(span, &terr.to_string()); + label_or_note(span, &terr.to_string(self.tcx)); label_or_note(sp, &msg); } } else { - label_or_note(span, &terr.to_string()); + if let Some(values) = values + && let Some((e, f)) = values.ty() + && let TypeError::ArgumentSorts(..) | TypeError::Sorts(_) = terr + { + let e = self.tcx.erase_regions(e); + let f = self.tcx.erase_regions(f); + let expected = with_forced_trimmed_paths!(e.sort_string(self.tcx)); + let found = with_forced_trimmed_paths!(f.sort_string(self.tcx)); + if expected == found { + label_or_note(span, &terr.to_string(self.tcx)); + } else { + label_or_note(span, &format!("expected {expected}, found {found}")); + } + } else { + label_or_note(span, &terr.to_string(self.tcx)); + } } if let Some((expected, found, exp_p, found_p)) = expected_found { @@ -1849,6 +1865,18 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { self.check_and_note_conflicting_crates(diag, terr); self.note_and_explain_type_err(diag, terr, cause, span, cause.body_id.to_def_id()); + if let Some(exp_found) = exp_found + && let exp_found = TypeError::Sorts(exp_found) + && exp_found != terr + { + self.note_and_explain_type_err( + diag, + exp_found, + cause, + span, + cause.body_id.to_def_id(), + ); + } if let Some(ValuePairs::PolyTraitRefs(exp_found)) = values && let ty::Closure(def_id, _) = exp_found.expected.skip_binder().self_ty().kind() diff --git a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs index 34e8edd6140b2..39b3c98f0a5cc 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs @@ -137,25 +137,25 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { diag.help( "given a type parameter `T` and a method `foo`: ``` -trait Trait { fn foo(&tcx) -> T; } +trait Trait { fn foo(&self) -> T; } ``` the only ways to implement method `foo` are: - constrain `T` with an explicit type: ``` impl Trait for X { - fn foo(&tcx) -> String { String::new() } + fn foo(&self) -> String { String::new() } } ``` - add a trait bound to `T` and call a method on that trait that returns `Self`: ``` impl Trait for X { - fn foo(&tcx) -> T { ::default() } + fn foo(&self) -> T { ::default() } } ``` - change `foo` to return an argument of type `T`: ``` impl Trait for X { - fn foo(&tcx, x: T) -> T { x } + fn foo(&self, x: T) -> T { x } } ```", ); @@ -218,6 +218,13 @@ impl Trait for X { ); } } + (ty::FnPtr(_), ty::FnDef(def, _)) + if let hir::def::DefKind::Fn = tcx.def_kind(def) => { + diag.note( + "when the arguments and return types match, functions can be coerced \ + to function pointers", + ); + } _ => {} } debug!( @@ -389,14 +396,14 @@ impl Trait for X { ``` trait Trait { type T; -fn foo(&tcx) -> Self::T; +fn foo(&self) -> Self::T; } ``` the only way of implementing method `foo` is to constrain `T` with an explicit associated type: ``` impl Trait for X { type T = String; -fn foo(&tcx) -> Self::T { String::new() } +fn foo(&self) -> Self::T { String::new() } } ```", ); diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs index 23063e80b05ff..73859aca42478 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs @@ -404,7 +404,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { (msg, sug) } }; - diag.span_suggestion(span, msg, sug, Applicability::MaybeIncorrect); + diag.span_suggestion_verbose(span, msg, sug, Applicability::MaybeIncorrect); } (ty::FnDef(did1, substs1), ty::FnDef(did2, substs2)) => { let expected_sig = diff --git a/compiler/rustc_infer/src/infer/higher_ranked/mod.rs b/compiler/rustc_infer/src/infer/higher_ranked/mod.rs index 817ae10c76087..31be107b35472 100644 --- a/compiler/rustc_infer/src/infer/higher_ranked/mod.rs +++ b/compiler/rustc_infer/src/infer/higher_ranked/mod.rs @@ -90,7 +90,7 @@ impl<'tcx> InferCtxt<'tcx> { types: &mut |bound_ty: ty::BoundTy| { self.tcx.mk_ty(ty::Placeholder(ty::PlaceholderType { universe: next_universe, - name: bound_ty.var, + name: bound_ty.kind, })) }, consts: &mut |bound_var: ty::BoundVar, ty| { diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index f0e42c1fce49c..f39170bb2916d 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -2044,7 +2044,7 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>( ) -> SubstsRef<'tcx> { struct ReplaceParamAndInferWithPlaceholder<'tcx> { tcx: TyCtxt<'tcx>, - idx: usize, + idx: u32, } impl<'tcx> TypeFolder<'tcx> for ReplaceParamAndInferWithPlaceholder<'tcx> { @@ -2056,7 +2056,7 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>( if let ty::Infer(_) = t.kind() { self.tcx.mk_ty(ty::Placeholder(ty::PlaceholderType { universe: ty::UniverseIndex::ROOT, - name: ty::BoundVar::from_usize({ + name: ty::BoundTyKind::Anon({ let idx = self.idx; self.idx += 1; idx @@ -2077,7 +2077,7 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>( self.tcx.mk_const( ty::PlaceholderConst { universe: ty::UniverseIndex::ROOT, - name: ty::BoundVar::from_usize({ + name: ty::BoundVar::from_u32({ let idx = self.idx; self.idx += 1; idx diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml index f817c5bc1cd73..1199ff287c430 100644 --- a/compiler/rustc_interface/Cargo.toml +++ b/compiler/rustc_interface/Cargo.toml @@ -49,9 +49,6 @@ rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } rustc_ty_utils = { path = "../rustc_ty_utils" } -[dev-dependencies] -rustc_target = { path = "../rustc_target" } - [features] llvm = ['rustc_codegen_llvm'] rustc_use_parallel_compiler = ['rayon', 'rustc-rayon-core', 'rustc_query_impl/rustc_use_parallel_compiler', 'rustc_errors/rustc_use_parallel_compiler'] diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs index 15d7e977bbe88..29543fe2f932c 100644 --- a/compiler/rustc_interface/src/errors.rs +++ b/compiler/rustc_interface/src/errors.rs @@ -1,5 +1,7 @@ use rustc_macros::Diagnostic; +use rustc_session::config::CrateType; use rustc_span::{Span, Symbol}; +use rustc_target::spec::TargetTriple; use std::io; use std::path::Path; @@ -91,3 +93,22 @@ pub struct FailedWritingFile<'a> { #[derive(Diagnostic)] #[diag(interface_proc_macro_crate_panic_abort)] pub struct ProcMacroCratePanicAbort; + +#[derive(Diagnostic)] +#[diag(interface_unsupported_crate_type_for_target)] +pub struct UnsupportedCrateTypeForTarget<'a> { + pub crate_type: CrateType, + pub target_triple: &'a TargetTriple, +} + +#[derive(Diagnostic)] +#[diag(interface_multiple_output_types_adaption)] +pub struct MultipleOutputTypesAdaption; + +#[derive(Diagnostic)] +#[diag(interface_ignoring_extra_filename)] +pub struct IgnoringExtraFilename; + +#[derive(Diagnostic)] +#[diag(interface_ignoring_out_dir)] +pub struct IgnoringOutDir; diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index 54363e07b971a..e4b4d5375e64a 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -1,3 +1,4 @@ +use crate::errors; use info; use libloading::Library; use rustc_ast as ast; @@ -472,16 +473,15 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec Outpu let unnamed_output_types = sess.opts.output_types.values().filter(|a| a.is_none()).count(); let ofile = if unnamed_output_types > 1 { - sess.warn( - "due to multiple output types requested, the explicitly specified \ - output file name will be adapted for each output type", - ); + sess.emit_warning(errors::MultipleOutputTypesAdaption); None } else { if !sess.opts.cg.extra_filename.is_empty() { - sess.warn("ignoring -C extra-filename flag due to -o flag"); + sess.emit_warning(errors::IgnoringExtraFilename); } Some(out_file.clone()) }; if sess.io.output_dir != None { - sess.warn("ignoring --out-dir flag due to -o flag"); + sess.emit_warning(errors::IgnoringOutDir); } OutputFilenames::new( diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 8361c81f0efe3..5d85cfe330acd 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -580,27 +580,28 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc { } fn check_impl_item(&mut self, cx: &LateContext<'_>, impl_item: &hir::ImplItem<'_>) { - // If the method is an impl for a trait, don't doc. let context = method_context(cx, impl_item.owner_id.def_id); - if context == MethodLateContext::TraitImpl { - return; - } - // If the method is an impl for an item with docs_hidden, don't doc. - if context == MethodLateContext::PlainImpl { - let parent = cx.tcx.hir().get_parent_item(impl_item.hir_id()); - let impl_ty = cx.tcx.type_of(parent); - let outerdef = match impl_ty.kind() { - ty::Adt(def, _) => Some(def.did()), - ty::Foreign(def_id) => Some(*def_id), - _ => None, - }; - let is_hidden = match outerdef { - Some(id) => cx.tcx.is_doc_hidden(id), - None => false, - }; - if is_hidden { - return; + match context { + // If the method is an impl for a trait, don't doc. + MethodLateContext::TraitImpl => return, + MethodLateContext::TraitAutoImpl => {} + // If the method is an impl for an item with docs_hidden, don't doc. + MethodLateContext::PlainImpl => { + let parent = cx.tcx.hir().get_parent_item(impl_item.hir_id()); + let impl_ty = cx.tcx.type_of(parent); + let outerdef = match impl_ty.kind() { + ty::Adt(def, _) => Some(def.did()), + ty::Foreign(def_id) => Some(*def_id), + _ => None, + }; + let is_hidden = match outerdef { + Some(id) => cx.tcx.is_doc_hidden(id), + None => false, + }; + if is_hidden { + return; + } } } diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index ba15dbd86cfa4..4ca37ef6850c1 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -324,7 +324,6 @@ fn register_builtins(store: &mut LintStore) { store.register_renamed("exceeding_bitshifts", "arithmetic_overflow"); store.register_renamed("redundant_semicolon", "redundant_semicolons"); store.register_renamed("overlapping_patterns", "overlapping_range_endpoints"); - store.register_renamed("safe_packed_borrows", "unaligned_references"); store.register_renamed("disjoint_capture_migration", "rust_2021_incompatible_closure_captures"); store.register_renamed("or_patterns_back_compat", "rust_2021_incompatible_or_patterns"); store.register_renamed("non_fmt_panic", "non_fmt_panics"); @@ -487,6 +486,16 @@ fn register_builtins(store: &mut LintStore) { "converted into hard error, see issue #71800 \ for more information", ); + store.register_removed( + "safe_packed_borrows", + "converted into hard error, see issue #82523 \ + for more information", + ); + store.register_removed( + "unaligned_references", + "converted into hard error, see issue #82523 \ + for more information", + ); } fn register_internals(store: &mut LintStore) { diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index d731c10f46e28..7e9ba4cd22b8d 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1187,51 +1187,6 @@ declare_lint! { "lints that have been renamed or removed" } -declare_lint! { - /// The `unaligned_references` lint detects unaligned references to fields - /// of [packed] structs. - /// - /// [packed]: https://doc.rust-lang.org/reference/type-layout.html#the-alignment-modifiers - /// - /// ### Example - /// - /// ```rust,compile_fail - /// #[repr(packed)] - /// pub struct Foo { - /// field1: u64, - /// field2: u8, - /// } - /// - /// fn main() { - /// unsafe { - /// let foo = Foo { field1: 0, field2: 0 }; - /// let _ = &foo.field1; - /// println!("{}", foo.field1); // An implicit `&` is added here, triggering the lint. - /// } - /// } - /// ``` - /// - /// {{produces}} - /// - /// ### Explanation - /// - /// Creating a reference to an insufficiently aligned packed field is [undefined behavior] and - /// should be disallowed. Using an `unsafe` block does not change anything about this. Instead, - /// the code should do a copy of the data in the packed field or use raw pointers and unaligned - /// accesses. See [issue #82523] for more information. - /// - /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html - /// [issue #82523]: https://github.com/rust-lang/rust/issues/82523 - pub UNALIGNED_REFERENCES, - Deny, - "detects unaligned references to fields of packed structs", - @future_incompatible = FutureIncompatibleInfo { - reference: "issue #82523 ", - reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow, - }; - report_in_external_macro -} - declare_lint! { /// The `const_item_mutation` lint detects attempts to mutate a `const` /// item. @@ -3308,7 +3263,6 @@ declare_lint_pass! { PUB_USE_OF_PRIVATE_EXTERN_CRATE, INVALID_TYPE_PARAM_DEFAULT, RENAMED_AND_REMOVED_LINTS, - UNALIGNED_REFERENCES, CONST_ITEM_MUTATION, PATTERNS_IN_FNS_WITHOUT_BODY, MISSING_FRAGMENT_SPECIFIER, diff --git a/compiler/rustc_metadata/src/dependency_format.rs b/compiler/rustc_metadata/src/dependency_format.rs index cee4ba56a9d8f..39ef4276faf10 100644 --- a/compiler/rustc_metadata/src/dependency_format.rs +++ b/compiler/rustc_metadata/src/dependency_format.rs @@ -113,37 +113,37 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { CrateType::Staticlib => Linkage::Static, }; - if preferred_linkage == Linkage::NotLinked { + match preferred_linkage { // If the crate is not linked, there are no link-time dependencies. - return Vec::new(); - } - - if preferred_linkage == Linkage::Static { - // Attempt static linkage first. For dylibs and executables, we may be - // able to retry below with dynamic linkage. - if let Some(v) = attempt_static(tcx) { - return v; - } + Linkage::NotLinked => return Vec::new(), + Linkage::Static => { + // Attempt static linkage first. For dylibs and executables, we may be + // able to retry below with dynamic linkage. + if let Some(v) = attempt_static(tcx) { + return v; + } - // Staticlibs and static executables must have all static dependencies. - // If any are not found, generate some nice pretty errors. - if ty == CrateType::Staticlib - || (ty == CrateType::Executable - && sess.crt_static(Some(ty)) - && !sess.target.crt_static_allows_dylibs) - { - for &cnum in tcx.crates(()).iter() { - if tcx.dep_kind(cnum).macros_only() { - continue; + // Staticlibs and static executables must have all static dependencies. + // If any are not found, generate some nice pretty errors. + if ty == CrateType::Staticlib + || (ty == CrateType::Executable + && sess.crt_static(Some(ty)) + && !sess.target.crt_static_allows_dylibs) + { + for &cnum in tcx.crates(()).iter() { + if tcx.dep_kind(cnum).macros_only() { + continue; + } + let src = tcx.used_crate_source(cnum); + if src.rlib.is_some() { + continue; + } + sess.emit_err(RlibRequired { crate_name: tcx.crate_name(cnum) }); } - let src = tcx.used_crate_source(cnum); - if src.rlib.is_some() { - continue; - } - sess.emit_err(RlibRequired { crate_name: tcx.crate_name(cnum) }); + return Vec::new(); } - return Vec::new(); } + Linkage::Dynamic | Linkage::IncludedFromDylib => {} } let mut formats = FxHashMap::default(); @@ -283,12 +283,9 @@ fn attempt_static(tcx: TyCtxt<'_>) -> Option { let mut ret = tcx .crates(()) .iter() - .map(|&cnum| { - if tcx.dep_kind(cnum) == CrateDepKind::Explicit { - Linkage::Static - } else { - Linkage::NotLinked - } + .map(|&cnum| match tcx.dep_kind(cnum) { + CrateDepKind::Explicit => Linkage::Static, + CrateDepKind::MacrosOnly | CrateDepKind::Implicit => Linkage::NotLinked, }) .collect::>(); diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs index 6f05c76e89de1..a5910100786ec 100644 --- a/compiler/rustc_metadata/src/native_libs.rs +++ b/compiler/rustc_metadata/src/native_libs.rs @@ -107,7 +107,7 @@ impl<'tcx> Collector<'tcx> { return; }; - if abi == Abi::Rust || abi == Abi::RustIntrinsic || abi == Abi::PlatformIntrinsic { + if matches!(abi, Abi::Rust | Abi::RustIntrinsic | Abi::PlatformIntrinsic) { return; } diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 29507ff3a86c1..9d8f14058f681 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -1415,7 +1415,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { if encode_opt { record!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id)); - if let DefKind::Generator = self.tcx.def_kind(def_id) && tcx.sess.opts.unstable_opts.drop_tracking_mir { + if tcx.sess.opts.unstable_opts.drop_tracking_mir && let DefKind::Generator = self.tcx.def_kind(def_id) { record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- tcx.mir_generator_witnesses(def_id)); } } diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 5bd6b0704426b..7f2994fd79b98 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -290,7 +290,7 @@ impl<'hir> Map<'hir> { #[track_caller] pub fn parent_id(self, hir_id: HirId) -> HirId { self.opt_parent_id(hir_id) - .unwrap_or_else(|| bug!("No parent for node {:?}", self.node_to_string(hir_id))) + .unwrap_or_else(|| bug!("No parent for node {}", self.node_to_string(hir_id))) } pub fn get_parent(self, hir_id: HirId) -> Node<'hir> { @@ -1191,12 +1191,10 @@ fn upstream_crates(tcx: TyCtxt<'_>) -> Vec<(StableCrateId, Svh)> { } fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { - let id_str = format!(" (hir_id={})", id); - let path_str = |def_id: LocalDefId| map.tcx.def_path_str(def_id.to_def_id()); let span_str = || map.tcx.sess.source_map().span_to_snippet(map.span(id)).unwrap_or_default(); - let node_str = |prefix| format!("{} {}{}", prefix, span_str(), id_str); + let node_str = |prefix| format!("{id} ({prefix} `{}`)", span_str()); match map.find(id) { Some(Node::Item(item)) => { @@ -1225,10 +1223,10 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { ItemKind::TraitAlias(..) => "trait alias", ItemKind::Impl { .. } => "impl", }; - format!("{} {}{}", item_str, path_str(item.owner_id.def_id), id_str) + format!("{id} ({item_str} {})", path_str(item.owner_id.def_id)) } Some(Node::ForeignItem(item)) => { - format!("foreign item {}{}", path_str(item.owner_id.def_id), id_str) + format!("{id} (foreign item {})", path_str(item.owner_id.def_id)) } Some(Node::ImplItem(ii)) => { let kind = match ii.kind { @@ -1236,7 +1234,7 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { ImplItemKind::Fn(..) => "method", ImplItemKind::Type(_) => "assoc type", }; - format!("{} {} in {}{}", kind, ii.ident, path_str(ii.owner_id.def_id), id_str) + format!("{id} ({kind} `{}` in {})", ii.ident, path_str(ii.owner_id.def_id)) } Some(Node::TraitItem(ti)) => { let kind = match ti.kind { @@ -1245,13 +1243,13 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { TraitItemKind::Type(..) => "assoc type", }; - format!("{} {} in {}{}", kind, ti.ident, path_str(ti.owner_id.def_id), id_str) + format!("{id} ({kind} `{}` in {})", ti.ident, path_str(ti.owner_id.def_id)) } Some(Node::Variant(ref variant)) => { - format!("variant {} in {}{}", variant.ident, path_str(variant.def_id), id_str) + format!("{id} (variant `{}` in {})", variant.ident, path_str(variant.def_id)) } Some(Node::Field(ref field)) => { - format!("field {} in {}{}", field.ident, path_str(field.def_id), id_str) + format!("{id} (field `{}` in {})", field.ident, path_str(field.def_id)) } Some(Node::AnonConst(_)) => node_str("const"), Some(Node::Expr(_)) => node_str("expr"), @@ -1269,16 +1267,15 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { Some(Node::Infer(_)) => node_str("infer"), Some(Node::Local(_)) => node_str("local"), Some(Node::Ctor(ctor)) => format!( - "ctor {}{}", + "{id} (ctor {})", ctor.ctor_def_id().map_or("".into(), |def_id| path_str(def_id)), - id_str ), Some(Node::Lifetime(_)) => node_str("lifetime"), Some(Node::GenericParam(ref param)) => { - format!("generic_param {}{}", path_str(param.def_id), id_str) + format!("{id} (generic_param {})", path_str(param.def_id)) } - Some(Node::Crate(..)) => String::from("root_crate"), - None => format!("unknown node{}", id_str), + Some(Node::Crate(..)) => String::from("(root_crate)"), + None => format!("{id} (unknown node)"), } } diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index e7bb3ab0bc352..db24dae11304f 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -135,7 +135,10 @@ impl Debug for CoverageKind { "Expression({:?}) = {} {} {}", id.index(), lhs.index(), - if *op == Op::Add { "+" } else { "-" }, + match op { + Op::Add => "+", + Op::Subtract => "-", + }, rhs.index(), ), Unreachable => write!(fmt, "Unreachable"), diff --git a/compiler/rustc_middle/src/mir/graphviz.rs b/compiler/rustc_middle/src/mir/graphviz.rs index 5de56dad07a41..cf6d46e1e2c8a 100644 --- a/compiler/rustc_middle/src/mir/graphviz.rs +++ b/compiler/rustc_middle/src/mir/graphviz.rs @@ -110,7 +110,7 @@ fn write_graph_label<'tcx, W: std::fmt::Write>( let decl = &body.local_decls[local]; write!(w, "let ")?; - if decl.mutability == Mutability::Mut { + if decl.mutability.is_mut() { write!(w, "mut ")?; } diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 552af589bec59..05a9ec5e6d04a 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -416,11 +416,7 @@ impl<'tcx> Body<'tcx> { (self.arg_count + 1..self.local_decls.len()).filter_map(move |index| { let local = Local::new(index); let decl = &self.local_decls[local]; - if decl.is_user_variable() && decl.mutability == Mutability::Mut { - Some(local) - } else { - None - } + (decl.is_user_variable() && decl.mutability.is_mut()).then(|| local) }) } diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 40289af257ff4..16daf63b82d9f 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -580,7 +580,7 @@ fn write_scope_tree( continue; } - let mut_str = if local_decl.mutability == Mutability::Mut { "mut " } else { "" }; + let mut_str = local_decl.mutability.prefix_str(); let mut indented_decl = format!("{0:1$}let {2}{3:?}: {4:?}", INDENT, indent, mut_str, local, local_decl.ty); diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index b63b9e754cf46..f98172e420162 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2171,7 +2171,7 @@ impl<'tcx> TyCtxt<'tcx> { self.late_bound_vars_map(id.owner) .and_then(|map| map.get(&id.local_id).cloned()) .unwrap_or_else(|| { - bug!("No bound vars found for {:?} ({:?})", self.hir().node_to_string(id), id) + bug!("No bound vars found for {}", self.hir().node_to_string(id)) }) .iter(), ) diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs index d83fc95ac4eeb..bd78705cdb59b 100644 --- a/compiler/rustc_middle/src/ty/error.rs +++ b/compiler/rustc_middle/src/ty/error.rs @@ -8,9 +8,7 @@ use rustc_span::symbol::Symbol; use rustc_target::spec::abi; use std::borrow::Cow; use std::collections::hash_map::DefaultHasher; -use std::fmt; -use std::hash::Hash; -use std::hash::Hasher; +use std::hash::{Hash, Hasher}; use std::path::PathBuf; #[derive(Clone, Copy, Debug, PartialEq, Eq, TypeFoldable, TypeVisitable, Lift)] @@ -30,7 +28,7 @@ impl ExpectedFound { } // Data structures used in type unification -#[derive(Copy, Clone, Debug, TypeFoldable, TypeVisitable, Lift)] +#[derive(Copy, Clone, Debug, TypeFoldable, TypeVisitable, Lift, PartialEq, Eq)] #[rustc_pass_by_value] pub enum TypeError<'tcx> { Mismatch, @@ -87,20 +85,16 @@ impl TypeError<'_> { /// in parentheses after some larger message. You should also invoke `note_and_explain_type_err()` /// afterwards to present additional details, particularly when it comes to lifetime-related /// errors. -impl<'tcx> fmt::Display for TypeError<'tcx> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +impl<'tcx> TypeError<'tcx> { + pub fn to_string(self, tcx: TyCtxt<'tcx>) -> Cow<'static, str> { use self::TypeError::*; - fn report_maybe_different( - f: &mut fmt::Formatter<'_>, - expected: &str, - found: &str, - ) -> fmt::Result { + fn report_maybe_different(expected: &str, found: &str) -> String { // A naive approach to making sure that we're not reporting silly errors such as: // (expected closure, found closure). if expected == found { - write!(f, "expected {}, found a different {}", expected, found) + format!("expected {}, found a different {}", expected, found) } else { - write!(f, "expected {}, found {}", expected, found) + format!("expected {}, found {}", expected, found) } } @@ -109,64 +103,63 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { _ => String::new(), }; - match *self { - CyclicTy(_) => write!(f, "cyclic type of infinite size"), - CyclicConst(_) => write!(f, "encountered a self-referencing constant"), - Mismatch => write!(f, "types differ"), + match self { + CyclicTy(_) => "cyclic type of infinite size".into(), + CyclicConst(_) => "encountered a self-referencing constant".into(), + Mismatch => "types differ".into(), ConstnessMismatch(values) => { - write!(f, "expected {} bound, found {} bound", values.expected, values.found) + format!("expected {} bound, found {} bound", values.expected, values.found).into() } PolarityMismatch(values) => { - write!(f, "expected {} polarity, found {} polarity", values.expected, values.found) + format!("expected {} polarity, found {} polarity", values.expected, values.found) + .into() } UnsafetyMismatch(values) => { - write!(f, "expected {} fn, found {} fn", values.expected, values.found) + format!("expected {} fn, found {} fn", values.expected, values.found).into() } AbiMismatch(values) => { - write!(f, "expected {} fn, found {} fn", values.expected, values.found) + format!("expected {} fn, found {} fn", values.expected, values.found).into() } - ArgumentMutability(_) | Mutability => write!(f, "types differ in mutability"), - TupleSize(values) => write!( - f, + ArgumentMutability(_) | Mutability => "types differ in mutability".into(), + TupleSize(values) => format!( "expected a tuple with {} element{}, found one with {} element{}", values.expected, pluralize!(values.expected), values.found, pluralize!(values.found) - ), - FixedArraySize(values) => write!( - f, + ) + .into(), + FixedArraySize(values) => format!( "expected an array with a fixed size of {} element{}, found one with {} element{}", values.expected, pluralize!(values.expected), values.found, pluralize!(values.found) - ), - ArgCount => write!(f, "incorrect number of function parameters"), - FieldMisMatch(adt, field) => write!(f, "field type mismatch: {}.{}", adt, field), - RegionsDoesNotOutlive(..) => write!(f, "lifetime mismatch"), + ) + .into(), + ArgCount => "incorrect number of function parameters".into(), + FieldMisMatch(adt, field) => format!("field type mismatch: {}.{}", adt, field).into(), + RegionsDoesNotOutlive(..) => "lifetime mismatch".into(), // Actually naming the region here is a bit confusing because context is lacking RegionsInsufficientlyPolymorphic(..) => { - write!(f, "one type is more general than the other") + "one type is more general than the other".into() } - RegionsOverlyPolymorphic(br, _) => write!( - f, + RegionsOverlyPolymorphic(br, _) => format!( "expected concrete lifetime, found bound lifetime parameter{}", br_string(br) - ), - RegionsPlaceholderMismatch => write!(f, "one type is more general than the other"), - ArgumentSorts(values, _) | Sorts(values) => ty::tls::with(|tcx| { - let (mut expected, mut found) = with_forced_trimmed_paths!(( - values.expected.sort_string(tcx), - values.found.sort_string(tcx), - )); + ) + .into(), + RegionsPlaceholderMismatch => "one type is more general than the other".into(), + ArgumentSorts(values, _) | Sorts(values) => { + let mut expected = values.expected.sort_string(tcx); + let mut found = values.found.sort_string(tcx); if expected == found { expected = values.expected.sort_string(tcx); found = values.found.sort_string(tcx); } - report_maybe_different(f, &expected, &found) - }), - Traits(values) => ty::tls::with(|tcx| { + report_maybe_different(&expected, &found).into() + } + Traits(values) => { let (mut expected, mut found) = with_forced_trimmed_paths!(( tcx.def_path_str(values.expected), tcx.def_path_str(values.found), @@ -175,12 +168,9 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { expected = tcx.def_path_str(values.expected); found = tcx.def_path_str(values.found); } - report_maybe_different( - f, - &format!("trait `{expected}`"), - &format!("trait `{found}`"), - ) - }), + report_maybe_different(&format!("trait `{expected}`"), &format!("trait `{found}`")) + .into() + } IntMismatch(ref values) => { let expected = match values.expected { ty::IntVarValue::IntType(ty) => ty.name_str(), @@ -190,43 +180,38 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { ty::IntVarValue::IntType(ty) => ty.name_str(), ty::IntVarValue::UintType(ty) => ty.name_str(), }; - write!(f, "expected `{}`, found `{}`", expected, found) - } - FloatMismatch(ref values) => { - write!( - f, - "expected `{}`, found `{}`", - values.expected.name_str(), - values.found.name_str() - ) + format!("expected `{}`, found `{}`", expected, found).into() } - VariadicMismatch(ref values) => write!( - f, + FloatMismatch(ref values) => format!( + "expected `{}`, found `{}`", + values.expected.name_str(), + values.found.name_str() + ) + .into(), + VariadicMismatch(ref values) => format!( "expected {} fn, found {} function", if values.expected { "variadic" } else { "non-variadic" }, if values.found { "variadic" } else { "non-variadic" } - ), - ProjectionMismatched(ref values) => ty::tls::with(|tcx| { - write!( - f, - "expected {}, found {}", - tcx.def_path_str(values.expected), - tcx.def_path_str(values.found) - ) - }), + ) + .into(), + ProjectionMismatched(ref values) => format!( + "expected `{}`, found `{}`", + tcx.def_path_str(values.expected), + tcx.def_path_str(values.found) + ) + .into(), ExistentialMismatch(ref values) => report_maybe_different( - f, &format!("trait `{}`", values.expected), &format!("trait `{}`", values.found), - ), + ) + .into(), ConstMismatch(ref values) => { - write!(f, "expected `{}`, found `{}`", values.expected, values.found) + format!("expected `{}`, found `{}`", values.expected, values.found).into() + } + IntrinsicCast => "cannot coerce intrinsics to function pointers".into(), + TargetFeatureCast(_) => { + "cannot coerce functions with `#[target_feature]` to safe function pointers".into() } - IntrinsicCast => write!(f, "cannot coerce intrinsics to function pointers"), - TargetFeatureCast(_) => write!( - f, - "cannot coerce functions with `#[target_feature]` to safe function pointers" - ), } } } @@ -259,60 +244,9 @@ impl<'tcx> TypeError<'tcx> { } impl<'tcx> Ty<'tcx> { - pub fn sort_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> { + pub fn sort_string(self, tcx: TyCtxt<'tcx>) -> Cow<'static, str> { match *self.kind() { - ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => { - format!("`{}`", self).into() - } - ty::Tuple(ref tys) if tys.is_empty() => format!("`{}`", self).into(), - - ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did())).into(), ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(), - ty::Array(t, n) => { - if t.is_simple_ty() { - return format!("array `{}`", self).into(); - } - - let n = tcx.lift(n).unwrap(); - if let ty::ConstKind::Value(v) = n.kind() { - if let Some(n) = v.try_to_machine_usize(tcx) { - return format!("array of {} element{}", n, pluralize!(n)).into(); - } - } - "array".into() - } - ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(), - ty::Slice(_) => "slice".into(), - ty::RawPtr(tymut) => { - let tymut_string = match tymut.mutbl { - hir::Mutability::Mut => tymut.to_string(), - hir::Mutability::Not => format!("const {}", tymut.ty), - }; - - if tymut_string != "_" && (tymut.ty.is_simple_text() || tymut_string.len() < "const raw pointer".len()) { - format!("`*{}`", tymut_string).into() - } else { - // Unknown type name, it's long or has type arguments - "raw pointer".into() - } - }, - ty::Ref(_, ty, mutbl) => { - let tymut = ty::TypeAndMut { ty, mutbl }; - let tymut_string = tymut.to_string(); - - if tymut_string != "_" - && (ty.is_simple_text() || tymut_string.len() < "mutable reference".len()) - { - format!("`&{}`", tymut_string).into() - } else { - // Unknown type name, it's long or has type arguments - match mutbl { - hir::Mutability::Mut => "mutable reference", - _ => "reference", - } - .into() - } - } ty::FnDef(def_id, ..) => match tcx.def_kind(def_id) { DefKind::Ctor(CtorOf::Struct, _) => "struct constructor".into(), DefKind::Ctor(CtorOf::Variant, _) => "enum constructor".into(), @@ -320,14 +254,13 @@ impl<'tcx> Ty<'tcx> { }, ty::FnPtr(_) => "fn pointer".into(), ty::Dynamic(ref inner, ..) if let Some(principal) = inner.principal() => { - format!("trait object `dyn {}`", tcx.def_path_str(principal.def_id())).into() + format!("`dyn {}`", tcx.def_path_str(principal.def_id())).into() } ty::Dynamic(..) => "trait object".into(), ty::Closure(..) => "closure".into(), ty::Generator(def_id, ..) => tcx.generator_kind(def_id).unwrap().descr().into(), ty::GeneratorWitness(..) | ty::GeneratorWitnessMIR(..) => "generator witness".into(), - ty::Tuple(..) => "tuple".into(), ty::Infer(ty::TyVar(_)) => "inferred type".into(), ty::Infer(ty::IntVar(_)) => "integer".into(), ty::Infer(ty::FloatVar(_)) => "floating-point number".into(), @@ -337,9 +270,14 @@ impl<'tcx> Ty<'tcx> { ty::Infer(ty::FreshIntTy(_)) => "fresh integral type".into(), ty::Infer(ty::FreshFloatTy(_)) => "fresh floating-point type".into(), ty::Alias(ty::Projection, _) => "associated type".into(), - ty::Param(p) => format!("type parameter `{}`", p).into(), + ty::Param(p) => format!("type parameter `{p}`").into(), ty::Alias(ty::Opaque, ..) => "opaque type".into(), ty::Error(_) => "type error".into(), + _ => { + let width = tcx.sess.diagnostic_width(); + let length_limit = std::cmp::max(width / 4, 15); + format!("`{}`", tcx.ty_string_with_limit(self, length_limit)).into() + } } } @@ -386,16 +324,14 @@ impl<'tcx> Ty<'tcx> { } impl<'tcx> TyCtxt<'tcx> { - pub fn short_ty_string(self, ty: Ty<'tcx>) -> (String, Option) { - let width = self.sess.diagnostic_width(); - let length_limit = width.saturating_sub(30); + pub fn ty_string_with_limit(self, ty: Ty<'tcx>, length_limit: usize) -> String { let mut type_limit = 50; let regular = FmtPrinter::new(self, hir::def::Namespace::TypeNS) .pretty_print_type(ty) .expect("could not write to `String`") .into_buffer(); - if regular.len() <= width { - return (regular, None); + if regular.len() <= length_limit { + return regular; } let mut short; loop { @@ -415,6 +351,20 @@ impl<'tcx> TyCtxt<'tcx> { } type_limit -= 1; } + short + } + + pub fn short_ty_string(self, ty: Ty<'tcx>) -> (String, Option) { + let width = self.sess.diagnostic_width(); + let length_limit = width.saturating_sub(30); + let regular = FmtPrinter::new(self, hir::def::Namespace::TypeNS) + .pretty_print_type(ty) + .expect("could not write to `String`") + .into_buffer(); + if regular.len() <= width { + return (regular, None); + } + let short = self.ty_string_with_limit(ty, length_limit); if regular == short { return (regular, None); } diff --git a/compiler/rustc_middle/src/ty/fold.rs b/compiler/rustc_middle/src/ty/fold.rs index 6b9a37d848da2..1445bc1ed32e6 100644 --- a/compiler/rustc_middle/src/ty/fold.rs +++ b/compiler/rustc_middle/src/ty/fold.rs @@ -610,7 +610,9 @@ impl<'tcx> TyCtxt<'tcx> { let index = entry.index(); let var = ty::BoundVar::from_usize(index); let kind = entry - .or_insert_with(|| ty::BoundVariableKind::Ty(ty::BoundTyKind::Anon)) + .or_insert_with(|| { + ty::BoundVariableKind::Ty(ty::BoundTyKind::Anon(index as u32)) + }) .expect_ty(); self.tcx.mk_ty(ty::Bound(ty::INNERMOST, BoundTy { var, kind })) } diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 25c6777a14c70..09c3d5b736cf1 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1369,7 +1369,7 @@ pub struct Placeholder { pub type PlaceholderRegion = Placeholder; -pub type PlaceholderType = Placeholder; +pub type PlaceholderType = Placeholder; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable)] #[derive(TyEncodable, TyDecodable, PartialOrd, Ord)] diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index f2abec216b7b3..e8e00d5feb873 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -698,8 +698,10 @@ pub trait PrettyPrinter<'tcx>: ty::Error(_) => p!("[type error]"), ty::Param(ref param_ty) => p!(print(param_ty)), ty::Bound(debruijn, bound_ty) => match bound_ty.kind { - ty::BoundTyKind::Anon => self.pretty_print_bound_var(debruijn, bound_ty.var)?, - ty::BoundTyKind::Param(p) => p!(write("{}", p)), + ty::BoundTyKind::Anon(bv) => { + self.pretty_print_bound_var(debruijn, ty::BoundVar::from_u32(bv))? + } + ty::BoundTyKind::Param(_, s) => p!(write("{}", s)), }, ty::Adt(def, substs) => { p!(print_def_path(def.did(), substs)); @@ -1084,9 +1086,11 @@ pub trait PrettyPrinter<'tcx>: write!(self, "Sized")?; } - for re in lifetimes { - write!(self, " + ")?; - self = self.print_region(re)?; + if !FORCE_TRIMMED_PATH.with(|flag| flag.get()) { + for re in lifetimes { + write!(self, " + ")?; + self = self.print_region(re)?; + } } Ok(self) @@ -2070,6 +2074,10 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> { return true; } + if FORCE_TRIMMED_PATH.with(|flag| flag.get()) { + return false; + } + let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions; match *region { @@ -2346,6 +2354,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { } else { let tcx = self.tcx; + let trim_path = FORCE_TRIMMED_PATH.with(|flag| flag.get()); // Closure used in `RegionFolder` to create names for anonymous late-bound // regions. We use two `DebruijnIndex`es (one for the currently folded // late-bound region and the other for the binder level) to determine @@ -2400,8 +2409,10 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { } }; - start_or_continue(&mut self, "for<", ", "); - do_continue(&mut self, name); + if !trim_path { + start_or_continue(&mut self, "for<", ", "); + do_continue(&mut self, name); + } tcx.mk_region(ty::ReLateBound(ty::INNERMOST, ty::BoundRegion { var: br.var, kind })) }; let mut folder = RegionFolder { @@ -2412,7 +2423,9 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { }; let new_value = value.clone().skip_binder().fold_with(&mut folder); let region_map = folder.region_map; - start_or_continue(&mut self, "", "> "); + if !trim_path { + start_or_continue(&mut self, "", "> "); + } (new_value, region_map) }; diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 034aab0c38ea3..8df639750c701 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -240,6 +240,7 @@ TrivialTypeTraversalAndLiftImpls! { crate::ty::AssocKind, crate::ty::AliasKind, crate::ty::Placeholder, + crate::ty::Placeholder, crate::ty::ClosureKind, crate::ty::FreeRegion, crate::ty::InferTy, diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index f97d2e753a3b6..060d864389cb0 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1504,13 +1504,22 @@ pub struct BoundTy { #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] #[derive(HashStable)] pub enum BoundTyKind { - Anon, - Param(Symbol), + Anon(u32), + Param(DefId, Symbol), +} + +impl BoundTyKind { + pub fn expect_anon(self) -> u32 { + match self { + BoundTyKind::Anon(i) => i, + _ => bug!(), + } + } } impl From for BoundTy { fn from(var: BoundVar) -> Self { - BoundTy { var, kind: BoundTyKind::Anon } + BoundTy { var, kind: BoundTyKind::Anon(var.as_u32()) } } } diff --git a/compiler/rustc_middle/src/ty/typeck_results.rs b/compiler/rustc_middle/src/ty/typeck_results.rs index 79a6c730d7159..9beaac87183a7 100644 --- a/compiler/rustc_middle/src/ty/typeck_results.rs +++ b/compiler/rustc_middle/src/ty/typeck_results.rs @@ -372,7 +372,7 @@ impl<'tcx> TypeckResults<'tcx> { pub fn node_type(&self, id: hir::HirId) -> Ty<'tcx> { self.node_type_opt(id).unwrap_or_else(|| { - bug!("node_type: no type for node `{}`", tls::with(|tcx| tcx.hir().node_to_string(id))) + bug!("node_type: no type for node {}", tls::with(|tcx| tcx.hir().node_to_string(id))) }) } @@ -551,9 +551,8 @@ fn validate_hir_id_for_typeck_results(hir_owner: OwnerId, hir_id: hir::HirId) { fn invalid_hir_id_for_typeck_results(hir_owner: OwnerId, hir_id: hir::HirId) { ty::tls::with(|tcx| { bug!( - "node {} with HirId::owner {:?} cannot be placed in TypeckResults with hir_owner {:?}", + "node {} cannot be placed in TypeckResults with hir_owner {:?}", tcx.hir().node_to_string(hir_id), - hir_id.owner, hir_owner ) }); diff --git a/compiler/rustc_mir_build/src/build/expr/as_temp.rs b/compiler/rustc_mir_build/src/build/expr/as_temp.rs index 0ca4e37451995..3d3cf75559e30 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_temp.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_temp.rs @@ -44,7 +44,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let expr_ty = expr.ty; let temp = { let mut local_decl = LocalDecl::new(expr_ty, expr_span); - if mutability == Mutability::Not { + if mutability.is_not() { local_decl = local_decl.immutable(); } diff --git a/compiler/rustc_mir_transform/src/check_packed_ref.rs b/compiler/rustc_mir_transform/src/check_packed_ref.rs index 3e7571aa7a2e7..9dc8dba23a4ec 100644 --- a/compiler/rustc_mir_transform/src/check_packed_ref.rs +++ b/compiler/rustc_mir_transform/src/check_packed_ref.rs @@ -1,7 +1,7 @@ +use rustc_errors::struct_span_err; use rustc_middle::mir::visit::{PlaceContext, Visitor}; use rustc_middle::mir::*; use rustc_middle::ty::{self, TyCtxt}; -use rustc_session::lint::builtin::UNALIGNED_REFERENCES; use crate::util; use crate::MirLint; @@ -49,31 +49,22 @@ impl<'tcx> Visitor<'tcx> for PackedRefChecker<'_, 'tcx> { // shouldn't do. unreachable!(); } else { - let source_info = self.source_info; - let lint_root = self.body.source_scopes[source_info.scope] - .local_data - .as_ref() - .assert_crate_local() - .lint_root; - self.tcx.struct_span_lint_hir( - UNALIGNED_REFERENCES, - lint_root, - source_info.span, - "reference to packed field is unaligned", - |lint| { - lint - .note( - "fields of packed structs are not properly aligned, and creating \ - a misaligned reference is undefined behavior (even if that \ - reference is never dereferenced)", - ) - .help( - "copy the field contents to a local variable, or replace the \ - reference with a raw pointer and use `read_unaligned`/`write_unaligned` \ - (loads and stores via `*p` must be properly aligned even when using raw pointers)" - ) - }, - ); + struct_span_err!( + self.tcx.sess, + self.source_info.span, + E0793, + "reference to packed field is unaligned" + ) + .note( + "fields of packed structs are not properly aligned, and creating \ + a misaligned reference is undefined behavior (even if that \ + reference is never dereferenced)", + ).help( + "copy the field contents to a local variable, or replace the \ + reference with a raw pointer and use `read_unaligned`/`write_unaligned` \ + (loads and stores via `*p` must be properly aligned even when using raw pointers)" + ) + .emit(); } } } diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs index 5c45abc5a170e..feb054392bc2d 100644 --- a/compiler/rustc_mir_transform/src/const_prop.rs +++ b/compiler/rustc_mir_transform/src/const_prop.rs @@ -5,7 +5,6 @@ use std::cell::Cell; use either::Right; -use rustc_ast::Mutability; use rustc_const_eval::const_eval::CheckAlignment; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def::DefKind; @@ -289,7 +288,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx> } // If the static allocation is mutable, then we can't const prop it as its content // might be different at runtime. - if alloc.inner().mutability == Mutability::Mut { + if alloc.inner().mutability.is_mut() { throw_machine_stop_str!("can't access mutable globals in ConstProp"); } @@ -528,7 +527,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { let r = self.use_ecx(|this| this.ecx.read_immediate(&this.ecx.eval_operand(right, None)?)); let l = self.use_ecx(|this| this.ecx.read_immediate(&this.ecx.eval_operand(left, None)?)); // Check for exceeding shifts *even if* we cannot evaluate the LHS. - if op == BinOp::Shr || op == BinOp::Shl { + if matches!(op, BinOp::Shr | BinOp::Shl) { let r = r.clone()?; // We need the type of the LHS. We cannot use `place_layout` as that is the type // of the result, which for checked binops is not the same! diff --git a/compiler/rustc_mir_transform/src/const_prop_lint.rs b/compiler/rustc_mir_transform/src/const_prop_lint.rs index 0ab67228f3f40..c4b10218c237b 100644 --- a/compiler/rustc_mir_transform/src/const_prop_lint.rs +++ b/compiler/rustc_mir_transform/src/const_prop_lint.rs @@ -368,7 +368,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { this.ecx.read_immediate(&this.ecx.eval_operand(left, None)?) }); // Check for exceeding shifts *even if* we cannot evaluate the LHS. - if op == BinOp::Shr || op == BinOp::Shl { + if matches!(op, BinOp::Shr | BinOp::Shl) { let r = r.clone()?; // We need the type of the LHS. We cannot use `place_layout` as that is the type // of the result, which for checked binops is not the same! diff --git a/compiler/rustc_mir_transform/src/coverage/debug.rs b/compiler/rustc_mir_transform/src/coverage/debug.rs index d6a298fade42e..22ea8710e6a96 100644 --- a/compiler/rustc_mir_transform/src/coverage/debug.rs +++ b/compiler/rustc_mir_transform/src/coverage/debug.rs @@ -323,7 +323,10 @@ impl DebugCounters { String::new() }, self.format_operand(lhs), - if op == Op::Add { "+" } else { "-" }, + match op { + Op::Add => "+", + Op::Subtract => "-", + }, self.format_operand(rhs), ); } diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index cbebca15483de..6815289776e93 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -23,6 +23,7 @@ use rustc_const_eval::util; use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::steal::Steal; use rustc_hir as hir; +use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::intravisit::{self, Visitor}; use rustc_index::vec::IndexVec; @@ -430,7 +431,9 @@ fn mir_drops_elaborated_and_const_checked( return tcx.mir_drops_elaborated_and_const_checked(def); } - if tcx.generator_kind(def.did).is_some() && tcx.sess.opts.unstable_opts.drop_tracking_mir { + if tcx.sess.opts.unstable_opts.drop_tracking_mir + && let DefKind::Generator = tcx.def_kind(def.did) + { tcx.ensure().mir_generator_witnesses(def.did); } let mir_borrowck = tcx.mir_borrowck_opt_const_arg(def); diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index 8d4fe74e7d392..e9ca6f7c93c44 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -427,7 +427,7 @@ impl<'tcx> CloneShimBuilder<'tcx> { fn make_place(&mut self, mutability: Mutability, ty: Ty<'tcx>) -> Place<'tcx> { let span = self.span; let mut local = LocalDecl::new(ty, span); - if mutability == Mutability::Not { + if mutability.is_not() { local = local.immutable(); } Place::from(self.local_decls.push(local)) diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 305f0427e501b..31a3ffbb1d891 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -201,7 +201,9 @@ use rustc_target::abi::Size; use std::ops::Range; use std::path::PathBuf; -use crate::errors::{LargeAssignmentsLint, RecursionLimit, TypeLengthLimit}; +use crate::errors::{ + EncounteredErrorWhileInstantiating, LargeAssignmentsLint, RecursionLimit, TypeLengthLimit, +}; #[derive(PartialEq)] pub enum MonoItemCollectionMode { @@ -524,10 +526,10 @@ fn collect_items_rec<'tcx>( && starting_point.node.is_user_defined() { let formatted_item = with_no_trimmed_paths!(starting_point.node.to_string()); - tcx.sess.span_note_without_error( - starting_point.span, - &format!("the above error was encountered while instantiating `{formatted_item}`"), - ); + tcx.sess.emit_note(EncounteredErrorWhileInstantiating { + span: starting_point.span, + formatted_item, + }); } inlining_map.lock_mut().record_accesses(starting_point.node, &neighbors.items); diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index 5233cfb21203b..a53bd7e1fef5e 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -83,3 +83,17 @@ pub struct SymbolAlreadyDefined { pub struct CouldntDumpMonoStats { pub error: String, } + +#[derive(Diagnostic)] +#[diag(monomorphize_encountered_error_while_instantiating)] +pub struct EncounteredErrorWhileInstantiating { + #[primary_span] + pub span: Span, + pub formatted_item: String, +} + +#[derive(Diagnostic)] +#[diag(monomorphize_unknown_cgu_collection_mode)] +pub struct UnknownCguCollectionMode<'a> { + pub mode: &'a str, +} diff --git a/compiler/rustc_monomorphize/src/partitioning/mod.rs b/compiler/rustc_monomorphize/src/partitioning/mod.rs index 615126e8b5896..524c51d88d755 100644 --- a/compiler/rustc_monomorphize/src/partitioning/mod.rs +++ b/compiler/rustc_monomorphize/src/partitioning/mod.rs @@ -114,7 +114,9 @@ use rustc_span::symbol::Symbol; use crate::collector::InliningMap; use crate::collector::{self, MonoItemCollectionMode}; -use crate::errors::{CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownPartitionStrategy}; +use crate::errors::{ + CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownCguCollectionMode, UnknownPartitionStrategy, +}; pub struct PartitioningCx<'a, 'tcx> { tcx: TyCtxt<'tcx>, @@ -348,17 +350,13 @@ where fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[CodegenUnit<'_>]) { let collection_mode = match tcx.sess.opts.unstable_opts.print_mono_items { Some(ref s) => { - let mode_string = s.to_lowercase(); - let mode_string = mode_string.trim(); - if mode_string == "eager" { + let mode = s.to_lowercase(); + let mode = mode.trim(); + if mode == "eager" { MonoItemCollectionMode::Eager } else { - if mode_string != "lazy" { - let message = format!( - "Unknown codegen-item collection mode '{mode_string}'. \ - Falling back to 'lazy' mode." - ); - tcx.sess.warn(&message); + if mode != "lazy" { + tcx.sess.emit_warning(UnknownCguCollectionMode { mode }); } MonoItemCollectionMode::Lazy diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 054b41b478d60..e63fc3c73b209 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -351,7 +351,7 @@ pub(crate) enum IfExpressionMissingThenBlockSub { } #[derive(Subdiagnostic)] -#[help(parse_extra_if_in_let_else)] +#[suggestion(parse_extra_if_in_let_else, applicability = "maybe-incorrect", code = "")] pub(crate) struct IfExpressionLetSomeSub { #[primary_span] pub if_span: Span, diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 17d1e200b41aa..500d7d77071de 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1882,7 +1882,16 @@ impl<'a> Parser<'a> { if let token::Literal(token::Lit { kind: token::Integer, symbol, suffix }) = next_token.kind { - if self.token.span.hi() == next_token.span.lo() { + // If this integer looks like a float, then recover as such. + // + // We will never encounter the exponent part of a floating + // point literal here, since there's no use of the exponent + // syntax that also constitutes a valid integer, so we need + // not check for that. + if suffix.map_or(true, |s| s == sym::f32 || s == sym::f64) + && symbol.as_str().chars().all(|c| c.is_numeric() || c == '_') + && self.token.span.hi() == next_token.span.lo() + { let s = String::from("0.") + symbol.as_str(); let kind = TokenKind::lit(token::Float, Symbol::intern(&s), suffix); return Some(Token::new(kind, self.token.span.to(next_token.span))); @@ -2281,7 +2290,7 @@ impl<'a> Parser<'a> { block } else { let let_else_sub = matches!(cond.kind, ExprKind::Let(..)) - .then(|| IfExpressionLetSomeSub { if_span: lo }); + .then(|| IfExpressionLetSomeSub { if_span: lo.until(cond_span) }); self.sess.emit_err(IfExpressionMissingThenBlock { if_span: lo, diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 4ff9927aab51a..58c7a398f1425 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -93,11 +93,12 @@ impl<'a> Parser<'a> { // or `auto trait` items. We aim to parse an arbitrary path `a::b` but not something // that starts like a path (1 token), but it fact not a path. // Also, we avoid stealing syntax from `parse_item_`. - if force_collect == ForceCollect::Yes { - self.collect_tokens_no_attrs(|this| this.parse_stmt_path_start(lo, attrs)) - } else { - self.parse_stmt_path_start(lo, attrs) - }? + match force_collect { + ForceCollect::Yes => { + self.collect_tokens_no_attrs(|this| this.parse_stmt_path_start(lo, attrs))? + } + ForceCollect::No => self.parse_stmt_path_start(lo, attrs)?, + } } else if let Some(item) = self.parse_item_common( attrs.clone(), false, @@ -113,13 +114,12 @@ impl<'a> Parser<'a> { self.mk_stmt(lo, StmtKind::Empty) } else if self.token != token::CloseDelim(Delimiter::Brace) { // Remainder are line-expr stmts. - let e = if force_collect == ForceCollect::Yes { - self.collect_tokens_no_attrs(|this| { + let e = match force_collect { + ForceCollect::Yes => self.collect_tokens_no_attrs(|this| { this.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs)) - }) - } else { - self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs)) - }?; + })?, + ForceCollect::No => self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs))?, + }; if matches!(e.kind, ExprKind::Assign(..)) && self.eat_keyword(kw::Else) { let bl = self.parse_block()?; // Destructuring assignment ... else. diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 82d9138c7a331..8b4f0ab8feb84 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -323,13 +323,14 @@ impl<'a> Parser<'a> { } else if self.can_begin_bound() { self.parse_bare_trait_object(lo, allow_plus)? } else if self.eat(&token::DotDotDot) { - if allow_c_variadic == AllowCVariadic::Yes { - TyKind::CVarArgs - } else { - // FIXME(Centril): Should we just allow `...` syntactically - // anywhere in a type and use semantic restrictions instead? - self.error_illegal_c_varadic_ty(lo); - TyKind::Err + match allow_c_variadic { + AllowCVariadic::Yes => TyKind::CVarArgs, + AllowCVariadic::No => { + // FIXME(Centril): Should we just allow `...` syntactically + // anywhere in a type and use semantic restrictions instead? + self.error_illegal_c_varadic_ty(lo); + TyKind::Err + } } } else { let msg = format!("expected type, found {}", super::token_descr(&self.token)); @@ -343,10 +344,9 @@ impl<'a> Parser<'a> { let mut ty = self.mk_ty(span, kind); // Try to recover from use of `+` with incorrect priority. - if allow_plus == AllowPlus::Yes { - self.maybe_recover_from_bad_type_plus(&ty)?; - } else { - self.maybe_report_ambiguous_plus(impl_dyn_multi, &ty); + match allow_plus { + AllowPlus::Yes => self.maybe_recover_from_bad_type_plus(&ty)?, + AllowPlus::No => self.maybe_report_ambiguous_plus(impl_dyn_multi, &ty), } if RecoverQuestionMark::Yes == recover_question_mark { ty = self.maybe_recover_from_question_mark(ty); diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 25cc65ba04c8b..d67d52da49746 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -864,33 +864,39 @@ impl CheckAttrVisitor<'_> { target: Target, specified_inline: &mut Option<(bool, Span)>, ) -> bool { - if target == Target::Use || target == Target::ExternCrate { - let do_inline = meta.name_or_empty() == sym::inline; - if let Some((prev_inline, prev_span)) = *specified_inline { - if do_inline != prev_inline { - let mut spans = MultiSpan::from_spans(vec![prev_span, meta.span()]); - spans.push_span_label(prev_span, fluent::passes_doc_inline_conflict_first); - spans.push_span_label(meta.span(), fluent::passes_doc_inline_conflict_second); - self.tcx.sess.emit_err(errors::DocKeywordConflict { spans }); - return false; + match target { + Target::Use | Target::ExternCrate => { + let do_inline = meta.name_or_empty() == sym::inline; + if let Some((prev_inline, prev_span)) = *specified_inline { + if do_inline != prev_inline { + let mut spans = MultiSpan::from_spans(vec![prev_span, meta.span()]); + spans.push_span_label(prev_span, fluent::passes_doc_inline_conflict_first); + spans.push_span_label( + meta.span(), + fluent::passes_doc_inline_conflict_second, + ); + self.tcx.sess.emit_err(errors::DocKeywordConflict { spans }); + return false; + } + true + } else { + *specified_inline = Some((do_inline, meta.span())); + true } - true - } else { - *specified_inline = Some((do_inline, meta.span())); - true } - } else { - self.tcx.emit_spanned_lint( - INVALID_DOC_ATTRIBUTES, - hir_id, - meta.span(), - errors::DocInlineOnlyUse { - attr_span: meta.span(), - item_span: (attr.style == AttrStyle::Outer) - .then(|| self.tcx.hir().span(hir_id)), - }, - ); - false + _ => { + self.tcx.emit_spanned_lint( + INVALID_DOC_ATTRIBUTES, + hir_id, + meta.span(), + errors::DocInlineOnlyUse { + attr_span: meta.span(), + item_span: (attr.style == AttrStyle::Outer) + .then(|| self.tcx.hir().span(hir_id)), + }, + ); + false + } } } @@ -1137,7 +1143,7 @@ impl CheckAttrVisitor<'_> { errors::DocTestUnknownInclude { path, value: value.to_string(), - inner: if attr.style == AttrStyle::Inner { "!" } else { "" }, + inner: match attr.style { AttrStyle::Inner=> "!" , AttrStyle::Outer => "" }, sugg: (attr.meta().unwrap().span, applicability), } ); diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs index dd8c646a43c82..526b829bf676a 100644 --- a/compiler/rustc_passes/src/check_const.rs +++ b/compiler/rustc_passes/src/check_const.rs @@ -17,7 +17,7 @@ use rustc_middle::ty::TyCtxt; use rustc_session::parse::feature_err; use rustc_span::{sym, Span, Symbol}; -use crate::errors::ExprNotAllowedInContext; +use crate::errors::{ExprNotAllowedInContext, SkippingConstChecks}; /// An expression that is not *always* legal in a const context. #[derive(Clone, Copy)] @@ -124,7 +124,7 @@ impl<'tcx> CheckConstVisitor<'tcx> { // corresponding feature gate. This encourages nightly users to use feature gates when // possible. None if tcx.sess.opts.unstable_opts.unleash_the_miri_inside_of_you => { - tcx.sess.span_warn(span, "skipping const checks"); + tcx.sess.emit_warning(SkippingConstChecks { span }); return; } diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 9e05ad22e6241..97169a6367c3d 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -1565,3 +1565,10 @@ pub(crate) struct ProcMacroUnsafe { #[primary_span] pub span: Span, } + +#[derive(Diagnostic)] +#[diag(passes_skipping_const_checks)] +pub struct SkippingConstChecks { + #[primary_span] + pub span: Span, +} diff --git a/compiler/rustc_passes/src/hir_id_validator.rs b/compiler/rustc_passes/src/hir_id_validator.rs index d143adb2eb941..de0e50a65de6e 100644 --- a/compiler/rustc_passes/src/hir_id_validator.rs +++ b/compiler/rustc_passes/src/hir_id_validator.rs @@ -74,37 +74,26 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> { .expect("owning item has no entry"); if max != self.hir_ids_seen.len() - 1 { - // Collect the missing ItemLocalIds - let missing: Vec<_> = (0..=max as u32) - .filter(|&i| !self.hir_ids_seen.contains(ItemLocalId::from_u32(i))) - .collect(); - - // Try to map those to something more useful - let mut missing_items = Vec::with_capacity(missing.len()); + let hir = self.tcx.hir(); + let pretty_owner = hir.def_path(owner.def_id).to_string_no_crate_verbose(); - for local_id in missing { - let hir_id = HirId { owner, local_id: ItemLocalId::from_u32(local_id) }; + let missing_items: Vec<_> = (0..=max as u32) + .map(|i| ItemLocalId::from_u32(i)) + .filter(|&local_id| !self.hir_ids_seen.contains(local_id)) + .map(|local_id| hir.node_to_string(HirId { owner, local_id })) + .collect(); - trace!("missing hir id {:#?}", hir_id); + let seen_items: Vec<_> = self + .hir_ids_seen + .iter() + .map(|local_id| hir.node_to_string(HirId { owner, local_id })) + .collect(); - missing_items.push(format!( - "[local_id: {}, owner: {}]", - local_id, - self.tcx.hir().def_path(owner.def_id).to_string_no_crate_verbose() - )); - } self.error(|| { format!( "ItemLocalIds not assigned densely in {}. \ - Max ItemLocalId = {}, missing IDs = {:#?}; seens IDs = {:#?}", - self.tcx.hir().def_path(owner.def_id).to_string_no_crate_verbose(), - max, - missing_items, - self.hir_ids_seen - .iter() - .map(|local_id| HirId { owner, local_id }) - .map(|h| format!("({:?} {})", h, self.tcx.hir().node_to_string(h))) - .collect::>() + Max ItemLocalId = {}, missing IDs = {:#?}; seen IDs = {:#?}", + pretty_owner, max, missing_items, seen_items ) }); } diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 0bde7502e3991..47911aef25d4f 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -125,7 +125,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { if let Some((depr, span)) = &depr { is_deprecated = true; - if kind == AnnotationKind::Prohibited || kind == AnnotationKind::DeprecationProhibited { + if matches!(kind, AnnotationKind::Prohibited | AnnotationKind::DeprecationProhibited) { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); self.tcx.emit_spanned_lint( USELESS_DEPRECATED, diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index b1b04c92a7504..84421dc1f6225 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -298,14 +298,15 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { self.r.record_partial_res(id, PartialRes::new(res)); } if module.is_normal() { - if res == Res::Err { - Ok(ty::Visibility::Public) - } else { - let vis = ty::Visibility::Restricted(res.def_id()); - if self.r.is_accessible_from(vis, parent_scope.module) { - Ok(vis.expect_local()) - } else { - Err(VisResolutionError::AncestorOnly(path.span)) + match res { + Res::Err => Ok(ty::Visibility::Public), + _ => { + let vis = ty::Visibility::Restricted(res.def_id()); + if self.r.is_accessible_from(vis, parent_scope.module) { + Ok(vis.expect_local()) + } else { + Err(VisResolutionError::AncestorOnly(path.span)) + } } } } else { diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 3660861525558..3bf041cebcb88 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1552,12 +1552,12 @@ impl<'a> Resolver<'a> { if b.is_extern_crate() && ident.span.rust_2018() { help_msgs.push(format!("use `::{ident}` to refer to this {thing} unambiguously")) } - if misc == AmbiguityErrorMisc::SuggestCrate { - help_msgs - .push(format!("use `crate::{ident}` to refer to this {thing} unambiguously")) - } else if misc == AmbiguityErrorMisc::SuggestSelf { - help_msgs - .push(format!("use `self::{ident}` to refer to this {thing} unambiguously")) + match misc { + AmbiguityErrorMisc::SuggestCrate => help_msgs + .push(format!("use `crate::{ident}` to refer to this {thing} unambiguously")), + AmbiguityErrorMisc::SuggestSelf => help_msgs + .push(format!("use `self::{ident}` to refer to this {thing} unambiguously")), + AmbiguityErrorMisc::FromPrelude | AmbiguityErrorMisc::None => {} } err.span_note(b.span, ¬e_msg); @@ -1717,7 +1717,7 @@ impl<'a> Resolver<'a> { Applicability::MaybeIncorrect, )), ) - } else if self.session.edition() == Edition::Edition2015 { + } else if self.session.rust_2015() { ( format!("maybe a missing crate `{ident}`?"), Some(( diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index a84652a315dc2..1c985d43658ae 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -7,7 +7,6 @@ use rustc_middle::ty; use rustc_session::lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK; use rustc_session::lint::BuiltinLintDiagnostics; use rustc_span::def_id::LocalDefId; -use rustc_span::edition::Edition; use rustc_span::hygiene::{ExpnId, ExpnKind, LocalExpnId, MacroKind, SyntaxContext}; use rustc_span::symbol::{kw, Ident}; use rustc_span::{Span, DUMMY_SP}; @@ -86,7 +85,7 @@ impl<'a> Resolver<'a> { // 4c. Standard library prelude (de-facto closed, controlled). // 6. Language prelude: builtin attributes (closed, controlled). - let rust_2015 = ctxt.edition() == Edition::Edition2015; + let rust_2015 = ctxt.edition().rust_2015(); let (ns, macro_kind, is_absolute_path) = match scope_set { ScopeSet::All(ns, _) => (ns, None, false), ScopeSet::AbsolutePath(ns) => (ns, None, true), diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index 979305547c14b..a50a8178de38b 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -29,7 +29,6 @@ use crate::{id_from_def_id, SaveContext}; use rls_data::{SigElement, Signature}; -use rustc_ast::Mutability; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; use rustc_hir_pretty::id_to_string; @@ -769,9 +768,8 @@ impl<'hir> Sig for hir::ForeignItem<'hir> { } hir::ForeignItemKind::Static(ref ty, m) => { let mut text = "static ".to_owned(); - if m == Mutability::Mut { - text.push_str("mut "); - } + text.push_str(m.prefix_str()); + let name = self.ident.to_string(); let defs = vec![SigElement { id: id_from_def_id(self.owner_id.to_def_id()), diff --git a/compiler/rustc_session/src/code_stats.rs b/compiler/rustc_session/src/code_stats.rs index 1085bce44758f..87dfccdef2f10 100644 --- a/compiler/rustc_session/src/code_stats.rs +++ b/compiler/rustc_session/src/code_stats.rs @@ -19,8 +19,26 @@ pub enum SizeKind { Min, } +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +pub enum FieldKind { + AdtField, + Upvar, + GeneratorLocal, +} + +impl std::fmt::Display for FieldKind { + fn fmt(&self, w: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + FieldKind::AdtField => write!(w, "field"), + FieldKind::Upvar => write!(w, "upvar"), + FieldKind::GeneratorLocal => write!(w, "local"), + } + } +} + #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct FieldInfo { + pub kind: FieldKind, pub name: Symbol, pub offset: u64, pub size: u64, @@ -145,7 +163,7 @@ impl CodeStats { fields.sort_by_key(|f| (f.offset, f.size)); for field in fields { - let FieldInfo { ref name, offset, size, align } = field; + let FieldInfo { kind, ref name, offset, size, align } = field; if offset > min_offset { let pad = offset - min_offset; @@ -155,16 +173,16 @@ impl CodeStats { if offset < min_offset { // If this happens it's probably a union. println!( - "print-type-size {indent}field `.{name}`: {size} bytes, \ + "print-type-size {indent}{kind} `.{name}`: {size} bytes, \ offset: {offset} bytes, \ alignment: {align} bytes" ); } else if info.packed || offset == min_offset { - println!("print-type-size {indent}field `.{name}`: {size} bytes"); + println!("print-type-size {indent}{kind} `.{name}`: {size} bytes"); } else { // Include field alignment in output only if it caused padding injection println!( - "print-type-size {indent}field `.{name}`: {size} bytes, \ + "print-type-size {indent}{kind} `.{name}`: {size} bytes, \ alignment: {align} bytes" ); } diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index c49c5fa990413..973d860118ef1 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -24,7 +24,7 @@ use rustc_span::RealFileName; use rustc_span::SourceFileHashAlgorithm; use rustc_errors::emitter::HumanReadableErrorType; -use rustc_errors::{ColorConfig, HandlerFlags}; +use rustc_errors::{ColorConfig, DiagnosticArgValue, HandlerFlags, IntoDiagnosticArg}; use std::collections::btree_map::{ Iter as BTreeMapIter, Keys as BTreeMapKeysIter, Values as BTreeMapValuesIter, @@ -2694,6 +2694,12 @@ impl fmt::Display for CrateType { } } +impl IntoDiagnosticArg for CrateType { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + self.to_string().into_diagnostic_arg() + } +} + #[derive(Copy, Clone, PartialEq, Debug)] pub enum PpSourceMode { /// `-Zunpretty=normal` diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index f5a72573d58cd..8e8fba5e236f5 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -375,3 +375,9 @@ pub fn report_lit_error(sess: &ParseSess, err: LitError, lit: token::Lit, span: } } } + +#[derive(Diagnostic)] +#[diag(session_optimization_fuel_exhausted)] +pub struct OptimisationFuelExhausted { + pub msg: String, +} diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 95f199de6ff6f..746e0f169bcf3 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1,13 +1,14 @@ use crate::cgu_reuse_tracker::CguReuseTracker; use crate::code_stats::CodeStats; -pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo}; +pub use crate::code_stats::{DataTypeKind, FieldInfo, FieldKind, SizeKind, VariantInfo}; use crate::config::Input; use crate::config::{self, CrateType, InstrumentCoverage, OptLevel, OutputType, SwitchWithOptPath}; use crate::errors::{ BranchProtectionRequiresAArch64, CannotEnableCrtStaticLinux, CannotMixAndMatchSanitizers, - LinkerPluginToWindowsNotSupported, NotCircumventFeature, ProfileSampleUseFileDoesNotExist, - ProfileUseFileDoesNotExist, SanitizerCfiEnabled, SanitizerNotSupported, SanitizersNotSupported, - SkippingConstChecks, SplitDebugInfoUnstablePlatform, StackProtectorNotSupportedForTarget, + LinkerPluginToWindowsNotSupported, NotCircumventFeature, OptimisationFuelExhausted, + ProfileSampleUseFileDoesNotExist, ProfileUseFileDoesNotExist, SanitizerCfiEnabled, + SanitizerNotSupported, SanitizersNotSupported, SkippingConstChecks, + SplitDebugInfoUnstablePlatform, StackProtectorNotSupportedForTarget, TargetRequiresUnwindTables, UnleashedFeatureHelp, UnstableVirtualFunctionElimination, UnsupportedDwarfVersion, }; @@ -483,6 +484,8 @@ impl Session { self.diagnostic().span_err_with_code(sp, msg, code) } #[rustc_lint_diagnostics] + #[allow(rustc::untranslatable_diagnostic)] + #[allow(rustc::diagnostic_outside_of_impl)] pub fn err(&self, msg: impl Into) -> ErrorGuaranteed { self.diagnostic().err(msg) } @@ -583,12 +586,16 @@ impl Session { )) } } + + #[rustc_lint_diagnostics] #[allow(rustc::untranslatable_diagnostic)] #[allow(rustc::diagnostic_outside_of_impl)] #[track_caller] pub fn span_warn>(&self, sp: S, msg: impl Into) { self.diagnostic().span_warn(sp, msg) } + + #[rustc_lint_diagnostics] #[allow(rustc::untranslatable_diagnostic)] #[allow(rustc::diagnostic_outside_of_impl)] pub fn span_warn_with_code>( @@ -599,6 +606,10 @@ impl Session { ) { self.diagnostic().span_warn_with_code(sp, msg, code) } + + #[rustc_lint_diagnostics] + #[allow(rustc::untranslatable_diagnostic)] + #[allow(rustc::diagnostic_outside_of_impl)] pub fn warn(&self, msg: impl Into) { self.diagnostic().warn(msg) } @@ -641,11 +652,17 @@ impl Session { self.diagnostic().delay_good_path_bug(msg) } + #[rustc_lint_diagnostics] + #[allow(rustc::untranslatable_diagnostic)] + #[allow(rustc::diagnostic_outside_of_impl)] pub fn note_without_error(&self, msg: impl Into) { self.diagnostic().note_without_error(msg) } #[track_caller] + #[rustc_lint_diagnostics] + #[allow(rustc::untranslatable_diagnostic)] + #[allow(rustc::diagnostic_outside_of_impl)] pub fn span_note_without_error>( &self, sp: S, @@ -653,6 +670,8 @@ impl Session { ) { self.diagnostic().span_note_without_error(sp, msg) } + + #[rustc_lint_diagnostics] #[allow(rustc::untranslatable_diagnostic)] #[allow(rustc::diagnostic_outside_of_impl)] pub fn struct_note_without_error( @@ -882,7 +901,7 @@ impl Session { // We only call `msg` in case we can actually emit warnings. // Otherwise, this could cause a `delay_good_path_bug` to // trigger (issue #79546). - self.warn(&format!("optimization-fuel-exhausted: {}", msg())); + self.emit_warning(OptimisationFuelExhausted { msg: msg() }); } fuel.out_of_fuel = true; } else if fuel.remaining > 0 { @@ -899,23 +918,24 @@ impl Session { ret } + /// Is this edition 2015? pub fn rust_2015(&self) -> bool { - self.edition() == Edition::Edition2015 + self.edition().rust_2015() } /// Are we allowed to use features from the Rust 2018 edition? pub fn rust_2018(&self) -> bool { - self.edition() >= Edition::Edition2018 + self.edition().rust_2018() } /// Are we allowed to use features from the Rust 2021 edition? pub fn rust_2021(&self) -> bool { - self.edition() >= Edition::Edition2021 + self.edition().rust_2021() } /// Are we allowed to use features from the Rust 2024 edition? pub fn rust_2024(&self) -> bool { - self.edition() >= Edition::Edition2024 + self.edition().rust_2024() } /// Returns `true` if we cannot skip the PLT for shared library calls. diff --git a/compiler/rustc_span/src/edition.rs b/compiler/rustc_span/src/edition.rs index b43183916bca5..e66ec07904341 100644 --- a/compiler/rustc_span/src/edition.rs +++ b/compiler/rustc_span/src/edition.rs @@ -49,8 +49,8 @@ impl fmt::Display for Edition { } impl Edition { - pub fn lint_name(&self) -> &'static str { - match *self { + pub fn lint_name(self) -> &'static str { + match self { Edition::Edition2015 => "rust_2015_compatibility", Edition::Edition2018 => "rust_2018_compatibility", Edition::Edition2021 => "rust_2021_compatibility", @@ -58,8 +58,8 @@ impl Edition { } } - pub fn feature_name(&self) -> Symbol { - match *self { + pub fn feature_name(self) -> Symbol { + match self { Edition::Edition2015 => sym::rust_2015_preview, Edition::Edition2018 => sym::rust_2018_preview, Edition::Edition2021 => sym::rust_2021_preview, @@ -67,8 +67,8 @@ impl Edition { } } - pub fn is_stable(&self) -> bool { - match *self { + pub fn is_stable(self) -> bool { + match self { Edition::Edition2015 => true, Edition::Edition2018 => true, Edition::Edition2021 => true, @@ -76,23 +76,24 @@ impl Edition { } } - pub fn rust_2015(&self) -> bool { - *self == Edition::Edition2015 + /// Is this edition 2015? + pub fn rust_2015(self) -> bool { + self == Edition::Edition2015 } /// Are we allowed to use features from the Rust 2018 edition? - pub fn rust_2018(&self) -> bool { - *self >= Edition::Edition2018 + pub fn rust_2018(self) -> bool { + self >= Edition::Edition2018 } /// Are we allowed to use features from the Rust 2021 edition? - pub fn rust_2021(&self) -> bool { - *self >= Edition::Edition2021 + pub fn rust_2021(self) -> bool { + self >= Edition::Edition2021 } /// Are we allowed to use features from the Rust 2024 edition? - pub fn rust_2024(&self) -> bool { - *self >= Edition::Edition2024 + pub fn rust_2024(self) -> bool { + self >= Edition::Edition2024 } } diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 7e61f2f9f73c0..006102a5f2fcf 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -706,22 +706,22 @@ impl Span { #[inline] pub fn rust_2015(self) -> bool { - self.edition() == edition::Edition::Edition2015 + self.edition().rust_2015() } #[inline] pub fn rust_2018(self) -> bool { - self.edition() >= edition::Edition::Edition2018 + self.edition().rust_2018() } #[inline] pub fn rust_2021(self) -> bool { - self.edition() >= edition::Edition::Edition2021 + self.edition().rust_2021() } #[inline] pub fn rust_2024(self) -> bool { - self.edition() >= edition::Edition::Edition2024 + self.edition().rust_2024() } /// Returns the source callee. diff --git a/compiler/rustc_trait_selection/src/solve/assembly.rs b/compiler/rustc_trait_selection/src/solve/assembly.rs index e44fd82ba2236..5690b6536bbc0 100644 --- a/compiler/rustc_trait_selection/src/solve/assembly.rs +++ b/compiler/rustc_trait_selection/src/solve/assembly.rs @@ -173,6 +173,21 @@ pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq { ecx: &mut EvalCtxt<'_, 'tcx>, goal: Goal<'tcx, Self>, ) -> QueryResult<'tcx>; + + // The most common forms of unsizing are array to slice, and concrete (Sized) + // type into a `dyn Trait`. ADTs and Tuples can also have their final field + // unsized if it's generic. + fn consider_builtin_unsize_candidate( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx>; + + // `dyn Trait1` can be unsized to `dyn Trait2` if they are the same trait, or + // if `Trait2` is a (transitive) supertrait of `Trait2`. + fn consider_builtin_dyn_upcast_candidates( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> Vec>; } impl<'tcx> EvalCtxt<'_, 'tcx> { @@ -303,6 +318,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { G::consider_builtin_future_candidate(self, goal) } else if lang_items.gen_trait() == Some(trait_def_id) { G::consider_builtin_generator_candidate(self, goal) + } else if lang_items.unsize_trait() == Some(trait_def_id) { + G::consider_builtin_unsize_candidate(self, goal) } else { Err(NoSolution) }; @@ -313,6 +330,14 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { } Err(NoSolution) => (), } + + // There may be multiple unsize candidates for a trait with several supertraits: + // `trait Foo: Bar + Bar` and `dyn Foo: Unsize>` + if lang_items.unsize_trait() == Some(trait_def_id) { + for result in G::consider_builtin_dyn_upcast_candidates(self, goal) { + candidates.push(Candidate { source: CandidateSource::BuiltinImpl, result }); + } + } } fn assemble_param_env_candidates>( diff --git a/compiler/rustc_trait_selection/src/solve/mod.rs b/compiler/rustc_trait_selection/src/solve/mod.rs index dd16672cc7a01..36170b3788a7a 100644 --- a/compiler/rustc_trait_selection/src/solve/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/mod.rs @@ -161,6 +161,7 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> { search_graph: &mut search_graph, infcx: self, var_values: CanonicalVarValues::dummy(), + in_projection_eq_hack: false, } .evaluate_goal(goal); @@ -174,6 +175,10 @@ struct EvalCtxt<'a, 'tcx> { var_values: CanonicalVarValues<'tcx>, search_graph: &'a mut search_graph::SearchGraph<'tcx>, + + /// This field is used by a debug assertion in [`EvalCtxt::evaluate_goal`], + /// see the comment in that method for more details. + in_projection_eq_hack: bool, } impl<'a, 'tcx> EvalCtxt<'a, 'tcx> { @@ -209,7 +214,8 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> { loop { let (ref infcx, goal, var_values) = tcx.infer_ctxt().build_with_canonical(DUMMY_SP, &canonical_goal); - let mut ecx = EvalCtxt { infcx, var_values, search_graph }; + let mut ecx = + EvalCtxt { infcx, var_values, search_graph, in_projection_eq_hack: false }; let result = ecx.compute_goal(goal); // FIXME: `Response` should be `Copy` @@ -239,10 +245,28 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> { let canonical_goal = self.infcx.canonicalize_query(goal, &mut orig_values); let canonical_response = EvalCtxt::evaluate_canonical_goal(self.tcx(), self.search_graph, canonical_goal)?; - Ok(( - !canonical_response.value.var_values.is_identity(), - instantiate_canonical_query_response(self.infcx, &orig_values, canonical_response), - )) + + let has_changed = !canonical_response.value.var_values.is_identity(); + let certainty = + instantiate_canonical_query_response(self.infcx, &orig_values, canonical_response); + + // Check that rerunning this query with its inference constraints applied + // doesn't result in new inference constraints and has the same result. + // + // If we have projection goals like `::Assoc == u32` we recursively + // call `exists ::Assoc == U` to enable better caching. This goal + // could constrain `U` to `u32` which would cause this check to result in a + // solver cycle. + if cfg!(debug_assertions) && has_changed && !self.in_projection_eq_hack { + let mut orig_values = OriginalQueryValues::default(); + let canonical_goal = self.infcx.canonicalize_query(goal, &mut orig_values); + let canonical_response = + EvalCtxt::evaluate_canonical_goal(self.tcx(), self.search_graph, canonical_goal)?; + assert!(canonical_response.value.var_values.is_identity()); + assert_eq!(certainty, canonical_response.value.certainty); + } + + Ok((has_changed, certainty)) } fn compute_goal(&mut self, goal: Goal<'tcx, ty::Predicate<'tcx>>) -> QueryResult<'tcx> { diff --git a/compiler/rustc_trait_selection/src/solve/project_goals.rs b/compiler/rustc_trait_selection/src/solve/project_goals.rs index b175a6dde179f..a23fdd24b4e42 100644 --- a/compiler/rustc_trait_selection/src/solve/project_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/project_goals.rs @@ -45,8 +45,9 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { projection_ty: goal.predicate.projection_ty, term: unconstrained_rhs, }); - let (_has_changed, normalize_certainty) = - self.evaluate_goal(goal.with(self.tcx(), unconstrained_predicate))?; + let (_has_changed, normalize_certainty) = self.in_projection_eq_hack(|this| { + this.evaluate_goal(goal.with(this.tcx(), unconstrained_predicate)) + })?; let nested_eq_goals = self.infcx.eq(goal.param_env, unconstrained_rhs, predicate.term)?; @@ -55,6 +56,15 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { } } + /// This sets a flag used by a debug assert in [`EvalCtxt::evaluate_goal`], + /// see the comment in that method for more details. + fn in_projection_eq_hack(&mut self, f: impl FnOnce(&mut Self) -> T) -> T { + self.in_projection_eq_hack = true; + let result = f(self); + self.in_projection_eq_hack = false; + result + } + /// Is the projection predicate is of the form `exists ::Assoc = T`. /// /// This is the case if the `term` is an inference variable in the innermost universe @@ -122,6 +132,28 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { && goal.param_env.visit_with(&mut visitor).is_continue() } + /// After normalizing the projection to `normalized_alias` with the given + /// `normalization_certainty`, constrain the inference variable `term` to it + /// and return a query response. + fn eq_term_and_make_canonical_response( + &mut self, + goal: Goal<'tcx, ProjectionPredicate<'tcx>>, + normalization_certainty: Certainty, + normalized_alias: impl Into>, + ) -> QueryResult<'tcx> { + // The term of our goal should be fully unconstrained, so this should never fail. + // + // It can however be ambiguous when the `normalized_alias` contains a projection. + let nested_goals = self + .infcx + .eq(goal.param_env, goal.predicate.term, normalized_alias.into()) + .expect("failed to unify with unconstrained term"); + let rhs_certainty = + self.evaluate_all(nested_goals).expect("failed to unify with unconstrained term"); + + self.make_canonical_response(normalization_certainty.unify_and(rhs_certainty)) + } + fn merge_project_candidates( &mut self, mut candidates: Vec>, @@ -218,7 +250,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { .map(|pred| goal.with(tcx, pred)); nested_goals.extend(where_clause_bounds); - let trait_ref_certainty = ecx.evaluate_all(nested_goals)?; + let match_impl_certainty = ecx.evaluate_all(nested_goals)?; // In case the associated item is hidden due to specialization, we have to // return ambiguity this would otherwise be incomplete, resulting in @@ -230,7 +262,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { goal.predicate.def_id(), impl_def_id )? else { - return ecx.make_canonical_response(trait_ref_certainty.unify_and(Certainty::AMBIGUOUS)); + return ecx.make_canonical_response(match_impl_certainty.unify_and(Certainty::AMBIGUOUS)); }; if !assoc_def.item.defaultness(tcx).has_value() { @@ -277,17 +309,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { ty.map_bound(|ty| ty.into()) }; - // The term of our goal should be fully unconstrained, so this should never fail. - // - // It can however be ambiguous when the resolved type is a projection. - let nested_goals = ecx - .infcx - .eq(goal.param_env, goal.predicate.term, term.subst(tcx, substs)) - .expect("failed to unify with unconstrained term"); - let rhs_certainty = - ecx.evaluate_all(nested_goals).expect("failed to unify with unconstrained term"); - - ecx.make_canonical_response(trait_ref_certainty.unify_and(rhs_certainty)) + ecx.eq_term_and_make_canonical_response(goal, match_impl_certainty, term.subst(tcx, substs)) }) } @@ -309,18 +331,11 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { )?; let subst_certainty = ecx.evaluate_all(nested_goals)?; - // The term of our goal should be fully unconstrained, so this should never fail. - // - // It can however be ambiguous when the resolved type is a projection. - let nested_goals = ecx - .infcx - .eq(goal.param_env, goal.predicate.term, assumption_projection_pred.term) - .expect("failed to unify with unconstrained term"); - let rhs_certainty = ecx - .evaluate_all(nested_goals) - .expect("failed to unify with unconstrained term"); - - ecx.make_canonical_response(subst_certainty.unify_and(rhs_certainty)) + ecx.eq_term_and_make_canonical_response( + goal, + subst_certainty, + assumption_projection_pred.term, + ) }) } else { Err(NoSolution) @@ -437,14 +452,12 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { [ty::GenericArg::from(goal.predicate.self_ty())], )); - let mut nested_goals = ecx.infcx.eq( - goal.param_env, - goal.predicate.term.ty().unwrap(), + let is_sized_certainty = ecx.evaluate_goal(goal.with(tcx, sized_predicate))?.1; + return ecx.eq_term_and_make_canonical_response( + goal, + is_sized_certainty, tcx.types.unit, - )?; - nested_goals.push(goal.with(tcx, sized_predicate)); - - return ecx.evaluate_all_and_make_canonical_response(nested_goals); + ); } ty::Adt(def, substs) if def.is_struct() => { @@ -456,7 +469,8 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { tcx, ty::Binder::dummy(goal.predicate.with_self_ty(tcx, self_ty)), ); - return ecx.evaluate_all_and_make_canonical_response(vec![new_goal]); + let (_, certainty) = ecx.evaluate_goal(new_goal)?; + return ecx.make_canonical_response(certainty); } } } @@ -469,7 +483,8 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { tcx, ty::Binder::dummy(goal.predicate.with_self_ty(tcx, self_ty)), ); - return ecx.evaluate_all_and_make_canonical_response(vec![new_goal]); + let (_, certainty) = ecx.evaluate_goal(new_goal)?; + return ecx.make_canonical_response(certainty); } }, @@ -482,9 +497,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { ), }; - let nested_goals = - ecx.infcx.eq(goal.param_env, goal.predicate.term.ty().unwrap(), metadata_ty)?; - ecx.evaluate_all_and_make_canonical_response(nested_goals) + ecx.eq_term_and_make_canonical_response(goal, Certainty::Yes, metadata_ty) }) } @@ -554,6 +567,20 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { .to_predicate(tcx), ) } + + fn consider_builtin_unsize_candidate( + _ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx> { + bug!("`Unsize` does not have an associated type: {:?}", goal); + } + + fn consider_builtin_dyn_upcast_candidates( + _ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> Vec> { + bug!("`Unsize` does not have an associated type: {:?}", goal); + } } /// This behavior is also implemented in `rustc_ty_utils` and in the old `project` code. diff --git a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs index 0030e9aa3e514..7514c7ee55170 100644 --- a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs @@ -45,6 +45,7 @@ impl<'tcx> SearchGraph<'tcx> { /// Tries putting the new goal on the stack, returning an error if it is already cached. /// /// This correctly updates the provisional cache if there is a cycle. + #[instrument(level = "debug", skip(self, tcx), ret)] pub(super) fn try_push_stack( &mut self, tcx: TyCtxt<'tcx>, @@ -79,8 +80,10 @@ impl<'tcx> SearchGraph<'tcx> { Entry::Occupied(entry_index) => { let entry_index = *entry_index.get(); - cache.add_dependency_of_leaf_on(entry_index); let stack_depth = cache.depth(entry_index); + debug!("encountered cycle with depth {stack_depth:?}"); + + cache.add_dependency_of_leaf_on(entry_index); self.stack[stack_depth].has_been_used = true; // NOTE: The goals on the stack aren't the only goals involved in this cycle. @@ -117,6 +120,7 @@ impl<'tcx> SearchGraph<'tcx> { /// updated the provisional cache and we have to recompute the current goal. /// /// FIXME: Refer to the rustc-dev-guide entry once it exists. + #[instrument(level = "debug", skip(self, tcx, actual_goal), ret)] pub(super) fn try_finalize_goal( &mut self, tcx: TyCtxt<'tcx>, diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs index 1ea8fb8fd3dcc..29ee9da38e08b 100644 --- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs @@ -4,10 +4,11 @@ use std::iter; use super::assembly::{self, Candidate, CandidateSource}; use super::infcx_ext::InferCtxtExt; -use super::{Certainty, EvalCtxt, Goal, QueryResult}; +use super::{CanonicalResponse, Certainty, EvalCtxt, Goal, QueryResult}; use rustc_hir::def_id::DefId; use rustc_infer::infer::InferCtxt; use rustc_infer::traits::query::NoSolution; +use rustc_infer::traits::util::supertraits; use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams}; use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt}; use rustc_middle::ty::{TraitPredicate, TypeVisitable}; @@ -238,6 +239,206 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { .to_predicate(tcx), ) } + + fn consider_builtin_unsize_candidate( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx> { + let tcx = ecx.tcx(); + let a_ty = goal.predicate.self_ty(); + let b_ty = goal.predicate.trait_ref.substs.type_at(1); + if b_ty.is_ty_var() { + return ecx.make_canonical_response(Certainty::AMBIGUOUS); + } + ecx.infcx.probe(|_| { + match (a_ty.kind(), b_ty.kind()) { + // Trait upcasting, or `dyn Trait + Auto + 'a` -> `dyn Trait + 'b` + (&ty::Dynamic(_, _, ty::Dyn), &ty::Dynamic(_, _, ty::Dyn)) => { + // Dyn upcasting is handled separately, since due to upcasting, + // when there are two supertraits that differ by substs, we + // may return more than one query response. + return Err(NoSolution); + } + // `T` -> `dyn Trait` unsizing + (_, &ty::Dynamic(data, region, ty::Dyn)) => { + // Can only unsize to an object-safe type + if data + .principal_def_id() + .map_or(false, |def_id| !tcx.check_is_object_safe(def_id)) + { + return Err(NoSolution); + } + + let Some(sized_def_id) = tcx.lang_items().sized_trait() else { + return Err(NoSolution); + }; + let nested_goals: Vec<_> = data + .iter() + // Check that the type implements all of the predicates of the def-id. + // (i.e. the principal, all of the associated types match, and any auto traits) + .map(|pred| goal.with(tcx, pred.with_self_ty(tcx, a_ty))) + .chain([ + // The type must be Sized to be unsized. + goal.with( + tcx, + ty::Binder::dummy(tcx.mk_trait_ref(sized_def_id, [a_ty])), + ), + // The type must outlive the lifetime of the `dyn` we're unsizing into. + goal.with(tcx, ty::Binder::dummy(ty::OutlivesPredicate(a_ty, region))), + ]) + .collect(); + + ecx.evaluate_all_and_make_canonical_response(nested_goals) + } + // `[T; n]` -> `[T]` unsizing + (&ty::Array(a_elem_ty, ..), &ty::Slice(b_elem_ty)) => { + // We just require that the element type stays the same + let nested_goals = ecx.infcx.eq(goal.param_env, a_elem_ty, b_elem_ty)?; + ecx.evaluate_all_and_make_canonical_response(nested_goals) + } + // Struct unsizing `Struct` -> `Struct` where `T: Unsize` + (&ty::Adt(a_def, a_substs), &ty::Adt(b_def, b_substs)) + if a_def.is_struct() && a_def.did() == b_def.did() => + { + let unsizing_params = tcx.unsizing_params_for_adt(a_def.did()); + // We must be unsizing some type parameters. This also implies + // that the struct has a tail field. + if unsizing_params.is_empty() { + return Err(NoSolution); + } + + let tail_field = a_def + .non_enum_variant() + .fields + .last() + .expect("expected unsized ADT to have a tail field"); + let tail_field_ty = tcx.bound_type_of(tail_field.did); + + let a_tail_ty = tail_field_ty.subst(tcx, a_substs); + let b_tail_ty = tail_field_ty.subst(tcx, b_substs); + + // Substitute just the unsizing params from B into A. The type after + // this substitution must be equal to B. This is so we don't unsize + // unrelated type parameters. + let new_a_substs = tcx.mk_substs(a_substs.iter().enumerate().map(|(i, a)| { + if unsizing_params.contains(i as u32) { b_substs[i] } else { a } + })); + let unsized_a_ty = tcx.mk_adt(a_def, new_a_substs); + + // Finally, we require that `TailA: Unsize` for the tail field + // types. + let mut nested_goals = ecx.infcx.eq(goal.param_env, unsized_a_ty, b_ty)?; + nested_goals.push(goal.with( + tcx, + ty::Binder::dummy( + tcx.mk_trait_ref(goal.predicate.def_id(), [a_tail_ty, b_tail_ty]), + ), + )); + + ecx.evaluate_all_and_make_canonical_response(nested_goals) + } + // Tuple unsizing `(.., T)` -> `(.., U)` where `T: Unsize` + (&ty::Tuple(a_tys), &ty::Tuple(b_tys)) + if a_tys.len() == b_tys.len() && !a_tys.is_empty() => + { + let (a_last_ty, a_rest_tys) = a_tys.split_last().unwrap(); + let b_last_ty = b_tys.last().unwrap(); + + // Substitute just the tail field of B., and require that they're equal. + let unsized_a_ty = tcx.mk_tup(a_rest_tys.iter().chain([b_last_ty])); + let mut nested_goals = ecx.infcx.eq(goal.param_env, unsized_a_ty, b_ty)?; + + // Similar to ADTs, require that the rest of the fields are equal. + nested_goals.push(goal.with( + tcx, + ty::Binder::dummy( + tcx.mk_trait_ref(goal.predicate.def_id(), [*a_last_ty, *b_last_ty]), + ), + )); + + ecx.evaluate_all_and_make_canonical_response(nested_goals) + } + _ => Err(NoSolution), + } + }) + } + + fn consider_builtin_dyn_upcast_candidates( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> Vec> { + let tcx = ecx.tcx(); + + let a_ty = goal.predicate.self_ty(); + let b_ty = goal.predicate.trait_ref.substs.type_at(1); + let ty::Dynamic(a_data, a_region, ty::Dyn) = *a_ty.kind() else { + return vec![]; + }; + let ty::Dynamic(b_data, b_region, ty::Dyn) = *b_ty.kind() else { + return vec![]; + }; + + // All of a's auto traits need to be in b's auto traits. + let auto_traits_compatible = + b_data.auto_traits().all(|b| a_data.auto_traits().any(|a| a == b)); + if !auto_traits_compatible { + return vec![]; + } + + let mut unsize_dyn_to_principal = |principal: Option>| { + ecx.infcx.probe(|_| -> Result<_, NoSolution> { + // Require that all of the trait predicates from A match B, except for + // the auto traits. We do this by constructing a new A type with B's + // auto traits, and equating these types. + let new_a_data = principal + .into_iter() + .map(|trait_ref| trait_ref.map_bound(ty::ExistentialPredicate::Trait)) + .chain(a_data.iter().filter(|a| { + matches!(a.skip_binder(), ty::ExistentialPredicate::Projection(_)) + })) + .chain( + b_data + .auto_traits() + .map(ty::ExistentialPredicate::AutoTrait) + .map(ty::Binder::dummy), + ); + let new_a_data = tcx.mk_poly_existential_predicates(new_a_data); + let new_a_ty = tcx.mk_dynamic(new_a_data, b_region, ty::Dyn); + + // We also require that A's lifetime outlives B's lifetime. + let mut nested_obligations = ecx.infcx.eq(goal.param_env, new_a_ty, b_ty)?; + nested_obligations.push( + goal.with(tcx, ty::Binder::dummy(ty::OutlivesPredicate(a_region, b_region))), + ); + + ecx.evaluate_all_and_make_canonical_response(nested_obligations) + }) + }; + + let mut responses = vec![]; + // If the principal def ids match (or are both none), then we're not doing + // trait upcasting. We're just removing auto traits (or shortening the lifetime). + if a_data.principal_def_id() == b_data.principal_def_id() { + if let Ok(response) = unsize_dyn_to_principal(a_data.principal()) { + responses.push(response); + } + } else if let Some(a_principal) = a_data.principal() + && let Some(b_principal) = b_data.principal() + { + for super_trait_ref in supertraits(tcx, a_principal.with_self_ty(tcx, a_ty)) { + if super_trait_ref.def_id() != b_principal.def_id() { + continue; + } + let erased_trait_ref = super_trait_ref + .map_bound(|trait_ref| ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref)); + if let Ok(response) = unsize_dyn_to_principal(Some(erased_trait_ref)) { + responses.push(response); + } + } + } + + responses + } } impl<'tcx> EvalCtxt<'_, 'tcx> { diff --git a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs index f779d9dd8d935..786473457ae43 100644 --- a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs +++ b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs @@ -219,7 +219,7 @@ fn satisfied_from_param_env<'tcx>( } if let Some(Ok(c)) = single_match { - let ocx = ObligationCtxt::new(infcx); + let ocx = ObligationCtxt::new_in_snapshot(infcx); assert!(ocx.eq(&ObligationCause::dummy(), param_env, c.ty(), ct.ty()).is_ok()); assert!(ocx.eq(&ObligationCause::dummy(), param_env, c, ct).is_ok()); assert!(ocx.select_all_or_error().is_empty()); diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index e9842b2cba516..f6d0b9713f0d0 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -1230,20 +1230,23 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } ty::PredicateKind::WellFormed(ty) => { - if self.tcx.sess.opts.unstable_opts.trait_solver == TraitSolver::Classic { - // WF predicates cannot themselves make - // errors. They can only block due to - // ambiguity; otherwise, they always - // degenerate into other obligations - // (which may fail). - span_bug!(span, "WF predicate not satisfied for {:?}", ty); - } else { - // FIXME: we'll need a better message which takes into account - // which bounds actually failed to hold. - self.tcx.sess.struct_span_err( - span, - &format!("the type `{}` is not well-formed", ty), - ) + match self.tcx.sess.opts.unstable_opts.trait_solver { + TraitSolver::Classic => { + // WF predicates cannot themselves make + // errors. They can only block due to + // ambiguity; otherwise, they always + // degenerate into other obligations + // (which may fail). + span_bug!(span, "WF predicate not satisfied for {:?}", ty); + } + TraitSolver::Chalk | TraitSolver::Next => { + // FIXME: we'll need a better message which takes into account + // which bounds actually failed to hold. + self.tcx.sess.struct_span_err( + span, + &format!("the type `{}` is not well-formed", ty), + ) + } } } @@ -1866,10 +1869,14 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> { with_forced_trimmed_paths! { if Some(pred.projection_ty.def_id) == self.tcx.lang_items().fn_once_output() { + let fn_kind = self_ty.prefix_string(self.tcx); + let item = match self_ty.kind() { + ty::FnDef(def, _) => self.tcx.item_name(*def).to_string(), + _ => self_ty.to_string(), + }; Some(format!( - "expected `{self_ty}` to be a {fn_kind} that returns `{expected_ty}`, but it \ + "expected `{item}` to be a {fn_kind} that returns `{expected_ty}`, but it \ returns `{normalized_ty}`", - fn_kind = self_ty.prefix_string(self.tcx) )) } else if Some(trait_def_id) == self.tcx.lang_items().future_trait() { Some(format!( diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index b35b9d62759c7..87dbf7c3fd699 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -133,7 +133,7 @@ impl<'tcx, 'a> GeneratorData<'tcx, 'a> { .cloned() .unwrap_or_else(|| { bug!( - "node_type: no type for node `{}`", + "node_type: no type for node {}", ty::tls::with(|tcx| tcx .hir() .node_to_string(await_expr.hir_id)) diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index a11c5e8196952..53cae3e720c5a 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -783,7 +783,7 @@ impl<'tcx> TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> { } ty::Bound(debruijn, bound_ty) if debruijn >= self.current_index => { let universe = self.universe_for(debruijn); - let p = ty::PlaceholderType { universe, name: bound_ty.var }; + let p = ty::PlaceholderType { universe, name: bound_ty.kind }; self.mapped_types.insert(p, bound_ty); self.infcx.tcx.mk_ty(ty::Placeholder(p)) } diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 89a8fdbac1cbc..0a4136dc1cfe5 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -524,7 +524,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { .kind { GenericParamDefKind::Type { .. } => { - let kind = ty::BoundTyKind::Param(param.name); + let kind = ty::BoundTyKind::Param(param.def_id, param.name); let bound_var = ty::BoundVariableKind::Ty(kind); bound_vars.push(bound_var); tcx.mk_ty(ty::Bound( diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index b8f5aeee2d593..ad7d479896fd0 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2454,7 +2454,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { .at(&cause, obligation.param_env) .define_opaque_types(false) .eq(placeholder_obligation_trait_ref, impl_trait_ref) - .map_err(|e| debug!("match_impl: failed eq_trait_refs due to `{e}`"))?; + .map_err(|e| { + debug!("match_impl: failed eq_trait_refs due to `{}`", e.to_string(self.tcx())) + })?; nested_obligations.extend(obligations); if !self.is_intercrate() diff --git a/compiler/rustc_traits/src/chalk/db.rs b/compiler/rustc_traits/src/chalk/db.rs index 84f7e83620818..dbd5f13fe4e8b 100644 --- a/compiler/rustc_traits/src/chalk/db.rs +++ b/compiler/rustc_traits/src/chalk/db.rs @@ -725,7 +725,7 @@ fn bound_vars_for_item(tcx: TyCtxt<'_>, def_id: DefId) -> SubstsRef<'_> { ty::INNERMOST, ty::BoundTy { var: ty::BoundVar::from(param.index), - kind: ty::BoundTyKind::Param(param.name), + kind: ty::BoundTyKind::Param(param.def_id, param.name), }, )) .into(), diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs index 3a25410516209..9c5db3314c5cd 100644 --- a/compiler/rustc_traits/src/chalk/lowering.rs +++ b/compiler/rustc_traits/src/chalk/lowering.rs @@ -370,7 +370,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty>> for Ty<'tcx> { ty::Placeholder(_placeholder) => { chalk_ir::TyKind::Placeholder(chalk_ir::PlaceholderIndex { ui: chalk_ir::UniverseIndex { counter: _placeholder.universe.as_usize() }, - idx: _placeholder.name.as_usize(), + idx: _placeholder.name.expect_anon() as usize, }) } ty::Infer(_infer) => unimplemented!(), @@ -452,10 +452,6 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty> { ), TyKind::Foreign(def_id) => ty::Foreign(def_id.0), TyKind::Error => return interner.tcx.ty_error(), - TyKind::Placeholder(placeholder) => ty::Placeholder(ty::Placeholder { - universe: ty::UniverseIndex::from_usize(placeholder.ui.counter), - name: ty::BoundVar::from_usize(placeholder.idx), - }), TyKind::Alias(alias_ty) => match alias_ty { chalk_ir::AliasTy::Projection(projection) => ty::Alias( ty::Projection, @@ -473,13 +469,17 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty> { ), }, TyKind::Function(_quantified_ty) => unimplemented!(), - TyKind::BoundVar(_bound) => ty::Bound( - ty::DebruijnIndex::from_usize(_bound.debruijn.depth() as usize), + TyKind::BoundVar(bound) => ty::Bound( + ty::DebruijnIndex::from_usize(bound.debruijn.depth() as usize), ty::BoundTy { - var: ty::BoundVar::from_usize(_bound.index), - kind: ty::BoundTyKind::Anon, + var: ty::BoundVar::from_usize(bound.index), + kind: ty::BoundTyKind::Anon(bound.index as u32), }, ), + TyKind::Placeholder(placeholder) => ty::Placeholder(ty::Placeholder { + universe: ty::UniverseIndex::from_usize(placeholder.ui.counter), + name: ty::BoundTyKind::Anon(placeholder.idx as u32), + }), TyKind::InferenceVar(_, _) => unimplemented!(), TyKind::Dyn(_) => unimplemented!(), }; @@ -504,7 +504,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Lifetime>> for Region<'t ty::RePlaceholder(placeholder_region) => { chalk_ir::LifetimeData::Placeholder(chalk_ir::PlaceholderIndex { ui: chalk_ir::UniverseIndex { counter: placeholder_region.universe.index() }, - idx: 0, + idx: 0, // FIXME: This `idx: 0` is sus. }) .intern(interner) } @@ -674,7 +674,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Binders { binder_index: ty::DebruijnIndex, list: Vec, next_ty_placeholder: usize, - pub(crate) params: rustc_data_structures::fx::FxHashMap, + pub(crate) params: rustc_data_structures::fx::FxHashMap, pub(crate) named_regions: BTreeMap, } @@ -1072,15 +1072,15 @@ impl<'tcx> TypeFolder<'tcx> for ParamsSubstitutor<'tcx> { ty::Param(param) => match self.list.iter().position(|r| r == ¶m) { Some(idx) => self.tcx.mk_ty(ty::Placeholder(ty::PlaceholderType { universe: ty::UniverseIndex::from_usize(0), - name: ty::BoundVar::from_usize(idx), + name: ty::BoundTyKind::Anon(idx as u32), })), None => { self.list.push(param); let idx = self.list.len() - 1 + self.next_ty_placeholder; - self.params.insert(idx, param); + self.params.insert(idx as u32, param); self.tcx.mk_ty(ty::Placeholder(ty::PlaceholderType { universe: ty::UniverseIndex::from_usize(0), - name: ty::BoundVar::from_usize(idx), + name: ty::BoundTyKind::Anon(idx as u32), })) } }, @@ -1119,13 +1119,13 @@ impl<'tcx> TypeFolder<'tcx> for ParamsSubstitutor<'tcx> { pub(crate) struct ReverseParamsSubstitutor<'tcx> { tcx: TyCtxt<'tcx>, - params: rustc_data_structures::fx::FxHashMap, + params: rustc_data_structures::fx::FxHashMap, } impl<'tcx> ReverseParamsSubstitutor<'tcx> { pub(crate) fn new( tcx: TyCtxt<'tcx>, - params: rustc_data_structures::fx::FxHashMap, + params: rustc_data_structures::fx::FxHashMap, ) -> Self { Self { tcx, params } } @@ -1139,7 +1139,7 @@ impl<'tcx> TypeFolder<'tcx> for ReverseParamsSubstitutor<'tcx> { fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> { match *t.kind() { ty::Placeholder(ty::PlaceholderType { universe: ty::UniverseIndex::ROOT, name }) => { - match self.params.get(&name.as_usize()) { + match self.params.get(&name.expect_anon()) { Some(param) => self.tcx.mk_ty(ty::Param(*param)), None => t, } @@ -1171,7 +1171,8 @@ impl<'tcx> TypeVisitor<'tcx> for PlaceholdersCollector { fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow { match t.kind() { ty::Placeholder(p) if p.universe == self.universe_index => { - self.next_ty_placeholder = self.next_ty_placeholder.max(p.name.as_usize() + 1); + self.next_ty_placeholder = + self.next_ty_placeholder.max(p.name.expect_anon() as usize + 1); } _ => (), @@ -1186,6 +1187,7 @@ impl<'tcx> TypeVisitor<'tcx> for PlaceholdersCollector { if let ty::BoundRegionKind::BrAnon(anon, _) = p.name { self.next_anon_region_placeholder = self.next_anon_region_placeholder.max(anon); } + // FIXME: This doesn't seem to handle BrNamed at all? } _ => (), diff --git a/compiler/rustc_traits/src/chalk/mod.rs b/compiler/rustc_traits/src/chalk/mod.rs index 13d83b9268941..5855a8e28dd1d 100644 --- a/compiler/rustc_traits/src/chalk/mod.rs +++ b/compiler/rustc_traits/src/chalk/mod.rs @@ -6,12 +6,10 @@ pub(crate) mod db; pub(crate) mod lowering; -use rustc_data_structures::fx::FxHashMap; - use rustc_middle::infer::canonical::{CanonicalTyVarKind, CanonicalVarKind}; use rustc_middle::traits::ChalkRustInterner; use rustc_middle::ty::query::Providers; -use rustc_middle::ty::{self, ParamTy, TyCtxt, TypeFoldable, TypeVisitable}; +use rustc_middle::ty::{self, TyCtxt, TypeFoldable, TypeVisitable}; use rustc_infer::infer::canonical::{ Canonical, CanonicalVarValues, Certainty, QueryRegionConstraints, QueryResponse, @@ -41,7 +39,7 @@ pub(crate) fn evaluate_goal<'tcx>( let mut params_substitutor = ParamsSubstitutor::new(tcx, placeholders_collector.next_ty_placeholder); let obligation = obligation.fold_with(&mut params_substitutor); - let params: FxHashMap = params_substitutor.params; + let params = params_substitutor.params; let max_universe = obligation.max_universe.index(); diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 378cd5a99ed86..93c9c675c9a6b 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -9,7 +9,7 @@ use rustc_middle::ty::layout::{ use rustc_middle::ty::{ self, subst::SubstsRef, AdtDef, EarlyBinder, ReprOptions, Ty, TyCtxt, TypeVisitable, }; -use rustc_session::{DataTypeKind, FieldInfo, SizeKind, VariantInfo}; +use rustc_session::{DataTypeKind, FieldInfo, FieldKind, SizeKind, VariantInfo}; use rustc_span::symbol::Symbol; use rustc_span::DUMMY_SP; use rustc_target::abi::*; @@ -881,6 +881,7 @@ fn variant_info_for_adt<'tcx>( let offset = layout.fields.offset(i); min_size = min_size.max(offset + field_layout.size); FieldInfo { + kind: FieldKind::AdtField, name, offset: offset.bytes(), size: field_layout.size.bytes(), @@ -960,6 +961,7 @@ fn variant_info_for_generator<'tcx>( let offset = layout.fields.offset(field_idx); upvars_size = upvars_size.max(offset + field_layout.size); FieldInfo { + kind: FieldKind::Upvar, name: Symbol::intern(&name), offset: offset.bytes(), size: field_layout.size.bytes(), @@ -983,6 +985,7 @@ fn variant_info_for_generator<'tcx>( // The struct is as large as the last field's end variant_size = variant_size.max(offset + field_layout.size); FieldInfo { + kind: FieldKind::GeneratorLocal, name: state_specific_names.get(*local).copied().flatten().unwrap_or( Symbol::intern(&format!(".generator_field{}", local.as_usize())), ), diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index b5005c1d8d804..41e837e8b754e 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -426,10 +426,6 @@ fn unsizing_params_for_adt<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> BitSet VecDeque { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_vec_deque_new", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_vec_deque_new", since = "1.68.0")] #[must_use] pub const fn new() -> VecDeque { // FIXME: This should just be `VecDeque::new_in(Global)` once that hits stable. diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 3118c7189a5ed..ca182c8109ec9 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2549,7 +2549,7 @@ impl ToString for char { } #[cfg(not(no_global_oom_handling))] -#[stable(feature = "bool_to_string_specialization", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "bool_to_string_specialization", since = "1.68.0")] impl ToString for bool { #[inline] fn to_string(&self) -> String { diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index a7d6fec7d3dc1..b75ae996e4853 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd { Self: Sized, Self: ~const Destruct, { - #[cfg(not(bootstrap))] - { - max_by(self, other, Ord::cmp) - } - - #[cfg(bootstrap)] - match self.cmp(&other) { - Ordering::Less | Ordering::Equal => other, - Ordering::Greater => self, - } + max_by(self, other, Ord::cmp) } /// Compares and returns the minimum of two values. @@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd { Self: Sized, Self: ~const Destruct, { - #[cfg(not(bootstrap))] - { - min_by(self, other, Ord::cmp) - } - - #[cfg(bootstrap)] - match self.cmp(&other) { - Ordering::Less | Ordering::Equal => self, - Ordering::Greater => other, - } + min_by(self, other, Ord::cmp) } /// Restrict a value to a certain interval. @@ -1234,23 +1216,7 @@ where F: ~const Destruct, K: ~const Destruct, { - cfg_if! { - if #[cfg(bootstrap)] { - const fn imp K, K: ~const Ord>( - f: &mut F, - (v1, v2): (&T, &T), - ) -> Ordering - where - T: ~const Destruct, - K: ~const Destruct, - { - f(v1).cmp(&f(v2)) - } - min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp)) - } else { - min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2))) - } - } + min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2))) } /// Compares and returns the maximum of two values. diff --git a/library/core/src/convert/num.rs b/library/core/src/convert/num.rs index 45e2f711c6c90..4da7c323492a1 100644 --- a/library/core/src/convert/num.rs +++ b/library/core/src/convert/num.rs @@ -169,7 +169,7 @@ impl_from! { u32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0" impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] } // bool -> Float -#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "float_from_bool", since = "1.68.0")] #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")] impl const From for f32 { /// Converts `bool` to `f32` losslessly. @@ -178,7 +178,7 @@ impl const From for f32 { small as u8 as Self } } -#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "float_from_bool", since = "1.68.0")] #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")] impl const From for f64 { /// Converts `bool` to `f64` losslessly. diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index c4fb362094664..46cbcd43530d5 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -56,51 +56,6 @@ unsafe impl Send for ResumeTy {} #[unstable(feature = "gen_future", issue = "50547")] unsafe impl Sync for ResumeTy {} -/// Wrap a generator in a future. -/// -/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give -/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`). -// This is `const` to avoid extra errors after we recover from `const async fn` -#[doc(hidden)] -#[unstable(feature = "gen_future", issue = "50547")] -#[rustc_const_unstable(feature = "gen_future", issue = "50547")] -#[inline] -pub const fn from_generator(gen: T) -> impl Future -where - T: crate::ops::Generator, -{ - use crate::{ - ops::{Generator, GeneratorState}, - pin::Pin, - task::Poll, - }; - - #[rustc_diagnostic_item = "gen_future"] - struct GenFuture>(T); - - // We rely on the fact that async/await futures are immovable in order to create - // self-referential borrows in the underlying generator. - impl> !Unpin for GenFuture {} - - impl> Future for GenFuture { - type Output = T::Return; - #[track_caller] - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - // SAFETY: Safe because we're !Unpin + !Drop, and this is just a field projection. - let gen = unsafe { Pin::map_unchecked_mut(self, |s| &mut s.0) }; - - // Resume the generator, turning the `&mut Context` into a `NonNull` raw pointer. The - // `.await` lowering will safely cast that back to a `&mut Context`. - match gen.resume(ResumeTy(NonNull::from(cx).cast::>())) { - GeneratorState::Yielded(()) => Poll::Pending, - GeneratorState::Complete(x) => Poll::Ready(x), - } - } - } - - GenFuture(gen) -} - #[lang = "get_context"] #[doc(hidden)] #[unstable(feature = "gen_future", issue = "50547")] diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index a315a28fb0d94..b1ed3b31e430c 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -58,7 +58,6 @@ use crate::marker::DiscriminantKind; use crate::marker::Tuple; use crate::mem; -#[cfg(not(bootstrap))] pub mod mir; // These imports are used for simplifying intra-doc links @@ -963,7 +962,6 @@ extern "rust-intrinsic" { /// This intrinsic does not have a stable counterpart. #[rustc_const_unstable(feature = "const_assert_type2", issue = "none")] #[rustc_safe_intrinsic] - #[cfg(not(bootstrap))] pub fn assert_mem_uninitialized_valid(); /// Gets a reference to a static `Location` indicating where it was called. diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index 3d7ccffa1735c..995d66dca56e5 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -60,8 +60,7 @@ //! //! # Examples //! -#![cfg_attr(bootstrap, doc = "```rust,compile_fail")] -#![cfg_attr(not(bootstrap), doc = "```rust")] +//! ```rust //! #![feature(core_intrinsics, custom_mir)] //! //! extern crate core; @@ -300,8 +299,7 @@ define!( /// /// # Examples /// - #[cfg_attr(bootstrap, doc = "```rust,compile_fail")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(custom_mir, core_intrinsics)] /// /// extern crate core; diff --git a/library/core/src/iter/sources/once_with.rs b/library/core/src/iter/sources/once_with.rs index 080ae27a30fcf..9309a06c8cf22 100644 --- a/library/core/src/iter/sources/once_with.rs +++ b/library/core/src/iter/sources/once_with.rs @@ -73,7 +73,7 @@ pub struct OnceWith { gen: Option, } -#[stable(feature = "iter_once_with_debug", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_once_with_debug", since = "1.68.0")] impl fmt::Debug for OnceWith { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.gen.is_some() { diff --git a/library/core/src/iter/sources/repeat_with.rs b/library/core/src/iter/sources/repeat_with.rs index 20420a3ad8e02..3f34105a3e071 100644 --- a/library/core/src/iter/sources/repeat_with.rs +++ b/library/core/src/iter/sources/repeat_with.rs @@ -78,7 +78,7 @@ pub struct RepeatWith { repeater: F, } -#[stable(feature = "iterator_repeat_with_debug", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iterator_repeat_with_debug", since = "1.68.0")] impl fmt::Debug for RepeatWith { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("RepeatWith").finish_non_exhaustive() diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 6dfe36e6926ef..8961ef4ab4816 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -192,7 +192,7 @@ #![feature(cfg_sanitize)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_has_atomic_equal_alignment)] -#![cfg_attr(not(bootstrap), feature(const_closures))] +#![feature(const_closures)] #![feature(const_fn_floating_point_arithmetic)] #![feature(const_mut_refs)] #![feature(const_precise_live_drops)] @@ -250,7 +250,6 @@ #![feature(sse4a_target_feature)] #![feature(tbm_target_feature)] #![feature(wasm_target_feature)] -#![cfg_attr(bootstrap, feature(f16c_target_feature))] // allow using `core::` in intra-doc links #[allow(unused_extern_crates)] diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 5e01ccc07d8fd..a67df7ed557a1 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -682,7 +682,6 @@ pub unsafe fn zeroed() -> T { pub unsafe fn uninitialized() -> T { // SAFETY: the caller must guarantee that an uninitialized value is valid for `T`. unsafe { - #[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB. intrinsics::assert_mem_uninitialized_valid::(); let mut val = MaybeUninit::::uninit(); diff --git a/library/core/src/ops/arith.rs b/library/core/src/ops/arith.rs index 75c52d3ecfc8b..cc13db5c9565b 100644 --- a/library/core/src/ops/arith.rs +++ b/library/core/src/ops/arith.rs @@ -545,7 +545,7 @@ div_impl_float! { f32 f64 } #[lang = "rem"] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_on_unimplemented( - message = "cannot mod `{Self}` by `{Rhs}`", + message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`", label = "no implementation for `{Self} % {Rhs}`" )] #[doc(alias = "%")] @@ -981,7 +981,7 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } #[lang = "rem_assign"] #[stable(feature = "op_assign_traits", since = "1.8.0")] #[rustc_on_unimplemented( - message = "cannot mod-assign `{Self}` by `{Rhs}``", + message = "cannot calculate and assign the remainder of `{Self}` divided by `{Rhs}`", label = "no implementation for `{Self} %= {Rhs}`" )] #[doc(alias = "%")] diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs index 48e90e6d79400..805a1e51ae9c0 100644 --- a/library/core/src/panicking.rs +++ b/library/core/src/panicking.rs @@ -117,7 +117,7 @@ pub const fn panic(expr: &'static str) -> ! { /// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize. #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)] #[cfg_attr(feature = "panic_immediate_abort", inline)] -#[cfg_attr(not(bootstrap), lang = "panic_nounwind")] // needed by codegen for non-unwinding panics +#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics #[rustc_nounwind] pub fn panic_nounwind(expr: &'static str) -> ! { panic_nounwind_fmt(fmt::Arguments::new_v1(&[expr], &[])); @@ -165,8 +165,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! { /// any extra arguments (including those synthesized by track_caller). #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)] #[cfg_attr(feature = "panic_immediate_abort", inline)] -#[cfg_attr(bootstrap, lang = "panic_no_unwind")] // needed by codegen for panic in nounwind function -#[cfg_attr(not(bootstrap), lang = "panic_cannot_unwind")] // needed by codegen for panic in nounwind function +#[lang = "panic_cannot_unwind"] // needed by codegen for panic in nounwind function #[rustc_nounwind] fn panic_cannot_unwind() -> ! { panic_nounwind("panic in a function that cannot unwind") diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index ec0c9984841e6..febe57dc90bc7 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -1164,7 +1164,7 @@ impl DispatchFromDyn> for Pin

where P: DispatchFromDyn {} /// constructor. /// /// [`Box::pin`]: ../../std/boxed/struct.Box.html#method.pin -#[stable(feature = "pin_macro", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "pin_macro", since = "1.68.0")] #[rustc_macro_transparency = "semitransparent"] #[allow_internal_unstable(unsafe_pin_internals)] pub macro pin($value:expr $(,)?) { diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index d93a3a57ecd27..6ea16bf643071 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -805,8 +805,9 @@ impl [T] { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[inline] + #[track_caller] pub fn windows(&self, size: usize) -> Windows<'_, T> { - let size = NonZeroUsize::new(size).expect("size is zero"); + let size = NonZeroUsize::new(size).expect("window size must be non-zero"); Windows::new(self, size) } @@ -839,8 +840,9 @@ impl [T] { /// [`rchunks`]: slice::rchunks #[stable(feature = "rust1", since = "1.0.0")] #[inline] + #[track_caller] pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T> { - assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); + assert!(chunk_size != 0, "chunk size must be non-zero"); Chunks::new(self, chunk_size) } @@ -877,8 +879,9 @@ impl [T] { /// [`rchunks_mut`]: slice::rchunks_mut #[stable(feature = "rust1", since = "1.0.0")] #[inline] + #[track_caller] pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T> { - assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); + assert!(chunk_size != 0, "chunk size must be non-zero"); ChunksMut::new(self, chunk_size) } @@ -914,8 +917,9 @@ impl [T] { /// [`rchunks_exact`]: slice::rchunks_exact #[stable(feature = "chunks_exact", since = "1.31.0")] #[inline] + #[track_caller] pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T> { - assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); + assert!(chunk_size != 0, "chunk size must be non-zero"); ChunksExact::new(self, chunk_size) } @@ -956,8 +960,9 @@ impl [T] { /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut #[stable(feature = "chunks_exact", since = "1.31.0")] #[inline] + #[track_caller] pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T> { - assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); + assert!(chunk_size != 0, "chunk size must be non-zero"); ChunksExactMut::new(self, chunk_size) } @@ -1037,9 +1042,10 @@ impl [T] { /// ``` #[unstable(feature = "slice_as_chunks", issue = "74985")] #[inline] + #[track_caller] #[must_use] pub fn as_chunks(&self) -> (&[[T; N]], &[T]) { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); let len = self.len() / N; let (multiple_of_n, remainder) = self.split_at(len * N); // SAFETY: We already panicked for zero, and ensured by construction @@ -1068,9 +1074,10 @@ impl [T] { /// ``` #[unstable(feature = "slice_as_chunks", issue = "74985")] #[inline] + #[track_caller] #[must_use] pub fn as_rchunks(&self) -> (&[T], &[[T; N]]) { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); let len = self.len() / N; let (remainder, multiple_of_n) = self.split_at(self.len() - len * N); // SAFETY: We already panicked for zero, and ensured by construction @@ -1108,8 +1115,9 @@ impl [T] { /// [`chunks_exact`]: slice::chunks_exact #[unstable(feature = "array_chunks", issue = "74985")] #[inline] + #[track_caller] pub fn array_chunks(&self) -> ArrayChunks<'_, T, N> { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); ArrayChunks::new(self) } @@ -1186,9 +1194,10 @@ impl [T] { /// ``` #[unstable(feature = "slice_as_chunks", issue = "74985")] #[inline] + #[track_caller] #[must_use] pub fn as_chunks_mut(&mut self) -> (&mut [[T; N]], &mut [T]) { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); let len = self.len() / N; let (multiple_of_n, remainder) = self.split_at_mut(len * N); // SAFETY: We already panicked for zero, and ensured by construction @@ -1223,9 +1232,10 @@ impl [T] { /// ``` #[unstable(feature = "slice_as_chunks", issue = "74985")] #[inline] + #[track_caller] #[must_use] pub fn as_rchunks_mut(&mut self) -> (&mut [T], &mut [[T; N]]) { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); let len = self.len() / N; let (remainder, multiple_of_n) = self.split_at_mut(self.len() - len * N); // SAFETY: We already panicked for zero, and ensured by construction @@ -1265,8 +1275,9 @@ impl [T] { /// [`chunks_exact_mut`]: slice::chunks_exact_mut #[unstable(feature = "array_chunks", issue = "74985")] #[inline] + #[track_caller] pub fn array_chunks_mut(&mut self) -> ArrayChunksMut<'_, T, N> { - assert_ne!(N, 0, "chunks cannot have a size of zero"); + assert!(N != 0, "chunk size must be non-zero"); ArrayChunksMut::new(self) } @@ -1297,8 +1308,9 @@ impl [T] { /// [`windows`]: slice::windows #[unstable(feature = "array_windows", issue = "75027")] #[inline] + #[track_caller] pub fn array_windows(&self) -> ArrayWindows<'_, T, N> { - assert_ne!(N, 0, "windows cannot have a size of zero"); + assert!(N != 0, "window size must be non-zero"); ArrayWindows::new(self) } @@ -1331,8 +1343,9 @@ impl [T] { /// [`chunks`]: slice::chunks #[stable(feature = "rchunks", since = "1.31.0")] #[inline] + #[track_caller] pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T> { - assert!(chunk_size != 0); + assert!(chunk_size != 0, "chunk size must be non-zero"); RChunks::new(self, chunk_size) } @@ -1369,8 +1382,9 @@ impl [T] { /// [`chunks_mut`]: slice::chunks_mut #[stable(feature = "rchunks", since = "1.31.0")] #[inline] + #[track_caller] pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T> { - assert!(chunk_size != 0); + assert!(chunk_size != 0, "chunk size must be non-zero"); RChunksMut::new(self, chunk_size) } @@ -1408,8 +1422,9 @@ impl [T] { /// [`chunks_exact`]: slice::chunks_exact #[stable(feature = "rchunks", since = "1.31.0")] #[inline] + #[track_caller] pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T> { - assert!(chunk_size != 0); + assert!(chunk_size != 0, "chunk size must be non-zero"); RChunksExact::new(self, chunk_size) } @@ -1451,8 +1466,9 @@ impl [T] { /// [`chunks_exact_mut`]: slice::chunks_exact_mut #[stable(feature = "rchunks", since = "1.31.0")] #[inline] + #[track_caller] pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T> { - assert!(chunk_size != 0); + assert!(chunk_size != 0, "chunk size must be non-zero"); RChunksExactMut::new(self, chunk_size) } diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index 89adfccd90135..808825326aef5 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -174,7 +174,7 @@ impl RawWakerVTable { /// Currently, `Context` only serves to provide access to a [`&Waker`](Waker) /// which can be used to wake the current task. #[stable(feature = "futures_api", since = "1.36.0")] -#[cfg_attr(not(bootstrap), lang = "Context")] +#[lang = "Context"] pub struct Context<'a> { waker: &'a Waker, // Ensure we future-proof against variance changes by forcing diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs index 69b72a81c5b6d..ac09a805975ef 100644 --- a/library/std/src/net/tcp.rs +++ b/library/std/src/net/tcp.rs @@ -829,7 +829,7 @@ impl TcpListener { /// } /// /// fn main() -> std::io::Result<()> { - /// let listener = TcpListener::bind("127.0.0.1:80").unwrap(); + /// let listener = TcpListener::bind("127.0.0.1:80")?; /// /// for stream in listener.incoming() { /// match stream { diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 2f53cf8393691..cd6b393a2eaf5 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -271,7 +271,7 @@ pub const MAIN_SEPARATOR: char = crate::sys::path::MAIN_SEP; /// The primary separator of path components for the current platform. /// /// For example, `/` on Unix and `\` on Windows. -#[stable(feature = "main_separator_str", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "main_separator_str", since = "1.68.0")] pub const MAIN_SEPARATOR_STR: &str = crate::sys::path::MAIN_SEP_STR; //////////////////////////////////////////////////////////////////////////////// @@ -1778,7 +1778,7 @@ impl ops::Deref for PathBuf { } } -#[stable(feature = "path_buf_deref_mut", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "path_buf_deref_mut", since = "1.68.0")] impl ops::DerefMut for PathBuf { #[inline] fn deref_mut(&mut self) -> &mut Path { @@ -2688,6 +2688,7 @@ impl Path { /// escapes the path please use [`Debug`] instead. /// /// [`Display`]: fmt::Display + /// [`Debug`]: fmt::Debug /// /// # Examples /// diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index abdd12127d366..5b19a658fb543 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -2,7 +2,6 @@ import argparse import contextlib import datetime -import distutils.version import hashlib import json import os @@ -13,17 +12,17 @@ import tarfile import tempfile -from time import time, sleep +from time import time -def support_xz(): - try: - with tempfile.NamedTemporaryFile(delete=False) as temp_file: - temp_path = temp_file.name - with tarfile.open(temp_path, "w:xz"): - pass - return True - except tarfile.CompressionError: - return False +try: + import lzma +except ImportError: + lzma = None + +if sys.platform == 'win32': + EXE_SUFFIX = ".exe" +else: + EXE_SUFFIX = "" def get(base, url, path, checksums, verbose=False): with tempfile.NamedTemporaryFile(delete=False) as temp_file: @@ -61,7 +60,7 @@ def get(base, url, path, checksums, verbose=False): def download(path, url, probably_big, verbose): - for _ in range(0, 4): + for _ in range(4): try: _download(path, url, probably_big, verbose, True) return @@ -395,17 +394,18 @@ class RustBuild(object): def __init__(self): self.checksums_sha256 = {} self.stage0_compiler = None - self._download_url = '' + self.download_url = '' self.build = '' self.build_dir = '' self.clean = False self.config_toml = '' self.rust_root = '' - self.use_locked_deps = '' - self.use_vendored_sources = '' + self.use_locked_deps = False + self.use_vendored_sources = False self.verbose = False self.git_version = None self.nix_deps_dir = None + self._should_fix_bins_and_dylibs = None def download_toolchain(self): """Fetch the build system for Rust, written in Rust @@ -426,7 +426,7 @@ def download_toolchain(self): self.program_out_of_date(self.rustc_stamp(), key)): if os.path.exists(bin_root): shutil.rmtree(bin_root) - tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz' + tarball_suffix = '.tar.gz' if lzma is None else '.tar.xz' filename = "rust-std-{}-{}{}".format( rustc_channel, self.build, tarball_suffix) pattern = "rust-std-{}".format(self.build) @@ -437,15 +437,17 @@ def download_toolchain(self): filename = "cargo-{}-{}{}".format(rustc_channel, self.build, tarball_suffix) self._download_component_helper(filename, "cargo", tarball_suffix) - self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root)) - - self.fix_bin_or_dylib("{}/bin/rustc".format(bin_root)) - self.fix_bin_or_dylib("{}/bin/rustdoc".format(bin_root)) - self.fix_bin_or_dylib("{}/libexec/rust-analyzer-proc-macro-srv".format(bin_root)) - lib_dir = "{}/lib".format(bin_root) - for lib in os.listdir(lib_dir): - if lib.endswith(".so"): - self.fix_bin_or_dylib(os.path.join(lib_dir, lib)) + if self.should_fix_bins_and_dylibs(): + self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root)) + + self.fix_bin_or_dylib("{}/bin/rustc".format(bin_root)) + self.fix_bin_or_dylib("{}/bin/rustdoc".format(bin_root)) + self.fix_bin_or_dylib("{}/libexec/rust-analyzer-proc-macro-srv".format(bin_root)) + lib_dir = "{}/lib".format(bin_root) + for lib in os.listdir(lib_dir): + if lib.endswith(".so"): + self.fix_bin_or_dylib(os.path.join(lib_dir, lib)) + with output(self.rustc_stamp()) as rust_stamp: rust_stamp.write(key) @@ -458,60 +460,73 @@ def _download_component_helper( if not os.path.exists(rustc_cache): os.makedirs(rustc_cache) - base = self._download_url - url = "dist/{}".format(key) tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get( - base, - "{}/{}".format(url, filename), + self.download_url, + "dist/{}/{}".format(key, filename), tarball, self.checksums_sha256, verbose=self.verbose, ) unpack(tarball, tarball_suffix, self.bin_root(), match=pattern, verbose=self.verbose) - def fix_bin_or_dylib(self, fname): - """Modifies the interpreter section of 'fname' to fix the dynamic linker, - or the RPATH section, to fix the dynamic library search path - - This method is only required on NixOS and uses the PatchELF utility to - change the interpreter/RPATH of ELF executables. - - Please see https://nixos.org/patchelf.html for more information + def should_fix_bins_and_dylibs(self): + """Whether or not `fix_bin_or_dylib` needs to be run; can only be True + on NixOS. """ - default_encoding = sys.getdefaultencoding() - try: - ostype = subprocess.check_output( - ['uname', '-s']).strip().decode(default_encoding) - except subprocess.CalledProcessError: - return - except OSError as reason: - if getattr(reason, 'winerror', None) is not None: - return - raise reason + if self._should_fix_bins_and_dylibs is not None: + return self._should_fix_bins_and_dylibs - if ostype != "Linux": - return + def get_answer(): + default_encoding = sys.getdefaultencoding() + try: + ostype = subprocess.check_output( + ['uname', '-s']).strip().decode(default_encoding) + except subprocess.CalledProcessError: + return False + except OSError as reason: + if getattr(reason, 'winerror', None) is not None: + return False + raise reason + + if ostype != "Linux": + return False + + # If the user has asked binaries to be patched for Nix, then + # don't check for NixOS or `/lib`. + if self.get_toml("patch-binaries-for-nix", "build") == "true": + return True - # If the user has asked binaries to be patched for Nix, then - # don't check for NixOS or `/lib`, just continue to the patching. - if self.get_toml('patch-binaries-for-nix', 'build') != 'true': # Use `/etc/os-release` instead of `/etc/NIXOS`. # The latter one does not exist on NixOS when using tmpfs as root. try: with open("/etc/os-release", "r") as f: - if not any(l.strip() in ["ID=nixos", "ID='nixos'", 'ID="nixos"'] for l in f): - return + if not any(l.strip() in ("ID=nixos", "ID='nixos'", 'ID="nixos"') for l in f): + return False except FileNotFoundError: - return + return False if os.path.exists("/lib"): - return + return False + + return True + + answer = self._should_fix_bins_and_dylibs = get_answer() + if answer: + print("info: You seem to be using Nix.") + return answer + + def fix_bin_or_dylib(self, fname): + """Modifies the interpreter section of 'fname' to fix the dynamic linker, + or the RPATH section, to fix the dynamic library search path - # At this point we're pretty sure the user is running NixOS or - # using Nix - nix_os_msg = "info: you seem to be using Nix. Attempting to patch" - print(nix_os_msg, fname) + This method is only required on NixOS and uses the PatchELF utility to + change the interpreter/RPATH of ELF executables. + + Please see https://nixos.org/patchelf.html for more information + """ + assert self._should_fix_bins_and_dylibs is True + print("attempting to patch", fname) # Only build `.nix-deps` once. nix_deps_dir = self.nix_deps_dir @@ -666,8 +681,7 @@ def program_config(self, program): config = self.get_toml(program) if config: return os.path.expanduser(config) - return os.path.join(self.bin_root(), "bin", "{}{}".format( - program, self.exe_suffix())) + return os.path.join(self.bin_root(), "bin", "{}{}".format(program, EXE_SUFFIX)) @staticmethod def get_string(line): @@ -692,13 +706,6 @@ def get_string(line): return line[start + 1:end] return None - @staticmethod - def exe_suffix(): - """Return a suffix for executables""" - if sys.platform == 'win32': - return '.exe' - return '' - def bootstrap_binary(self): """Return the path of the bootstrap binary @@ -710,7 +717,7 @@ def bootstrap_binary(self): """ return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap") - def build_bootstrap(self, color): + def build_bootstrap(self, color, verbose_count): """Build bootstrap""" print("Building bootstrap") build_dir = os.path.join(self.build_dir, "bootstrap") @@ -757,7 +764,6 @@ def build_bootstrap(self, color): if target_linker is not None: env["RUSTFLAGS"] += " -C linker=" + target_linker env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes" - env["RUSTFLAGS"] += " -Wsemicolon_in_expressions_from_macros" if self.get_toml("deny-warnings", "rust") != "false": env["RUSTFLAGS"] += " -Dwarnings" @@ -768,8 +774,7 @@ def build_bootstrap(self, color): self.cargo())) args = [self.cargo(), "build", "--manifest-path", os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] - for _ in range(0, self.verbose): - args.append("--verbose") + args.extend("--verbose" for _ in range(verbose_count)) if self.use_locked_deps: args.append("--locked") if self.use_vendored_sources: @@ -792,16 +797,7 @@ def build_triple(self): so use `self.build` where possible. """ config = self.get_toml('build') - if config: - return config - return default_build_triple(self.verbose) - - def set_dist_environment(self, url): - """Set download URL for normal environment""" - if 'RUSTUP_DIST_SERVER' in os.environ: - self._download_url = os.environ['RUSTUP_DIST_SERVER'] - else: - self._download_url = url + return config or default_build_triple(self.verbose) def check_vendored_status(self): """Check that vendoring is configured properly""" @@ -834,17 +830,10 @@ def check_vendored_status(self): if os.path.exists(cargo_dir): shutil.rmtree(cargo_dir) -def bootstrap(help_triggered): - """Configure, fetch, build and run the initial bootstrap""" - - # If the user is asking for help, let them know that the whole download-and-build - # process has to happen before anything is printed out. - if help_triggered: - print("info: Downloading and building bootstrap before processing --help") - print(" command. See src/bootstrap/README.md for help with common") - print(" commands.") - - parser = argparse.ArgumentParser(description='Build rust') +def parse_args(): + """Parse the command line arguments that the python script needs.""" + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument('-h', '--help', action='store_true') parser.add_argument('--config') parser.add_argument('--build-dir') parser.add_argument('--build') @@ -852,13 +841,14 @@ def bootstrap(help_triggered): parser.add_argument('--clean', action='store_true') parser.add_argument('-v', '--verbose', action='count', default=0) - args = [a for a in sys.argv if a != '-h' and a != '--help'] - args, _ = parser.parse_known_args(args) + return parser.parse_known_args(sys.argv)[0] +def bootstrap(args): + """Configure, fetch, build and run the initial bootstrap""" # Configure initial bootstrap build = RustBuild() build.rust_root = os.path.abspath(os.path.join(__file__, '../../..')) - build.verbose = args.verbose + build.verbose = args.verbose != 0 build.clean = args.clean # Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./config.toml`, @@ -886,12 +876,12 @@ def bootstrap(help_triggered): with open(include_path) as included_toml: build.config_toml += os.linesep + included_toml.read() - config_verbose = build.get_toml('verbose', 'build') - if config_verbose is not None: - build.verbose = max(build.verbose, int(config_verbose)) + verbose_count = args.verbose + config_verbose_count = build.get_toml('verbose', 'build') + if config_verbose_count is not None: + verbose_count = max(args.verbose, int(config_verbose_count)) build.use_vendored_sources = build.get_toml('vendor', 'build') == 'true' - build.use_locked_deps = build.get_toml('locked-deps', 'build') == 'true' build.check_vendored_status() @@ -903,8 +893,7 @@ def bootstrap(help_triggered): data = json.load(f) build.checksums_sha256 = data["checksums_sha256"] build.stage0_compiler = Stage0Toolchain(data["compiler"]) - - build.set_dist_environment(data["config"]["dist_server"]) + build.download_url = os.getenv("RUSTUP_DIST_SERVER") or data["config"]["dist_server"] build.build = args.build or build.build_triple() @@ -914,7 +903,7 @@ def bootstrap(help_triggered): # Fetch/build the bootstrap build.download_toolchain() sys.stdout.flush() - build.build_bootstrap(args.color) + build.build_bootstrap(args.color, verbose_count) sys.stdout.flush() # Run the bootstrap @@ -932,25 +921,32 @@ def main(): # x.py help ... if len(sys.argv) > 1 and sys.argv[1] == 'help': - sys.argv = [sys.argv[0], '-h'] + sys.argv[2:] + sys.argv[1] = '-h' + + args = parse_args() + help_triggered = args.help or len(sys.argv) == 1 - help_triggered = ( - '-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1) + # If the user is asking for help, let them know that the whole download-and-build + # process has to happen before anything is printed out. + if help_triggered: + print( + "info: Downloading and building bootstrap before processing --help command.\n" + " See src/bootstrap/README.md for help with common commands." + ) + + exit_code = 0 try: - bootstrap(help_triggered) - if not help_triggered: - print("Build completed successfully in {}".format( - format_build_time(time() - start_time))) + bootstrap(args) except (SystemExit, KeyboardInterrupt) as error: if hasattr(error, 'code') and isinstance(error.code, int): exit_code = error.code else: exit_code = 1 print(error) - if not help_triggered: - print("Build completed unsuccessfully in {}".format( - format_build_time(time() - start_time))) - sys.exit(exit_code) + + if not help_triggered: + print("Build completed successfully in", format_build_time(time() - start_time)) + sys.exit(exit_code) if __name__ == '__main__': diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs index 6ae283f32a5f3..bd67978a7662e 100644 --- a/src/bootstrap/download.rs +++ b/src/bootstrap/download.rs @@ -18,6 +18,8 @@ use crate::{ Config, }; +static SHOULD_FIX_BINS_AND_DYLIBS: OnceCell = OnceCell::new(); + /// Generic helpers that are useful anywhere in bootstrap. impl Config { pub fn is_verbose(&self) -> bool { @@ -70,53 +72,61 @@ impl Config { check_run(cmd, self.is_verbose()) } - /// Modifies the interpreter section of 'fname' to fix the dynamic linker, - /// or the RPATH section, to fix the dynamic library search path - /// - /// This is only required on NixOS and uses the PatchELF utility to - /// change the interpreter/RPATH of ELF executables. - /// - /// Please see https://nixos.org/patchelf.html for more information - fn fix_bin_or_dylib(&self, fname: &Path) { - // FIXME: cache NixOS detection? - match Command::new("uname").arg("-s").stderr(Stdio::inherit()).output() { - Err(_) => return, - Ok(output) if !output.status.success() => return, - Ok(output) => { - let mut s = output.stdout; - if s.last() == Some(&b'\n') { - s.pop(); - } - if s != b"Linux" { - return; + /// Whether or not `fix_bin_or_dylib` needs to be run; can only be true + /// on NixOS + fn should_fix_bins_and_dylibs(&self) -> bool { + let val = *SHOULD_FIX_BINS_AND_DYLIBS.get_or_init(|| { + match Command::new("uname").arg("-s").stderr(Stdio::inherit()).output() { + Err(_) => return false, + Ok(output) if !output.status.success() => return false, + Ok(output) => { + let mut os_name = output.stdout; + if os_name.last() == Some(&b'\n') { + os_name.pop(); + } + if os_name != b"Linux" { + return false; + } } } - } - // If the user has asked binaries to be patched for Nix, then - // don't check for NixOS or `/lib`, just continue to the patching. - // NOTE: this intentionally comes after the Linux check: - // - patchelf only works with ELF files, so no need to run it on Mac or Windows - // - On other Unix systems, there is no stable syscall interface, so Nix doesn't manage the global libc. - if !self.patch_binaries_for_nix { + // If the user has asked binaries to be patched for Nix, then + // don't check for NixOS or `/lib`. + // NOTE: this intentionally comes after the Linux check: + // - patchelf only works with ELF files, so no need to run it on Mac or Windows + // - On other Unix systems, there is no stable syscall interface, so Nix doesn't manage the global libc. + if self.patch_binaries_for_nix { + return true; + } + // Use `/etc/os-release` instead of `/etc/NIXOS`. // The latter one does not exist on NixOS when using tmpfs as root. - const NIX_IDS: &[&str] = &["ID=nixos", "ID='nixos'", "ID=\"nixos\""]; - let os_release = match File::open("/etc/os-release") { - Err(e) if e.kind() == ErrorKind::NotFound => return, + let is_nixos = match File::open("/etc/os-release") { + Err(e) if e.kind() == ErrorKind::NotFound => false, Err(e) => panic!("failed to access /etc/os-release: {}", e), - Ok(f) => f, + Ok(os_release) => BufReader::new(os_release).lines().any(|l| { + let l = l.expect("reading /etc/os-release"); + matches!(l.trim(), "ID=nixos" | "ID='nixos'" | "ID=\"nixos\"") + }), }; - if !BufReader::new(os_release).lines().any(|l| NIX_IDS.contains(&t!(l).trim())) { - return; - } - if Path::new("/lib").exists() { - return; - } + is_nixos && !Path::new("/lib").exists() + }); + if val { + println!("info: You seem to be using Nix."); } + val + } - // At this point we're pretty sure the user is running NixOS or using Nix - println!("info: you seem to be using Nix. Attempting to patch {}", fname.display()); + /// Modifies the interpreter section of 'fname' to fix the dynamic linker, + /// or the RPATH section, to fix the dynamic library search path + /// + /// This is only required on NixOS and uses the PatchELF utility to + /// change the interpreter/RPATH of ELF executables. + /// + /// Please see https://nixos.org/patchelf.html for more information + fn fix_bin_or_dylib(&self, fname: &Path) { + assert_eq!(SHOULD_FIX_BINS_AND_DYLIBS.get(), Some(&true)); + println!("attempting to patch {}", fname.display()); // Only build `.nix-deps` once. static NIX_DEPS_DIR: OnceCell = OnceCell::new(); @@ -318,18 +328,32 @@ impl Config { let channel = format!("{version}-{date}"); let host = self.build; - let rustfmt_path = self.initial_rustc.with_file_name(exe("rustfmt", host)); - let bin_root = self.out.join(host.triple).join("stage0"); + 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"); if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) { return Some(rustfmt_path); } - let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple); - self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0"); - - self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt")); - self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt")); + self.download_component( + DownloadSource::Dist, + format!("rustfmt-{version}-{build}.tar.xz", build = host.triple), + "rustfmt-preview", + &date, + "rustfmt", + ); + self.download_component( + DownloadSource::Dist, + format!("rustc-{version}-{build}.tar.xz", build = host.triple), + "rustc", + &date, + "rustfmt", + ); + + if self.should_fix_bins_and_dylibs() { + self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt")); + self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt")); + } self.create(&rustfmt_stamp, &channel); Some(rustfmt_path) @@ -358,16 +382,21 @@ impl Config { let filename = format!("rust-src-{version}.tar.xz"); self.download_ci_component(filename, "rust-src", commit); - self.fix_bin_or_dylib(&bin_root.join("bin").join("rustc")); - self.fix_bin_or_dylib(&bin_root.join("bin").join("rustdoc")); - self.fix_bin_or_dylib(&bin_root.join("libexec").join("rust-analyzer-proc-macro-srv")); - let lib_dir = bin_root.join("lib"); - for lib in t!(fs::read_dir(&lib_dir), lib_dir.display().to_string()) { - let lib = t!(lib); - if lib.path().extension() == Some(OsStr::new("so")) { - self.fix_bin_or_dylib(&lib.path()); + if self.should_fix_bins_and_dylibs() { + self.fix_bin_or_dylib(&bin_root.join("bin").join("rustc")); + self.fix_bin_or_dylib(&bin_root.join("bin").join("rustdoc")); + self.fix_bin_or_dylib( + &bin_root.join("libexec").join("rust-analyzer-proc-macro-srv"), + ); + let lib_dir = bin_root.join("lib"); + for lib in t!(fs::read_dir(&lib_dir), lib_dir.display().to_string()) { + let lib = t!(lib); + if lib.path().extension() == Some(OsStr::new("so")) { + self.fix_bin_or_dylib(&lib.path()); + } } } + t!(fs::write(rustc_stamp, commit)); } } @@ -459,8 +488,10 @@ impl Config { let key = format!("{}{}", llvm_sha, self.llvm_assertions); if program_out_of_date(&llvm_stamp, &key) && !self.dry_run() { self.download_ci_llvm(&llvm_sha); - for entry in t!(fs::read_dir(llvm_root.join("bin"))) { - self.fix_bin_or_dylib(&t!(entry).path()); + if self.should_fix_bins_and_dylibs() { + for entry in t!(fs::read_dir(llvm_root.join("bin"))) { + self.fix_bin_or_dylib(&t!(entry).path()); + } } // Update the timestamp of llvm-config to force rustc_llvm to be @@ -475,13 +506,16 @@ impl Config { let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.build)); t!(filetime::set_file_times(&llvm_config, now, now)); - let llvm_lib = llvm_root.join("lib"); - for entry in t!(fs::read_dir(&llvm_lib)) { - let lib = t!(entry).path(); - if lib.extension().map_or(false, |ext| ext == "so") { - self.fix_bin_or_dylib(&lib); + if self.should_fix_bins_and_dylibs() { + let llvm_lib = llvm_root.join("lib"); + for entry in t!(fs::read_dir(&llvm_lib)) { + let lib = t!(entry).path(); + if lib.extension().map_or(false, |ext| ext == "so") { + self.fix_bin_or_dylib(&lib); + } } } + t!(fs::write(llvm_stamp, key)); } } diff --git a/src/doc/book b/src/doc/book index 2cd1b5593d26d..f2a78f64b668f 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit 2cd1b5593d26dc6a03c20f8619187ad4b2485552 +Subproject commit f2a78f64b668f63f581203c6bac509903f7c00ee diff --git a/src/doc/embedded-book b/src/doc/embedded-book index 19f798d448835..f1a4614aa41cc 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit 19f798d448835a4888e3b3eae7fe69f1d61d8681 +Subproject commit f1a4614aa41cc544b91b79760a709e113f3451d7 diff --git a/src/doc/nomicon b/src/doc/nomicon index 960d610e7f338..bd1829d235296 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit 960d610e7f33889a2577f5f17c26f0d5c82b30df +Subproject commit bd1829d235296952bf72ca55635e360584b8805e diff --git a/src/doc/reference b/src/doc/reference index 2cb0ed9ba5636..22882fb3f7b4d 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 2cb0ed9ba56360949f492f9866afe8c293f9f9da +Subproject commit 22882fb3f7b4d69fdc0d1731e8b9cfcb6910537d diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index a9fb7d13eadfc..134376872e8c3 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit a9fb7d13eadfcc5f457962731f105b97f9a7474a +Subproject commit 134376872e8c387ef369507e0ee9b5a0e3272718 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index 7352353ae91c4..e359ee27fc3da 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit 7352353ae91c48b136d2ca7d03822e1448165e1e +Subproject commit e359ee27fc3da3356d71a732128c0a1abe02e53a diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 8a9e6caf611ba..1644d1c5a29a7 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -58,11 +58,11 @@ pub(crate) fn render_example_with_highlighting( write_footer(out, playground_button); } -/// Highlights `src` as a macro, returning the HTML output. -pub(crate) fn render_macro_with_highlighting(src: &str, out: &mut Buffer) { - write_header(out, "macro", None, Tooltip::None); +/// Highlights `src` as an item-decl, returning the HTML output. +pub(crate) fn render_item_decl_with_highlighting(src: &str, out: &mut Buffer) { + write!(out, "

");
     write_code(out, src, None, None);
-    write_footer(out, None);
+    write!(out, "
"); } /// Highlights `src` as a source code page, returning the HTML output. diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index a60e7cb10fa51..6ab849c92a076 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -30,7 +30,6 @@ pub(crate) struct Page<'a> { pub(crate) root_path: &'a str, pub(crate) static_root_path: Option<&'a str>, pub(crate) description: &'a str, - pub(crate) keywords: &'a str, pub(crate) resource_suffix: &'a str, } diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 15258a467a228..b59645ec2e2d5 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -18,7 +18,7 @@ use super::search_index::build_index; use super::write_shared::write_shared; use super::{ collect_spans_and_sources, print_sidebar, scrape_examples_help, sidebar_module_like, AllTypes, - LinkFromSrc, NameDoc, StylePath, BASIC_KEYWORDS, + LinkFromSrc, NameDoc, StylePath, }; use crate::clean::{self, types::ExternalLocation, ExternalCrate}; @@ -195,7 +195,6 @@ impl<'tcx> Context<'tcx> { self.shared.layout.krate ) }; - let keywords = make_item_keywords(it); let name; let tyname_s = if it.is_crate() { name = format!("{} crate", tyname); @@ -212,7 +211,6 @@ impl<'tcx> Context<'tcx> { static_root_path: clone_shared.static_root_path.as_deref(), title: &title, description: &desc, - keywords: &keywords, resource_suffix: &clone_shared.resource_suffix, }; let mut page_buffer = Buffer::html(); @@ -598,7 +596,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { root_path: "../", static_root_path: shared.static_root_path.as_deref(), description: "List of all items in this crate", - keywords: BASIC_KEYWORDS, resource_suffix: &shared.resource_suffix, }; let all = shared.all.replace(AllTypes::new()); @@ -828,7 +825,3 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { &self.shared.cache } } - -fn make_item_keywords(it: &clean::Item) -> String { - format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap()) -} diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index be6de231854ba..816a8f4e274ce 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -2743,8 +2743,6 @@ fn sidebar_foreign_type(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item) { } } -pub(crate) const BASIC_KEYWORDS: &str = "rust, rustlang, rust-lang"; - /// Returns a list of all paths used in the type. /// This is used to help deduplicate imported impls /// for reexported types. If any of the contained diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index b0288d55c256a..bd7548003ad3b 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -355,7 +355,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: } clean::ImportItem(ref import) => { - let (stab, stab_tags) = if let Some(import_def_id) = import.source.did { + let stab_tags = if let Some(import_def_id) = import.source.did { let ast_attrs = cx.tcx().get_attrs_unchecked(import_def_id); let import_attrs = Box::new(clean::Attributes::from_ast(ast_attrs)); @@ -367,15 +367,12 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: ..myitem.clone() }; - let stab = import_item.stability_class(cx.tcx()); let stab_tags = Some(extra_info_tags(&import_item, item, cx.tcx())); - (stab, stab_tags) + stab_tags } else { - (None, None) + None }; - let add = if stab.is_some() { " " } else { "" }; - w.write_str(ITEM_TABLE_ROW_OPEN); let id = match import.kind { clean::ImportKind::Simple(s) => { @@ -391,11 +388,10 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: }; write!( w, - "
\ + "
\ {vis}{imp}\
\ {stab_tags_before}{stab_tags}{stab_tags_after}", - stab = stab.unwrap_or_default(), vis = visibility_print_with_space(myitem.visibility(tcx), myitem.item_id, cx), imp = import.print(cx), ); @@ -417,9 +413,6 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: _ => "", }; - let stab = myitem.stability_class(cx.tcx()); - let add = if stab.is_some() { " " } else { "" }; - let visibility_emoji = match myitem.visibility(tcx) { Some(ty::Visibility::Restricted(_)) => { " ðŸ”’ " @@ -437,7 +430,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: }; write!( w, - "
\ + "
\ {name}\ {visibility_emoji}\ {unsafety_flag}\ @@ -448,8 +441,6 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: visibility_emoji = visibility_emoji, stab_tags = extra_info_tags(myitem, item, cx.tcx()), class = myitem.type_(), - add = add, - stab = stab.unwrap_or_default(), unsafety_flag = unsafety_flag, href = item_path(myitem.type_(), myitem.name.unwrap().as_str()), title = [myitem.type_().to_string(), full_path(cx, myitem)] @@ -530,26 +521,24 @@ fn item_function(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, f: &cle let notable_traits = f.decl.output.as_return().and_then(|output| notable_traits_button(output, cx)); - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - w.reserve(header_len); - write!( - w, - "{vis}{constness}{asyncness}{unsafety}{abi}fn \ - {name}{generics}{decl}{notable_traits}{where_clause}", - vis = visibility, - constness = constness, - asyncness = asyncness, - unsafety = unsafety, - abi = abi, - name = name, - generics = f.generics.print(cx), - where_clause = print_where_clause(&f.generics, cx, 0, Ending::Newline), - decl = f.decl.full_print(header_len, 0, cx), - notable_traits = notable_traits.unwrap_or_default(), - ); - }); + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + w.reserve(header_len); + write!( + w, + "{vis}{constness}{asyncness}{unsafety}{abi}fn \ + {name}{generics}{decl}{notable_traits}{where_clause}", + vis = visibility, + constness = constness, + asyncness = asyncness, + unsafety = unsafety, + abi = abi, + name = name, + generics = f.generics.print(cx), + where_clause = print_where_clause(&f.generics, cx, 0, Ending::Newline), + decl = f.decl.full_print(header_len, 0, cx), + notable_traits = notable_traits.unwrap_or_default(), + ); }); document(w, cx, it, None, HeadingOffset::H2); } @@ -569,145 +558,140 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean: let must_implement_one_of_functions = tcx.trait_def(t.def_id).must_implement_one_of.clone(); // Output the trait definition - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - write!( - w, - "{}{}{}trait {}{}{}", - visibility_print_with_space(it.visibility(tcx), it.item_id, cx), - t.unsafety(tcx).print_with_space(), - if t.is_auto(tcx) { "auto " } else { "" }, - it.name.unwrap(), - t.generics.print(cx), - bounds - ); + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + write!( + w, + "{}{}{}trait {}{}{}", + visibility_print_with_space(it.visibility(tcx), it.item_id, cx), + t.unsafety(tcx).print_with_space(), + if t.is_auto(tcx) { "auto " } else { "" }, + it.name.unwrap(), + t.generics.print(cx), + bounds + ); - if !t.generics.where_predicates.is_empty() { - write!(w, "{}", print_where_clause(&t.generics, cx, 0, Ending::Newline)); - } else { - w.write_str(" "); - } + if !t.generics.where_predicates.is_empty() { + write!(w, "{}", print_where_clause(&t.generics, cx, 0, Ending::Newline)); + } else { + w.write_str(" "); + } - if t.items.is_empty() { - w.write_str("{ }"); - } else { - // FIXME: we should be using a derived_id for the Anchors here - w.write_str("{\n"); - let mut toggle = false; - - // If there are too many associated types, hide _everything_ - if should_hide_fields(count_types) { - toggle = true; - toggle_open( - w, - format_args!( - "{} associated items", - count_types + count_consts + count_methods - ), - ); - } - for types in [&required_types, &provided_types] { - for t in types { - render_assoc_item( - w, - t, - AssocItemLink::Anchor(None), - ItemType::Trait, - cx, - RenderMode::Normal, - ); - w.write_str(";\n"); - } - } - // If there are too many associated constants, hide everything after them - // We also do this if the types + consts is large because otherwise we could - // render a bunch of types and _then_ a bunch of consts just because both were - // _just_ under the limit - if !toggle && should_hide_fields(count_types + count_consts) { - toggle = true; - toggle_open( - w, - format_args!( - "{} associated constant{} and {} method{}", - count_consts, - pluralize(count_consts), - count_methods, - pluralize(count_methods), - ), - ); - } - if count_types != 0 && (count_consts != 0 || count_methods != 0) { - w.write_str("\n"); - } - for consts in [&required_consts, &provided_consts] { - for c in consts { - render_assoc_item( - w, - c, - AssocItemLink::Anchor(None), - ItemType::Trait, - cx, - RenderMode::Normal, - ); - w.write_str(";\n"); - } - } - if !toggle && should_hide_fields(count_methods) { - toggle = true; - toggle_open(w, format_args!("{} methods", count_methods)); - } - if count_consts != 0 && count_methods != 0 { - w.write_str("\n"); - } - for (pos, m) in required_methods.iter().enumerate() { + if t.items.is_empty() { + w.write_str("{ }"); + } else { + // FIXME: we should be using a derived_id for the Anchors here + w.write_str("{\n"); + let mut toggle = false; + + // If there are too many associated types, hide _everything_ + if should_hide_fields(count_types) { + toggle = true; + toggle_open( + w, + format_args!("{} associated items", count_types + count_consts + count_methods), + ); + } + for types in [&required_types, &provided_types] { + for t in types { render_assoc_item( w, - m, + t, AssocItemLink::Anchor(None), ItemType::Trait, cx, RenderMode::Normal, ); w.write_str(";\n"); - - if pos < required_methods.len() - 1 { - w.write_str(""); - } - } - if !required_methods.is_empty() && !provided_methods.is_empty() { - w.write_str("\n"); } - for (pos, m) in provided_methods.iter().enumerate() { + } + // If there are too many associated constants, hide everything after them + // We also do this if the types + consts is large because otherwise we could + // render a bunch of types and _then_ a bunch of consts just because both were + // _just_ under the limit + if !toggle && should_hide_fields(count_types + count_consts) { + toggle = true; + toggle_open( + w, + format_args!( + "{} associated constant{} and {} method{}", + count_consts, + pluralize(count_consts), + count_methods, + pluralize(count_methods), + ), + ); + } + if count_types != 0 && (count_consts != 0 || count_methods != 0) { + w.write_str("\n"); + } + for consts in [&required_consts, &provided_consts] { + for c in consts { render_assoc_item( w, - m, + c, AssocItemLink::Anchor(None), ItemType::Trait, cx, RenderMode::Normal, ); - match *m.kind { - clean::MethodItem(ref inner, _) - if !inner.generics.where_predicates.is_empty() => - { - w.write_str(",\n { ... }\n"); - } - _ => { - w.write_str(" { ... }\n"); - } - } + w.write_str(";\n"); + } + } + if !toggle && should_hide_fields(count_methods) { + toggle = true; + toggle_open(w, format_args!("{} methods", count_methods)); + } + if count_consts != 0 && count_methods != 0 { + w.write_str("\n"); + } + for (pos, m) in required_methods.iter().enumerate() { + render_assoc_item( + w, + m, + AssocItemLink::Anchor(None), + ItemType::Trait, + cx, + RenderMode::Normal, + ); + w.write_str(";\n"); - if pos < provided_methods.len() - 1 { - w.write_str(""); + if pos < required_methods.len() - 1 { + w.write_str(""); + } + } + if !required_methods.is_empty() && !provided_methods.is_empty() { + w.write_str("\n"); + } + for (pos, m) in provided_methods.iter().enumerate() { + render_assoc_item( + w, + m, + AssocItemLink::Anchor(None), + ItemType::Trait, + cx, + RenderMode::Normal, + ); + match *m.kind { + clean::MethodItem(ref inner, _) + if !inner.generics.where_predicates.is_empty() => + { + w.write_str(",\n { ... }\n"); + } + _ => { + w.write_str(" { ... }\n"); } } - if toggle { - toggle_close(w); + + if pos < provided_methods.len() - 1 { + w.write_str(""); } - w.write_str("}"); } - }); + if toggle { + toggle_close(w); + } + w.write_str("}"); + } }); // Trait documentation @@ -1050,18 +1034,16 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean: } fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::TraitAlias) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - write!( - w, - "trait {}{}{} = {};", - it.name.unwrap(), - t.generics.print(cx), - print_where_clause(&t.generics, cx, 0, Ending::Newline), - bounds(&t.bounds, true, cx) - ); - }); + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + write!( + w, + "trait {}{}{} = {};", + it.name.unwrap(), + t.generics.print(cx), + print_where_clause(&t.generics, cx, 0, Ending::Newline), + bounds(&t.bounds, true, cx) + ); }); document(w, cx, it, None, HeadingOffset::H2); @@ -1074,18 +1056,16 @@ fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: & } fn item_opaque_ty(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::OpaqueTy) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - write!( - w, - "type {}{}{where_clause} = impl {bounds};", - it.name.unwrap(), - t.generics.print(cx), - where_clause = print_where_clause(&t.generics, cx, 0, Ending::Newline), - bounds = bounds(&t.bounds, false, cx), - ); - }); + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + write!( + w, + "type {}{}{where_clause} = impl {bounds};", + it.name.unwrap(), + t.generics.print(cx), + where_clause = print_where_clause(&t.generics, cx, 0, Ending::Newline), + bounds = bounds(&t.bounds, false, cx), + ); }); document(w, cx, it, None, HeadingOffset::H2); @@ -1113,7 +1093,7 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea }); } - wrap_into_item_decl(w, |w| write_content(w, cx, it, t)); + write_content(w, cx, it, t); document(w, cx, it, None, HeadingOffset::H2); @@ -1127,11 +1107,9 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea } fn item_union(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Union) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - render_union(w, it, Some(&s.generics), &s.fields, "", cx); - }); + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + render_union(w, it, Some(&s.generics), &s.fields, "", cx); }); document(w, cx, it, None, HeadingOffset::H2); @@ -1192,60 +1170,58 @@ fn print_tuple_struct_fields(w: &mut Buffer, cx: &Context<'_>, s: &[clean::Item] fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::Enum) { let tcx = cx.tcx(); let count_variants = e.variants().count(); - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_pre(w, it, ""); - write!( - w, - "{}enum {}{}", - visibility_print_with_space(it.visibility(tcx), it.item_id, cx), - it.name.unwrap(), - e.generics.print(cx), - ); - if !print_where_clause_and_check(w, &e.generics, cx) { - // If there wasn't a `where` clause, we add a whitespace. - w.write_str(" "); - } + wrap_item(w, |w| { + render_attributes_in_pre(w, it, ""); + write!( + w, + "{}enum {}{}", + visibility_print_with_space(it.visibility(tcx), it.item_id, cx), + it.name.unwrap(), + e.generics.print(cx), + ); + if !print_where_clause_and_check(w, &e.generics, cx) { + // If there wasn't a `where` clause, we add a whitespace. + w.write_str(" "); + } - let variants_stripped = e.has_stripped_entries(); - if count_variants == 0 && !variants_stripped { - w.write_str("{}"); - } else { - w.write_str("{\n"); - let toggle = should_hide_fields(count_variants); - if toggle { - toggle_open(w, format_args!("{} variants", count_variants)); - } - for v in e.variants() { - w.write_str(" "); - let name = v.name.unwrap(); - match *v.kind { - // FIXME(#101337): Show discriminant - clean::VariantItem(ref var) => match var.kind { - clean::VariantKind::CLike => write!(w, "{}", name), - clean::VariantKind::Tuple(ref s) => { - write!(w, "{}(", name); - print_tuple_struct_fields(w, cx, s); - w.write_str(")"); - } - clean::VariantKind::Struct(ref s) => { - render_struct(w, v, None, None, &s.fields, " ", false, cx); - } - }, - _ => unreachable!(), - } - w.write_str(",\n"); + let variants_stripped = e.has_stripped_entries(); + if count_variants == 0 && !variants_stripped { + w.write_str("{}"); + } else { + w.write_str("{\n"); + let toggle = should_hide_fields(count_variants); + if toggle { + toggle_open(w, format_args!("{} variants", count_variants)); + } + for v in e.variants() { + w.write_str(" "); + let name = v.name.unwrap(); + match *v.kind { + // FIXME(#101337): Show discriminant + clean::VariantItem(ref var) => match var.kind { + clean::VariantKind::CLike => write!(w, "{}", name), + clean::VariantKind::Tuple(ref s) => { + write!(w, "{}(", name); + print_tuple_struct_fields(w, cx, s); + w.write_str(")"); + } + clean::VariantKind::Struct(ref s) => { + render_struct(w, v, None, None, &s.fields, " ", false, cx); + } + }, + _ => unreachable!(), } + w.write_str(",\n"); + } - if variants_stripped { - w.write_str(" // some variants omitted\n"); - } - if toggle { - toggle_close(w); - } - w.write_str("}"); + if variants_stripped { + w.write_str(" // some variants omitted\n"); } - }); + if toggle { + toggle_close(w); + } + w.write_str("}"); + } }); document(w, cx, it, None, HeadingOffset::H2); @@ -1346,38 +1322,30 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean:: } fn item_macro(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::Macro) { - wrap_into_item_decl(w, |w| { - highlight::render_macro_with_highlighting(&t.source, w); - }); + highlight::render_item_decl_with_highlighting(&t.source, w); document(w, cx, it, None, HeadingOffset::H2) } fn item_proc_macro(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, m: &clean::ProcMacro) { - wrap_into_item_decl(w, |w| { + wrap_item(w, |w| { let name = it.name.expect("proc-macros always have names"); match m.kind { MacroKind::Bang => { - wrap_item(w, |w| { - write!(w, "{}!() {{ /* proc-macro */ }}", name); - }); + write!(w, "{}!() {{ /* proc-macro */ }}", name); } MacroKind::Attr => { - wrap_item(w, |w| { - write!(w, "#[{}]", name); - }); + write!(w, "#[{}]", name); } MacroKind::Derive => { - wrap_item(w, |w| { - write!(w, "#[derive({})]", name); - if !m.helpers.is_empty() { - w.push_str("\n{\n"); - w.push_str(" // Attributes available to this derive:\n"); - for attr in &m.helpers { - writeln!(w, " #[{}]", attr); - } - w.push_str("}\n"); + write!(w, "#[derive({})]", name); + if !m.helpers.is_empty() { + w.push_str("\n{\n"); + w.push_str(" // Attributes available to this derive:\n"); + for attr in &m.helpers { + writeln!(w, " #[{}]", attr); } - }); + w.push_str("}\n"); + } } } }); @@ -1400,61 +1368,57 @@ fn item_primitive(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) { } fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &clean::Constant) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - let tcx = cx.tcx(); - render_attributes_in_code(w, it); + wrap_item(w, |w| { + let tcx = cx.tcx(); + render_attributes_in_code(w, it); - write!( - w, - "{vis}const {name}: {typ}", - vis = visibility_print_with_space(it.visibility(tcx), it.item_id, cx), - name = it.name.unwrap(), - typ = c.type_.print(cx), - ); + write!( + w, + "{vis}const {name}: {typ}", + vis = visibility_print_with_space(it.visibility(tcx), it.item_id, cx), + name = it.name.unwrap(), + typ = c.type_.print(cx), + ); - // FIXME: The code below now prints - // ` = _; // 100i32` - // if the expression is - // `50 + 50` - // which looks just wrong. - // Should we print - // ` = 100i32;` - // instead? - - let value = c.value(tcx); - let is_literal = c.is_literal(tcx); - let expr = c.expr(tcx); - if value.is_some() || is_literal { - write!(w, " = {expr};", expr = Escape(&expr)); - } else { - w.write_str(";"); - } + // FIXME: The code below now prints + // ` = _; // 100i32` + // if the expression is + // `50 + 50` + // which looks just wrong. + // Should we print + // ` = 100i32;` + // instead? + + let value = c.value(tcx); + let is_literal = c.is_literal(tcx); + let expr = c.expr(tcx); + if value.is_some() || is_literal { + write!(w, " = {expr};", expr = Escape(&expr)); + } else { + w.write_str(";"); + } - if !is_literal { - if let Some(value) = &value { - let value_lowercase = value.to_lowercase(); - let expr_lowercase = expr.to_lowercase(); + if !is_literal { + if let Some(value) = &value { + let value_lowercase = value.to_lowercase(); + let expr_lowercase = expr.to_lowercase(); - if value_lowercase != expr_lowercase - && value_lowercase.trim_end_matches("i32") != expr_lowercase - { - write!(w, " // {value}", value = Escape(value)); - } + if value_lowercase != expr_lowercase + && value_lowercase.trim_end_matches("i32") != expr_lowercase + { + write!(w, " // {value}", value = Escape(value)); } } - }); + } }); document(w, cx, it, None, HeadingOffset::H2) } fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Struct) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_code(w, it); - render_struct(w, it, Some(&s.generics), s.ctor_kind, &s.fields, "", true, cx); - }); + wrap_item(w, |w| { + render_attributes_in_code(w, it); + render_struct(w, it, Some(&s.generics), s.ctor_kind, &s.fields, "", true, cx); }); document(w, cx, it, None, HeadingOffset::H2); @@ -1503,34 +1467,30 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean } fn item_static(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Static) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - render_attributes_in_code(w, it); - write!( - w, - "{vis}static {mutability}{name}: {typ}", - vis = visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx), - mutability = s.mutability.print_with_space(), - name = it.name.unwrap(), - typ = s.type_.print(cx) - ); - }); + wrap_item(w, |w| { + render_attributes_in_code(w, it); + write!( + w, + "{vis}static {mutability}{name}: {typ}", + vis = visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx), + mutability = s.mutability.print_with_space(), + name = it.name.unwrap(), + typ = s.type_.print(cx) + ); }); document(w, cx, it, None, HeadingOffset::H2) } fn item_foreign_type(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) { - wrap_into_item_decl(w, |w| { - wrap_item(w, |w| { - w.write_str("extern {\n"); - render_attributes_in_code(w, it); - write!( - w, - " {}type {};\n}}", - visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx), - it.name.unwrap(), - ); - }); + wrap_item(w, |w| { + w.write_str("extern {\n"); + render_attributes_in_code(w, it); + write!( + w, + " {}type {};\n}}", + visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx), + it.name.unwrap(), + ); }); document(w, cx, it, None, HeadingOffset::H2); @@ -1609,20 +1569,11 @@ fn bounds(t_bounds: &[clean::GenericBound], trait_alias: bool, cx: &Context<'_>) bounds } -fn wrap_into_item_decl(w: &mut Buffer, f: F) -where - F: FnOnce(&mut Buffer), -{ - w.write_str("
"); - f(w); - w.write_str("
") -} - fn wrap_item(w: &mut Buffer, f: F) where F: FnOnce(&mut Buffer), { - w.write_str(r#"
"#);
+    w.write_str(r#"
"#);
     f(w);
     w.write_str("
"); } diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index bc8badad38eb0..6b71ecc24bde6 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -11,7 +11,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use serde::ser::SerializeSeq; use serde::{Serialize, Serializer}; -use super::{collect_paths_for_type, ensure_trailing_slash, Context, BASIC_KEYWORDS}; +use super::{collect_paths_for_type, ensure_trailing_slash, Context}; use crate::clean::Crate; use crate::config::{EmitType, RenderOptions}; use crate::docfs::PathError; @@ -340,7 +340,6 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; root_path: "./", static_root_path: shared.static_root_path.as_deref(), description: "List of crates", - keywords: BASIC_KEYWORDS, resource_suffix: &shared.resource_suffix, }; diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 799c497d13709..2c90bf4fadc01 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -4,7 +4,7 @@ use crate::error::Error; use crate::html::format::Buffer; use crate::html::highlight; use crate::html::layout; -use crate::html::render::{Context, BASIC_KEYWORDS}; +use crate::html::render::Context; use crate::visit::DocVisitor; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; @@ -228,7 +228,6 @@ impl SourceCollector<'_, '_> { root_path: &root_path, static_root_path: shared.static_root_path.as_deref(), description: &desc, - keywords: BASIC_KEYWORDS, resource_suffix: &shared.resource_suffix, }; let v = layout::render( diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 8699508e43916..dad27c66a3de5 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1,3 +1,11 @@ +/* When static files are updated, their suffixes need to be updated. + 1. In the top directory run: + ./x.py doc --stage 1 library/core + 2. Find the directory containing files named with updated suffixes: + find build -path '*'/stage1-std/'*'/static.files + 3. Copy the filenames with updated suffixes from the directory. +*/ + /* See FiraSans-LICENSE.txt for the Fira Sans license. */ @font-face { font-family: 'Fira Sans'; @@ -22,7 +30,7 @@ font-style: normal; font-weight: 400; src: local('Source Serif 4'), - url("SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2") format("woff2"); + url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2"); font-display: swap; } @font-face { @@ -30,7 +38,7 @@ font-style: italic; font-weight: 400; src: local('Source Serif 4 Italic'), - url("SourceSerif4-It-d034fe4ef9d0fa00.ttf.woff2") format("woff2"); + url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2"); font-display: swap; } @font-face { @@ -38,7 +46,7 @@ font-style: normal; font-weight: 700; src: local('Source Serif 4 Bold'), - url("SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2") format("woff2"); + url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2"); font-display: swap; } @@ -335,7 +343,7 @@ pre { padding: 14px; line-height: 1.5; /* https://github.com/rust-lang/rust/issues/105906 */ } -.item-decl pre { +pre.item-decl { overflow-x: auto; } /* This rule allows to have scrolling on the X axis. */ @@ -977,10 +985,6 @@ so that we can apply CSS-filters to change the arrow color in themes */ 0 -1px 0 black; } -.item-left.unstable { - opacity: 0.65; -} - .since { font-weight: normal; font-size: initial; @@ -1262,6 +1266,14 @@ a.test-arrow:hover { line-height: 1.5; color: inherit; } +#search-tabs button:not(.selected) { + background-color: var(--search-tab-button-not-selected-background); + border-top-color: var(--search-tab-button-not-selected-border-top-color); +} +#search-tabs button:hover, #search-tabs button.selected { + background-color: var(--search-tab-button-selected-background); + border-top-color: var(--search-tab-button-selected-border-top-color); +} #search-tabs .count { font-size: 1rem; diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index c28cefebc8bf5..920f45c4bbadb 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -40,8 +40,6 @@ } .setting-check { - position: relative; - width: 100%; margin-right: 20px; display: flex; align-items: center; diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index ed779bf6166ee..d20d13ab36d2d 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -46,6 +46,10 @@ Original by Dempfi (https://github.com/dempfi/ayu) --search-results-alias-color: #c5c5c5; --search-results-grey-color: #999; --search-tab-title-count-color: #888; + --search-tab-button-not-selected-border-top-color: none; + --search-tab-button-not-selected-background: transparent !important; + --search-tab-button-selected-border-top-color: none; + --search-tab-button-selected-background: #141920 !important; --stab-background-color: #314559; --stab-code-color: #e6e1cf; --code-highlight-kw-color: #ff7733; @@ -171,28 +175,17 @@ pre, .rustdoc.source .example-wrap { } #search-tabs > button.selected { - background-color: #141920 !important; border-bottom: 1px solid #ffb44c !important; border-top: none; } - #search-tabs > button:not(.selected) { - background-color: transparent !important; border: none; + background-color: transparent !important; } - #search-tabs > button:hover { border-bottom: 1px solid rgba(242, 151, 24, 0.3); } -/* rules that this theme does not need to set, here to satisfy the rule checker */ -/* note that a lot of these are partially set in some way (meaning they are set -individually rather than as a group) */ -/* FIXME: these rules should be at the bottom of the file but currently must be -above the `@media (max-width: 700px)` rules due to a bug in the css checker */ -/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */ -#search-tabs > button:hover, #search-tabs > button.selected {} - #settings-menu > a img { filter: invert(100); } diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index 3766f0daa42ff..b84d87c4a54f3 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -41,6 +41,10 @@ --search-results-alias-color: #fff; --search-results-grey-color: #ccc; --search-tab-title-count-color: #888; + --search-tab-button-not-selected-border-top-color: #252525; + --search-tab-button-not-selected-background: #252525; + --search-tab-button-selected-border-top-color: #0089ff; + --search-tab-button-selected-background: #353535; --stab-background-color: #314559; --stab-code-color: #e6e1cf; --code-highlight-kw-color: #ab8ac1; @@ -95,13 +99,3 @@ --scrape-example-code-wrapper-background-start: rgba(53, 53, 53, 1); --scrape-example-code-wrapper-background-end: rgba(53, 53, 53, 0); } - -#search-tabs > button:not(.selected) { - background-color: #252525; - border-top-color: #252525; -} - -#search-tabs > button:hover, #search-tabs > button.selected { - border-top-color: #0089ff; - background-color: #353535; -} diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index 8a7f6abcf8d8e..342274e676718 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -41,6 +41,10 @@ --search-results-alias-color: #000; --search-results-grey-color: #999; --search-tab-title-count-color: #888; + --search-tab-button-not-selected-border-top-color: #e6e6e6; + --search-tab-button-not-selected-background: #e6e6e6; + --search-tab-button-selected-border-top-color: #0089ff; + --search-tab-button-selected-background: #ffffff; --stab-background-color: #fff5d6; --stab-code-color: #000; --code-highlight-kw-color: #8959a8; @@ -92,13 +96,3 @@ --scrape-example-code-wrapper-background-start: rgba(255, 255, 255, 1); --scrape-example-code-wrapper-background-end: rgba(255, 255, 255, 0); } - -#search-tabs > button:not(.selected) { - background-color: #e6e6e6; - border-top-color: #e6e6e6; -} - -#search-tabs > button:hover, #search-tabs > button.selected { - background-color: #ffffff; - border-top-color: #0089ff; -} diff --git a/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 index db57d21455c94..181a07f63bef8 100644 Binary files a/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 and b/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 differ diff --git a/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 index 1cbc021a3aa22..2ae08a7bedfed 100644 Binary files a/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 and b/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 differ diff --git a/src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md b/src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md index 68ea1892406cb..5871e1f3d1b33 100644 --- a/src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md +++ b/src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. This Font Software is licensed under the SIL Open Font License, Version 1.1. diff --git a/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 index 2db73fe2b49e8..0263fc304226d 100644 Binary files a/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 and b/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 differ diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index b9ad8ef70e917..c66f500f42333 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -180,7 +180,6 @@ function browserSupportsHistoryApi() { return window.history && typeof window.history.pushState === "function"; } -// eslint-disable-next-line no-unused-vars function loadCss(cssUrl) { const link = document.createElement("link"); link.href = cssUrl; diff --git a/src/librustdoc/html/static/js/storage.js b/src/librustdoc/html/static/js/storage.js index 8836d1b2e464b..c72ac254fc08c 100644 --- a/src/librustdoc/html/static/js/storage.js +++ b/src/librustdoc/html/static/js/storage.js @@ -51,7 +51,6 @@ function hasClass(elem, className) { return elem && elem.classList && elem.classList.contains(className); } -// eslint-disable-next-line no-unused-vars function addClass(elem, className) { if (!elem || !elem.classList) { return; diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index fddda293b9a86..8540ee6631934 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -5,7 +5,6 @@ {#- -#} {#- -#} {#- -#} - {#- -#} {{page.title}} {#- -#} {#- -#} {#- -#} diff --git a/src/stage0.json b/src/stage0.json index 6a389a64406f9..46f70b1ef4b09 100644 --- a/src/stage0.json +++ b/src/stage0.json @@ -17,355 +17,409 @@ "tool is executed." ], "compiler": { - "date": "2022-12-27", + "date": "2023-01-25", "version": "beta" }, "rustfmt": { - "date": "2022-12-27", + "date": "2023-01-30", "version": "nightly" }, "checksums_sha256": { - "dist/2022-12-27/cargo-beta-aarch64-apple-darwin.tar.gz": "00b7df89de07931d150940536a1e6c980897ed0e9880bb6f24d5ebbad896c8f2", - "dist/2022-12-27/cargo-beta-aarch64-apple-darwin.tar.xz": "17e1e9cf2c4dad4fec7f420f43cea21923d76ba2d6f87ad67c90ea9c8e4a04f6", - "dist/2022-12-27/cargo-beta-aarch64-pc-windows-msvc.tar.gz": "783b7e2569490dffc953d4b24e659fec384739ceb8bad37e3a97df374945a91d", - "dist/2022-12-27/cargo-beta-aarch64-pc-windows-msvc.tar.xz": "a9402480620b03c010cb18dacca9a95c82e7b6078d2c1163543bc4292d7dd300", - "dist/2022-12-27/cargo-beta-aarch64-unknown-linux-gnu.tar.gz": "7fa9aa92c2b1268420f60af2826dffa50b61c9926a2a1cd1c8273fe5861cde11", - "dist/2022-12-27/cargo-beta-aarch64-unknown-linux-gnu.tar.xz": "97d583ed82db1fd5a03ce44a660f1163d0812b6f352adc6d78e61d7ae4fbfe23", - "dist/2022-12-27/cargo-beta-aarch64-unknown-linux-musl.tar.gz": "69236898b091d6ef31445eb1223acfc01adf21fb1aa277a7d441eaa300c0c9ad", - "dist/2022-12-27/cargo-beta-aarch64-unknown-linux-musl.tar.xz": "4a92788cdba1705b79ce9999d45a62d4631dbc59cc980437e1635dc908458b66", - "dist/2022-12-27/cargo-beta-arm-unknown-linux-gnueabi.tar.gz": "b35b72b16c59b38e38acddf2c06c2c819ca78f146bbf4f3ce9d7ff982b86655e", - "dist/2022-12-27/cargo-beta-arm-unknown-linux-gnueabi.tar.xz": "81d7fbe3f50cbad04c2ad0e118001976a880d23ad2a894ee49c6f6c10583d10d", - "dist/2022-12-27/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz": "942f6860e2cf9da7c5399d308acad43f862750bf7d383444c2dd636b86553e14", - "dist/2022-12-27/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz": "5f2f3c7186a2cb28f96bba8db7d404b0f3338bbe57edd631bb16fe4d2c8d493a", - "dist/2022-12-27/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz": "f15932518f114587c3639ed270cab3e4ef4eb28e0abb6b59b5f63138fa43e829", - "dist/2022-12-27/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz": "41116748ab087e0c7a5354508fb95e1a966212ef5cac40da59e363108077c3a9", - "dist/2022-12-27/cargo-beta-i686-pc-windows-gnu.tar.gz": "37bbf0a9dcc1b3fbc11a5f72de922fb0f5dc80a632d803fa0a892d72bdd457c1", - "dist/2022-12-27/cargo-beta-i686-pc-windows-gnu.tar.xz": "7a8afd8a69e1e25e47122096920217bbe765e82e831583420487702831241d5c", - "dist/2022-12-27/cargo-beta-i686-pc-windows-msvc.tar.gz": "c40ec16780156f6568bf8f1353a3bb367d4bec09dc6e98b03de44bd2ed301ae8", - "dist/2022-12-27/cargo-beta-i686-pc-windows-msvc.tar.xz": "94320949f071236d828fb1252159f0f2b1f18030303af1ae0b7ca06cd9567de0", - "dist/2022-12-27/cargo-beta-i686-unknown-linux-gnu.tar.gz": "1fb3fc33289ae716f950feca832196bb32cde0556e41e501d05c84116836d916", - "dist/2022-12-27/cargo-beta-i686-unknown-linux-gnu.tar.xz": "4f112ea5a91abbf63db484368090fdf8fbc6b7abc1a5d7c8353df15e7908c2e3", - "dist/2022-12-27/cargo-beta-mips-unknown-linux-gnu.tar.gz": "b90f3c17c73f4dd7b36e0ff56b17be8e1c90f82b33c9be28b7b813fc5c788e05", - "dist/2022-12-27/cargo-beta-mips-unknown-linux-gnu.tar.xz": "8754bb3f116b09a8b38ac0684014532a19ccb57e4e94d1097a8484e8d67e31ce", - "dist/2022-12-27/cargo-beta-mips64-unknown-linux-gnuabi64.tar.gz": "549733dbbc3ec23976d6975e78ec8b8a30396eb45e4a8f5eef6d4c846cf04da1", - "dist/2022-12-27/cargo-beta-mips64-unknown-linux-gnuabi64.tar.xz": "f5997ebe7c67969b7d14a2233897b6014ebd9b38010eee101d9e484d42b220c9", - "dist/2022-12-27/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "3450c71c082bf84115fb035239453e39230afa0575dca0fc52586222b474a0c2", - "dist/2022-12-27/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "a16c397c5e980a926e0122cff5f8d30c4b54c2dba7f48ef00b587c5cda8f500d", - "dist/2022-12-27/cargo-beta-mipsel-unknown-linux-gnu.tar.gz": "62e025463eca2dac0547275c7827e6ecd109d1b84d056526e647abd220b3e1fc", - "dist/2022-12-27/cargo-beta-mipsel-unknown-linux-gnu.tar.xz": "99c5f5511b23d93707df394c2ab90ddd98e7876c9ee74c861dc919cdd498399b", - "dist/2022-12-27/cargo-beta-powerpc-unknown-linux-gnu.tar.gz": "eee574420f365d02d52f5f4754563bc1fe4f0b07d02a554f6aa886bccbe4c092", - "dist/2022-12-27/cargo-beta-powerpc-unknown-linux-gnu.tar.xz": "64e53a591e2d4dee9935fca4a2df18fbbed1b00b74dd6631473ba2d5b257891b", - "dist/2022-12-27/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz": "37d2a5f1c496c8ad8d2b5af5e89a4a325ddcef32ebd7087ef3cc9e653e5a8f4a", - "dist/2022-12-27/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz": "8753d9bfdda6decdcc4f58d2391956609e0aeb75ce4368c7ed52c23ed3f28943", - "dist/2022-12-27/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz": "303c63a294f2112fceb70cee063f35cbee3296b93ca91e43300e72b064d80da7", - "dist/2022-12-27/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz": "96b752dd307d2709dbf2b91c687a55992f4e0e5a143223a8c2a267883b4a2832", - "dist/2022-12-27/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz": "e5c279922e9adb47e6ecaee191ad291bfc627aa05e4c026628664bc47e5ce254", - "dist/2022-12-27/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz": "7e0145fe22bfca7070dcace196e3229a86f9f5b31ab1cfc4fd7ff158db5b1388", - "dist/2022-12-27/cargo-beta-s390x-unknown-linux-gnu.tar.gz": "49df0b5774471ced53703942c6551c045ed56c92a3a224615f583511bc845a61", - "dist/2022-12-27/cargo-beta-s390x-unknown-linux-gnu.tar.xz": "955e67ac19fc7a2a882f759339343c466da9658b2cd95799dd78328c13d6527e", - "dist/2022-12-27/cargo-beta-x86_64-apple-darwin.tar.gz": "a0e01a9ded551ea1f411da70d4481627579e870c2ff7592efde1d8be83ca46d5", - "dist/2022-12-27/cargo-beta-x86_64-apple-darwin.tar.xz": "a9205d81dff07cbf2468fa6f6999fd0f1266ad4faf84f5688e3e5cb330bdce0f", - "dist/2022-12-27/cargo-beta-x86_64-pc-windows-gnu.tar.gz": "d6406b59361cdc97df606901beeafe6660a4cf557b9de4a313d4659c83f10255", - "dist/2022-12-27/cargo-beta-x86_64-pc-windows-gnu.tar.xz": "ae15fd38cfcd149de306280a48785fe269ea36b1a958de6815adc7a80792d798", - "dist/2022-12-27/cargo-beta-x86_64-pc-windows-msvc.tar.gz": "d75a793188af608b8bbd92907ff69294bc66b85b7ffe03882abcb661fd8c27f9", - "dist/2022-12-27/cargo-beta-x86_64-pc-windows-msvc.tar.xz": "26f4ed51fc227dccc67d4c68fcac78374fb1441093d3524ec157b1b6b6e90012", - "dist/2022-12-27/cargo-beta-x86_64-unknown-freebsd.tar.gz": "6503b65a5258b5517c5213f0fb858aeff7e00c453a3633749d1a72f7f645050b", - "dist/2022-12-27/cargo-beta-x86_64-unknown-freebsd.tar.xz": "75ba61fe1670d0e4cf9f9f35460c663701c75ceca95917ed25e98f20cc2f0ef5", - "dist/2022-12-27/cargo-beta-x86_64-unknown-illumos.tar.gz": "e003c3a1ed8b57546e6ecdcbbcb58a97896a8e511b6a8fdc31100c24b8dd5a17", - "dist/2022-12-27/cargo-beta-x86_64-unknown-illumos.tar.xz": "b377d76b8fae7ebc607f33400cc0b37974fbf02a4d29187b1f0f6f668c12ff01", - "dist/2022-12-27/cargo-beta-x86_64-unknown-linux-gnu.tar.gz": "0dcfb9c65b5ad5c6af905c78d6914f5d7f8a62def817e64192b29c957b848783", - "dist/2022-12-27/cargo-beta-x86_64-unknown-linux-gnu.tar.xz": "1ca64be7777194c3191350723e8a909cce93d8ac28ceafb5df641f3066c6a8b9", - "dist/2022-12-27/cargo-beta-x86_64-unknown-linux-musl.tar.gz": "9c24ff865929e88db27285fcb4a10adf97289a388f93ff5fa421211f35267047", - "dist/2022-12-27/cargo-beta-x86_64-unknown-linux-musl.tar.xz": "b794e0397ca0ec274e307468ed56b8116438c0b8a444f593eb56350d687e8137", - "dist/2022-12-27/cargo-beta-x86_64-unknown-netbsd.tar.gz": "0fc5f8716933c46509cc05492e5bf75f6d06575dd6f803882397929b95394e12", - "dist/2022-12-27/cargo-beta-x86_64-unknown-netbsd.tar.xz": "0cfe7415cb4c0a96019eefe0363c1d61934d76f3b5fb72a113b9de1401ecfad9", - "dist/2022-12-27/rust-std-beta-aarch64-apple-darwin.tar.gz": "777b016bebe68ea79bfb336eedb595174466bfd54321523b9913f5c2741d0135", - "dist/2022-12-27/rust-std-beta-aarch64-apple-darwin.tar.xz": "c4ab94494052bf3fb37a226e1313886546bde1ec4d7188049cb95dbf2963e1fa", - "dist/2022-12-27/rust-std-beta-aarch64-apple-ios-sim.tar.gz": "884004f47fea38414ed805abda4afce3adf5a83fcd072ddececfa888e55bdef4", - "dist/2022-12-27/rust-std-beta-aarch64-apple-ios-sim.tar.xz": "db0858bd63fa8609ceb6ee42cbddc31f31b2a0ce0c02e1fe1c2d32f0c8d607c6", - "dist/2022-12-27/rust-std-beta-aarch64-apple-ios.tar.gz": "996c8612a39bddb3047ce0f23f761deeca61d15b36f2ea270f5a220d14c1ed27", - "dist/2022-12-27/rust-std-beta-aarch64-apple-ios.tar.xz": "c06360094800d069261d363b709ca552d3899d50c12d39c23eb58d75015c980a", - "dist/2022-12-27/rust-std-beta-aarch64-fuchsia.tar.gz": "891f1909fcc78019f77d704c3b3b1031c605dee01a116f04e7f4f402d6b9b2af", - "dist/2022-12-27/rust-std-beta-aarch64-fuchsia.tar.xz": "3033d409735b299b6754852c28c1dac378a94ad892144ed76199d542a265c8a7", - "dist/2022-12-27/rust-std-beta-aarch64-linux-android.tar.gz": "080c97ad158327dfdd24a3c17477614de1dfe27f1236c73ed43b1e7e881f6b06", - "dist/2022-12-27/rust-std-beta-aarch64-linux-android.tar.xz": "80b89416148f4ed917978686ba337ebdbb3d4a50903a792831fa3b83032c43cb", - "dist/2022-12-27/rust-std-beta-aarch64-pc-windows-msvc.tar.gz": "854badcf35650c196b2051be46254d2f4e86b4522dbfa9f1d1a64148cae7bf1e", - "dist/2022-12-27/rust-std-beta-aarch64-pc-windows-msvc.tar.xz": "e4ccf358da4cb13b281c999318816fc99948a3531e9ecd6d0abad9b819c117be", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz": "9473f12fc35106ab9144b38bddc3c35d56b0413bec06c2d1d5f43d4fde614331", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz": "5cb44be7d8adc0589afca90ef0669c42f03a61a622d856fb057d450554d24c01", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-linux-musl.tar.gz": "25ebf045fc59488abc07ed24aa3364fb64cc186f6c852b12cb5c094f81d5fd69", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-linux-musl.tar.xz": "d43bca65f55159d6eafb7e342ec5d4598d63bc8fad0c9fc15b6bd88743321d4e", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz": "91198741990d9300024da5113843cbeff02ed9ea344d9feb57736e9334136d27", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz": "0aee6204d34246480be1d0f6efd6a66eb10d83a9dd1c215433e840949687c598", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-none.tar.gz": "97f3193bfde82b997346b49231a0f24a6960da88773bf27c73f57f40ec4f84e6", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-none.tar.xz": "1d2122442cc0a6595c901831e8cbaaeafd2043fbc8c4b028265310d2086673cb", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-uefi.tar.gz": "6d351f35cb9252c2825311eb22049283534cc2877cfd673fc1b5b3c94c6ef864", - "dist/2022-12-27/rust-std-beta-aarch64-unknown-uefi.tar.xz": "054bb5a98df25830201ab04e81f63630dc329f48daa0d715a3443f95d2c0f442", - "dist/2022-12-27/rust-std-beta-arm-linux-androideabi.tar.gz": "93b70e7c6b686ed5695bcf2f0b2da14e89a50e54304d445ebfc35107f689c442", - "dist/2022-12-27/rust-std-beta-arm-linux-androideabi.tar.xz": "9b8983be6089216428007e968844f57bd88e2371dd592b1ca06aed2aa6479d8c", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz": "753ef462dd47349fee5f45adadc073363250fbcbf566ff337250466d0ce73343", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz": "c19389db997fd0e158e5a5e847f566f6b03f06b3161ce5644ca0178fae25d0f5", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz": "c819d6a3de743f54e28eab0f2c7744dd5a5be7c6677bb712bfd3f93938435194", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz": "4ca09f9df5476449c3510c82e284026329411253e2a02c90e6239f30a9a6074a", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-musleabi.tar.gz": "f7994d565baee0fbdb010211fcd30398f7f90bd97770ce72e5ba34bf1f06a466", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-musleabi.tar.xz": "f54e1efdb9a088a13371e5fd7e1599a7bcadc5db4247e8811ab9d374c17fac8a", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz": "add3333e892ccfc31b8fa506e79d5633261daf13e7902549ac5ecfe8f3655bbd", - "dist/2022-12-27/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz": "bfa9a7cb0de16ecef093d593677e32164e4e68042806f543824c16f2a12b55ae", - "dist/2022-12-27/rust-std-beta-armebv7r-none-eabi.tar.gz": "81c958b4ba5933c02cb2872efc4d5de86a2bc1a1d326bf563256ec74e256fd8f", - "dist/2022-12-27/rust-std-beta-armebv7r-none-eabi.tar.xz": "634d2e35b2314826198eb2a7fd6f253cac5c2bbe7a5a7c7cdecc09949db23b3a", - "dist/2022-12-27/rust-std-beta-armebv7r-none-eabihf.tar.gz": "62dd020647cfa88c6719b4b9a803d07f3ccae7c2f94c924e1529def264db1be8", - "dist/2022-12-27/rust-std-beta-armebv7r-none-eabihf.tar.xz": "53a03694b610146cb80e0ef0033600ea4dd6f8b7d413c3ac675cb57c9b4c5cde", - "dist/2022-12-27/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz": "ac7c396d35406501eda50191b92abab74e19148ec6caa2d5171bba35f2d3ec96", - "dist/2022-12-27/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz": "058c514636a2063193d278e16fc683dbe9c1dadcbca45707152d150dba71065a", - "dist/2022-12-27/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz": "bc5400e734bc4747b3ea44bb5c3cf9af5f11d5b5f2e970bd4626a25a276f15f7", - "dist/2022-12-27/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz": "0079d1cb3d1fd5be99bed480e6ec0b451dd9e2a2299e3347cbee33344cd8c718", - "dist/2022-12-27/rust-std-beta-armv7-linux-androideabi.tar.gz": "9dbc9e97f9990f03efe67c817c9dda7fcdc931c7605742182f4d128859c1a53f", - "dist/2022-12-27/rust-std-beta-armv7-linux-androideabi.tar.xz": "d0119bed6cb41629aa65d83f7c1021e05e2f90bd21a28e6f0d3b6f0ea9127dd4", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz": "09cab74e4a6e38d07622fd80e97d424d7437d554c05ce1896acaaddad0e3b637", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz": "4602ca768e8ba85cfc5a4d4a2964cccd048ad82f349b7453f077e38de918cb0d", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz": "b983a7699fce4c6f9c7f16ea3fd2905a8ddf21623bae71a9e7515b5cd5b288ec", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz": "ca2d6d4c09326559a1528cf32c7a899f985c7e3b7751cec8911d0facac149e51", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz": "dfa375f608f297f4dd0fc39921609ecebb31101850d73a8bb8b67ce98e319f3d", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz": "3159afaebb2b17f6b12128e2829944f9406e26cc7019eb33839fda311ea0b809", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz": "5a2c2361c944d85455b7a037bc820fbfe824180106f5a6d6fbf4066ef78236a3", - "dist/2022-12-27/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz": "0bd7ac1cada0a3a3894d404ad5871ef3abc4963eeb5a1f05f59e6264b1e6cc3c", - "dist/2022-12-27/rust-std-beta-armv7a-none-eabi.tar.gz": "1f9daa0af4695c51e4cda38235497923b9adfefd1a6eb4be086d720cffab7594", - "dist/2022-12-27/rust-std-beta-armv7a-none-eabi.tar.xz": "b9e5b75720d71bc9e0e16b73b7cf04cd3e5a57da7a6b842926ffcf273308543b", - "dist/2022-12-27/rust-std-beta-armv7r-none-eabi.tar.gz": "4837b13f144f12e9edb5b49ddf5169d1cd13cff0a3ec3e54160714d45138448e", - "dist/2022-12-27/rust-std-beta-armv7r-none-eabi.tar.xz": "32a56e92757a9ee82ff71962c7c8144e4240133d44de77d5955510640a31061b", - "dist/2022-12-27/rust-std-beta-armv7r-none-eabihf.tar.gz": "d31ed0250a195a8043e71c8ae3b2e86111ec07b00892ae05c3783761b20774ee", - "dist/2022-12-27/rust-std-beta-armv7r-none-eabihf.tar.xz": "06b70c26d9161b17c2e4ca9255ae1a73f7bbeadb24d733c320875e3dbbc77caf", - "dist/2022-12-27/rust-std-beta-asmjs-unknown-emscripten.tar.gz": "6271afcf4b05fb4de2ed08ba441b3ee0b476e2e33dbda8a5efa3d7540475bca5", - "dist/2022-12-27/rust-std-beta-asmjs-unknown-emscripten.tar.xz": "131c51bb571df676dbafd84d5015888c4bc15130bd7300d4c53c1667907f7f51", - "dist/2022-12-27/rust-std-beta-i586-pc-windows-msvc.tar.gz": "d6bca2e8ba737a4704dc01dd6fca58a7c8dc8a065107f9fa98588c5fbdfe39a3", - "dist/2022-12-27/rust-std-beta-i586-pc-windows-msvc.tar.xz": "d64aa029d4209256e18d7bed6e0e28156a965b1d50cb3eb8d70abab57be55a97", - "dist/2022-12-27/rust-std-beta-i586-unknown-linux-gnu.tar.gz": "f48248f5fedc961ea4050254cf9bdbbe70420ebdaf712847a5374a3c97e21df3", - "dist/2022-12-27/rust-std-beta-i586-unknown-linux-gnu.tar.xz": "c9287bc9be332f084a2779803964ae374930d3bec787155ac3c8d1d6be6a587d", - "dist/2022-12-27/rust-std-beta-i586-unknown-linux-musl.tar.gz": "1914ba0edb77b0bc7cd83dd93d8a6ca53b29800844cdec9a976342982aad8b27", - "dist/2022-12-27/rust-std-beta-i586-unknown-linux-musl.tar.xz": "30d5d1bf54eb6758e0bd3a3f48f186a957fdb1310ba8b3625b5f33994c8a58fb", - "dist/2022-12-27/rust-std-beta-i686-linux-android.tar.gz": "6c05a59ff653bcde6a71dfcbd38718ca3cfeb89b7ec09d1cd380fdb589941d27", - "dist/2022-12-27/rust-std-beta-i686-linux-android.tar.xz": "80b6b57ff73a9483046380c0d4cfc8c090fca5fc4174d5c47f71fffccb7178a6", - "dist/2022-12-27/rust-std-beta-i686-pc-windows-gnu.tar.gz": "941bb6f5107630a0b26b8749be29c6df920ccb467df367a5f55491b062352f4a", - "dist/2022-12-27/rust-std-beta-i686-pc-windows-gnu.tar.xz": "f3f2ece3bb0080980e099c176a8a1366171741450fa8b8e515362572b519e19f", - "dist/2022-12-27/rust-std-beta-i686-pc-windows-msvc.tar.gz": "a94fcee79bd5941e718a112d855163563f6e5377b59a9c1405ac8804131b0383", - "dist/2022-12-27/rust-std-beta-i686-pc-windows-msvc.tar.xz": "4bea862e2d998e976526cb741b7d674a7d620fc7e4838955ef4c53d000cf24aa", - "dist/2022-12-27/rust-std-beta-i686-unknown-freebsd.tar.gz": "e5cc60f1c00d966809cd76fd452bbb03452c5cc94a487ef4ad14af12608ae5fa", - "dist/2022-12-27/rust-std-beta-i686-unknown-freebsd.tar.xz": "df8df7d1750cf9e92b3e4b57b83b195c1eea6ca62f38ad317882a69e2e813ba9", - "dist/2022-12-27/rust-std-beta-i686-unknown-linux-gnu.tar.gz": "4ff8fc04b63f7a80587d4f75376c74ade7721369ad1508faf5c0f83930e1cf7a", - "dist/2022-12-27/rust-std-beta-i686-unknown-linux-gnu.tar.xz": "4716141a8be8017adb8540c05f88e6463b2add95439320b0084ffb290bc0d943", - "dist/2022-12-27/rust-std-beta-i686-unknown-linux-musl.tar.gz": "d7cff128c80db94aaaa2bb708bafa3f857fe8b819ff21a85f7c6c7c5170576be", - "dist/2022-12-27/rust-std-beta-i686-unknown-linux-musl.tar.xz": "bc83b17627e87ee4b555e9cc5912dbfbba74586f46719994be6832e22f70424b", - "dist/2022-12-27/rust-std-beta-i686-unknown-uefi.tar.gz": "ec6723c138565c4d9ca87bcda199aceb7b3a42ddf979658cf9e8433a4dae9c70", - "dist/2022-12-27/rust-std-beta-i686-unknown-uefi.tar.xz": "0e67f10a29f2826399604839a4dcbd173f8de39a755283a0c245c54b8a658210", - "dist/2022-12-27/rust-std-beta-mips-unknown-linux-gnu.tar.gz": "a78f899f6fae1671e41aa7d76b37d9041cc32dfa6e9315dabff3afe21f93700b", - "dist/2022-12-27/rust-std-beta-mips-unknown-linux-gnu.tar.xz": "4c74cece45b9271c77c4b328d1b3d876b50429077074580d771fc2b03f0d4738", - "dist/2022-12-27/rust-std-beta-mips-unknown-linux-musl.tar.gz": "a854fbab503a0541d593cf9496a4e4cf8b9edb49422406b3a7f34e3fa21905f6", - "dist/2022-12-27/rust-std-beta-mips-unknown-linux-musl.tar.xz": "f42a81564e7366d5d630632af3113b99c5de6d147d7eb9e31da762bb9d35d4ea", - "dist/2022-12-27/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.gz": "de070d1ae3fb8a825092a9a78c26db553839c6d862e451a497d5f94230414bc5", - "dist/2022-12-27/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.xz": "0a7092c99c587ef69801af713ef834bae809e4868dfcff43babd44bec532717e", - "dist/2022-12-27/rust-std-beta-mips64-unknown-linux-muslabi64.tar.gz": "7077c20142082b0e2b8d6299ffcd8739c8295d315b917563cffe6d42e129cd08", - "dist/2022-12-27/rust-std-beta-mips64-unknown-linux-muslabi64.tar.xz": "86f0988f3baf0b5bbed81483e7d68004651f227ab22d1d36b34c73f132191dfb", - "dist/2022-12-27/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "536fe3059a8095bcc1c44391c27b7d9832d6a057388b4de089915810cbe1baae", - "dist/2022-12-27/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "6b4e397a3a175f4cbbddabb750df14d668c1f4c8520577d35fbcb9dfa8613097", - "dist/2022-12-27/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.gz": "30f42499ab4f21caf21551e0e92bb5db9a2e0f42fd0b3e59ee9789dd40d10391", - "dist/2022-12-27/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.xz": "1190cfa1023a8d35d202979a1070863bb713495c2c9b720d0371b6d70d23bd7c", - "dist/2022-12-27/rust-std-beta-mipsel-unknown-linux-gnu.tar.gz": "4ac79a395ba5d70e1a09d0e1ce232b9405b9995f7c459d176be52eade40bbab7", - "dist/2022-12-27/rust-std-beta-mipsel-unknown-linux-gnu.tar.xz": "42f3666885680cbb2d15ec85cfbc9103e5b170346a9b8cff63a2d15f78472c67", - "dist/2022-12-27/rust-std-beta-mipsel-unknown-linux-musl.tar.gz": "0b1c979205f8476ad6f0e35c05acb1976cb4c44006c25931e73c35025939f1ff", - "dist/2022-12-27/rust-std-beta-mipsel-unknown-linux-musl.tar.xz": "7b6c76ae46ca56746b0bdea404125256636f05c1354e5dcf32c2a487d25e0ee1", - "dist/2022-12-27/rust-std-beta-nvptx64-nvidia-cuda.tar.gz": "ad9cb2ec325e2a2f14ac4db6a5df53a7c06adfe8c4c58f0f2c83748a34d0c550", - "dist/2022-12-27/rust-std-beta-nvptx64-nvidia-cuda.tar.xz": "1d507bb0cd8c80ee4e9155a0740c2319027ee5280552c1056ee7921a82bb9aa7", - "dist/2022-12-27/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz": "e8d3b7bb483d7b3b737840ddf7a27a28c216d9d0b3ffc7ccded547f76bc932c5", - "dist/2022-12-27/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz": "130edffa27b82def2876fb5562fc7a3971d33855e3ce023e18507b3e1bd47d10", - "dist/2022-12-27/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz": "b5659dcc18fb0e5849acb13df7153518c8df5ca9566852cabaeee33583321d1f", - "dist/2022-12-27/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz": "6bdfae3e9cf07608c862f4c042c47ed318c388bfcfb4cabfa233580b90c7a459", - "dist/2022-12-27/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz": "f28795f8c2823bd817df63486d8a11b6b7cfb9538110e87d8d008ed979a81a3c", - "dist/2022-12-27/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz": "695f6acb6ddb4c4a87515646157b88d2f58e2114b100f22bedcd4e2fa8de00b8", - "dist/2022-12-27/rust-std-beta-riscv32i-unknown-none-elf.tar.gz": "5f004e4b265efae872e8b0d8fda81f4e65cc50452d558ef90b9bef7639f6ba6d", - "dist/2022-12-27/rust-std-beta-riscv32i-unknown-none-elf.tar.xz": "c93c1cb534e83d43c40c62ed6623559e3e380f177c4bd151a0d1389a80a58139", - "dist/2022-12-27/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz": "79988bb7bfa27dcacae0c459143be6a34f328ec6bcb73c2267d41a6f022fc045", - "dist/2022-12-27/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz": "11235a96e7e8e14a173db0be71cd1ce7955c79f5a7d20b7436238256a06342fd", - "dist/2022-12-27/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz": "a315accc791f1247e92a6362eb7bd6ab899c4688db7decb36b8d892c200186b1", - "dist/2022-12-27/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz": "a4f6ac1d21ecda00c9d3e34d900771a4c5a50e3e5071d2eba837c9e4738edc80", - "dist/2022-12-27/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz": "06dd8941f63c3031fa0383dd34981c655b26fd10d5510cd06bdcabb4a592a435", - "dist/2022-12-27/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz": "882e464b44acb7e286f49d45a4f5a41fbf570ee0d78f1915fd6f94ac392fa928", - "dist/2022-12-27/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz": "734d6f54d143ddddc2141da72ee02a32d4d505e20eaf0041c86c89f8ad8730ea", - "dist/2022-12-27/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz": "be32ca1ddb2d48877c70c9a128dba02bfdca7a00e93c114c3c99127e7be04adf", - "dist/2022-12-27/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz": "a6c70d3715b7e50ff15f5473348d8e1c5a061036055a85784b5e84a99e4008ee", - "dist/2022-12-27/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz": "0dbbf637d310f7ef44cb1bc08122c172606c8ff1c886195eebbd52cad5789597", - "dist/2022-12-27/rust-std-beta-s390x-unknown-linux-gnu.tar.gz": "3e2f7751028f9123d94ff72b08f8ce0b40da36eada77e1414d4178756b46313a", - "dist/2022-12-27/rust-std-beta-s390x-unknown-linux-gnu.tar.xz": "382a35c79a03f7abebb9c5788f9dd19bd0973cb89e9b07a971eaafc611c3645a", - "dist/2022-12-27/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz": "3eb49f766b206966433eecc7cdbbf709e75991644eae6f44596e5ec893fb3e8b", - "dist/2022-12-27/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz": "9162e50f2ddb12fefecdc7c4c2d60e76874e78fd89b45d7fd81a6c95a856ee28", - "dist/2022-12-27/rust-std-beta-sparcv9-sun-solaris.tar.gz": "dbf20b8fd52e1b6a553369a1690344574e6c660996ddd5121d4a05bfb71c87aa", - "dist/2022-12-27/rust-std-beta-sparcv9-sun-solaris.tar.xz": "a40d8d444e57eabeecf8acf0b59f24b5d4e2c97ee538bfe38904a1f81a48fb14", - "dist/2022-12-27/rust-std-beta-thumbv6m-none-eabi.tar.gz": "1e63244aa865e6a115e603f238b64410606453fb38802b1684fa6397660a1501", - "dist/2022-12-27/rust-std-beta-thumbv6m-none-eabi.tar.xz": "ecd94de3f4a3aff8f9f920ff68383e342dc293ad2fb2584c9d9e48bf60eb82d5", - "dist/2022-12-27/rust-std-beta-thumbv7em-none-eabi.tar.gz": "ad21ab2584999c7c528dcde2e435d0ee73686b9b94c4f31dfeb3abf3cf9b9821", - "dist/2022-12-27/rust-std-beta-thumbv7em-none-eabi.tar.xz": "9394854e14bc3e671060630c01b6977ab5afcf9022790986c492fe58f0509191", - "dist/2022-12-27/rust-std-beta-thumbv7em-none-eabihf.tar.gz": "1cbabb457c0546da725a548a88b3268bb0feca4269af2b9cd0b98455c2e0c468", - "dist/2022-12-27/rust-std-beta-thumbv7em-none-eabihf.tar.xz": "1bb23d8d2783554e2043ed71cf982d9750bafa3ccac6e387b25d279137042867", - "dist/2022-12-27/rust-std-beta-thumbv7m-none-eabi.tar.gz": "076a918e524cc33a02ab2c94e3a607dd293d5d6d63e0797b16f2246057d1082c", - "dist/2022-12-27/rust-std-beta-thumbv7m-none-eabi.tar.xz": "de8f3e8907fde91bfcbff0c353eb3d1cb9d06dec31142479ef1ad2c6c368d5c6", - "dist/2022-12-27/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz": "658d66031594324821649058e16e3e0b06542e8c9dd17c5fe705c487b5915ffe", - "dist/2022-12-27/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz": "56a9a0235c0aacf561cfc9e7981c57a4d174dbedf5ed943d266302662246b10e", - "dist/2022-12-27/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "3318c23ea42624e26cf2a25dd5fae206ccb96137d6833f28d7bfebe3ba7e327c", - "dist/2022-12-27/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "b91396e82a9c30711608c3650d637a3ad56ea90d682460c791210f8bfb5a6854", - "dist/2022-12-27/rust-std-beta-thumbv8m.base-none-eabi.tar.gz": "55b45e9863e197262bd97a9bcb80991c9c34385acaa228b062546b690621b530", - "dist/2022-12-27/rust-std-beta-thumbv8m.base-none-eabi.tar.xz": "dc0b7ed56a142475759164713bcdd7c64958c7e7febcafa5371414082ae495b2", - "dist/2022-12-27/rust-std-beta-thumbv8m.main-none-eabi.tar.gz": "b2bed92d03b295035e4bc4e0fd63b44ee1cc634edb394cfbd7afdc00353a73e9", - "dist/2022-12-27/rust-std-beta-thumbv8m.main-none-eabi.tar.xz": "bcce53fd7c0c494ea1c45227190a959e992f07851dd064b2a9c599fafb07077c", - "dist/2022-12-27/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz": "d6df9026c218b906671e89e433b165552a9486e41399a8f01a12d10495afc8dc", - "dist/2022-12-27/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz": "f5f2411e3ff94f6e524a14ee46e6e6bc2e9ec91e395b0382f7a40bc6e970d623", - "dist/2022-12-27/rust-std-beta-wasm32-unknown-emscripten.tar.gz": "c766ec36907ce0a7e76ba9a227fdd57eae7a744bc5679b67a6ce1d6ab41ea19f", - "dist/2022-12-27/rust-std-beta-wasm32-unknown-emscripten.tar.xz": "de5f398bc34fb22489e9f6f2a9847954d8231ff5732f2595e8be93eaf7849986", - "dist/2022-12-27/rust-std-beta-wasm32-unknown-unknown.tar.gz": "e3ed4bc39da4731443b3bbd584106444aceaf91720546ac66e98712fe65dfa93", - "dist/2022-12-27/rust-std-beta-wasm32-unknown-unknown.tar.xz": "704a65e4f3e1afea9d1bd6a60c4d3e5fd57e3e14ba0dd2e2b94305c3e1c92cb8", - "dist/2022-12-27/rust-std-beta-wasm32-wasi.tar.gz": "03e2ca41c758fb4f9a2ea562ac4ed7186e27607458bdd7b575d786368336ea11", - "dist/2022-12-27/rust-std-beta-wasm32-wasi.tar.xz": "1ebc2ac44181d6d26928cbd550c64c5b496008e97356c68497f15f8cc8351f37", - "dist/2022-12-27/rust-std-beta-x86_64-apple-darwin.tar.gz": "0f0520f7163ef3d659e5761b2f0c7a9f2de00b2f769eeec8d1e7e9b3b08daf6d", - "dist/2022-12-27/rust-std-beta-x86_64-apple-darwin.tar.xz": "25795f1876330666b7fd6dd724661b364643448d0688d479f492c02faf2f7a4a", - "dist/2022-12-27/rust-std-beta-x86_64-apple-ios.tar.gz": "014a022bbb524d8c550d5dc7d678b9764adcc9962538980e9596ebced9c5614d", - "dist/2022-12-27/rust-std-beta-x86_64-apple-ios.tar.xz": "9b38e214e203c959eba0e8d651410f6cafc9e4b5725228c2bb4ac8f562e6cfa7", - "dist/2022-12-27/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz": "afd9236304892945334183b31072b9b9f9b4faef8b7cdc4ad1f45a9b3e080a58", - "dist/2022-12-27/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz": "33a7e5fd18f2166fb2b6cbe7630d80915533d59afc0080f1370bcfad1114eaa1", - "dist/2022-12-27/rust-std-beta-x86_64-fuchsia.tar.gz": "7e91e1298da3676c4c051d7f34eec21f2fffa0a34af212c785b79c2d1048fe92", - "dist/2022-12-27/rust-std-beta-x86_64-fuchsia.tar.xz": "fff70ed752d0760990f7a90bc3c50ac6586e8b012e61a15b6dfb325dd081b9a9", - "dist/2022-12-27/rust-std-beta-x86_64-linux-android.tar.gz": "f9183794392422fbe8cfd61ea7bae0dadd8731e82b1d15a59f4e93acccd2048f", - "dist/2022-12-27/rust-std-beta-x86_64-linux-android.tar.xz": "4fce2ab0dacac153de7d9805786b17d517863b0ff04a8224540daee86eff4056", - "dist/2022-12-27/rust-std-beta-x86_64-pc-solaris.tar.gz": "d5b64111b3763063c38ae63915ca366a4fdb63f0dcf8121588a8953f01ebc669", - "dist/2022-12-27/rust-std-beta-x86_64-pc-solaris.tar.xz": "c396b086773dc06db2e59bcdaff8ffbb7069efee5841b9e3cdd4dfb05fd95ce4", - "dist/2022-12-27/rust-std-beta-x86_64-pc-windows-gnu.tar.gz": "e851812f69bcb2fe606bfbda125fa6b3f55752fd1a2330878c48ca99eedbb8b6", - "dist/2022-12-27/rust-std-beta-x86_64-pc-windows-gnu.tar.xz": "689738a0952a0eab27ba3d3f9bc9b531ec29f338ea373bfa783a83786d5c2885", - "dist/2022-12-27/rust-std-beta-x86_64-pc-windows-msvc.tar.gz": "b51f78199bfc1417f020e2d0dd16044f63f6b6675b2b6856f669f8604e44a6bf", - "dist/2022-12-27/rust-std-beta-x86_64-pc-windows-msvc.tar.xz": "7713269f3c51717f6231cf4100043eca2330512b602c2962da81af561e90193b", - "dist/2022-12-27/rust-std-beta-x86_64-sun-solaris.tar.gz": "9f0a129f4c2ea324e2dc94fad3f7acbc7bf2b988f66d9c42dd8abbc60c569acf", - "dist/2022-12-27/rust-std-beta-x86_64-sun-solaris.tar.xz": "6ca71851fd0a7879aa750a63deb4ee587f82c28b27486f716e4fae5ebe599086", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-freebsd.tar.gz": "6cfbf0f85757854fba1551c3312baac820e398b573d50b005cc3958723db7c82", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-freebsd.tar.xz": "2e2dfb82fa7e23f888ae9541a30d15ba978cb29bbdfec6afb00590a39c16df5d", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-illumos.tar.gz": "92650856a7e74c8b912d5c84cd1002a490f9c8e3fa4506733fcbedb3cd42792b", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-illumos.tar.xz": "3dd302996bd3fb9f8b077e6d5fe3dc6f7dd9590d5fc3eb3bab2cffaada4e99d3", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz": "3a1faf905ffc7263e725ce7571cb84dd8698adbc45b6902da86350299b2e3ccb", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz": "daef635cdf88c8d9c924c0d66e2b26db1f56bda9b48ca0c21e089060b07dc997", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz": "567bb99f67737cca721d1dc6975daefd3dad29b13d531d3b939405ef4e7aee84", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz": "aa218c4547e77f33ba4bc45bba0b6fcf3cce9355c2cf11d74a3a4c5e49f9b3cd", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-musl.tar.gz": "de43b04cccb3c2bdcd2a7993c391299a4bde5041102ce0eb5e32b6cfae86cd79", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-linux-musl.tar.xz": "f99963704b4c3189361925ec8b53daa2ca15ae4af9215cbd87cfec23e044cefa", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-netbsd.tar.gz": "3d4949e63f137552e3b74e50b366f95d7a153e7c61cf5587634be51516fdc610", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-netbsd.tar.xz": "5b48095a35f862190536e64eff726327e25c23981c0bc1224c8c44bfccbb705d", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-none.tar.gz": "12b5c69138260daf976e963ba503c66ec4432f11cf7506bc9ba691ac2c1df4a1", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-none.tar.xz": "5c334a67f6586dc406b6e55c7f9d64b7701e1c7879bf5860b378069301c57854", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-redox.tar.gz": "58c15f9119e5f78d7c70b24e67af57ce10bb2d2cb1347b9b4631478665c624de", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-redox.tar.xz": "a2f8b635254d53ec5b902dbeb8ac63c6c3982f94dfbcaec3d093f17f0f5fa896", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-uefi.tar.gz": "1ce5c25480e97699b12c180ed6198766a0c12a3543dd317ba6f4a52538027b0d", - "dist/2022-12-27/rust-std-beta-x86_64-unknown-uefi.tar.xz": "e4d9ffe34ba40e5ccf87007085dc4daa20a8a52944f092e2a075527702b55072", - "dist/2022-12-27/rustc-beta-aarch64-apple-darwin.tar.gz": "f5c8dadb8eb0335a50326a94f858625e4f01e3159e933d58f9d24338d47943be", - "dist/2022-12-27/rustc-beta-aarch64-apple-darwin.tar.xz": "0a6eeb32e4d85b628044c3e075e5f1414a42bb582905b199d360addae466d3ae", - "dist/2022-12-27/rustc-beta-aarch64-pc-windows-msvc.tar.gz": "0f7ce917f14a1d42637fbbbc343473596becceb22634cb7c7cdee6beaa2b9ca1", - "dist/2022-12-27/rustc-beta-aarch64-pc-windows-msvc.tar.xz": "49667bd902fb5fb2855e843ca5c1dcd453171f164a3dee2dcd9e09b0d9e1e57e", - "dist/2022-12-27/rustc-beta-aarch64-unknown-linux-gnu.tar.gz": "d5a03695685afff4debff8e09f2d91db02d2ac29981a9ec230619c3e388ce1c9", - "dist/2022-12-27/rustc-beta-aarch64-unknown-linux-gnu.tar.xz": "db1aeb772a08f111d8f024164b570322f45ecab0f6db4e931b91971b2b982323", - "dist/2022-12-27/rustc-beta-aarch64-unknown-linux-musl.tar.gz": "0e51f97b677b5c813862bba3e5a3b0884f0ecdf9b7c3676089625431a3d0cb2c", - "dist/2022-12-27/rustc-beta-aarch64-unknown-linux-musl.tar.xz": "f88c6c33ac3682f340ed60b4f62ee8ed61eb21069a1f0a912024d19e41c0d5c7", - "dist/2022-12-27/rustc-beta-arm-unknown-linux-gnueabi.tar.gz": "25abe3158ec3ab7c064341247d78ea265ad7e0dc2063837fb5cf0a3bea9d011e", - "dist/2022-12-27/rustc-beta-arm-unknown-linux-gnueabi.tar.xz": "1d430b8e35ebd63a79b34917edacebb76b2fa8f1cea4772ba2c4ef0340485fb3", - "dist/2022-12-27/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz": "1858d5ed21a3132af4b56c841cbabc9fb834d501946956a0e9aeeddfa095344f", - "dist/2022-12-27/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz": "17cc52dbd6ccbed4677ad52fa666ea10295c11209528e78ac190f01b5d509f87", - "dist/2022-12-27/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz": "3440edd99025f24f2640528d2d1c10047c834b93cb09a935c65ecfb72012e7d0", - "dist/2022-12-27/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz": "7e1ff0a950db0ecbadef3a9ee55a593891f11a42c6c0ff59637074c8b5c4da74", - "dist/2022-12-27/rustc-beta-i686-pc-windows-gnu.tar.gz": "90487ff490c4e71ae62e28492cf49600f8f92e0f35f5d76a50eafcf4bbcf4bcb", - "dist/2022-12-27/rustc-beta-i686-pc-windows-gnu.tar.xz": "8b44fb934aba0eef296098bfc5a9f2994cdd595420ce10f4f310c5ee9d481071", - "dist/2022-12-27/rustc-beta-i686-pc-windows-msvc.tar.gz": "0fefda6b62234a43976ebf18d7cd62057cad5b494c750f2d9730f5df64cadb00", - "dist/2022-12-27/rustc-beta-i686-pc-windows-msvc.tar.xz": "c9eecbc06e7456bf5e383557a8e5720d00d09de640b8c46139121faadc354d74", - "dist/2022-12-27/rustc-beta-i686-unknown-linux-gnu.tar.gz": "8b17d032192aa17e52a3f08a074079561ad7ad6c439f9274aef228af93adacc3", - "dist/2022-12-27/rustc-beta-i686-unknown-linux-gnu.tar.xz": "c70638cad594097450a469837411b110e979c303727341623427e3c9e4e4f507", - "dist/2022-12-27/rustc-beta-mips-unknown-linux-gnu.tar.gz": "3669ff9024092ab467a1b95aec2cb1692810ee716739f31e3aee7d89e6bd6d7f", - "dist/2022-12-27/rustc-beta-mips-unknown-linux-gnu.tar.xz": "165859e42492e33bff634c80b6c96b13fd2252981b4be2821b96a6593933e22a", - "dist/2022-12-27/rustc-beta-mips64-unknown-linux-gnuabi64.tar.gz": "2ac418c0cdeb2382aea7296169d747f65349d7e6d5aebbdde7b377e985de354e", - "dist/2022-12-27/rustc-beta-mips64-unknown-linux-gnuabi64.tar.xz": "21ae51357508398527b6edd2e5fbb1745fda1c8db2683c40847216c0ce251d47", - "dist/2022-12-27/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "3eb68935676424aa8c68bc32b06c010c5c1302fa6f77e9b33e5543565562d176", - "dist/2022-12-27/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "0eeb58035b510a166b8506168f67850993e278888986773c779bee24d7a6ec11", - "dist/2022-12-27/rustc-beta-mipsel-unknown-linux-gnu.tar.gz": "f41d878b2e49beb9ee3a1bb8863ce1b81fae7100a786a78d9922bf8a4fd0dfc8", - "dist/2022-12-27/rustc-beta-mipsel-unknown-linux-gnu.tar.xz": "e0cd18973c7651cd2e1e041f92900375a045bef62754d432df539000aa5946c4", - "dist/2022-12-27/rustc-beta-powerpc-unknown-linux-gnu.tar.gz": "7206be82ba39971c6a734f4a89f7f750d581768d82253e31cd985fecd1d17c3e", - "dist/2022-12-27/rustc-beta-powerpc-unknown-linux-gnu.tar.xz": "f9ec2a3e98a3b94b170237386256c763d62925b430d0e12a289982c7c79d2bfc", - "dist/2022-12-27/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz": "32be7fe5f359cb2312c9bd966eb43b143b336b4acbdf118bf09221574f157b16", - "dist/2022-12-27/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz": "a8163a5b527b1ee932e06589d690c17d8848dbfa8504de6984a718579698abb2", - "dist/2022-12-27/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz": "3e875cb943dd0ffff907f6a582a64f923cb84a07ddd8b5e6f1ec2e1d4228342f", - "dist/2022-12-27/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz": "22537364de01be77a2a5d79486b1090dbee7b3273fc634073031f82576a61a14", - "dist/2022-12-27/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz": "230041ec7d0d4debc841abafe2f3314de51793d281a1077835d9190286a558f7", - "dist/2022-12-27/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz": "2dafdb1a97469737123149608476c248a77ccebeb22834b6a2166fc30551a7ce", - "dist/2022-12-27/rustc-beta-s390x-unknown-linux-gnu.tar.gz": "0bd96121550321138dad9f74f331eaefd77ab388843e5561c5c0cb32e9d80072", - "dist/2022-12-27/rustc-beta-s390x-unknown-linux-gnu.tar.xz": "ecb02c8535c1518e589eefb10be17830010c40be61f3184576abe93e098d793d", - "dist/2022-12-27/rustc-beta-x86_64-apple-darwin.tar.gz": "600b83ea5c832dc6ad9746d74b7dbc8ea566adb9208c4260b183ef05078d2bff", - "dist/2022-12-27/rustc-beta-x86_64-apple-darwin.tar.xz": "175930f3062b433fc0a2b959917933bf3347d3f3e0900684785493d0ee9dc6f3", - "dist/2022-12-27/rustc-beta-x86_64-pc-windows-gnu.tar.gz": "d1701678ee1d2f2e91f3c1f898f852593ec1b109e430c53c13bc2898b08bca3f", - "dist/2022-12-27/rustc-beta-x86_64-pc-windows-gnu.tar.xz": "3400e923af537d28139b9d5d780caa039828e06677cbf499322614006552778c", - "dist/2022-12-27/rustc-beta-x86_64-pc-windows-msvc.tar.gz": "d462ca50803b13e136fbfd49ac4a6e186e416041f3cdaa8b4fe72e628cc10555", - "dist/2022-12-27/rustc-beta-x86_64-pc-windows-msvc.tar.xz": "81ca0992ec8306ff67b00f5f85f31c6617f78b7350116dd56df082c477c9069d", - "dist/2022-12-27/rustc-beta-x86_64-unknown-freebsd.tar.gz": "65fe64154264ab76bb94aa7f107efa9b58cb801c9aaabcc7e6ffa0ce14319ef9", - "dist/2022-12-27/rustc-beta-x86_64-unknown-freebsd.tar.xz": "cd6e9bfb6e8c08a46dce7bc623cfdc5a04e55c8377eaa3a75fae0bfe8e00b43e", - "dist/2022-12-27/rustc-beta-x86_64-unknown-illumos.tar.gz": "a66bb4b0d9dd9a21b54857c4fa7eb48a88789f0414fec4a1e36c798546c4b71f", - "dist/2022-12-27/rustc-beta-x86_64-unknown-illumos.tar.xz": "b63e6299e961b75d9c9bcb46e1dbc22b8fec89292ee6c8758edd43f4b89cb12e", - "dist/2022-12-27/rustc-beta-x86_64-unknown-linux-gnu.tar.gz": "c768beca1350bdcbcc31c7d3f30c3ccec0ab2bea0c28bc4c89cdd32d9780cd00", - "dist/2022-12-27/rustc-beta-x86_64-unknown-linux-gnu.tar.xz": "62a675d74274ddb4d8a9146c20942cb91b86e0c94a902169c2cf77f4d471d645", - "dist/2022-12-27/rustc-beta-x86_64-unknown-linux-musl.tar.gz": "8f2b81b37bc34291f3d90bb6aec621da0ac760c39727bfd24449c288cc8cb3c3", - "dist/2022-12-27/rustc-beta-x86_64-unknown-linux-musl.tar.xz": "053c313c9a751bf0102448866fad2a80ca67b9f79afce82ce03805430e2e695b", - "dist/2022-12-27/rustc-beta-x86_64-unknown-netbsd.tar.gz": "a9f42eb0ffdc4bef87669d8fb5163e81a5d82ff6baf631f159b7bccafe9df453", - "dist/2022-12-27/rustc-beta-x86_64-unknown-netbsd.tar.xz": "d1ea529e56d57132de1782396a767f8f00f30e2b5f7c9a5fa96c3289b43e3515", - "dist/2022-12-27/rustfmt-nightly-aarch64-apple-darwin.tar.gz": "411b96fddfbcc90b4522e3f4e2d6e174f3440960e89193c97fcd5ca8afd62809", - "dist/2022-12-27/rustfmt-nightly-aarch64-apple-darwin.tar.xz": "29db6fb11b411dc8351a8a8d1b148e81d9c87f9fb234b3a18722ee470b4d36c0", - "dist/2022-12-27/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz": "32ab437117791eb7113ac522ee4119e2e43722528141302772adf9cda7306b24", - "dist/2022-12-27/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz": "4d892f3c65ef8e32670ab3c3e8fb39a2ae623c59d1ff555ec94644254e954474", - "dist/2022-12-27/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz": "8bff3a1591d25d3e1acb70600e6cd54d712772247376ac5eb90a4b2aafd21a6a", - "dist/2022-12-27/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz": "b81b094d128a37b178da1eda7c72399a9da4bd614e697c53e9c4d78589f859f5", - "dist/2022-12-27/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz": "b3a685d1abe4ac639a0a3ea187b83ec660cd838e7c5c010ed60f8620d17df906", - "dist/2022-12-27/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz": "10b7563202520708fd27cc221ee8db34b368563eb1586be1395955ebf4313d6e", - "dist/2022-12-27/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz": "34e5ca3d51b51ccd97ded5e0c31c999a84f9d5ca5ee3d010e15212a97ab40567", - "dist/2022-12-27/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz": "16638ba8478861276c10847b989fd23de942cb82a9d4da9d92858c6800a39a9e", - "dist/2022-12-27/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz": "13fa3bf29e9d20291703bf2c03bc97cd8e2081d1c747b6835eb0a06f94dd5d19", - "dist/2022-12-27/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz": "98dd01d90657e43ab3a2b91673137cd6ae4c171633db1f1e4b68b2e90bcb9bab", - "dist/2022-12-27/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "1370e4c8ad5bab425c02fc924d5ac079ac1387368a3ea5d22c1cdc2edc9c6ba0", - "dist/2022-12-27/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "8c312da4ccd992c303fa3f181dc46f9b01022f72061ef43b2fd5848736547870", - "dist/2022-12-27/rustfmt-nightly-i686-pc-windows-gnu.tar.gz": "0d7a87816f50452349bd26cefdd9f53f2d93a53243290ac59bd5de414407aa1e", - "dist/2022-12-27/rustfmt-nightly-i686-pc-windows-gnu.tar.xz": "982fc6783ad07235d375c4c8964104fdc64a009ea359cca532cc268a8249e88c", - "dist/2022-12-27/rustfmt-nightly-i686-pc-windows-msvc.tar.gz": "a5b76840e49a912a819809a2b4c73a0e750422fad4876d11b409a8ed49a77911", - "dist/2022-12-27/rustfmt-nightly-i686-pc-windows-msvc.tar.xz": "9566b6417a0bdb4c73272d167cc743b297db62f625449343a6f1ab60c52d5327", - "dist/2022-12-27/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz": "bf6cb5e886ce02a3f9b4b00a3696da0ee277af8f690f5a31119c5fce5779cd4d", - "dist/2022-12-27/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz": "7afa5129bc43346614869721e7094f65eba6681bb9b8ca8a3559925f29433f10", - "dist/2022-12-27/rustfmt-nightly-mips-unknown-linux-gnu.tar.gz": "f9805697506a0c730299492fe04c53433c8c4deb70ca245ff1c2cf5151fe306e", - "dist/2022-12-27/rustfmt-nightly-mips-unknown-linux-gnu.tar.xz": "f5d7d5a841a7e7a5d749e52cdb118d2f2cec09de68835a42748db4b3a0a79979", - "dist/2022-12-27/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.gz": "dc903c64c969a3c21664263c2a30e9cb0dc42069a95f755545ce9648240a376e", - "dist/2022-12-27/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.xz": "de6591cc73244d99b3469d88439ad442f00037a1cdcaf5fdc5a694b52e47b2fb", - "dist/2022-12-27/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.gz": "f4e8dba56a1b90d5871bf8722a5ecd2027a4f101299880a8689f5cf46df2606a", - "dist/2022-12-27/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.xz": "496c19042848726db446cd3df4c52f3e8a5527002ca5492e2d6ef72528d6887a", - "dist/2022-12-27/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.gz": "58742a5c8230e8749b01058acea639d92d45090bcec6fb7eb1d8f356b0f08631", - "dist/2022-12-27/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.xz": "bbbdaa32d8d29c407133b0ef2851970da884032effeb85c271d57e58b7d38a44", - "dist/2022-12-27/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz": "1a8a59193dc15d331c3243a2cfaf5c81c023464becc4da63201583d2d2cdc27d", - "dist/2022-12-27/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz": "ee86ae7621804a7b57ccab06dc73b7d87453b53814d482ea43dc26dd01dae1c5", - "dist/2022-12-27/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz": "21a79a050e4461305e280ed7de7c0ade2774ad5230f671c76667be7bdbdc47af", - "dist/2022-12-27/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz": "033afa47c24a4887d40d62391f9f66b76dffdc1bd8f1ad622bfb14db91d7df03", - "dist/2022-12-27/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "01cea51850a7f676803f5f8f9a556a71bfb8e7a7e04cc5fc0e7d1b706473338b", - "dist/2022-12-27/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "720bf138fb2c541d8d8d0c60d6584cff692c932c6f383901f999e7b3d4078770", - "dist/2022-12-27/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "8c3f3fd601bc7d8670f6acfcda29206fd5590fb3a2a6cbb3794ba29cf749144d", - "dist/2022-12-27/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "8f1b43479a724197c7ac051c6a6d2a10bd87c6b24fed1d38c9e93f503c87e5b6", - "dist/2022-12-27/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz": "b38b6dc1e65cc0f5031d2045a90404f3b2ce2648884db1f658641e76168d0109", - "dist/2022-12-27/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz": "ed635e2388fcd3bbe94f497404b6787edd5e7471d6c6471345386a43444f46d1", - "dist/2022-12-27/rustfmt-nightly-x86_64-apple-darwin.tar.gz": "457995f055ef35a2491326f95caf31376b21e3cc4c0316cf4536cb7604e472d3", - "dist/2022-12-27/rustfmt-nightly-x86_64-apple-darwin.tar.xz": "d80b01e8c007da58250f7affea8d034a536437efd766eeb8de6d5b7feba9b0d5", - "dist/2022-12-27/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz": "ee2ab7683e75fa68ad482c81e546cd71b9209497f16a0590507e5de884f1e627", - "dist/2022-12-27/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz": "d08326f42bf7f38855e37c624a38923d09cbf162b666e8058891aff06ec017c8", - "dist/2022-12-27/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz": "e42ee4dfdd0aa342dd8192204fd6cfb503eaa0069f70776adbbca352d7e7b661", - "dist/2022-12-27/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz": "76ec230ae507729fb4ced016a45b0020775a9eef068c2b2e5ae6e3fcb451d32d", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz": "55f5c89950a81b00efc542c19b42cbfeb9c969af63280106fc78e8893df3d568", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz": "5a4cf3589d06e562ebed70bf0015af3e80f83de1c4d311c810ebf09feac640bf", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-illumos.tar.gz": "fb44bc69be6c89c7245b914324e23284dbd9887ac0c1c4a65379344ce78cfb28", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-illumos.tar.xz": "8d34915b54cd8ea6abf0bff01546f31f74342e1d21128b1e14c32cdfd3505afd", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz": "d15403f81b36c0a2829ad2dee5c1edf39a993a13ccc57f01bb45c77898e3b9ec", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz": "4c0c61f404ec6bb87ab044c0850d116c577a2ff3cfda9ac1598a7858b4fe1a7d", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz": "8bc1fe0e2496769f52a576ccd13f706b26f706f060bebb2618e2c64c3831e2d3", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz": "bcb527bb736bea88bbbb6974ba388b11fe20596c2c178314bbfdad5e2db65fcc", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz": "8bffdf816b12c53d5443e2523c0960a37ab67c93590b0bb753fd5a026e67d368", - "dist/2022-12-27/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz": "bb5c947ab6dfa28fa7c3d7050e9c14c02eaedf2a4e06d290bee554f569be2c30" + "dist/2023-01-25/cargo-beta-aarch64-apple-darwin.tar.gz": "323f3c4c41892765b24201aae83a54fcaef08e47b9b2912a2680528c6ed4f8f8", + "dist/2023-01-25/cargo-beta-aarch64-apple-darwin.tar.xz": "2039157d9100ccadf4d3596f5d7b052e10ff997b59ac7619999969794fc51eae", + "dist/2023-01-25/cargo-beta-aarch64-pc-windows-msvc.tar.gz": "ac3c88c99aed8d4547f8b0f857ec3538456f10223411580278eed10f6e2be30b", + "dist/2023-01-25/cargo-beta-aarch64-pc-windows-msvc.tar.xz": "27b11ea3c67f202e61b5e7394d36bedc7f1b054ca53d68e53ccd7bacf77b4af3", + "dist/2023-01-25/cargo-beta-aarch64-unknown-linux-gnu.tar.gz": "4d6d1d47d34e8042aa978fe5a6b5b8984d6626d38731081db2d5b413d5b844f4", + "dist/2023-01-25/cargo-beta-aarch64-unknown-linux-gnu.tar.xz": "a50e473aa6b6bffd84a719aec602d4bc19f03ccb0ee5f26340eb466501cb2970", + "dist/2023-01-25/cargo-beta-aarch64-unknown-linux-musl.tar.gz": "a043def73a5c72d515c3d7dabe09022c353b047e7a4e4e13e9b17da9b30f8828", + "dist/2023-01-25/cargo-beta-aarch64-unknown-linux-musl.tar.xz": "a63a8915409df4ae5d76d530b46cb7e83b6e6ca79790fa095d899e33773124a0", + "dist/2023-01-25/cargo-beta-arm-unknown-linux-gnueabi.tar.gz": "9c0c413187f1f1e0f1b6f1b66af0bd1b264d94f73439f6df24f476ee1c6c04fe", + "dist/2023-01-25/cargo-beta-arm-unknown-linux-gnueabi.tar.xz": "cb79e76beb989a3e4ffd1461817ad2dd0602aca3bce1a2e54cccc1bbb518a303", + "dist/2023-01-25/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz": "d57c5806a13b498768b53a053c7eb17e8becb19ea5fc9561a2a600dafea32056", + "dist/2023-01-25/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz": "33f35d8c2f5fcd5fa7928f2186a8b2417040e01462152430bae978d8d5a661cd", + "dist/2023-01-25/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz": "80ba79da61f82dc760a9dd7bfdfde29fefcab4ae94917cbf5d908332f93061d3", + "dist/2023-01-25/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz": "a8e48c6345b0e195ea58d6237a247b0d20c8d128af1b12813430806b9a340d5b", + "dist/2023-01-25/cargo-beta-i686-pc-windows-gnu.tar.gz": "052e2c0ff954d66e40101dc075bdd19fdb0befcbfdbc26dd94093bc4147c65cc", + "dist/2023-01-25/cargo-beta-i686-pc-windows-gnu.tar.xz": "94681fbbeb12de4b97b0a5a0206204c41b16c3de1c7c3262e1488f00b22aeb51", + "dist/2023-01-25/cargo-beta-i686-pc-windows-msvc.tar.gz": "3c0c2205e97136ac5e13b3c89d745af24afc60e6b5adc24abf22755d8d0007a1", + "dist/2023-01-25/cargo-beta-i686-pc-windows-msvc.tar.xz": "9ccf1a81d524fbac3f859c0185421936b97ae565164c12ed32e6a39052eac695", + "dist/2023-01-25/cargo-beta-i686-unknown-linux-gnu.tar.gz": "68749447a45ada6bb6e06488e3d58ecca7939d3c77dc40c22f22d7257eae247c", + "dist/2023-01-25/cargo-beta-i686-unknown-linux-gnu.tar.xz": "6b8942c01d1b8fd1f1f399b7f63db409a30df240b5aca5cf34e3166adafb5053", + "dist/2023-01-25/cargo-beta-mips-unknown-linux-gnu.tar.gz": "7f8fcf5d25353dac5d2cd6ad04b20da19b2dbccd25a977e8122d85724a632392", + "dist/2023-01-25/cargo-beta-mips-unknown-linux-gnu.tar.xz": "91d0ec836e2941287ac28a753650e1b7b57364af58fdfedebe1fafea8612f1ac", + "dist/2023-01-25/cargo-beta-mips64-unknown-linux-gnuabi64.tar.gz": "171f40046f777d84fe5a4349d3565ad3485fdf075d8fbe194ca31ba2be9eeb1a", + "dist/2023-01-25/cargo-beta-mips64-unknown-linux-gnuabi64.tar.xz": "0521be760b2a1e6cc134bbe3473dea01a6d0fbf68b05995f41a75875d489eb60", + "dist/2023-01-25/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "ee7c39af31d09a42c5ce1151da6dc1147b5c1aceb0ea94cb3059bac49e72ba2a", + "dist/2023-01-25/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "dc8ddfc8bd305c3f1f4d7965b8bbd8b24235ef758c38a32b3d64b5879fab25d2", + "dist/2023-01-25/cargo-beta-mipsel-unknown-linux-gnu.tar.gz": "4757229750f44b3d523ef7a9c778d923113a8eb8b93ad97ef5e4f23a6f1e6a21", + "dist/2023-01-25/cargo-beta-mipsel-unknown-linux-gnu.tar.xz": "36911ebbdde86d90bca90b61b1b31f6ab054ff65907ac73a22d5ae09d061c444", + "dist/2023-01-25/cargo-beta-powerpc-unknown-linux-gnu.tar.gz": "8e4ce0a0743d301d056a1bafb4216ae96fd6cb06ca083216eaf7f3a21514e064", + "dist/2023-01-25/cargo-beta-powerpc-unknown-linux-gnu.tar.xz": "47e28a41670bbcc7a3787c68dcf72ffe42bfbc3e9f14418871ca814538f88180", + "dist/2023-01-25/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz": "7bcab6e25cd8208eb220839f6adb202dcd382e4bc32fa63b83c40fba330246b9", + "dist/2023-01-25/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz": "650bb4d6b51ef5293164642101395fbf6d9eedcaccccc8ff3e2be032d9e60316", + "dist/2023-01-25/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz": "fc779f539835c1f3e1e7d9c1eed932568a5e731888f766202279e9240dd20e36", + "dist/2023-01-25/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz": "b39ab17c34560266df7dc60b6cf5626758f8b28f7142b916f1f3399342e6e0ec", + "dist/2023-01-25/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz": "7b677b4a2cc59b3baebc1265f8a364879b2195905de1eb20f62b66e2fbfdbb08", + "dist/2023-01-25/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz": "bceab89d3ae1ffd25fc155a7b3514c69e3962ce8f7727cc7e7c4b40f0c6eb3eb", + "dist/2023-01-25/cargo-beta-s390x-unknown-linux-gnu.tar.gz": "d0522064a1994aa338d12f5ef68635f8804a2cb9151dd67771ae132e65560790", + "dist/2023-01-25/cargo-beta-s390x-unknown-linux-gnu.tar.xz": "478fdff509a609e5310c54fa1e0eecbb3870a0636132dbcc71291e150c805828", + "dist/2023-01-25/cargo-beta-x86_64-apple-darwin.tar.gz": "cfb5bc9dcf4c85915e5c7e4a29e7f45c4e5de4a3535c75ce7c192c08511e0350", + "dist/2023-01-25/cargo-beta-x86_64-apple-darwin.tar.xz": "6b1f48ceebc916f9829f599fc815de2b8724873ce8a22ba058a2a1ac1df46295", + "dist/2023-01-25/cargo-beta-x86_64-pc-windows-gnu.tar.gz": "60d119c084899f0a1d7661188756833118bc538d7e7298c72d1452b06e27ef62", + "dist/2023-01-25/cargo-beta-x86_64-pc-windows-gnu.tar.xz": "801d03dfab7e8007a97d95c551b3a069e56371fe33fa4682e20fa50a8123bc20", + "dist/2023-01-25/cargo-beta-x86_64-pc-windows-msvc.tar.gz": "269bdb128749d234e12b5795b90acc1a91bc0c338ed3be70ab2e62d476fcd055", + "dist/2023-01-25/cargo-beta-x86_64-pc-windows-msvc.tar.xz": "88737cc19187a0752e45345eb286a5e9d500f9c71e03bb26737888fe42b350b5", + "dist/2023-01-25/cargo-beta-x86_64-unknown-freebsd.tar.gz": "146d1af37cce4b6eff9f99bb74ad33f2d91383a2b69dfdbd59ad54fc2dd44c49", + "dist/2023-01-25/cargo-beta-x86_64-unknown-freebsd.tar.xz": "9466a4417a1ea6a9ab03ea7d05f747a731ed0bf5545148a1c782c797dcff50a9", + "dist/2023-01-25/cargo-beta-x86_64-unknown-illumos.tar.gz": "f32fcd8a18047646865afc67f92d6edda54fbe3f4e9963aba2095e23295e6ce0", + "dist/2023-01-25/cargo-beta-x86_64-unknown-illumos.tar.xz": "25431bfe87d8c944225122d21ca4823cefe72b304b10933c628d5d2df13d5f5c", + "dist/2023-01-25/cargo-beta-x86_64-unknown-linux-gnu.tar.gz": "cd67e483efd3a9cca57523cee428cd9a5555ff93b057f7fef4178a3e2fd49309", + "dist/2023-01-25/cargo-beta-x86_64-unknown-linux-gnu.tar.xz": "45d578c09399495b67ac38358e4251e3d7a20e988428a1a5a1e39387d2664da8", + "dist/2023-01-25/cargo-beta-x86_64-unknown-linux-musl.tar.gz": "f66eb2cf2c637b4822e2c326b4a57d63eb3c0b517ddb69ff57a45001bc0a110f", + "dist/2023-01-25/cargo-beta-x86_64-unknown-linux-musl.tar.xz": "7a0817ef29d6511d4fd9dbbdf3e9a92635f076d9b0633cb55b325cebeee4efb9", + "dist/2023-01-25/cargo-beta-x86_64-unknown-netbsd.tar.gz": "1330a1b4f975b1d96692bdc4a6392ca87e8e99982768acefc2815e386b6f4e77", + "dist/2023-01-25/cargo-beta-x86_64-unknown-netbsd.tar.xz": "919e25bd54133f4a8cbbf09218415ca7a5041298b32181fa566c5d4a8bfd8b90", + "dist/2023-01-25/rust-std-beta-aarch64-apple-darwin.tar.gz": "3dcf5c58141e44d1c84f33f58ca4dd99edd277ef15a69fc6b94fbe7c67a27483", + "dist/2023-01-25/rust-std-beta-aarch64-apple-darwin.tar.xz": "a651af6487e2f3246075b984fffb4072338a559ff8e6c373289a6242c0ca3ea7", + "dist/2023-01-25/rust-std-beta-aarch64-apple-ios-sim.tar.gz": "5e3d5aa50784ee63c6df03b07ac92649f76c40ac6fb49c24d97896814002697c", + "dist/2023-01-25/rust-std-beta-aarch64-apple-ios-sim.tar.xz": "0ae7440c74cee87c25757159a5749014eecf77b2bcee7e1e71eb9249f917d725", + "dist/2023-01-25/rust-std-beta-aarch64-apple-ios.tar.gz": "a47acbecb37786773c5d80da5990298c5facad11151c9991796eedf80472b1d5", + "dist/2023-01-25/rust-std-beta-aarch64-apple-ios.tar.xz": "9168f9b1cea16a213249a1c452a59719234c145045ddc6ae1752ce4bdf02be41", + "dist/2023-01-25/rust-std-beta-aarch64-linux-android.tar.gz": "54fad0afeead88e1f33eaada03b14710052c6fa0b7130dd87463d3670f1d9fb3", + "dist/2023-01-25/rust-std-beta-aarch64-linux-android.tar.xz": "5fdd761ca88de80754cf3e1221db141204f79e6c2aa57c72c0879af3b87dd0f4", + "dist/2023-01-25/rust-std-beta-aarch64-pc-windows-msvc.tar.gz": "27196acc8f1ab9d6843b673835927c16d6730a8daf96b1f05959884ac53232fe", + "dist/2023-01-25/rust-std-beta-aarch64-pc-windows-msvc.tar.xz": "0ea12b5fade681173aa4795399710cf5ff21d58f5f2fe54eb8d2c7516ef387b8", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-fuchsia.tar.gz": "7bd0d57ba438868635726bad30fea7a52a5c429e77329bf2977805872deb1be2", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-fuchsia.tar.xz": "8520674b4e10a6948b25dc0c58369e921a68c48a7b961bae510ac36e5c29cfe8", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz": "67c5668ce3427245821e53ea976201ebc23d1cb3c1a35a0d725d935de303e8a6", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz": "38236c5e562995e1aadd25151513580a2a7c7828df3baec0e0cccc0f6a856c2a", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-linux-musl.tar.gz": "a5453d21e3620701a957208c573d718872c3909c2c4f9e83be33e14d36677cda", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-linux-musl.tar.xz": "751928d0f640e3b77e2fde9cda623c3e9b3bca7de742100fc1f48388e4d22d8d", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz": "5a036c4d9cbda730e6f2af8c4912506659d1e3065b4d72050cc5b18e442105ea", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz": "2adfb04a0700dd3503527a80eb5ee71733b0fa2dbe974650d450d4bc3b5c8b0e", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-none.tar.gz": "a92fa3278a98de5ab93d1f487863453dbe60bb31158d027aaaef85adf1f62924", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-none.tar.xz": "1c0e523505aa9dbc07ec867ff8527dde29a706868bb55694d62e31924429e235", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-uefi.tar.gz": "4adaac4b13c8d8170b59913230ac9e313ae48400b314d2ce10c138631626728e", + "dist/2023-01-25/rust-std-beta-aarch64-unknown-uefi.tar.xz": "2a2178e4e55f35ea5147f66d36450f9694416c0fbae9b776f39f405a1ab31cbb", + "dist/2023-01-25/rust-std-beta-arm-linux-androideabi.tar.gz": "17e4384d3a229bc452897e26400016c70912feb7e6ac2991a256829c5b391148", + "dist/2023-01-25/rust-std-beta-arm-linux-androideabi.tar.xz": "e57afb560be9a93faf5f0f852eac5cf5b16e2c05383d995a4e6a249367ee4567", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz": "d5a7c8f2fd9c3a1baa573b805334e5446605d2aa4589262f67e321c0590ef19e", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz": "1e62c48781111afd20fb1e015a4f611c3a3301762fd9e64e49beeb6f2bd14c8d", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz": "9e62d990466900818533af63479758f01f6e914d6ccb7910639c6fbbd49ae803", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz": "e685b0f2acf33c2eb58ac1e1a526787ee9df2f0bd1a1850581cc681c41a3ef0e", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-musleabi.tar.gz": "7a02618c26f17076add562a9f8792d170fe60190d1868703936e37df3af882e4", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-musleabi.tar.xz": "d8988dd528dcc19742b703d44dff4ebcef71cec66eaae39768434d77e53557eb", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz": "882e8f09cf68f135a29e64d0eb50727e4ac56939c4cfbcc3d369b928be442099", + "dist/2023-01-25/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz": "7d9b1ebaf89cad6024f07543519dde11da15eab0e2de3df88543156e4a44c48f", + "dist/2023-01-25/rust-std-beta-armebv7r-none-eabi.tar.gz": "a7e73661652b1feb9b1f50d271ebeba2938c169c8add96add8a26ded3d8468f5", + "dist/2023-01-25/rust-std-beta-armebv7r-none-eabi.tar.xz": "2a80ab44cb2f2b9769f52b6ddc5ffa4c8994092b18a7fb3125cdfaecb4e1a578", + "dist/2023-01-25/rust-std-beta-armebv7r-none-eabihf.tar.gz": "f70b0f86c783cc771700dc1f59c43e53b0de2d57775fef5854cd97fde4406b11", + "dist/2023-01-25/rust-std-beta-armebv7r-none-eabihf.tar.xz": "07214e7295be853fc7859481fcf94a4b20cc3bc2c022bf1783ddea56e30f92de", + "dist/2023-01-25/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz": "72be8b0740b14edda6656d2b5cffc69dea01f9bad7fcc9202586a901376116b2", + "dist/2023-01-25/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz": "42fb2607f1c7402f4d32be981cb5c0755be2e36fd0296b3b2753eecae98e5cc3", + "dist/2023-01-25/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz": "ae9ec6f3c3444e5b14103db8c04b95597705fe44c68c253c75383b47da4094de", + "dist/2023-01-25/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz": "1e0f7f1ccf9e4f6cc010a096d01f3e6056f1d4b0d319f5699dc67cad2f889d4a", + "dist/2023-01-25/rust-std-beta-armv7-linux-androideabi.tar.gz": "6e8b70d2606902b369dfc263ee25343fa3c71c4081f03066822e9a2a260ac573", + "dist/2023-01-25/rust-std-beta-armv7-linux-androideabi.tar.xz": "e3f9052bc831ca0a9b38a3da3be846113c6ab2c4f320ecdba489f0eddfc7e47c", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz": "e858e836806f3641c2f1074e63ce88771cdf135bca36d7c0d3dec0d1a4c98f8e", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz": "becfe9addbca5bf2123d12e70007c16c036c79fb299de2ce8da067d0f21b0f74", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz": "eef38b595752add74cf3bd29326116e33a0945115d08ced77e603c5bb46e72c0", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz": "77e5cf7b344e590b9a15b2c160473f7c212304f624ed9aea8c7a8fd5e0fd787c", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz": "2a70ffd7f8f3289e005c0f72e2c127a44f8f014628df7ac01b4b0ae2fc61a9c9", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz": "97e2ae0072d5ae01644eda9a0c3438e78da27bb2f78d843fd626d3db36a6090b", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz": "7a30075e86bbd33241120dcf078b31ca9ec1877788db2c5700f4752cd447b587", + "dist/2023-01-25/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz": "2c1dfbc1361f030a3a116936f3e43e2c3adae2529feffc98a76e78fdad3572d9", + "dist/2023-01-25/rust-std-beta-armv7a-none-eabi.tar.gz": "aafe7ae2fc49e2c4ae9e1e008700f399f397dfca05d624dac4999f6c733ae2cb", + "dist/2023-01-25/rust-std-beta-armv7a-none-eabi.tar.xz": "d4bde0e0db35cb07134f6a94eee24e4359478dec9054e8a3802440eed68f60b7", + "dist/2023-01-25/rust-std-beta-armv7r-none-eabi.tar.gz": "fe83fe1f0b051838767589ecc9c17915441a44cd77226c9be26e9a63951bce2c", + "dist/2023-01-25/rust-std-beta-armv7r-none-eabi.tar.xz": "94eee8d1125537ebe1002c424c686c50996c03ed31d0a1275d49fd7ef0420ae1", + "dist/2023-01-25/rust-std-beta-armv7r-none-eabihf.tar.gz": "6ea9fca06fdb82026505c85a7bf7ad8be01926096be63c6cf20c5625c42df7dd", + "dist/2023-01-25/rust-std-beta-armv7r-none-eabihf.tar.xz": "70459483493bbb4cb2cc4b2af0cb012c01c47afc214643a588cf894a028a0ceb", + "dist/2023-01-25/rust-std-beta-asmjs-unknown-emscripten.tar.gz": "27d86df76c05de73d0ff9542d6904f03ecbd2cedd3a9d6a9cb654dcb78363514", + "dist/2023-01-25/rust-std-beta-asmjs-unknown-emscripten.tar.xz": "24b5a81721fe20849bdf075d39a99c0e80a21178327f9fa96b21649c99486213", + "dist/2023-01-25/rust-std-beta-i586-pc-windows-msvc.tar.gz": "3740517ab4573f77d5812c9b9c04fe63eacd29e56ea7ba5c5f335ad66026bd30", + "dist/2023-01-25/rust-std-beta-i586-pc-windows-msvc.tar.xz": "6c4e780249dcf8b306f8fab3fddd232724248b2670113dfc14c7823781d669f5", + "dist/2023-01-25/rust-std-beta-i586-unknown-linux-gnu.tar.gz": "15fc95314219ac5b38f44a4ec3568fbb4ce66d7ff7b63cdf1fb7a8b058f2933c", + "dist/2023-01-25/rust-std-beta-i586-unknown-linux-gnu.tar.xz": "b1a5ffd05afd400760002da124a8e5c86d091db574bf1ccf255d86b2515789e8", + "dist/2023-01-25/rust-std-beta-i586-unknown-linux-musl.tar.gz": "ef3551edc72cb79e776c7792346352eb858f3e3f7ee1c261b47ef974e52d9a2f", + "dist/2023-01-25/rust-std-beta-i586-unknown-linux-musl.tar.xz": "0e1a8e0ababab458af0a329e14398274fa55bf0e6ce2b2a0a515e5f6d12d6f34", + "dist/2023-01-25/rust-std-beta-i686-linux-android.tar.gz": "74a26b7fee3e0b95f4f0e065bcac58b865abd5f9abe14e42b2263bb0b87aee69", + "dist/2023-01-25/rust-std-beta-i686-linux-android.tar.xz": "c7df97d2322f5f331d349e35091ab5a61fae8dfc16781f1a74849c7c1e150293", + "dist/2023-01-25/rust-std-beta-i686-pc-windows-gnu.tar.gz": "396ca6747252adc4e6d41764df00418de22c22ee77823836c4fa3f1bd7cae869", + "dist/2023-01-25/rust-std-beta-i686-pc-windows-gnu.tar.xz": "4536de17560a21d543f81f6bdb25581a3b145b792531590a6ba35464e95c6389", + "dist/2023-01-25/rust-std-beta-i686-pc-windows-msvc.tar.gz": "da11b2338bacffa3940497b20fbb2544c0846696925d59cf9d7cf4514dedbb81", + "dist/2023-01-25/rust-std-beta-i686-pc-windows-msvc.tar.xz": "5bd5cd665f9e3d92f26998694c12b1f0e53df8ca9ef305c4cc48dd81bbe181f8", + "dist/2023-01-25/rust-std-beta-i686-unknown-freebsd.tar.gz": "b1553f92e0d0891717635136ad698a017c6aaab07a58183284752ff5480b37bf", + "dist/2023-01-25/rust-std-beta-i686-unknown-freebsd.tar.xz": "d6d2a550d36028e5adf62b875fccbae2f78546828de880e5bea33effca22edbd", + "dist/2023-01-25/rust-std-beta-i686-unknown-linux-gnu.tar.gz": "3d9f9c3108d45f95ebd12c284147111155cd3714caa555548111fb6791c7ef1b", + "dist/2023-01-25/rust-std-beta-i686-unknown-linux-gnu.tar.xz": "a4d9ee2238037d3ca5d4a9dd51c04737ecc2a12dc0be1e2996bbe46d7c1cebb9", + "dist/2023-01-25/rust-std-beta-i686-unknown-linux-musl.tar.gz": "9380bbf6ac2d745d1b7c3207c2cdacdd7bef0ff225e3ee5f22e46d826835b17a", + "dist/2023-01-25/rust-std-beta-i686-unknown-linux-musl.tar.xz": "517232f4e831f5305e836cc0666adef721c1b68fae80617a57bfb56405e343b9", + "dist/2023-01-25/rust-std-beta-i686-unknown-uefi.tar.gz": "1e6bfe0d160e3650a1a453de57f51673a6e04f9348f361fe08d2e96fa89d058c", + "dist/2023-01-25/rust-std-beta-i686-unknown-uefi.tar.xz": "f19c1458ef1386540cffca6cf7485ad22c38f0e9ee8a62e26a4e10eeeddb2a36", + "dist/2023-01-25/rust-std-beta-mips-unknown-linux-gnu.tar.gz": "6169b653843ce79f799a99fc7f147bf8315688214dc47a64aed792f5ca274ffa", + "dist/2023-01-25/rust-std-beta-mips-unknown-linux-gnu.tar.xz": "7f5e0f0e02c51dd88b9b819d1ae370e922eacf2523dd0ae664cbd8d79b7cdffe", + "dist/2023-01-25/rust-std-beta-mips-unknown-linux-musl.tar.gz": "124c50ad3ca4da2c97a5e96599762d7fad6701d0193b4a1ba3249c3a67d349ab", + "dist/2023-01-25/rust-std-beta-mips-unknown-linux-musl.tar.xz": "0a07005e369def1cbc8d49cd2904a1fd60c23771eca700e9b4abc49d2edf74a6", + "dist/2023-01-25/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.gz": "5278c6eab22d49d033595f8b98cccfcb89fa8827ef3a8ce487e78c9f74452d2b", + "dist/2023-01-25/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.xz": "206a55c0e4fb54ccfe2f372888bf42212352d56a7f1b3ba6628aec130b325573", + "dist/2023-01-25/rust-std-beta-mips64-unknown-linux-muslabi64.tar.gz": "f64069192d200f852e82735e239cb678fae027a7120e9d79c136aa4a3887bdb1", + "dist/2023-01-25/rust-std-beta-mips64-unknown-linux-muslabi64.tar.xz": "b31af554724c4582494548efda53dbef35db5cd3609104550ab2eee1bcb3f327", + "dist/2023-01-25/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "8445183d07e397b5bcd0f45fbb1b58ff22dc0901d0a1a3637761929f6b0e0364", + "dist/2023-01-25/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "5919f229d0ca138205def6752109056c989493c3a2a241cbd891bfdd84f8c7f0", + "dist/2023-01-25/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.gz": "c72e51c7b1a5720dd74a923fc2ce1caaff1da484c063b50f96bcf84db529326f", + "dist/2023-01-25/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.xz": "9a11cb1d587e2389531edff732c205a653e43bc62132cf697cb9fd04842558df", + "dist/2023-01-25/rust-std-beta-mipsel-unknown-linux-gnu.tar.gz": "682fe8fe1e3dad08190e8c42fb2df8fc734a42df081c59d0b30f4cc9f5fcef8d", + "dist/2023-01-25/rust-std-beta-mipsel-unknown-linux-gnu.tar.xz": "7eee1fff997cd847aac8d6c61cad4bc572d3069dbe59ce2a06c39d6b63346d34", + "dist/2023-01-25/rust-std-beta-mipsel-unknown-linux-musl.tar.gz": "0b5c68bb95668394dda1c910cf99835007271b5598d4652c7c6b974c6c0b2acd", + "dist/2023-01-25/rust-std-beta-mipsel-unknown-linux-musl.tar.xz": "411c8552901b80720a3bca0707eef475a7ad1650d34cda0b29fedfa9fc9b1852", + "dist/2023-01-25/rust-std-beta-nvptx64-nvidia-cuda.tar.gz": "187fef84302125e38937cf390bdf26d40ef98c6d06fd5893db8adceab3e75f04", + "dist/2023-01-25/rust-std-beta-nvptx64-nvidia-cuda.tar.xz": "83ce613db91a23549e4a1e1d5e4c24ad3ca7ddfb586b45d25e2bd85e67a19390", + "dist/2023-01-25/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz": "785bdd67b22af15637696a03b6a4a917f8195049a4bda14a88dc48e6c3101a5e", + "dist/2023-01-25/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz": "df034c1d2baea51f6756e1efef58db81cda5e795691c3a7175cb3b61edd8f33a", + "dist/2023-01-25/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz": "24d020c96db72a49c39dca1546a683d4d2134718dafbd74fb846dc77b30cf78e", + "dist/2023-01-25/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz": "a798a58bf5723f86b08a11c92f901cee246c5a0af06c4f7e08b303c7fd6c0354", + "dist/2023-01-25/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz": "0c383e01f53b5bf85301c46978493e94aef2eba98a966ea283771de7829ea492", + "dist/2023-01-25/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz": "61040426e2eb9950a3487109977ebfe66c134f5394c95847df222ff24c61563b", + "dist/2023-01-25/rust-std-beta-riscv32i-unknown-none-elf.tar.gz": "ef44851d420b5ee0cc3351084c9bc645e4caba447c8dd737840315687547657d", + "dist/2023-01-25/rust-std-beta-riscv32i-unknown-none-elf.tar.xz": "5cb083baabc7f33c515f2dbdaafd49465c85888d97af68dbd2bcd08a3e70e016", + "dist/2023-01-25/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz": "96bd2d16b470e6377c9c2894b24e77d9f7b51dd54d5369dc361791153a9d1519", + "dist/2023-01-25/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz": "93af94b167327c431158be466ff47b3aab8a77319bf7bed8bdbdedb4633a8e67", + "dist/2023-01-25/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz": "57071d1f70a444a1b4b26b2a579e6c6324522893de60be9e97fe281e8878f276", + "dist/2023-01-25/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz": "a75b8cbf062d1c6fcd8b2089c83f82b75247ced44793272ec56849c4448389f9", + "dist/2023-01-25/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz": "195fe88c1b4b77cb12f566e27a9d3ff25ed2edf5f26be9b3b3dd0a88ac6f5e3c", + "dist/2023-01-25/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz": "76884a90032874b98b0f4f873818dd90befc91d2ed96945120a1ce5a6a80c4e6", + "dist/2023-01-25/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz": "017a6896b2b0e534c1c80f13eca4a3a570560800a117ea2d6b4ae0e6d665a969", + "dist/2023-01-25/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz": "ac712a5b5cf3cd2eb2ae3825e75a5d84c5a899f86a104195b200711da15e9e53", + "dist/2023-01-25/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz": "405fd311dec82db95adea38b3ec0e53454aca72bafd58f7960f8be25b50f9bc6", + "dist/2023-01-25/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz": "0a3c8988561da39a817a3dba8115237f1c4ab6642f1925f52b7398102184ec7a", + "dist/2023-01-25/rust-std-beta-s390x-unknown-linux-gnu.tar.gz": "65b8a84d7355f889de036b1ce760068c2b81d73b43e5f7da29f9706ae1806a89", + "dist/2023-01-25/rust-std-beta-s390x-unknown-linux-gnu.tar.xz": "1c8843868742c36a5e9f6839275b4ad2b8a45f587f18f798448a674e0b0841cd", + "dist/2023-01-25/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz": "b225da38b37554abb5a7f098be013b2e5971f9f34c634661d3244dad3ef1315f", + "dist/2023-01-25/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz": "78018c4b996f7fd8bcaaf6073c84a3180250840263b54cc68ff6d195855b0727", + "dist/2023-01-25/rust-std-beta-sparcv9-sun-solaris.tar.gz": "468853e0d54a486aa0a25dd9fd2ab47c08e48c6aa47838c350c108738d7ca812", + "dist/2023-01-25/rust-std-beta-sparcv9-sun-solaris.tar.xz": "c59fec4162cbd9204d73f7aada19aa459e23f3ed73584203d83d52439a982382", + "dist/2023-01-25/rust-std-beta-thumbv6m-none-eabi.tar.gz": "326a3fe4191366ad170f44bfe726d80954024b1a3c7560d75da77bd16b44cafb", + "dist/2023-01-25/rust-std-beta-thumbv6m-none-eabi.tar.xz": "9c59dca2473fc377b65ce74cda0a3a064cf9fe07b1fb1eca0a4641b6de397d0a", + "dist/2023-01-25/rust-std-beta-thumbv7em-none-eabi.tar.gz": "ba2a8bd5d55ee9eefb6f5a5bae987822bf763783ac0374b97c823cfbcced622f", + "dist/2023-01-25/rust-std-beta-thumbv7em-none-eabi.tar.xz": "e8b7df90ffd190d0122d20d4c070f42273bab2da67745f831934fbc09730f34f", + "dist/2023-01-25/rust-std-beta-thumbv7em-none-eabihf.tar.gz": "183f0945d1df7a68c45bed842991486ffee21a03313e60e89746ac4122ca348e", + "dist/2023-01-25/rust-std-beta-thumbv7em-none-eabihf.tar.xz": "039816d5dc555e28fe45183a09a77a6357ce571111041740d0f95e89489b7cf6", + "dist/2023-01-25/rust-std-beta-thumbv7m-none-eabi.tar.gz": "22c48ee80a14149c2635eb344f74ec5765bcc5b7eb0fa1c7ad55b25c016c0934", + "dist/2023-01-25/rust-std-beta-thumbv7m-none-eabi.tar.xz": "a690f9227a3587f5dc143ab86a1ea7c83777a36b1ff18e877801c73745ff80cf", + "dist/2023-01-25/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz": "16978fed1307ce642c4c9b0acfb09d9dc532b64a72d25e2d1f3ab3afbcb673b9", + "dist/2023-01-25/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz": "c1cb59f61a45cb2a842d235762d244a4f4b2f078bc9cd1fe6ef5c632c665573d", + "dist/2023-01-25/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "7d005cc7f199344bf7ecbcb5d3a4acc8ef42cb61d18fa091fe001872a69ab4bf", + "dist/2023-01-25/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "cb567b761f1d78188538e1a5cf4f01aadd641dfec3e8c1a3e2ff2d5e7b930070", + "dist/2023-01-25/rust-std-beta-thumbv8m.base-none-eabi.tar.gz": "c7c83022f3772e1f7af9e8883a1082695f17956ad4b2d4b8fafeb2a8b9ec6ee7", + "dist/2023-01-25/rust-std-beta-thumbv8m.base-none-eabi.tar.xz": "392e9bdc0d84e9b9ab83f7118abd07ca39df9fb5a8482f6c9a1bb8969db2c1b5", + "dist/2023-01-25/rust-std-beta-thumbv8m.main-none-eabi.tar.gz": "97f59b364d4a3491f612217f455b1e7285691e12e73e42d4e7a074c301a973f6", + "dist/2023-01-25/rust-std-beta-thumbv8m.main-none-eabi.tar.xz": "4935afc5e64589ca8f06d3b8bda2ccb89901a60334b50c45be0b760d6f9f58a8", + "dist/2023-01-25/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz": "eb165b5f5924a077c563d7e8e2eef96eff9398432748070b87f4baf0d04388a3", + "dist/2023-01-25/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz": "9c2bf943142fb554fe2332cd7d12ebd568b8b59e06df73e45ad35da27400757e", + "dist/2023-01-25/rust-std-beta-wasm32-unknown-emscripten.tar.gz": "bbd4bb99dbf9b8a178ae767962877bbe8dbd73175e68db654d7eb208c0f10cff", + "dist/2023-01-25/rust-std-beta-wasm32-unknown-emscripten.tar.xz": "265ef776729a591e3867947eb23384aeaf02887a2f03f893bb21489bac1aff88", + "dist/2023-01-25/rust-std-beta-wasm32-unknown-unknown.tar.gz": "177edb18d11154664c510f27fc02b566c40320b5604587975b0897a70647be3d", + "dist/2023-01-25/rust-std-beta-wasm32-unknown-unknown.tar.xz": "7105e29d9a6540ec629a8844407b84624efed5e2a2642a5fc18fa8d73ad5356e", + "dist/2023-01-25/rust-std-beta-wasm32-wasi.tar.gz": "d13a3c25523c269b2515d254558af46bb35fe24d796bdd00aafcc84c63f3ac69", + "dist/2023-01-25/rust-std-beta-wasm32-wasi.tar.xz": "97ee2ec6214ffc91e46e4e590acc8dc4e69a7a935a64a0e2af31940d745e2ac1", + "dist/2023-01-25/rust-std-beta-x86_64-apple-darwin.tar.gz": "d184abb149484d78b713cd1d0f94db958dc4ac182eed453178f669c44856c823", + "dist/2023-01-25/rust-std-beta-x86_64-apple-darwin.tar.xz": "e3c448e63d87842f42f99390d7d0ed18c13e03a226967e8f2e9ef8c764d10318", + "dist/2023-01-25/rust-std-beta-x86_64-apple-ios.tar.gz": "04c884f5f4c4a6d1dfb0941b62e16ec5516d42e6ecdb7b3b86f23994b8c7b295", + "dist/2023-01-25/rust-std-beta-x86_64-apple-ios.tar.xz": "6a3c0e72376a2f1654e7ac08dc5e38794a91b432450c7bf978be97ed10f1fa61", + "dist/2023-01-25/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz": "fc41a378f93c5bf1280c52d21f495924c2e76925f609356b8d27e43d0650d2ab", + "dist/2023-01-25/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz": "ab6bd497938262cae110bf9f39cc94f5ef1ba831db19e63b4d60c8fef7f8dc90", + "dist/2023-01-25/rust-std-beta-x86_64-linux-android.tar.gz": "d990e089f838d0158fa2ba3ea08153edb48f4346e682f0fdcdfed1b37a186b2d", + "dist/2023-01-25/rust-std-beta-x86_64-linux-android.tar.xz": "0b6e71cdcef8c32e649dc209dbe9bc30a0864aba4fc85d0d615ff5c405204f6b", + "dist/2023-01-25/rust-std-beta-x86_64-pc-solaris.tar.gz": "3cc30012778b45a27dc6c92f5cb0955461dbd1aba130c191c20a510d29bf2c00", + "dist/2023-01-25/rust-std-beta-x86_64-pc-solaris.tar.xz": "0e3f033b01d1223d9f55c86497c9625c4de36953b6c269ca622c96b2fce09afe", + "dist/2023-01-25/rust-std-beta-x86_64-pc-windows-gnu.tar.gz": "18a61cd3593bc67eeb93b615c4585e18495128cd4f50933776705c6ff5cf1616", + "dist/2023-01-25/rust-std-beta-x86_64-pc-windows-gnu.tar.xz": "8bf3998dfd69a17354dd79dea20220f405a2a116842d3813fe033cfa5a6aafdb", + "dist/2023-01-25/rust-std-beta-x86_64-pc-windows-msvc.tar.gz": "76137f8246ad53adaf26d739c91dd3bc5820697a0c1d2af0937328bb5e6536b9", + "dist/2023-01-25/rust-std-beta-x86_64-pc-windows-msvc.tar.xz": "2febd8119b376da8f2b1baf3ca63b97d11a17e1a766986ff1d6dffc522cb0081", + "dist/2023-01-25/rust-std-beta-x86_64-sun-solaris.tar.gz": "b5769729f089ea5cd5fb5ba1995a0e18dcef21425b69b7e952d42c5bdf0253c2", + "dist/2023-01-25/rust-std-beta-x86_64-sun-solaris.tar.xz": "a8593120f87887738390e0ec9ff1d72a743a77dc17a33276e7bec7b04f45442e", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-freebsd.tar.gz": "269fec46599b8839f3a81c6cc85fbca7a7e86cb661e5cbcbffb853ba674ae1cb", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-freebsd.tar.xz": "20c2d1d3e64f56f00c237ae261d5880a7fd7c6f1e2360dc7fa0039b3ea932c66", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-fuchsia.tar.gz": "d64735ce43c75d7c741f9cb7754812f09e21706be8bd0931d72b09916d312844", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-fuchsia.tar.xz": "f501f199bfe1120901e919a14684e57f0723b59ffb5cad79f501834a63df5570", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-illumos.tar.gz": "a80058880e7441e2cd6bb77a7a284902d15dc21d8f0b37f2af3b3da31f07f9f4", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-illumos.tar.xz": "17d07564595b2dbc9eecc8271d3332bef81c7a57138559740c606d2181777f89", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz": "0e4c01e6438fc005ba7177d33cc0dba8646eb51a47da06b079ef9fc2e264f052", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz": "1f95934a853b0ce1f4bc50ac86b1ae74a34acbae8a64903faf6f7ba63e49051b", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz": "431fa66d45ff345f1fb2e279eb52ab24757ed3971f049f9a04a63b228a417f59", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz": "6901b028b8df3d09e994387a810d3a74b873d2ff5fcf93c1d49bf7c3521a506b", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-musl.tar.gz": "a22d8f960e3d15886f893dd4e137becf9c84b1bb2ce500d574e5cc85f43b2b64", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-linux-musl.tar.xz": "1fa467a1334a1cea4af8b27f7fc186eabf3a8f26091ae29b501bec6b2564b98e", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-netbsd.tar.gz": "50f2c04d4ee499959f52546af600c40b16a5627bb9adddeab819519231cf1efe", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-netbsd.tar.xz": "69084f5bf6e22d6ba232d2040bfee15b00418ab20980c716602a19134ee54bcd", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-none.tar.gz": "5a8b98fce343e17fdfd2f3f9b4f810097cdf12430e02d65b3d1042e273f1ddae", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-none.tar.xz": "d5db956978faa532d822609d475599c12507e5b67ac73b9a9194afb7449b9b7d", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-redox.tar.gz": "3c4f69556a6ed2c64fd6274bfa17ff489b5e0c9f1f8d6884fe31c28c39e15d89", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-redox.tar.xz": "feb6456b55a38b83755b281e039941d97659947b289ac2750fd3b3588cf43fd3", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-uefi.tar.gz": "81e795c668369a3947d4d69aeb4f823c8446b09ae18c6fdc800d54aae514f27e", + "dist/2023-01-25/rust-std-beta-x86_64-unknown-uefi.tar.xz": "5c51b99639e5f67e01fe37a868dae17da4ff11d755434b189cc4ae81453826ac", + "dist/2023-01-25/rustc-beta-aarch64-apple-darwin.tar.gz": "9d6277d58b9a679d47eb80d1132d590102f632d5fdb85ba54ef653b2e602c6d3", + "dist/2023-01-25/rustc-beta-aarch64-apple-darwin.tar.xz": "6a49fa544dd3bc4d657ae064863b760935977674e6c837f6a7f84dc1c9dbe95a", + "dist/2023-01-25/rustc-beta-aarch64-pc-windows-msvc.tar.gz": "0536b525d92007041a4d5f4b57601bcc17e1257f44eddd1e4630fbda8b5ea2e8", + "dist/2023-01-25/rustc-beta-aarch64-pc-windows-msvc.tar.xz": "35621c50a8e1ce5591dfdf95b4f5e17e60478309348e67f6e3bf767b57c494ba", + "dist/2023-01-25/rustc-beta-aarch64-unknown-linux-gnu.tar.gz": "feb0c0534f2f78500a25906fb6f0bd5772574fbfbd23b6abea807f074905905a", + "dist/2023-01-25/rustc-beta-aarch64-unknown-linux-gnu.tar.xz": "fb269a472ef44aad092259352bb55b24dafc56459eacb7300fd7db0bbc5a96c1", + "dist/2023-01-25/rustc-beta-aarch64-unknown-linux-musl.tar.gz": "98514e08e1a21f94028df39496e802f5b6379414dad4e7069253cd8b3f961c43", + "dist/2023-01-25/rustc-beta-aarch64-unknown-linux-musl.tar.xz": "b01b5ef23232834174ea31bbf402fd4652769a7fac5b522ac28e53c469389b60", + "dist/2023-01-25/rustc-beta-arm-unknown-linux-gnueabi.tar.gz": "d638873a2fe3bb666174b4270a44da25a9f7f05f0a2544598556485661b51d66", + "dist/2023-01-25/rustc-beta-arm-unknown-linux-gnueabi.tar.xz": "7bd32b738a280b6d42fb925b5c7cd8b4ca660285ae77cf27b0ed6eafb0b0237c", + "dist/2023-01-25/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz": "8ed861c6ccc085030bb0947119746df3c83b9971e7b7c0ca43a8133700f985bc", + "dist/2023-01-25/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz": "f4ffb8ec45475b96815eccb657d9a5f443e8067a2f7b50a18eaf80c8a9cd1944", + "dist/2023-01-25/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz": "e6a809e4e255e265aa54ac730655569e93b0227037e5eebe2995e6ed13c4a2fd", + "dist/2023-01-25/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz": "0849a22e9d82c3cacfb39c5067106767bc40380e231842e968770b7d79dc9376", + "dist/2023-01-25/rustc-beta-i686-pc-windows-gnu.tar.gz": "348a94bb0048a2de0764ea5ebc83a6578d1f63f4edf8d6627cd346345cb3beda", + "dist/2023-01-25/rustc-beta-i686-pc-windows-gnu.tar.xz": "02885355eefef4a901522a441c376a59521ff91889dd6e2438cfe5869360ad7f", + "dist/2023-01-25/rustc-beta-i686-pc-windows-msvc.tar.gz": "56d6b9b2d0e8eb13a568b60f2b5284cbdb3efcbc921d6c318408c58d12c6ee11", + "dist/2023-01-25/rustc-beta-i686-pc-windows-msvc.tar.xz": "bcf405c76b2aebb76ca70595ddbe5de1faf8c34320b08cd4839db7f46dc9dc7c", + "dist/2023-01-25/rustc-beta-i686-unknown-linux-gnu.tar.gz": "6b5c11f41bdb8a7b596ac92bfe18e7a2410a7fc77fe7ca7036e72c563b9e41c0", + "dist/2023-01-25/rustc-beta-i686-unknown-linux-gnu.tar.xz": "7291ffdbce495b5d0ca017730495300a72d3341170d099b3c8abda5cb9ed190c", + "dist/2023-01-25/rustc-beta-mips-unknown-linux-gnu.tar.gz": "6005076b8cd38020a02cd2720e8c67491d31f50465d62d9f5148d93feb4eb198", + "dist/2023-01-25/rustc-beta-mips-unknown-linux-gnu.tar.xz": "1b421c2addb488faefec78cdcbbaf03a9c45640f4ba6740bbb1afbece3e30ba0", + "dist/2023-01-25/rustc-beta-mips64-unknown-linux-gnuabi64.tar.gz": "2d1f7463d3922238c189c5f669b8f4e80f85f389f5edca000b63ebf041fb4222", + "dist/2023-01-25/rustc-beta-mips64-unknown-linux-gnuabi64.tar.xz": "29dcad8e598e6b79730a53146d3d8ceb5acd0029a83216060ece931d149e9a97", + "dist/2023-01-25/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "c3e1527a463155bc9ed2c3eb65217c72fd067bbd316432a16a2777a444e7eb9a", + "dist/2023-01-25/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "8a031c5830bb8168c1e20426082c0783fa52310b22a28c5fbb5b1214adcf3bd5", + "dist/2023-01-25/rustc-beta-mipsel-unknown-linux-gnu.tar.gz": "5c1af72641cb7bf514f936def835ebccfa908434f9e26e6d3cf65756d68fe24d", + "dist/2023-01-25/rustc-beta-mipsel-unknown-linux-gnu.tar.xz": "40a95925bb98eadd7b49be71dd9fa76abf09fc16bd2d6707e3206cf7e7f9b9ce", + "dist/2023-01-25/rustc-beta-powerpc-unknown-linux-gnu.tar.gz": "2dfea875b3b5f3405f9df83fd5a5144b8fc93a90ba17a3ffcb437c934a9772e8", + "dist/2023-01-25/rustc-beta-powerpc-unknown-linux-gnu.tar.xz": "2c23590890472f2ed15df449a33188bbc7d3dc8755e8929861ccdfeb24ee0909", + "dist/2023-01-25/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz": "0b31cad32717c5c7a75069bfaa32fab82d0eb75190b0d34d2e09c221def5f7a5", + "dist/2023-01-25/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz": "939feb641d84aa98e46934c3896adee94169d8e5d8d2d97065e904aa1eac16ad", + "dist/2023-01-25/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz": "d031874dccc1fc029196bc49f7713805226be2ac03a17fc38dc2f40c7f807093", + "dist/2023-01-25/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz": "8b6f367822b14dfd341d711c4736e00ac1fcc914a3c5214209742f2543bba880", + "dist/2023-01-25/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz": "6fb98f6c504ff7278af6f840e39d1236b7209a35a3f5dc78d281c59a2264b525", + "dist/2023-01-25/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz": "1e5a16e7c67bad200e3f051aa959cd9123ad26e15443128ee9ce28151b28e7ba", + "dist/2023-01-25/rustc-beta-s390x-unknown-linux-gnu.tar.gz": "c8bbed9a7319e601e9e53461665201f89aceca9bc72dcdd1e3206110d535c6c4", + "dist/2023-01-25/rustc-beta-s390x-unknown-linux-gnu.tar.xz": "05af8b1637b522af7ac981d133eaf88c157a7d4ed414ce53c13bbca0667510dd", + "dist/2023-01-25/rustc-beta-x86_64-apple-darwin.tar.gz": "ead6472d2644ffeb7f27252e0445aa27b9cb028dc982da011069975767711249", + "dist/2023-01-25/rustc-beta-x86_64-apple-darwin.tar.xz": "3777d00c129c51b8980afc2ba1b1605f58490ec4d5203609d260e05ae5801182", + "dist/2023-01-25/rustc-beta-x86_64-pc-windows-gnu.tar.gz": "5871e7fa9b9af9af9ccc405866774db110dc5ba8b66649c87f546139c383cea1", + "dist/2023-01-25/rustc-beta-x86_64-pc-windows-gnu.tar.xz": "9804f9a57acfa97db3a33fa7f77f5a8ced7d6b9e5013e61aa76287dfe45d9223", + "dist/2023-01-25/rustc-beta-x86_64-pc-windows-msvc.tar.gz": "3a7387c88e4a17e331d8f8800e6be0cf113242edb2b760fcff0dcd2ff97c1ca8", + "dist/2023-01-25/rustc-beta-x86_64-pc-windows-msvc.tar.xz": "12becb176b75b9274a44ccb22a4859fb8cb52df2cf954011c7294d22dc2e8721", + "dist/2023-01-25/rustc-beta-x86_64-unknown-freebsd.tar.gz": "262df9ec15e8b14d1a2959f9d386717147af17612ae92762916e9e195ac83c7f", + "dist/2023-01-25/rustc-beta-x86_64-unknown-freebsd.tar.xz": "2647f9420cc4b2a2a94b32ef6c7d88285bb50c3b04bbd29bdc11f6e5fb8f9c4f", + "dist/2023-01-25/rustc-beta-x86_64-unknown-illumos.tar.gz": "82875b6f60bbdea438f0da1a162c30d236fdd32124296a83510954f89dfbb20d", + "dist/2023-01-25/rustc-beta-x86_64-unknown-illumos.tar.xz": "19bd296d5c116bdb620e50b6fba3c7d5a5e978f26a8f1be1afec1c6854408d2c", + "dist/2023-01-25/rustc-beta-x86_64-unknown-linux-gnu.tar.gz": "45b8d74f203b66d25a15e59db755918d0954a3338f08236664007de2478e2438", + "dist/2023-01-25/rustc-beta-x86_64-unknown-linux-gnu.tar.xz": "c047becdba71a802c1d06b31e5c3dce8efb11a9daa299e1cd03a0f9f6b48cbf9", + "dist/2023-01-25/rustc-beta-x86_64-unknown-linux-musl.tar.gz": "a649445f1676acafc59b4808211aa669c9fb8093cabb7007432d0ae2f6e21239", + "dist/2023-01-25/rustc-beta-x86_64-unknown-linux-musl.tar.xz": "b6ed06a8df0de6b64099fba4d1ca9478e0802dfc086308f425692ee40faa8d2a", + "dist/2023-01-25/rustc-beta-x86_64-unknown-netbsd.tar.gz": "d939bd071f42aa7657297110be68dd9d2aad840272bf881a1fdc82053914f970", + "dist/2023-01-25/rustc-beta-x86_64-unknown-netbsd.tar.xz": "5671084575291d8c4ef2ed0930b22815d6810e2378fb98ca5a0738faa76b525b", + "dist/2023-01-30/rustc-nightly-aarch64-apple-darwin.tar.gz": "f634a282a8388aff57d988616f17f2c511253a02d45193b03fa87167448a8cd9", + "dist/2023-01-30/rustc-nightly-aarch64-apple-darwin.tar.xz": "4fd6a4ec8665ba71ccf3ac7d08f9010b4e130ce496bc62548d36170786f213ab", + "dist/2023-01-30/rustc-nightly-aarch64-pc-windows-msvc.tar.gz": "5b7fc325745b2f1e22b1a58ead8163314c3ec06f4a30483bf7ddfb57f811a2d4", + "dist/2023-01-30/rustc-nightly-aarch64-pc-windows-msvc.tar.xz": "4aa8d587ebd53bbd11c33f263991328576977d801d5b6eccf56147301ea0f52e", + "dist/2023-01-30/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz": "7838bf7da92539b0329be0b9b80f0738df3617e982f539326a6a99892eb905f1", + "dist/2023-01-30/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz": "636af094f94de9baa3edd5f9e1b7655e0bb7f6f23d24d6f389a3abeab7360e00", + "dist/2023-01-30/rustc-nightly-aarch64-unknown-linux-musl.tar.gz": "51b8a8a06244ee37d2c37e84154ff87132b4f90a1e62a8c9454ed5ea5c296c1f", + "dist/2023-01-30/rustc-nightly-aarch64-unknown-linux-musl.tar.xz": "cc18ce5f4f461a830c725ca8ddccda17bd726374198c487810eab8d36a8f7c98", + "dist/2023-01-30/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz": "e2d7b96bf5e2feb47019c63067dbb1627bf26ac4e730774d29ea9f6967edae3a", + "dist/2023-01-30/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz": "0483f07f1a53949c2f04e2766f53fe9138ce126059f650ac61215e6a84c5fd57", + "dist/2023-01-30/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz": "d3ad417041c432438f1ed56a2324ab412dca7631a74da03e0bc72cd28e69f197", + "dist/2023-01-30/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz": "f029fafa0635efec9065d76780f003e2c4220c7b6ea4b426ebcb57d943403998", + "dist/2023-01-30/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "dd2ee13ccea00c23ca2f90872c7c31a3a1ef008962db9cf8066acc130bca778f", + "dist/2023-01-30/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "dc23fa4c0268a7227e0f9e4941376ffc4c64c0614622f442da10dbb75e014dd4", + "dist/2023-01-30/rustc-nightly-i686-pc-windows-gnu.tar.gz": "d4b02e59373fe60ba06e979f784bf1b8c94ca4a5ee471ed83814623db9e14af6", + "dist/2023-01-30/rustc-nightly-i686-pc-windows-gnu.tar.xz": "5355e1bfdddd2a56dd0c882fc492e4d571e5b29636d381e848102e996ca9b680", + "dist/2023-01-30/rustc-nightly-i686-pc-windows-msvc.tar.gz": "02a43fb72394837461770c1b472afb534ac03bac9cf23bfdbba8227cf879dabe", + "dist/2023-01-30/rustc-nightly-i686-pc-windows-msvc.tar.xz": "78cbe74bd0f7029b01e3aeb451ea6bbc1656db1fb4a80caac4cc27b6e0144b79", + "dist/2023-01-30/rustc-nightly-i686-unknown-linux-gnu.tar.gz": "7fa9a3e3d70a6c15bfd00a0b5a83d73f4e952862b8ef1d6837d3598c4cee8752", + "dist/2023-01-30/rustc-nightly-i686-unknown-linux-gnu.tar.xz": "76b3abe5c532785ab80804461204280e6d853773c62956f283f5dc88130e310c", + "dist/2023-01-30/rustc-nightly-mips-unknown-linux-gnu.tar.gz": "2aa78ea99fceb90e568f6c46881623f5088afeaf47ba204abf2ef755397e84eb", + "dist/2023-01-30/rustc-nightly-mips-unknown-linux-gnu.tar.xz": "6abe1f28662aca904b1fd91e46e0441ba7b4f66f1e7757cab93a0d73012b36fc", + "dist/2023-01-30/rustc-nightly-mips64-unknown-linux-gnuabi64.tar.gz": "3afadbbe1b073ee2a81609c87c3d88a5d7344765b970b8c48dcdfe539c5ba540", + "dist/2023-01-30/rustc-nightly-mips64-unknown-linux-gnuabi64.tar.xz": "f1eb22696c376dfea266090320e7a941986f8de2176b6ceb6dc0f0452994ae4a", + "dist/2023-01-30/rustc-nightly-mips64el-unknown-linux-gnuabi64.tar.gz": "c7f548350e118d4281a8a6ac8044c19eb1583683490b0ea6fb9f5f27f5e3873a", + "dist/2023-01-30/rustc-nightly-mips64el-unknown-linux-gnuabi64.tar.xz": "aad40926a20ac8bda9e534d63e180adfa355e9df22a1068310cf9ae667ffd0ad", + "dist/2023-01-30/rustc-nightly-mipsel-unknown-linux-gnu.tar.gz": "4778f49dceea661baaf641531946dda47d8ddb7f801cc63afbec37a86d45a0f4", + "dist/2023-01-30/rustc-nightly-mipsel-unknown-linux-gnu.tar.xz": "1ba09bcefaf5ed5a3029230ebc3e9cad33626b38553451b952ef215c68a98e34", + "dist/2023-01-30/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz": "6efe1f619ad49c94b3e6fef2a51893cec88ecacf31d963576e6343e8a050d20d", + "dist/2023-01-30/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz": "971fdc824861c98bf223fb2c733e780cf87c90f3a5646561f4e35fa8cd068c7c", + "dist/2023-01-30/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz": "10741ef62e00541a85747db16f830c71ffa1dce036a95bc43df433e450f96602", + "dist/2023-01-30/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz": "b8bc80ee97c54e428c51f56e30cdd610fb07f41bead0409b089fe56237bb0421", + "dist/2023-01-30/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "f8f52abf57943895d34ffe2157f863bbdabaf804969baa2624e38a13648d43de", + "dist/2023-01-30/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "7dfb9af100df05b558c873b5440c532d28de44fbf8c7d933c29481eef6693539", + "dist/2023-01-30/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "9454d78432ce8ad61f8cfbe448654d8acddda9c596c36c7863631c638aba949f", + "dist/2023-01-30/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "c69f1b0062aaf566d6610e6b19335ed002a281aa65b34c1be001a875b85f76d2", + "dist/2023-01-30/rustc-nightly-s390x-unknown-linux-gnu.tar.gz": "92184254f00348bfaa7f40f8a07b585eeb6dabc02e4dff3351cb395b354a930a", + "dist/2023-01-30/rustc-nightly-s390x-unknown-linux-gnu.tar.xz": "b41eff99cf9b9851ffbf496ba6dc892d5dfd124da68c91db66d6fb77b19370d4", + "dist/2023-01-30/rustc-nightly-x86_64-apple-darwin.tar.gz": "8d901d7c2ed293a9e2d2fb8849edee50e6f6e3c5a049fa91cfb13f8f16571b7e", + "dist/2023-01-30/rustc-nightly-x86_64-apple-darwin.tar.xz": "d472dc97f3242d243f584efe113f23e62ac1f53677fb3b3cd1749adb65a6635c", + "dist/2023-01-30/rustc-nightly-x86_64-pc-windows-gnu.tar.gz": "9259adfb75f90cd43c99f253aaf4b242afe941c4075eabc6bce824c3337b4d2e", + "dist/2023-01-30/rustc-nightly-x86_64-pc-windows-gnu.tar.xz": "e42b3e9a462004296e53ed3e71403caff98b3718ff15508d913e0a25ad02ea3d", + "dist/2023-01-30/rustc-nightly-x86_64-pc-windows-msvc.tar.gz": "82f615142be1fed6ffd5c9a6f2d1d3fb73ebf32801348cf6279991c0a76b771c", + "dist/2023-01-30/rustc-nightly-x86_64-pc-windows-msvc.tar.xz": "2a4e2aad343062379334ee1a73b657656e0c03f0490c901806c864ea8a38ebe1", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-freebsd.tar.gz": "2a8fa3a6a104bd35de9a83d98786e7acb7614e0b830336adda30e8d1f1cade69", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-freebsd.tar.xz": "37327a8b756918c25cb799f2e5742a07145e4c1e424442a5d975e99aff1f303d", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-illumos.tar.gz": "8be0295e8b89b6e8f465b0825b0625232c7624cb897efe3e0bf4da222799349c", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-illumos.tar.xz": "8e515082490a64d83771131f4fa5fba8b021d205b56149459e2f2da7584407e3", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz": "c105e3dabdc7bebebadc6ffa5b6f3f962057948cdac6647cd5adf16d66982701", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz": "09b82ca24ff847e000aed1b2eaca74cdf0f6e533bd6655eaa302281eb7037163", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-linux-musl.tar.gz": "e77d81b158b53a94065cd90f68e26dd12d156084b02c53c51172e02c4db58c1c", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-linux-musl.tar.xz": "613c7eab1b998aec0673e1781e3ed78c4d038b449d879c11254b1b6d4345e34c", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-netbsd.tar.gz": "ac8c53be048049118af9fd9d356dcc69ddfaafcd52020ea93703c94d6167b367", + "dist/2023-01-30/rustc-nightly-x86_64-unknown-netbsd.tar.xz": "28b1c8adfffa7863bcd8a46ef407044d06fc16b29f7b6f42072fcbfbdc779e79", + "dist/2023-01-30/rustfmt-nightly-aarch64-apple-darwin.tar.gz": "f7e585d9016a012e2cde4d7e0899e52e1c410c53ed9caf6db22d13f6791ffb0f", + "dist/2023-01-30/rustfmt-nightly-aarch64-apple-darwin.tar.xz": "bdea28e1700f34dc0a6e57db5f73caf6c8d1671a8356cc51096f8155f58690c8", + "dist/2023-01-30/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz": "e9988193283871e678a0d0e08cfb5bdab37d43cb0bec0e5f63a12a38c164936b", + "dist/2023-01-30/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz": "30d1bad2b730589f9d75ca3e2d410d0f9c90707526ed6a66edac92a19eb3716c", + "dist/2023-01-30/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz": "7c6c93fa25193360e28a90269439b28465b6693b6ce68ff2eb1c4209c36a9d60", + "dist/2023-01-30/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz": "4c8331d14ab428b922135690b433f97acd37291e1801635252ab5da849d42180", + "dist/2023-01-30/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz": "0fb5372bf4cc0b6388194021dc7b6a539bd413e89058c05cdc42c1dfe8d92edc", + "dist/2023-01-30/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz": "0e2452ff037698781157c30c5fd67f552e897feb1d86b7b074c195c70a6a1a3a", + "dist/2023-01-30/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz": "6c079c2dde918cf2d9f029dfb3a2a9bebba2504dfe97c5fdc0ef79022415b9f0", + "dist/2023-01-30/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz": "5ab6fa16d7aaca7e6e36caea8e11b916c089dccb511f79b7f69bba667edabc50", + "dist/2023-01-30/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz": "7b919c9132269fcde24559af58d3d2fee56d93308d731d891f89dcee193bbbdb", + "dist/2023-01-30/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz": "53d7c7d03b64526e013c11c49519a63f51562f9682039479c377c92529e5e026", + "dist/2023-01-30/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "c19265cc3a85cd296a85b450e2f4e4b5f3646aa70d6c70dfdfe9ef222fd72136", + "dist/2023-01-30/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "66159d87fd85a4534104da3f7f5c0a14403960ff2c836eb72e35bed6a1ebde32", + "dist/2023-01-30/rustfmt-nightly-i686-pc-windows-gnu.tar.gz": "be84f8558d15dcc802f399f44f0de58e93b28e99cf62e38c0d6e6078a8d73102", + "dist/2023-01-30/rustfmt-nightly-i686-pc-windows-gnu.tar.xz": "b4e8f18335aa3cba092df29c3aadef79c0b88e00f563604467cb2485e10cced6", + "dist/2023-01-30/rustfmt-nightly-i686-pc-windows-msvc.tar.gz": "43ce7581f50e05c775b39a6a6d297d6e8c56a40f5a5817ae4d996d319fbe96c1", + "dist/2023-01-30/rustfmt-nightly-i686-pc-windows-msvc.tar.xz": "2ca2b20996f1a4cbdb619393a3f544ada208caaf381748ee997a70139e52a591", + "dist/2023-01-30/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz": "229fb281ec100e68445b5a402a3d39a0947475054c4f043d55ab2e33bd3d2a57", + "dist/2023-01-30/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz": "65326115afcf1c8e07cfcb9ed294a1e5a136b998557cd60b4cb976520f84cfe1", + "dist/2023-01-30/rustfmt-nightly-mips-unknown-linux-gnu.tar.gz": "337bdf61237c8e47909c3f14b5c8fdf3b8b14f2b265e6da45cd6b4d8180d0afd", + "dist/2023-01-30/rustfmt-nightly-mips-unknown-linux-gnu.tar.xz": "d683349af8320d6bc9f16021fc8937920d70e99cf668ce64cad962705dd20ea5", + "dist/2023-01-30/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.gz": "08a1ae9e61ef097c5d5ce83e5d2bdda62e72d07b4dd21aad286413c619fefa1a", + "dist/2023-01-30/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.xz": "cc3f1f86997c5ccf5607c8f873c916d1158da76ff971d75e36ed8e3a87c86924", + "dist/2023-01-30/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.gz": "f4b7084fc67cf17b3cf1d36136aa03aa5b6af188d311684b15395f05104181f6", + "dist/2023-01-30/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.xz": "2ab645d5117606f2c7e8decbeae1d8855ec7ba53051144ba4783efee2c58d91d", + "dist/2023-01-30/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.gz": "cfa8baa60cc59ac2750f799d33b06eb399d330f318783907717a9e360fd7d85f", + "dist/2023-01-30/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.xz": "bf24570425c064aaef31788bbabd6c4938c9323eca2dedf2ac9084d125623544", + "dist/2023-01-30/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz": "f5437d81735fa67ef24c7b561d1c720395f5d8d4ddcfd88364717a7ed9b96a7d", + "dist/2023-01-30/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz": "8e19c3c95d6445e1ef9b1735191f0d0bc33802bcfa138a9d676d9b266adab17c", + "dist/2023-01-30/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz": "7fd91c2ef7e26c08854c91969d167d1c97538d7678c6ed7914eb0f67290d8d5d", + "dist/2023-01-30/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz": "9e8ada358580b396054278972d532ce2044550071036e9da2eab598e2953a03a", + "dist/2023-01-30/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "eec8b1c24ccaea22eed7708e61bd32bac0850d0dff2b06f1a15a95ab86385363", + "dist/2023-01-30/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "215f1f3bdd8f347af5969c66ff7f7cbf39753ae483e75e689ac581f9d35a64df", + "dist/2023-01-30/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "39460814c429b6a57ce72fafa583d04190053f2c2ce995c8bcb0799ecb7f8bd5", + "dist/2023-01-30/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "6bd08db8702f2fcd9f4cd19a1d977962c84856f748552a96b564e5a77cf2fdfc", + "dist/2023-01-30/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz": "81d6335fa1265cdf99682503cfb236b914fa17d45f967e456ddbeb12bae2dcbf", + "dist/2023-01-30/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz": "d36b7517efac2c4a34a1055411f779c386c7a566e4eec408dbc8a319f67f5451", + "dist/2023-01-30/rustfmt-nightly-x86_64-apple-darwin.tar.gz": "1a34ec058cb45189c4062ad2a00ab33387a54716f75005d9959cf0691d06ae50", + "dist/2023-01-30/rustfmt-nightly-x86_64-apple-darwin.tar.xz": "a2fdcb7cc9fe7819699f511d52da0e8ed4e55ba42c63e7b1d61512e4e14e5c29", + "dist/2023-01-30/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz": "95e3f080394d2e4f9916f17c9cf5137d032da847d9ac1c04519b31177fb1618e", + "dist/2023-01-30/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz": "c306895982f92c24559b18f8ff9e011e8722c3310e5f70010fd04b0d044c49bb", + "dist/2023-01-30/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz": "36331cd76f8e918b73ebf6d9095efd0a07cc9f084f194f74c881c14fbc6e8a77", + "dist/2023-01-30/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz": "2e7caa7209e52a9df17254b17f1930afd5ae973826ce3293f29b8b878aa13042", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz": "dec92f2c27f785f8ae0db18c2e8a9db87e1ae8addb4302f5cbe9f745cd92c4f2", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz": "a8fef2e56d9d2be9072c17d75e7ac695eb8fc266fc35e1055fbb25757e6db29d", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-illumos.tar.gz": "9b5f93f00f61def125436332e4b709bdfe74c441995bae49c0d482f24bd9f8f1", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-illumos.tar.xz": "4f82313dce2e1315bd0d3ebf95f33bbdf7275c59205b0910bbc92d41c47c7c22", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz": "69efa04956d9bcf177a3bd9ba9541fa681b39416a1b7dd2b18415b72311897b9", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz": "0c3c33d744ec05e96298d0bdb9890654ab9ce3e9013b9af14c78683560456820", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz": "cba8b1f086c544d79aa09ac954374f44d5e7d38ad9bbc2f9e84723d0088592e5", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz": "ce73d1d03b62931d6eb9508b701e9dacc08b98b484af3daa79ae600c4883a9f4", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz": "87e1018a3ee4f781b3c1b471fcdf80ebd70096ed58b29db00ad97573626294f4", + "dist/2023-01-30/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz": "c6896ee319403ebb5c909b13feabc7411e3aa80523ef1bc84c8aae181514c923" } } diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs index 530a80b1ed374..f530a4d73d360 100644 --- a/src/tools/bump-stage0/src/main.rs +++ b/src/tools/bump-stage0/src/main.rs @@ -6,7 +6,7 @@ use std::convert::TryInto; const PATH: &str = "src/stage0.json"; const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"]; -const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt-preview"]; +const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt-preview", "rustc"]; struct Tool { config: Config, diff --git a/src/tools/cargo b/src/tools/cargo index 3c5af6bed9a1a..e84a7928d93a3 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c +Subproject commit e84a7928d93a31f284b497c214a2ece69b4d7719 diff --git a/src/tools/clippy/tests/ui/track-diagnostics.stderr b/src/tools/clippy/tests/ui/track-diagnostics.stderr index ec30318625311..39418d359288b 100644 --- a/src/tools/clippy/tests/ui/track-diagnostics.stderr +++ b/src/tools/clippy/tests/ui/track-diagnostics.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/track-diagnostics.rs:LL:CC | LL | const S: A = B; - | ^ expected struct `A`, found struct `B` + | ^ expected `A`, found `B` -Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:LL:CC error: aborting due to previous error diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index f1f26e4e31044..d7de41435aa9d 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -a322848c6b0e037c1f0209387558ecb6ab763714 +0d32c8f2ce10710b6560dcb75f32f79c378410d0 diff --git a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs index a807200771d62..4a43db0aac50a 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs +++ b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs @@ -1,7 +1,9 @@ // This should fail even without validation/SB //@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -#![allow(dead_code, unused_variables, unaligned_references)] +#![allow(dead_code, unused_variables)] + +use std::{mem, ptr}; #[repr(packed)] struct Foo { @@ -9,11 +11,16 @@ struct Foo { y: i32, } +unsafe fn raw_to_ref<'a, T>(x: *const T) -> &'a T { + mem::transmute(x) +} + fn main() { // Try many times as this might work by chance. for _ in 0..20 { let foo = Foo { x: 42, y: 99 }; - let p = &foo.x; - let i = *p; //~ERROR: alignment 4 is required + // There seem to be implicit reborrows, which make the error already appear here + let p: &i32 = unsafe { raw_to_ref(ptr::addr_of!(foo.x)) }; //~ERROR: alignment 4 is required + let i = *p; } } diff --git a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr index 6c2a3dca2deef..7c246706dba5a 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required --> $DIR/reference_to_packed.rs:LL:CC | -LL | let i = *p; - | ^^ accessing memory with alignment ALIGN, but alignment ALIGN is required +LL | let p: &i32 = unsafe { raw_to_ref(ptr::addr_of!(foo.x)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile b/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile index 9f4be71263465..a2a2a41c7a5a1 100644 --- a/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile +++ b/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile @@ -11,7 +11,7 @@ all: tr -d '\r\n' | $(CGREP) -e \ "mismatched types.*\ crateB::try_foo\(foo2\);.*\ - expected struct \`crateA::foo::Foo\`, found struct \`Foo\`.*\ + expected \`crateA::foo::Foo\`, found \`Foo\`.*\ different versions of crate \`crateA\`.*\ mismatched types.*\ crateB::try_bar\(bar2\);.*\ diff --git a/tests/run-make/incremental-session-fail/Makefile b/tests/run-make/incremental-session-fail/Makefile index 0461bb926e76e..6ce1370927bc1 100644 --- a/tests/run-make/incremental-session-fail/Makefile +++ b/tests/run-make/incremental-session-fail/Makefile @@ -9,6 +9,6 @@ all: touch $(SESSION_DIR) # Check exit code is 1 for an error, and not 101 for ICE. $(RUSTC) foo.rs --crate-type=rlib -C incremental=$(SESSION_DIR) > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ] - $(CGREP) "Could not create incremental compilation crate directory" < $(OUTPUT_FILE) + $(CGREP) "could not create incremental compilation crate directory" < $(OUTPUT_FILE) # -v tests are fragile, hopefully this text won't change $(CGREP) -v "internal compiler error" < $(OUTPUT_FILE) diff --git a/tests/rustdoc-gui/code-tags.goml b/tests/rustdoc-gui/code-tags.goml index 8561f537f3d32..ca337cbc323e2 100644 --- a/tests/rustdoc-gui/code-tags.goml +++ b/tests/rustdoc-gui/code-tags.goml @@ -9,16 +9,16 @@ size: (1080, 600) // Check that their content is inside

 assert-count: (".example-wrap pre > code", 4)
 // Check that function signature is inside 

-assert: ".item-decl pre.rust > code"
+assert: "pre.rust.item-decl > code"
 
 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
-assert: ".item-decl pre.rust > code"
+assert: "pre.rust.item-decl > code"
 
 goto: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
-assert: ".item-decl pre.rust > code"
+assert: "pre.rust.item-decl > code"
 
 goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
-assert: ".item-decl pre.rust > code"
+assert: "pre.rust.item-decl > code"
 
 goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
-assert: ".item-decl pre.rust > code"
+assert: "pre.rust.item-decl > code"
diff --git a/tests/rustdoc-gui/font-weight.goml b/tests/rustdoc-gui/font-weight.goml
index fafb156317866..aad334d2bd295 100644
--- a/tests/rustdoc-gui/font-weight.goml
+++ b/tests/rustdoc-gui/font-weight.goml
@@ -1,6 +1,6 @@
 // This test checks that the font weight is correctly applied.
 goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
-assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"})
+assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"})
 assert-css: (
     "//*[@class='structfield small-section-header']//a[text()='Alias']",
     {"font-weight": "400"},
@@ -19,8 +19,7 @@ goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
 
 // This is a complex selector, so here's how it works:
 //
-// * //*[@class='item-decl'] — selects element of any tag with classes docblock and item-decl
-// * /pre[@class='rust'] — selects immediate child with tag pre and class rust
+// * //pre[@class='rust item-decl'] — selects item-decl code block
 // * /code — selects immediate child with tag code
 // * /a[@class='constant'] — selects immediate child with tag a and class constant
 // * //text() — selects child that is text node
@@ -29,11 +28,11 @@ goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
 // This uses '/parent::*' as a proxy for the style of the text node.
 // We can't just select the '' because intermediate tags could be added.
 assert-count: (
-    "//*[@class='item-decl']/pre[@class='rust']/code/a[@class='constant']//text()/parent::*",
+    "//pre[@class='rust item-decl']/code/a[@class='constant']//text()/parent::*",
     1,
 )
 assert-css: (
-    "//*[@class='item-decl']/pre[@class='rust']/code/a[@class='constant']//text()/parent::*",
+    "//pre[@class='rust item-decl']/code/a[@class='constant']//text()/parent::*",
     {"font-weight": "400"},
 )
 
diff --git a/tests/rustdoc-gui/list_code_block.goml b/tests/rustdoc-gui/list_code_block.goml
index c527cfbfcbc56..4c477d70c8956 100644
--- a/tests/rustdoc-gui/list_code_block.goml
+++ b/tests/rustdoc-gui/list_code_block.goml
@@ -1,4 +1,4 @@
 // This test checks that code blocks in list are supported.
 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
 goto: "./fn.check_list_code_block.html"
-assert: (".item-decl pre.rust")
+assert: ("pre.rust.item-decl")
diff --git a/tests/rustdoc-gui/type-declation-overflow.goml b/tests/rustdoc-gui/type-declation-overflow.goml
index 644429c014c18..708e9dca0ee7b 100644
--- a/tests/rustdoc-gui/type-declation-overflow.goml
+++ b/tests/rustdoc-gui/type-declation-overflow.goml
@@ -12,7 +12,7 @@ size: (1100, 800)
 // Logically, the  scroll width should be the width of the window.
 assert-property: ("body", {"scrollWidth": "1100"})
 // However, since there is overflow in the type declaration, its scroll width is bigger.
-assert-property: (".item-decl pre", {"scrollWidth": "1324"})
+assert-property: ("pre.item-decl", {"scrollWidth": "1324"})
 
 // In the table-ish view on the module index, the name should not be wrapped more than necessary.
 goto: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
@@ -24,7 +24,7 @@ assert-property: ("body", {"scrollWidth": "1100"})
 // We now check that the section width hasn't grown because of it.
 assert-property: ("#main-content", {"scrollWidth": "840"})
 // And now checking that it has scrollable content.
-assert-property: (".item-decl pre", {"scrollWidth": "1103"})
+assert-property: ("pre.item-decl", {"scrollWidth": "1103"})
 
 // ... and constant.
 // On a sidenote, it also checks that the (very) long title isn't changing the docblock width.
@@ -33,7 +33,7 @@ assert-property: ("body", {"scrollWidth": "1100"})
 // We now check that the section width hasn't grown because of it.
 assert-property: ("#main-content", {"scrollWidth": "840"})
 // And now checking that it has scrollable content.
-assert-property: (".item-decl pre", {"scrollWidth": "950"})
+assert-property: ("pre.item-decl", {"scrollWidth": "950"})
 
 // On mobile:
 size: (600, 600)
@@ -65,12 +65,12 @@ compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-ban
 goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
 
 click: ".item-decl .type-contents-toggle"
-assert-property: (".item-decl > pre", {"scrollLeft": 0})
-scroll-to: "//*[@class='item-decl']//details/a[text()='String']"
-assert-property-false: (".item-decl > pre", {"scrollLeft": 0})
+assert-property: ("pre.item-decl", {"scrollLeft": 0})
+scroll-to: "//*[@class='rust item-decl']//details/a[text()='String']"
+assert-property-false: ("pre.item-decl", {"scrollLeft": 0})
 
 // Then on an item without "hidden methods".
 goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.TraitWithLongItemsName.html"
-assert-property: (".item-decl > pre", {"scrollLeft": 0})
-scroll-to: "//*[@class='item-decl']//code/a[text()='String']"
-assert-property-false: (".item-decl > pre", {"scrollLeft": 0})
+assert-property: ("pre.item-decl", {"scrollLeft": 0})
+scroll-to: "//*[@class='rust item-decl']//code/a[text()='String']"
+assert-property-false: ("pre.item-decl", {"scrollLeft": 0})
diff --git a/tests/rustdoc-ui/track-diagnostics.stderr b/tests/rustdoc-ui/track-diagnostics.stderr
index ec30318625311..39418d359288b 100644
--- a/tests/rustdoc-ui/track-diagnostics.stderr
+++ b/tests/rustdoc-ui/track-diagnostics.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/track-diagnostics.rs:LL:CC
    |
 LL | const S: A = B;
-   |              ^ expected struct `A`, found struct `B`
+   |              ^ expected `A`, found `B`
 -Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:LL:CC
 
 error: aborting due to previous error
diff --git a/tests/rustdoc/array-links.rs b/tests/rustdoc/array-links.rs
index e7c0ee2de1a7a..8ee294daa963d 100644
--- a/tests/rustdoc/array-links.rs
+++ b/tests/rustdoc/array-links.rs
@@ -4,25 +4,25 @@
 pub struct MyBox(*const T);
 
 // @has 'foo/fn.alpha.html'
-// @snapshot link_slice_u32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code'
 pub fn alpha() -> &'static [u32; 1] {
     loop {}
 }
 
 // @has 'foo/fn.beta.html'
-// @snapshot link_slice_generic - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code'
 pub fn beta() -> &'static [T; 1] {
     loop {}
 }
 
 // @has 'foo/fn.gamma.html'
-// @snapshot link_box_u32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code'
 pub fn gamma() -> MyBox<[u32; 1]> {
     loop {}
 }
 
 // @has 'foo/fn.delta.html'
-// @snapshot link_box_generic - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_box_generic - '//pre[@class="rust item-decl"]/code'
 pub fn delta() -> MyBox<[T; 1]> {
     loop {}
 }
diff --git a/tests/rustdoc/assoc-consts.rs b/tests/rustdoc/assoc-consts.rs
index 77b139b644f3a..68a11c57b5292 100644
--- a/tests/rustdoc/assoc-consts.rs
+++ b/tests/rustdoc/assoc-consts.rs
@@ -1,5 +1,5 @@
 pub trait Foo {
-    // @has assoc_consts/trait.Foo.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has assoc_consts/trait.Foo.html '//pre[@class="rust item-decl"]' \
     //      'const FOO: usize = 13usize;'
     // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
     const FOO: usize = 12 + 1;
diff --git a/tests/rustdoc/assoc-item-cast.rs b/tests/rustdoc/assoc-item-cast.rs
index ab9702a24f469..ad8235985bcf0 100644
--- a/tests/rustdoc/assoc-item-cast.rs
+++ b/tests/rustdoc/assoc-item-cast.rs
@@ -10,5 +10,5 @@ pub trait AsExpression {
 }
 
 // @has foo/type.AsExprOf.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type AsExprOf = >::Expression;'
+// @has - '//pre[@class="rust item-decl"]' 'type AsExprOf = >::Expression;'
 pub type AsExprOf = >::Expression;
diff --git a/tests/rustdoc/assoc-types.rs b/tests/rustdoc/assoc-types.rs
index de36c8ffeff0f..e74db7578d132 100644
--- a/tests/rustdoc/assoc-types.rs
+++ b/tests/rustdoc/assoc-types.rs
@@ -12,8 +12,8 @@ pub trait Index {
 }
 
 // @has assoc_types/fn.use_output.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' '-> &T::Output'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output'
+// @has - '//pre[@class="rust item-decl"]' '-> &T::Output'
+// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output'
 pub fn use_output>(obj: &T, index: usize) -> &T::Output {
     obj.index(index)
 }
@@ -23,13 +23,13 @@ pub trait Feed {
 }
 
 // @has assoc_types/fn.use_input.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'T::Input'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
+// @has - '//pre[@class="rust item-decl"]' 'T::Input'
+// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
 pub fn use_input(_feed: &T, _element: T::Input) { }
 
 // @has assoc_types/fn.cmp_input.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where T::Input: PartialEq'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
+// @has - '//pre[@class="rust item-decl"]' 'where T::Input: PartialEq'
+// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
 pub fn cmp_input(a: &T::Input, b: &U::Input) -> bool
     where T::Input: PartialEq
 {
diff --git a/tests/rustdoc/async-fn.rs b/tests/rustdoc/async-fn.rs
index 8cafb5a2497a3..3db344af67439 100644
--- a/tests/rustdoc/async-fn.rs
+++ b/tests/rustdoc/async-fn.rs
@@ -1,35 +1,35 @@
 // edition:2018
-// @has async_fn/fn.foo.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn foo() -> Option'
+// @has async_fn/fn.foo.html '//pre[@class="rust item-decl"]' 'pub async fn foo() -> Option'
 pub async fn foo() -> Option {
     None
 }
 
-// @has async_fn/fn.bar.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn bar(a: i32, b: i32) -> i32'
+// @has async_fn/fn.bar.html '//pre[@class="rust item-decl"]' 'pub async fn bar(a: i32, b: i32) -> i32'
 pub async fn bar(a: i32, b: i32) -> i32 {
     0
 }
 
-// @has async_fn/fn.baz.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn baz(a: T) -> T'
+// @has async_fn/fn.baz.html '//pre[@class="rust item-decl"]' 'pub async fn baz(a: T) -> T'
 pub async fn baz(a: T) -> T {
     a
 }
 
-// @has async_fn/fn.qux.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async unsafe fn qux() -> char'
+// @has async_fn/fn.qux.html '//pre[@class="rust item-decl"]' 'pub async unsafe fn qux() -> char'
 pub async unsafe fn qux() -> char {
     'âš '
 }
 
-// @has async_fn/fn.mut_args.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn mut_args(a: usize)'
+// @has async_fn/fn.mut_args.html '//pre[@class="rust item-decl"]' 'pub async fn mut_args(a: usize)'
 pub async fn mut_args(mut a: usize) {}
 
-// @has async_fn/fn.mut_ref.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn mut_ref(x: i32)'
+// @has async_fn/fn.mut_ref.html '//pre[@class="rust item-decl"]' 'pub async fn mut_ref(x: i32)'
 pub async fn mut_ref(ref mut x: i32) {}
 
 trait Bar {}
 
 impl Bar for () {}
 
-// @has async_fn/fn.quux.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn quux() -> impl Bar'
+// @has async_fn/fn.quux.html '//pre[@class="rust item-decl"]' 'pub async fn quux() -> impl Bar'
 pub async fn quux() -> impl Bar {
     ()
 }
@@ -50,27 +50,27 @@ pub trait Pattern<'a> {}
 
 pub trait Trait {}
 // @has async_fn/fn.const_generics.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn const_generics(_: impl Trait)'
+// @has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics(_: impl Trait)'
 pub async fn const_generics(_: impl Trait) {}
 
 // test that elided lifetimes are properly elided and not displayed as `'_`
 // regression test for #63037
 // @has async_fn/fn.elided.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn elided(foo: &str) -> &str'
+// @has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str'
 pub async fn elided(foo: &str) -> &str {}
 // This should really be shown as written, but for implementation reasons it's difficult.
 // See `impl Clean for TyKind::Ref`.
 // @has async_fn/fn.user_elided.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn user_elided(foo: &str) -> &str'
+// @has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str'
 pub async fn user_elided(foo: &'_ str) -> &str {}
 // @has async_fn/fn.static_trait.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub async fn static_trait(foo: &str) -> Box'
+// @has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box'
 pub async fn static_trait(foo: &str) -> Box {}
 // @has async_fn/fn.lifetime_for_trait.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn lifetime_for_trait(foo: &str) -> Box"
+// @has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box"
 pub async fn lifetime_for_trait(foo: &str) -> Box {}
 // @has async_fn/fn.elided_in_input_trait.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
+// @has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
 pub async fn elided_in_input_trait(t: impl Pattern<'_>) {}
 
 struct AsyncFdReadyGuard<'a, T> { x: &'a T }
@@ -88,8 +88,8 @@ impl Foo {
 
 // test named lifetimes, just in case
 // @has async_fn/fn.named.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
+// @has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
 pub async fn named<'a, 'b>(foo: &'a str) -> &'b str {}
 // @has async_fn/fn.named_trait.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
+// @has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
 pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {}
diff --git a/tests/rustdoc/attribute-rendering.rs b/tests/rustdoc/attribute-rendering.rs
index 36e10923c8535..a652fda1604cd 100644
--- a/tests/rustdoc/attribute-rendering.rs
+++ b/tests/rustdoc/attribute-rendering.rs
@@ -1,7 +1,7 @@
 #![crate_name = "foo"]
 
 // @has 'foo/fn.f.html'
-// @has - //*[@'class="item-decl"]' '#[export_name = "f"] pub fn f()'
+// @has - //*[@'class="rust item-decl"]' '#[export_name = "f"] pub fn f()'
 #[export_name = "\
 f"]
 pub fn f() {}
diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs
index 70e2e5c29508c..86333c7534a3f 100644
--- a/tests/rustdoc/attributes.rs
+++ b/tests/rustdoc/attributes.rs
@@ -1,13 +1,13 @@
 #![crate_name = "foo"]
 
-// @has foo/fn.f.html '//div[@class="item-decl"]/pre[@class="rust"]' '#[no_mangle]'
+// @has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]'
 #[no_mangle]
 pub extern "C" fn f() {}
 
-// @has foo/fn.g.html '//div[@class="item-decl"]/pre[@class="rust"]' '#[export_name = "bar"]'
+// @has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]'
 #[export_name = "bar"]
 pub extern "C" fn g() {}
 
-// @has foo/struct.Repr.html '//div[@class="item-decl"]' '#[repr(C, align(8))]'
+// @has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]'
 #[repr(C, align(8))]
 pub struct Repr;
diff --git a/tests/rustdoc/auxiliary/issue-85454.rs b/tests/rustdoc/auxiliary/issue-85454.rs
index 5143968bbd439..5db4fe053af6e 100644
--- a/tests/rustdoc/auxiliary/issue-85454.rs
+++ b/tests/rustdoc/auxiliary/issue-85454.rs
@@ -1,5 +1,5 @@
 // @has issue_85454/trait.FromResidual.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
+// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
 pub trait FromResidual::Residual> {
     fn from_residual(residual: R) -> Self;
 }
diff --git a/tests/rustdoc/const-fn.rs b/tests/rustdoc/const-fn.rs
index 18863abaeaccd..f661618568121 100644
--- a/tests/rustdoc/const-fn.rs
+++ b/tests/rustdoc/const-fn.rs
@@ -1,7 +1,7 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.bar.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub const fn bar() -> '
+// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
 /// foo
 pub const fn bar() -> usize {
     2
diff --git a/tests/rustdoc/const-generics/add-impl.rs b/tests/rustdoc/const-generics/add-impl.rs
index b5226ad3f78bd..195e47bc8ba80 100644
--- a/tests/rustdoc/const-generics/add-impl.rs
+++ b/tests/rustdoc/const-generics/add-impl.rs
@@ -2,7 +2,7 @@
 
 use std::ops::Add;
 
-// @has foo/struct.Simd.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Simd'
+// @has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd'
 pub struct Simd {
     inner: T,
 }
diff --git a/tests/rustdoc/const-generics/const-generic-defaults.rs b/tests/rustdoc/const-generics/const-generic-defaults.rs
index acc3b853e5679..f781c6a62f24b 100644
--- a/tests/rustdoc/const-generics/const-generic-defaults.rs
+++ b/tests/rustdoc/const-generics/const-generic-defaults.rs
@@ -1,5 +1,5 @@
 #![crate_name = "foo"]
 
-// @has foo/struct.Foo.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
 //      'pub struct Foo(_);'
 pub struct Foo(T);
diff --git a/tests/rustdoc/const-generics/const-generics-docs.rs b/tests/rustdoc/const-generics/const-generics-docs.rs
index 543332d2c320b..ade70bbe80d92 100644
--- a/tests/rustdoc/const-generics/const-generics-docs.rs
+++ b/tests/rustdoc/const-generics/const-generics-docs.rs
@@ -3,21 +3,21 @@
 #![crate_name = "foo"]
 
 extern crate extern_crate;
-// @has foo/fn.extern_fn.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \
 //      'pub fn extern_fn() -> impl Iterator'
 pub use extern_crate::extern_fn;
-// @has foo/struct.ExternTy.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \
 //      'pub struct ExternTy {'
 pub use extern_crate::ExternTy;
-// @has foo/type.TyAlias.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \
 //      'type TyAlias = ExternTy;'
 pub use extern_crate::TyAlias;
-// @has foo/trait.WTrait.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \
 //      'pub trait WTrait'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn hey() -> usize'
+// @has - '//pre[@class="rust item-decl"]' 'fn hey() -> usize'
 pub use extern_crate::WTrait;
 
-// @has foo/trait.Trait.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \
 //      'pub trait Trait'
 // @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8'
 // @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8'
@@ -30,10 +30,10 @@ impl Trait<2> for u8 {}
 impl Trait<{1 + 2}> for u8 {}
 impl Trait for [u8; N] {}
 
-// @has foo/struct.Foo.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
 //      'pub struct Foowhere u8: Trait'
 pub struct Foo where u8: Trait;
-// @has foo/struct.Bar.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Bar(_)'
+// @has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar(_)'
 pub struct Bar([T; N]);
 
 // @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl Foowhere u8: Trait'
@@ -56,32 +56,32 @@ impl Bar {
     }
 }
 
-// @has foo/fn.test.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.test.html '//pre[@class="rust item-decl"]' \
 //      'pub fn test() -> impl Traitwhere u8: Trait'
 pub fn test() -> impl Trait where u8: Trait {
     2u8
 }
 
-// @has foo/fn.a_sink.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \
 //      'pub async fn a_sink(v: [u8; N]) -> impl Trait'
 pub async fn a_sink(v: [u8; N]) -> impl Trait {
     v
 }
 
-// @has foo/fn.b_sink.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \
 //      'pub async fn b_sink(_: impl Trait)'
 pub async fn b_sink(_: impl Trait) {}
 
-// @has foo/fn.concrete.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \
 //      'pub fn concrete() -> [u8; 22]'
 pub fn concrete() -> [u8; 3 + std::mem::size_of::() << 1] {
     Default::default()
 }
 
-// @has foo/type.Faz.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/type.Faz.html '//pre[@class="rust item-decl"]' \
 //      'type Faz = [u8; N];'
 pub type Faz = [u8; N];
-// @has foo/type.Fiz.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \
 //      'type Fiz = [[u8; N]; 48];'
 pub type Fiz = [[u8; N]; 3 << 4];
 
@@ -91,7 +91,7 @@ macro_rules! define_me {
     }
 }
 
-// @has foo/struct.Foz.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \
 //      'pub struct Foz(_);'
 define_me!(Foz);
 
@@ -103,13 +103,13 @@ impl Q for [u8; N] {
     const ASSOC: usize = N;
 }
 
-// @has foo/fn.q_user.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \
 //      'pub fn q_user() -> [u8; 13]'
 pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {
     [0; <[u8; 13] as Q>::ASSOC]
 }
 
-// @has foo/union.Union.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/union.Union.html '//pre[@class="rust item-decl"]' \
 //      'pub union Union'
 pub union Union {
     // @has - //pre "pub arr: [u8; N]"
@@ -118,7 +118,7 @@ pub union Union {
     pub another_arr: [(); N],
 }
 
-// @has foo/enum.Enum.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \
 //      'pub enum Enum'
 pub enum Enum {
     // @has - //pre "Variant([u8; N])"
diff --git a/tests/rustdoc/const-generics/const-impl.rs b/tests/rustdoc/const-generics/const-impl.rs
index 726fb8f0c3416..91866b7d890c7 100644
--- a/tests/rustdoc/const-generics/const-impl.rs
+++ b/tests/rustdoc/const-generics/const-impl.rs
@@ -8,7 +8,7 @@ pub enum Order {
     Unsorted,
 }
 
-// @has foo/struct.VSet.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct VSet'
+// @has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet'
 // @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl Send for VSet'
 // @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl Sync for VSet'
 pub struct VSet {
diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs
index c53cf6dcd0570..e23b3006da6cd 100644
--- a/tests/rustdoc/const-generics/generic_const_exprs.rs
+++ b/tests/rustdoc/const-generics/generic_const_exprs.rs
@@ -2,6 +2,6 @@
 #![feature(generic_const_exprs)]
 #![allow(incomplete_features)]
 // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647
-// @has foo/struct.Ice.html '//div[@class="item-decl"]/pre[@class="rust"]' \
+// @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \
 //      'pub struct Ice;'
 pub struct Ice where [(); N + 1]:;
diff --git a/tests/rustdoc/const-generics/type-alias.rs b/tests/rustdoc/const-generics/type-alias.rs
index 72473a112440c..4b93e72d27370 100644
--- a/tests/rustdoc/const-generics/type-alias.rs
+++ b/tests/rustdoc/const-generics/type-alias.rs
@@ -1,4 +1,4 @@
 #![crate_name = "foo"]
 
-// @has foo/type.CellIndex.html '//div[@class="item-decl"]/pre[@class="rust"]' 'type CellIndex = [i64; D];'
+// @has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex = [i64; D];'
 pub type CellIndex = [i64; D];
diff --git a/tests/rustdoc/const-intrinsic.rs b/tests/rustdoc/const-intrinsic.rs
index 42f6ac7923bf2..6d2c6cce29c29 100644
--- a/tests/rustdoc/const-intrinsic.rs
+++ b/tests/rustdoc/const-intrinsic.rs
@@ -6,20 +6,20 @@
 
 extern "rust-intrinsic" {
     // @has 'foo/fn.transmute.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub const unsafe extern "rust-intrinsic" fn transmute(_: T) -> U'
+    // @has - '//pre[@class="rust item-decl"]' 'pub const unsafe extern "rust-intrinsic" fn transmute(_: T) -> U'
     #[stable(since="1.0.0", feature="rust1")]
     #[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
     pub fn transmute(_: T) -> U;
 
     // @has 'foo/fn.unreachable.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
+    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
     #[stable(since="1.0.0", feature="rust1")]
     pub fn unreachable() -> !;
 }
 
 extern "C" {
     // @has 'foo/fn.needs_drop.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "C" fn needs_drop() -> !'
+    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !'
     #[stable(since="1.0.0", feature="rust1")]
     pub fn needs_drop() -> !;
 }
diff --git a/tests/rustdoc/const-value-display.rs b/tests/rustdoc/const-value-display.rs
index 8d95f0de9d098..a7548ad2cc467 100644
--- a/tests/rustdoc/const-value-display.rs
+++ b/tests/rustdoc/const-value-display.rs
@@ -1,9 +1,9 @@
 #![crate_name = "foo"]
 
 // @has 'foo/constant.HOUR_IN_SECONDS.html'
-// @has - '//*[@class="item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
+// @has - '//*[@class="rust item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
 pub const HOUR_IN_SECONDS: u64 = 60 * 60;
 
 // @has 'foo/constant.NEGATIVE.html'
-// @has - '//*[@class="item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
+// @has - '//*[@class="rust item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
 pub const NEGATIVE: i64 = -60 * 60;
diff --git a/tests/rustdoc/decl-trailing-whitespace.rs b/tests/rustdoc/decl-trailing-whitespace.rs
index e47edc1321851..d2a12435d8f27 100644
--- a/tests/rustdoc/decl-trailing-whitespace.rs
+++ b/tests/rustdoc/decl-trailing-whitespace.rs
@@ -7,7 +7,7 @@ pub struct Error;
 // @has 'foo/trait.Write.html'
 
 pub trait Write {
-    // @snapshot 'declaration' - '//*[@class="item-decl"]//code'
+    // @snapshot 'declaration' - '//*[@class="rust item-decl"]//code'
     fn poll_write(
         self: Option,
         cx: &mut Option,
diff --git a/tests/rustdoc/document-item-with-associated-const-in-where-clause.rs b/tests/rustdoc/document-item-with-associated-const-in-where-clause.rs
new file mode 100644
index 0000000000000..c9408ef3360b4
--- /dev/null
+++ b/tests/rustdoc/document-item-with-associated-const-in-where-clause.rs
@@ -0,0 +1,17 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+pub trait Enumerable {
+    const N: usize;
+}
+
+#[derive(Clone)]
+pub struct SymmetricGroup
+where
+    S: Enumerable,
+    [(); S::N]: Sized,
+{
+    _phantom: std::marker::PhantomData,
+}
+
+fn main() {}
diff --git a/tests/rustdoc/fn-pointer-arg-name.rs b/tests/rustdoc/fn-pointer-arg-name.rs
index 96c64ac4e0211..359ca64ee8d67 100644
--- a/tests/rustdoc/fn-pointer-arg-name.rs
+++ b/tests/rustdoc/fn-pointer-arg-name.rs
@@ -1,5 +1,5 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.f.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f(callback: fn(len: usize, foo: u32))'
+// @has - '//pre[@class="rust item-decl"]' 'pub fn f(callback: fn(len: usize, foo: u32))'
 pub fn f(callback: fn(len: usize, foo: u32)) {}
diff --git a/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs b/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs
index 406157ce26c80..d368db909fa01 100644
--- a/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs
+++ b/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs
@@ -63,7 +63,7 @@ impl Helper for St {
 // this test as long as one can ensure that private fields are not leaked!
 //
 // @has hide_complex_unevaluated_const_arguments/trait.Sub.html \
-//      '//div[@class="item-decl"]/pre[@class="rust"]' \
+//      '//pre[@class="rust item-decl"]' \
 //      'pub trait Sub: Sup<{ _ }, { _ }> { }'
 pub trait Sub: Sup<{ 90 * 20 * 4 }, { Struct { private: () } }> {}
 
diff --git a/tests/rustdoc/inline-default-methods.rs b/tests/rustdoc/inline-default-methods.rs
index a4ca928f3331b..e6468316f583b 100644
--- a/tests/rustdoc/inline-default-methods.rs
+++ b/tests/rustdoc/inline-default-methods.rs
@@ -4,6 +4,6 @@
 extern crate inline_default_methods;
 
 // @has inline_default_methods/trait.Foo.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn bar(&self);'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn foo(&mut self) { ... }'
+// @has - '//pre[@class="rust item-decl"]' 'fn bar(&self);'
+// @has - '//pre[@class="rust item-decl"]' 'fn foo(&mut self) { ... }'
 pub use inline_default_methods::Foo;
diff --git a/tests/rustdoc/inline_cross/dyn_trait.rs b/tests/rustdoc/inline_cross/dyn_trait.rs
index 0da8bfc3a9ae3..649d98f71396a 100644
--- a/tests/rustdoc/inline_cross/dyn_trait.rs
+++ b/tests/rustdoc/inline_cross/dyn_trait.rs
@@ -4,28 +4,28 @@
 // edition:2021
 
 // @has user/type.Ty0.html
-// @has - '//*[@class="item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool + 'static"
+// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool + 'static"
 // FIXME(fmease): Hide default lifetime bound `'static`
 pub use dyn_trait::Ty0;
 
 // @has user/type.Ty1.html
-// @has - '//*[@class="item-decl"]//code' "dyn Display + 'obj"
+// @has - '//*[@class="rust item-decl"]//code' "dyn Display + 'obj"
 pub use dyn_trait::Ty1;
 
 // @has user/type.Ty2.html
-// @has - '//*[@class="item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>"
+// @has - '//*[@class="rust item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>"
 pub use dyn_trait::Ty2;
 
 // @has user/type.Ty3.html
-// @has - '//*[@class="item-decl"]//code' "&'s (dyn ToString + 's)"
+// @has - '//*[@class="rust item-decl"]//code' "&'s (dyn ToString + 's)"
 // FIXME(fmease): Hide default lifetime bound, render "&'s dyn ToString"
 pub use dyn_trait::Ty3;
 
 // @has user/fn.func0.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func0(_: &dyn Fn())"
+// @has - '//pre[@class="rust item-decl"]' "func0(_: &dyn Fn())"
 // FIXME(fmease): Show placeholder-lifetime bound, render "func0(_: &(dyn Fn() + '_))"
 pub use dyn_trait::func0;
 
 // @has user/fn.func1.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func1<'func>(_: &(dyn Fn() + 'func))"
+// @has - '//pre[@class="rust item-decl"]' "func1<'func>(_: &(dyn Fn() + 'func))"
 pub use dyn_trait::func1;
diff --git a/tests/rustdoc/inline_cross/impl_trait.rs b/tests/rustdoc/inline_cross/impl_trait.rs
index e8587209b6165..7d810ab481372 100644
--- a/tests/rustdoc/inline_cross/impl_trait.rs
+++ b/tests/rustdoc/inline_cross/impl_trait.rs
@@ -4,37 +4,37 @@
 extern crate impl_trait_aux;
 
 // @has impl_trait/fn.func.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn func<'a>(_x: impl Clone + Into> + 'a)"
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+// @has - '//pre[@class="rust item-decl"]' "pub fn func<'a>(_x: impl Clone + Into> + 'a)"
+// @!has - '//pre[@class="rust item-decl"]' 'where'
 pub use impl_trait_aux::func;
 
 // @has impl_trait/fn.func2.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func2("
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_x: impl Deref> + Iterator,"
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_y: impl Iterator)"
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+// @has - '//pre[@class="rust item-decl"]' "func2("
+// @has - '//pre[@class="rust item-decl"]' "_x: impl Deref> + Iterator,"
+// @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator)"
+// @!has - '//pre[@class="rust item-decl"]' 'where'
 pub use impl_trait_aux::func2;
 
 // @has impl_trait/fn.func3.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func3("
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_x: impl Iterator> + Clone)"
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+// @has - '//pre[@class="rust item-decl"]' "func3("
+// @has - '//pre[@class="rust item-decl"]' "_x: impl Iterator> + Clone)"
+// @!has - '//pre[@class="rust item-decl"]' 'where'
 pub use impl_trait_aux::func3;
 
 // @has impl_trait/fn.func4.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func4("
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "T: Iterator,"
+// @has - '//pre[@class="rust item-decl"]' "func4("
+// @has - '//pre[@class="rust item-decl"]' "T: Iterator,"
 pub use impl_trait_aux::func4;
 
 // @has impl_trait/fn.func5.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func5("
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other = ()>,"
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(_: &'beta ())>"
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+// @has - '//pre[@class="rust item-decl"]' "func5("
+// @has - '//pre[@class="rust item-decl"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other = ()>,"
+// @has - '//pre[@class="rust item-decl"]' "_a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(_: &'beta ())>"
+// @!has - '//pre[@class="rust item-decl"]' 'where'
 pub use impl_trait_aux::func5;
 
 // @has impl_trait/fn.async_fn.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn async_fn()"
+// @has - '//pre[@class="rust item-decl"]' "pub async fn async_fn()"
 pub use impl_trait_aux::async_fn;
 
 // @has impl_trait/struct.Foo.html
diff --git a/tests/rustdoc/inline_cross/issue-24183.rs b/tests/rustdoc/inline_cross/issue-24183.rs
index d11b6955f3c0f..751a32385e812 100644
--- a/tests/rustdoc/inline_cross/issue-24183.rs
+++ b/tests/rustdoc/inline_cross/issue-24183.rs
@@ -5,7 +5,7 @@
 // edition: 2021
 
 // @has usr/trait.U.html
-// @has - '//*[@class="item-decl"]' "pub trait U {"
+// @has - '//*[@class="rust item-decl"]' "pub trait U {"
 // @has - '//*[@id="method.modified"]' \
 // "fn modified(self) -> Self\
 // where \
@@ -14,5 +14,5 @@
 pub use issue_24183::U;
 
 // @has usr/trait.S.html
-// @has - '//*[@class="item-decl"]' 'pub trait S: Sized {'
+// @has - '//*[@class="rust item-decl"]' 'pub trait S: Sized {'
 pub use issue_24183::S;
diff --git a/tests/rustdoc/inline_cross/macros.rs b/tests/rustdoc/inline_cross/macros.rs
index d5b0de5725bce..b11d5b6c4fa2e 100644
--- a/tests/rustdoc/inline_cross/macros.rs
+++ b/tests/rustdoc/inline_cross/macros.rs
@@ -6,9 +6,9 @@
 
 extern crate macros;
 
-// @has foo/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
+// @has foo/index.html '//*[@class="item-left"]/span[@class="stab deprecated"]' \
 //         Deprecated
-// @has - '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
+// @has - '//*[@class="item-left"]/span[@class="stab unstable"]' \
 //         Experimental
 
 // @has foo/macro.my_macro.html
diff --git a/tests/rustdoc/issue-20646.rs b/tests/rustdoc/issue-20646.rs
index a774b0ca7cd7a..b2ee9c26014b3 100644
--- a/tests/rustdoc/issue-20646.rs
+++ b/tests/rustdoc/issue-20646.rs
@@ -13,7 +13,7 @@ pub trait Trait {
 }
 
 // @has issue_20646/fn.fun.html \
-//      '//div[@class="item-decl"]/pre[@class="rust"]' 'where T: Trait'
+//      '//pre[@class="rust item-decl"]' 'where T: Trait'
 pub fn fun(_: T) where T: Trait {}
 
 pub mod reexport {
@@ -21,6 +21,6 @@ pub mod reexport {
     //      '//*[@id="associatedtype.Output"]' \
     //      'type Output'
     // @has issue_20646/reexport/fn.fun.html \
-    //      '//div[@class="item-decl"]/pre[@class="rust"]' 'where T: Trait'
+    //      '//pre[@class="rust item-decl"]' 'where T: Trait'
     pub use issue_20646::{Trait, fun};
 }
diff --git a/tests/rustdoc/issue-20727-2.rs b/tests/rustdoc/issue-20727-2.rs
index 026b4f5acc912..c1aa9617b2e25 100644
--- a/tests/rustdoc/issue-20727-2.rs
+++ b/tests/rustdoc/issue-20727-2.rs
@@ -5,18 +5,18 @@ extern crate issue_20727;
 
 // @has issue_20727_2/trait.Add.html
 pub trait Add {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Add {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Output;'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Add {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Output;'
     type Output;
 
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn add(self, rhs: RHS) -> Self::Output;'
+    // @has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;'
     fn add(self, rhs: RHS) -> Self::Output;
 }
 
 // @has issue_20727_2/reexport/trait.Add.html
 pub mod reexport {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Add {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Output;'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn add(self, rhs: RHS) -> Self::Output;'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Add {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Output;'
+    // @has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;'
     pub use issue_20727::Add;
 }
diff --git a/tests/rustdoc/issue-20727-3.rs b/tests/rustdoc/issue-20727-3.rs
index 741ce8023d7e7..2f9d91fc5f724 100644
--- a/tests/rustdoc/issue-20727-3.rs
+++ b/tests/rustdoc/issue-20727-3.rs
@@ -7,18 +7,18 @@ pub trait Bar {}
 
 // @has issue_20727_3/trait.Deref2.html
 pub trait Deref2 {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Deref2 {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Target: Bar;'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Deref2 {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Target: Bar;'
     type Target: Bar;
 
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn deref(&self) -> Self::Target;'
+    // @has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;'
     fn deref(&self) -> Self::Target;
 }
 
 // @has issue_20727_3/reexport/trait.Deref2.html
 pub mod reexport {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Deref2 {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Target: Bar;'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn deref(&self) -> Self::Target;'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Deref2 {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Target: Bar;'
+    // @has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;'
     pub use issue_20727::Deref2;
 }
diff --git a/tests/rustdoc/issue-20727-4.rs b/tests/rustdoc/issue-20727-4.rs
index b8fac4da6eadf..ec9f18fc3feb8 100644
--- a/tests/rustdoc/issue-20727-4.rs
+++ b/tests/rustdoc/issue-20727-4.rs
@@ -5,36 +5,36 @@ extern crate issue_20727;
 
 // @has issue_20727_4/trait.Index.html
 pub trait Index {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Index {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Output: ?Sized'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Index {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized'
     type Output: ?Sized;
 
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'fn index(&self, index: Idx) -> &Self::Output'
     fn index(&self, index: Idx) -> &Self::Output;
 }
 
 // @has issue_20727_4/trait.IndexMut.html
 pub trait IndexMut: Index {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'trait IndexMut: Index {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;'
     fn index_mut(&mut self, index: Idx) -> &mut Self::Output;
 }
 
 pub mod reexport {
     // @has issue_20727_4/reexport/trait.Index.html
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Indexwhere Idx: ?Sized,{'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Output: ?Sized'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' 'trait Indexwhere Idx: ?Sized,{'
+    // @has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized'
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'fn index(&self, index: Idx) -> &Self::Output'
     pub use issue_20727::Index;
 
     // @has issue_20727_4/reexport/trait.IndexMut.html
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'trait IndexMut: Indexwhere Idx: ?Sized,{'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;'
     pub use issue_20727::IndexMut;
 }
diff --git a/tests/rustdoc/issue-20727.rs b/tests/rustdoc/issue-20727.rs
index df334821cccc9..266848beef93d 100644
--- a/tests/rustdoc/issue-20727.rs
+++ b/tests/rustdoc/issue-20727.rs
@@ -5,20 +5,20 @@ extern crate issue_20727;
 
 // @has issue_20727/trait.Deref.html
 pub trait Deref {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Deref {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Target: ?Sized;'
+    // @has - '//pre[@class="rust item-decl"]' 'trait Deref {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;'
     type Target: ?Sized;
 
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' \
     //        "fn deref<'a>(&'a self) -> &'a Self::Target;"
     fn deref<'a>(&'a self) -> &'a Self::Target;
 }
 
 // @has issue_20727/reexport/trait.Deref.html
 pub mod reexport {
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'trait Deref {'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'type Target: ?Sized;'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' \
+    // @has - '//pre[@class="rust item-decl"]' 'trait Deref {'
+    // @has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;'
+    // @has - '//pre[@class="rust item-decl"]' \
     //      "fn deref<'a>(&'a self) -> &'a Self::Target;"
     pub use issue_20727::Deref;
 }
diff --git a/tests/rustdoc/issue-22038.rs b/tests/rustdoc/issue-22038.rs
index 19e626ba13235..de6cc78707c6d 100644
--- a/tests/rustdoc/issue-22038.rs
+++ b/tests/rustdoc/issue-22038.rs
@@ -1,19 +1,19 @@
 extern "C" {
     // @has issue_22038/fn.foo1.html \
-    //      '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "C" fn foo1()'
+    //      '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn foo1()'
     pub fn foo1();
 }
 
 extern "system" {
     // @has issue_22038/fn.foo2.html \
-    //      '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "system" fn foo2()'
+    //      '//pre[@class="rust item-decl"]' 'pub unsafe extern "system" fn foo2()'
     pub fn foo2();
 }
 
 // @has issue_22038/fn.bar.html \
-//      '//div[@class="item-decl"]/pre[@class="rust"]' 'pub extern "C" fn bar()'
+//      '//pre[@class="rust item-decl"]' 'pub extern "C" fn bar()'
 pub extern "C" fn bar() {}
 
 // @has issue_22038/fn.baz.html \
-//      '//div[@class="item-decl"]/pre[@class="rust"]' 'pub extern "system" fn baz()'
+//      '//pre[@class="rust item-decl"]' 'pub extern "system" fn baz()'
 pub extern "system" fn baz() {}
diff --git a/tests/rustdoc/issue-32374.rs b/tests/rustdoc/issue-32374.rs
index 8296d7a81f2b1..1153a745b0bfe 100644
--- a/tests/rustdoc/issue-32374.rs
+++ b/tests/rustdoc/issue-32374.rs
@@ -2,9 +2,9 @@
 #![doc(issue_tracker_base_url = "https://issue_url/")]
 #![unstable(feature = "test", issue = "32374")]
 
-// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
+// @matches issue_32374/index.html '//*[@class="item-left"]/span[@class="stab deprecated"]' \
 //      'Deprecated'
-// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
+// @matches issue_32374/index.html '//*[@class="item-left"]/span[@class="stab unstable"]' \
 //      'Experimental'
 // @matches issue_32374/index.html '//*[@class="item-right docblock-short"]/text()' 'Docs'
 
diff --git a/tests/rustdoc/issue-33302.rs b/tests/rustdoc/issue-33302.rs
index 7af00c778361d..a316f3ad99bcf 100644
--- a/tests/rustdoc/issue-33302.rs
+++ b/tests/rustdoc/issue-33302.rs
@@ -6,17 +6,17 @@ macro_rules! make {
         pub struct S;
 
         // @has issue_33302/constant.CST.html \
-        //        '//div[@class="item-decl"]/pre[@class="rust"]' 'pub const CST: i32'
+        //        '//pre[@class="rust item-decl"]' 'pub const CST: i32'
         pub const CST: i32 = ($n * $n);
         // @has issue_33302/static.ST.html \
-        //        '//div[@class="item-decl"]/pre[@class="rust"]' 'pub static ST: i32'
+        //        '//pre[@class="rust item-decl"]' 'pub static ST: i32'
         pub static ST: i32 = ($n * $n);
 
         pub trait T {
             fn ignore(_: &X) {}
             const C: X;
             // @has issue_33302/trait.T.html \
-            //        '//div[@class="item-decl"]/pre[@class="rust"]' 'const D: i32'
+            //        '//pre[@class="rust item-decl"]' 'const D: i32'
             // @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
             const D: i32 = ($n * $n);
         }
diff --git a/tests/rustdoc/issue-85454.rs b/tests/rustdoc/issue-85454.rs
index 74fc22b31dc0c..2d410a5974afa 100644
--- a/tests/rustdoc/issue-85454.rs
+++ b/tests/rustdoc/issue-85454.rs
@@ -5,7 +5,7 @@
 extern crate issue_85454;
 
 // @has foo/trait.FromResidual.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
+// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
 pub trait FromResidual::Residual> {
     fn from_residual(residual: R) -> Self;
 }
@@ -24,6 +24,6 @@ pub enum ControlFlow {
 
 pub mod reexport {
     // @has foo/reexport/trait.FromResidual.html
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
+    // @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
     pub use issue_85454::*;
 }
diff --git a/tests/rustdoc/issue-98697.rs b/tests/rustdoc/issue-98697.rs
index 884b63ac97ffc..5d5aee1fe1df6 100644
--- a/tests/rustdoc/issue-98697.rs
+++ b/tests/rustdoc/issue-98697.rs
@@ -8,8 +8,8 @@
 
 extern crate issue_98697_reexport_with_anonymous_lifetime;
 
-// @has issue_98697/fn.repro.html '//div[@class="item-decl"]/pre[@class="rust"]/code' 'fn repro()where F: Fn(&str)'
-// @!has issue_98697/fn.repro.html '//div[@class="item-decl"]/pre[@class="rust"]/code' 'for<'
+// @has issue_98697/fn.repro.html '//pre[@class="rust item-decl"]/code' 'fn repro()where F: Fn(&str)'
+// @!has issue_98697/fn.repro.html '//pre[@class="rust item-decl"]/code' 'for<'
 pub use issue_98697_reexport_with_anonymous_lifetime::repro;
 
 // @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra'
diff --git a/tests/rustdoc/legacy-const-generic.rs b/tests/rustdoc/legacy-const-generic.rs
index 14533624e448e..3a488bdd2088b 100644
--- a/tests/rustdoc/legacy-const-generic.rs
+++ b/tests/rustdoc/legacy-const-generic.rs
@@ -2,14 +2,14 @@
 #![feature(rustc_attrs)]
 
 // @has 'foo/fn.foo.html'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]'
+// @has - '//pre[@class="rust item-decl"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]'
 #[rustc_legacy_const_generics(1)]
 pub fn foo(x: usize, z: usize) -> [usize; 3] {
     [x, Y, z]
 }
 
 // @has 'foo/fn.bar.html'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]'
+// @has - '//pre[@class="rust item-decl"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]'
 #[rustc_legacy_const_generics(1, 2)]
 pub fn bar(x: usize) -> [usize; 3] {
     [x, Y, z]
diff --git a/tests/rustdoc/lifetime-name.rs b/tests/rustdoc/lifetime-name.rs
index 0fb6605910907..15e09f5165a2f 100644
--- a/tests/rustdoc/lifetime-name.rs
+++ b/tests/rustdoc/lifetime-name.rs
@@ -1,5 +1,5 @@
 #![crate_name = "foo"]
 
 // @has 'foo/type.Resolutions.html'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub type Resolutions<'tcx> = &'tcx u8;"
+// @has - '//pre[@class="rust item-decl"]' "pub type Resolutions<'tcx> = &'tcx u8;"
 pub type Resolutions<'tcx> = &'tcx u8;
diff --git a/tests/rustdoc/macro-higher-kinded-function.rs b/tests/rustdoc/macro-higher-kinded-function.rs
index b8c52b7b791d6..a45ef37a7fce5 100644
--- a/tests/rustdoc/macro-higher-kinded-function.rs
+++ b/tests/rustdoc/macro-higher-kinded-function.rs
@@ -11,8 +11,8 @@ macro_rules! gen {
 }
 
 // @has 'foo/struct.Providers.html'
-// @has - '//*[@class="item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
-// @has - '//*[@class="item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
+// @has - '//*[@class="rust item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
+// @has - '//*[@class="rust item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
 // @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8"
 // @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16"
 gen! {
diff --git a/tests/rustdoc/mut-params.rs b/tests/rustdoc/mut-params.rs
index 431db51d95f7c..e403b7b78c9e7 100644
--- a/tests/rustdoc/mut-params.rs
+++ b/tests/rustdoc/mut-params.rs
@@ -13,6 +13,6 @@ impl Foo {
     pub fn bar(mut bar: ()) {}
 }
 
-// @count foo/fn.baz.html '//div[@class="item-decl"]/pre[@class="rust"]' 1
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'mut'
+// @count foo/fn.baz.html '//pre[@class="rust item-decl"]' 1
+// @!has - '//pre[@class="rust item-decl"]' 'mut'
 pub fn baz(mut foo: Foo) {}
diff --git a/tests/rustdoc/normalize-assoc-item.rs b/tests/rustdoc/normalize-assoc-item.rs
index 659480479fd13..af7b2f955fd4e 100644
--- a/tests/rustdoc/normalize-assoc-item.rs
+++ b/tests/rustdoc/normalize-assoc-item.rs
@@ -19,12 +19,12 @@ impl Trait for isize {
     type X = <() as Trait>::X;
 }
 
-// @has 'normalize_assoc_item/fn.f.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f() -> isize'
+// @has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust item-decl"]' 'pub fn f() -> isize'
 pub fn f() -> ::X {
     0
 }
 
-// @has 'normalize_assoc_item/fn.f2.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f2() -> fn() -> i32'
+// @has 'normalize_assoc_item/fn.f2.html' '//pre[@class="rust item-decl"]' 'pub fn f2() -> fn() -> i32'
 pub fn f2() -> ::X {
     todo!()
 }
@@ -49,10 +49,10 @@ impl Trait for Generic {
 // These can't be normalized because they depend on a generic parameter.
 // However the user can choose whether the text should be displayed as `Inner::X` or `::X`.
 
-// @has 'normalize_assoc_item/struct.Unknown.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Unknown(pub ::X);'
+// @has 'normalize_assoc_item/struct.Unknown.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown(pub ::X);'
 pub struct Unknown(pub ::X);
 
-// @has 'normalize_assoc_item/struct.Unknown2.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Unknown2(pub Inner::X);'
+// @has 'normalize_assoc_item/struct.Unknown2.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown2(pub Inner::X);'
 pub struct Unknown2(pub Inner::X);
 
 trait Lifetimes<'a> {
@@ -63,20 +63,20 @@ impl<'a> Lifetimes<'a> for usize {
     type Y = &'a isize;
 }
 
-// @has 'normalize_assoc_item/fn.g.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn g() -> &isize"
+// @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust item-decl"]' "pub fn g() -> &isize"
 pub fn g() -> >::Y {
     &0
 }
 
-// @has 'normalize_assoc_item/constant.A.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub const A: &isize"
+// @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust item-decl"]' "pub const A: &isize"
 pub const A: >::Y = &0;
 
 // test cross-crate re-exports
 extern crate inner;
-// @has 'normalize_assoc_item/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn foo() -> i32"
+// @has 'normalize_assoc_item/fn.foo.html' '//pre[@class="rust item-decl"]' "pub fn foo() -> i32"
 pub use inner::foo;
 
-// @has 'normalize_assoc_item/fn.h.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn h() -> IntoIter"
+// @has 'normalize_assoc_item/fn.h.html' '//pre[@class="rust item-decl"]' "pub fn h() -> IntoIter"
 pub fn h() ->  as IntoIterator>::IntoIter {
     vec![].into_iter()
 }
diff --git a/tests/rustdoc/pub-method.rs b/tests/rustdoc/pub-method.rs
index 7115a01d079ff..ea4791579cd65 100644
--- a/tests/rustdoc/pub-method.rs
+++ b/tests/rustdoc/pub-method.rs
@@ -3,7 +3,7 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.bar.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn bar() -> '
+// @has - '//pre[@class="rust item-decl"]' 'pub fn bar() -> '
 /// foo
 pub fn bar() -> usize {
     2
diff --git a/tests/rustdoc/range-arg-pattern.rs b/tests/rustdoc/range-arg-pattern.rs
index bdbcc47c9f28d..d0d9111bb4088 100644
--- a/tests/rustdoc/range-arg-pattern.rs
+++ b/tests/rustdoc/range-arg-pattern.rs
@@ -1,5 +1,5 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.f.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f(_: u8)'
+// @has - '//pre[@class="rust item-decl"]' 'pub fn f(_: u8)'
 pub fn f(0u8..=255: u8) {}
diff --git a/tests/rustdoc/reexport-check.rs b/tests/rustdoc/reexport-check.rs
index acac0c9919716..94fa03385322a 100644
--- a/tests/rustdoc/reexport-check.rs
+++ b/tests/rustdoc/reexport-check.rs
@@ -4,7 +4,6 @@
 extern crate reexport_check;
 
 // @!has 'foo/index.html' '//code' 'pub use self::i32;'
-// @has 'foo/index.html' '//div[@class="item-left deprecated"]' 'i32'
 // @has 'foo/i32/index.html'
 #[allow(deprecated, deprecated_in_future)]
 pub use std::i32;
@@ -12,6 +11,9 @@ pub use std::i32;
 // @has 'foo/index.html' '//div[@class="item-left"]' 'String'
 pub use std::string::String;
 
+// i32 is deprecated, String is not
+// @count 'foo/index.html' '//span[@class="stab deprecated"]' 1
+
 // @has 'foo/index.html' '//div[@class="item-right docblock-short"]' 'Docs in original'
 // this is a no-op, but shows what happens if there's an attribute that isn't a doc-comment
 #[doc(inline)]
diff --git a/tests/rustdoc/reexport-dep-foreign-fn.rs b/tests/rustdoc/reexport-dep-foreign-fn.rs
index 6694c91d10442..e7f5720d583c9 100644
--- a/tests/rustdoc/reexport-dep-foreign-fn.rs
+++ b/tests/rustdoc/reexport-dep-foreign-fn.rs
@@ -8,5 +8,5 @@
 extern crate all_item_types;
 
 // @has 'foo/fn.foo_ffn.html'
-// @has - '//*[@class="item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
+// @has - '//*[@class="rust item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
 pub use all_item_types::foo_ffn;
diff --git a/tests/rustdoc/reexports-priv.rs b/tests/rustdoc/reexports-priv.rs
index 35c90ba5d7b89..84ea4ad2c9ef3 100644
--- a/tests/rustdoc/reexports-priv.rs
+++ b/tests/rustdoc/reexports-priv.rs
@@ -5,7 +5,7 @@
 
 extern crate reexports;
 
-// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {'
 pub use reexports::addr_of;
 // @!has 'foo/macro.addr_of_crate.html'
 pub(crate) use reexports::addr_of_crate;
@@ -14,7 +14,7 @@ pub(self) use reexports::addr_of_self;
 // @!has 'foo/macro.addr_of_local.html'
 use reexports::addr_of_local;
 
-// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;'
 pub use reexports::Foo;
 // @!has 'foo/struct.FooCrate.html'
 pub(crate) use reexports::FooCrate;
@@ -23,7 +23,7 @@ pub(self) use reexports::FooSelf;
 // @!has 'foo/struct.FooLocal.html'
 use reexports::FooLocal;
 
-// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {'
 pub use reexports::Bar;
 // @!has 'foo/enum.BarCrate.html'
 pub(crate) use reexports::BarCrate;
@@ -32,7 +32,7 @@ pub(self) use reexports::BarSelf;
 // @!has 'foo/enum.BarLocal.html'
 use reexports::BarLocal;
 
-// @has 'foo/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo()'
+// @has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()'
 pub use reexports::foo;
 // @!has 'foo/fn.foo_crate.html'
 pub(crate) use reexports::foo_crate;
@@ -41,7 +41,7 @@ pub(self) use reexports::foo_self;
 // @!has 'foo/fn.foo_local.html'
 use reexports::foo_local;
 
-// @has 'foo/type.Type.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub type Type ='
+// @has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type ='
 pub use reexports::Type;
 // @!has 'foo/type.TypeCrate.html'
 pub(crate) use reexports::TypeCrate;
@@ -50,7 +50,7 @@ pub(self) use reexports::TypeSelf;
 // @!has 'foo/type.TypeLocal.html'
 use reexports::TypeLocal;
 
-// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {'
 pub use reexports::Union;
 // @!has 'foo/union.UnionCrate.html'
 pub(crate) use reexports::UnionCrate;
@@ -61,66 +61,66 @@ use reexports::UnionLocal;
 
 pub mod outer {
     pub mod inner {
-        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {'
         pub use reexports::addr_of;
-        // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="rust item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
         pub(crate) use reexports::addr_of_crate;
-        // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="rust item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
         pub(super) use reexports::addr_of_super;
         // @!has 'foo/outer/inner/macro.addr_of_self.html'
         pub(self) use reexports::addr_of_self;
         // @!has 'foo/outer/inner/macro.addr_of_local.html'
         use reexports::addr_of_local;
 
-        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
+        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;'
         pub use reexports::Foo;
-        // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="item-decl"]' 'pub(crate) struct FooCrate;'
+        // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) struct FooCrate;'
         pub(crate) use reexports::FooCrate;
-        // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="item-decl"]' 'pub(in outer) struct FooSuper;'
+        // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) struct FooSuper;'
         pub(super) use reexports::FooSuper;
         // @!has 'foo/outer/inner/struct.FooSelf.html'
         pub(self) use reexports::FooSelf;
         // @!has 'foo/outer/inner/struct.FooLocal.html'
         use reexports::FooLocal;
 
-        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
+        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {'
         pub use reexports::Bar;
-        // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="item-decl"]' 'pub(crate) enum BarCrate {'
+        // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) enum BarCrate {'
         pub(crate) use reexports::BarCrate;
-        // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="item-decl"]' 'pub(in outer) enum BarSuper {'
+        // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) enum BarSuper {'
         pub(super) use reexports::BarSuper;
         // @!has 'foo/outer/inner/enum.BarSelf.html'
         pub(self) use reexports::BarSelf;
         // @!has 'foo/outer/inner/enum.BarLocal.html'
         use reexports::BarLocal;
 
-        // @has 'foo/outer/inner/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo()'
+        // @has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()'
         pub use reexports::foo;
-        // @has 'foo/outer/inner/fn.foo_crate.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub(crate) fn foo_crate()'
+        // @has 'foo/outer/inner/fn.foo_crate.html' '//pre[@class="rust item-decl"]' 'pub(crate) fn foo_crate()'
         pub(crate) use reexports::foo_crate;
-        // @has 'foo/outer/inner/fn.foo_super.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub(in outer) fn foo_super()'
+        // @has 'foo/outer/inner/fn.foo_super.html' '//pre[@class="rust item-decl"]' 'pub(in outer) fn foo_super()'
         pub(super) use::reexports::foo_super;
         // @!has 'foo/outer/inner/fn.foo_self.html'
         pub(self) use reexports::foo_self;
         // @!has 'foo/outer/inner/fn.foo_local.html'
         use reexports::foo_local;
 
-        // @has 'foo/outer/inner/type.Type.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub type Type ='
+        // @has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type ='
         pub use reexports::Type;
-        // @has 'foo/outer/inner/type.TypeCrate.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub(crate) type TypeCrate ='
+        // @has 'foo/outer/inner/type.TypeCrate.html' '//pre[@class="rust item-decl"]' 'pub(crate) type TypeCrate ='
         pub(crate) use reexports::TypeCrate;
-        // @has 'foo/outer/inner/type.TypeSuper.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub(in outer) type TypeSuper ='
+        // @has 'foo/outer/inner/type.TypeSuper.html' '//pre[@class="rust item-decl"]' 'pub(in outer) type TypeSuper ='
         pub(super) use reexports::TypeSuper;
         // @!has 'foo/outer/inner/type.TypeSelf.html'
         pub(self) use reexports::TypeSelf;
         // @!has 'foo/outer/inner/type.TypeLocal.html'
         use reexports::TypeLocal;
 
-        // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
+        // @has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {'
         pub use reexports::Union;
-        // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="item-decl"]' 'pub(crate) union UnionCrate {'
+        // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) union UnionCrate {'
         pub(crate) use reexports::UnionCrate;
-        // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="item-decl"]' 'pub(in outer) union UnionSuper {'
+        // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) union UnionSuper {'
         pub(super) use reexports::UnionSuper;
         // @!has 'foo/outer/inner/union.UnionSelf.html'
         pub(self) use reexports::UnionSelf;
diff --git a/tests/rustdoc/reexports.rs b/tests/rustdoc/reexports.rs
index 65d305c6d2c42..3c51ac395afc5 100644
--- a/tests/rustdoc/reexports.rs
+++ b/tests/rustdoc/reexports.rs
@@ -4,7 +4,7 @@
 
 extern crate reexports;
 
-// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {'
 pub use reexports::addr_of;
 // @!has 'foo/macro.addr_of_crate.html'
 pub(crate) use reexports::addr_of_crate;
@@ -13,7 +13,7 @@ pub(self) use reexports::addr_of_self;
 // @!has 'foo/macro.addr_of_local.html'
 use reexports::addr_of_local;
 
-// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;'
 pub use reexports::Foo;
 // @!has 'foo/struct.FooCrate.html'
 pub(crate) use reexports::FooCrate;
@@ -22,7 +22,7 @@ pub(self) use reexports::FooSelf;
 // @!has 'foo/struct.FooLocal.html'
 use reexports::FooLocal;
 
-// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {'
 pub use reexports::Bar;
 // @!has 'foo/enum.BarCrate.html'
 pub(crate) use reexports::BarCrate;
@@ -31,7 +31,7 @@ pub(self) use reexports::BarSelf;
 // @!has 'foo/enum.BarLocal.html'
 use reexports::BarLocal;
 
-// @has 'foo/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo()'
+// @has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()'
 pub use reexports::foo;
 // @!has 'foo/fn.foo_crate.html'
 pub(crate) use reexports::foo_crate;
@@ -40,7 +40,7 @@ pub(self) use reexports::foo_self;
 // @!has 'foo/fn.foo_local.html'
 use reexports::foo_local;
 
-// @has 'foo/type.Type.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub type Type ='
+// @has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type ='
 pub use reexports::Type;
 // @!has 'foo/type.TypeCrate.html'
 pub(crate) use reexports::TypeCrate;
@@ -49,7 +49,7 @@ pub(self) use reexports::TypeSelf;
 // @!has 'foo/type.TypeLocal.html'
 use reexports::TypeLocal;
 
-// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {'
 pub use reexports::Union;
 // @!has 'foo/union.UnionCrate.html'
 pub(crate) use reexports::UnionCrate;
@@ -60,7 +60,7 @@ use reexports::UnionLocal;
 
 pub mod outer {
     pub mod inner {
-        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {'
         pub use reexports::addr_of;
         // @!has 'foo/outer/inner/macro.addr_of_crate.html'
         pub(crate) use reexports::addr_of_crate;
@@ -71,7 +71,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/macro.addr_of_local.html'
         use reexports::addr_of_local;
 
-        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
+        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;'
         pub use reexports::Foo;
         // @!has 'foo/outer/inner/struct.FooCrate.html'
         pub(crate) use reexports::FooCrate;
@@ -82,7 +82,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/struct.FooLocal.html'
         use reexports::FooLocal;
 
-        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
+        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {'
         pub use reexports::Bar;
         // @!has 'foo/outer/inner/enum.BarCrate.html'
         pub(crate) use reexports::BarCrate;
@@ -93,7 +93,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/enum.BarLocal.html'
         use reexports::BarLocal;
 
-        // @has 'foo/outer/inner/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo()'
+        // @has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()'
         pub use reexports::foo;
         // @!has 'foo/outer/inner/fn.foo_crate.html'
         pub(crate) use reexports::foo_crate;
@@ -104,7 +104,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/fn.foo_local.html'
         use reexports::foo_local;
 
-        // @has 'foo/outer/inner/type.Type.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub type Type ='
+        // @has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type ='
         pub use reexports::Type;
         // @!has 'foo/outer/inner/type.TypeCrate.html'
         pub(crate) use reexports::TypeCrate;
@@ -115,7 +115,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/type.TypeLocal.html'
         use reexports::TypeLocal;
 
-        // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
+        // @has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {'
         pub use reexports::Union;
         // @!has 'foo/outer/inner/union.UnionCrate.html'
         pub(crate) use reexports::UnionCrate;
diff --git a/tests/rustdoc/rfc-2632-const-trait-impl.rs b/tests/rustdoc/rfc-2632-const-trait-impl.rs
index a229a4e29fefb..1120302ac7ea9 100644
--- a/tests/rustdoc/rfc-2632-const-trait-impl.rs
+++ b/tests/rustdoc/rfc-2632-const-trait-impl.rs
@@ -12,10 +12,10 @@ use std::marker::Destruct;
 
 pub struct S(T);
 
-// @!has foo/trait.Tr.html '//div[@class="item-decl"]/pre[@class="rust"]/code/a[@class="trait"]' '~const'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]/code/a[@class="trait"]' 'Clone'
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]/code/span[@class="where"]' '~const'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]/code/span[@class="where"]' ': Clone'
+// @!has foo/trait.Tr.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const'
+// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Clone'
+// @!has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' '~const'
+// @has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' ': Clone'
 #[const_trait]
 pub trait Tr {
     // @!has - '//section[@id="method.a"]/h4[@class="code-header"]' '~const'
@@ -45,10 +45,10 @@ where
     }
 }
 
-// @!has foo/fn.foo.html '//div[@class="item-decl"]/pre[@class="rust"]/code/a[@class="trait"]' '~const'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]/code/a[@class="trait"]' 'Clone'
-// @!has - '//div[@class="item-decl"]/pre[@class="rust"]/code/span[@class="where fmt-newline"]' '~const'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]/code/span[@class="where fmt-newline"]' ': Clone'
+// @!has foo/fn.foo.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const'
+// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Clone'
+// @!has - '//pre[@class="rust item-decl"]/code/span[@class="where fmt-newline"]' '~const'
+// @has - '//pre[@class="rust item-decl"]/code/span[@class="where fmt-newline"]' ': Clone'
 pub const fn foo()
 where
     Option: ~const Clone + ~const Destruct,
diff --git a/tests/rustdoc/safe-intrinsic.rs b/tests/rustdoc/safe-intrinsic.rs
index 0b65bf1dfed0f..c508909f9aafa 100644
--- a/tests/rustdoc/safe-intrinsic.rs
+++ b/tests/rustdoc/safe-intrinsic.rs
@@ -7,16 +7,16 @@
 
 extern "rust-intrinsic" {
     // @has 'foo/fn.abort.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub extern "rust-intrinsic" fn abort() -> !'
+    // @has - '//pre[@class="rust item-decl"]' 'pub extern "rust-intrinsic" fn abort() -> !'
     #[rustc_safe_intrinsic]
     pub fn abort() -> !;
     // @has 'foo/fn.unreachable.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
+    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
     pub fn unreachable() -> !;
 }
 
 extern "C" {
     // @has 'foo/fn.needs_drop.html'
-    // @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub unsafe extern "C" fn needs_drop() -> !'
+    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !'
     pub fn needs_drop() -> !;
 }
diff --git a/tests/rustdoc/slice-links.rs b/tests/rustdoc/slice-links.rs
index 67137fdcab274..6dea3b74ea3ec 100644
--- a/tests/rustdoc/slice-links.rs
+++ b/tests/rustdoc/slice-links.rs
@@ -4,25 +4,25 @@
 pub struct MyBox(*const T);
 
 // @has 'foo/fn.alpha.html'
-// @snapshot link_slice_u32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code'
 pub fn alpha() -> &'static [u32] {
     loop {}
 }
 
 // @has 'foo/fn.beta.html'
-// @snapshot link_slice_generic - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code'
 pub fn beta() -> &'static [T] {
     loop {}
 }
 
 // @has 'foo/fn.gamma.html'
-// @snapshot link_box_u32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code'
 pub fn gamma() -> MyBox<[u32]> {
     loop {}
 }
 
 // @has 'foo/fn.delta.html'
-// @snapshot link_box_generic - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_box_generic - '//pre[@class="rust item-decl"]/code'
 pub fn delta() -> MyBox<[T]> {
     loop {}
 }
diff --git a/tests/rustdoc/struct-arg-pattern.rs b/tests/rustdoc/struct-arg-pattern.rs
index 3bfb43a0bef2c..6f06c8c9c4996 100644
--- a/tests/rustdoc/struct-arg-pattern.rs
+++ b/tests/rustdoc/struct-arg-pattern.rs
@@ -4,7 +4,7 @@ struct BodyId {
     hir_id: usize,
 }
 
-// @has 'foo/fn.body_owner.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn body_owner(_: BodyId)'
+// @has 'foo/fn.body_owner.html' '//pre[@class="rust item-decl"]' 'pub fn body_owner(_: BodyId)'
 pub fn body_owner(BodyId { hir_id }: BodyId) {
     // ...
 }
diff --git a/tests/rustdoc/test-parens.rs b/tests/rustdoc/test-parens.rs
index f5fdb1f52bf8e..9640b96b6b546 100644
--- a/tests/rustdoc/test-parens.rs
+++ b/tests/rustdoc/test-parens.rs
@@ -1,5 +1,5 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.foo.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_: &(dyn ToString + 'static)"
+// @has - '//pre[@class="rust item-decl"]' "_: &(dyn ToString + 'static)"
 pub fn foo(_: &(ToString + 'static)) {}
diff --git a/tests/rustdoc/toggle-item-contents.rs b/tests/rustdoc/toggle-item-contents.rs
index 5d34ec09b66dc..1f745043894ea 100644
--- a/tests/rustdoc/toggle-item-contents.rs
+++ b/tests/rustdoc/toggle-item-contents.rs
@@ -55,7 +55,7 @@ pub union Union {
 
 // @has 'toggle_item_contents/struct.PrivStruct.html'
 // @count - '//details[@class="toggle type-contents-toggle"]' 0
-// @has - '//div[@class="item-decl"]' '/* private fields */'
+// @has - '//pre[@class="rust item-decl"]' '/* private fields */'
 pub struct PrivStruct {
     a: usize,
     b: usize,
@@ -81,8 +81,8 @@ pub enum EnumStructVariant {
 }
 
 // @has 'toggle_item_contents/enum.LargeEnum.html'
-// @count - '//div[@class="item-decl"]/pre//details[@class="toggle type-contents-toggle"]' 1
-// @has - '//div[@class="item-decl"]/pre//details[@class="toggle type-contents-toggle"]' 'Show 13 variants'
+// @count - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 1
+// @has - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 'Show 13 variants'
 pub enum LargeEnum {
     A, B, C, D, E, F(u8), G, H, I, J, K, L, M
 }
diff --git a/tests/rustdoc/trait_alias.rs b/tests/rustdoc/trait_alias.rs
index 791c099cc5233..5c3f82c6b3cff 100644
--- a/tests/rustdoc/trait_alias.rs
+++ b/tests/rustdoc/trait_alias.rs
@@ -14,13 +14,13 @@ use std::fmt::Debug;
 // @has foo/index.html '//a[@class="traitalias"]' 'Foo'
 
 // @has foo/traitalias.CopyAlias.html
-// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait CopyAlias = Copy;'
+// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait CopyAlias = Copy;'
 pub trait CopyAlias = Copy;
 // @has foo/traitalias.Alias2.html
-// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
+// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Alias2 = Copy + Debug;'
 pub trait Alias2 = Copy + Debug;
 // @has foo/traitalias.Foo.html
-// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Foo = Into + Debug;'
+// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Foo = Into + Debug;'
 pub trait Foo = Into + Debug;
 // @has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
 pub fn bar() where T: Alias2 {}
diff --git a/tests/rustdoc/tuple-struct-fields-doc.rs b/tests/rustdoc/tuple-struct-fields-doc.rs
index d72c10f2b2542..2836ddedc2b20 100644
--- a/tests/rustdoc/tuple-struct-fields-doc.rs
+++ b/tests/rustdoc/tuple-struct-fields-doc.rs
@@ -19,7 +19,7 @@ pub struct Foo(
 );
 
 // @has foo/enum.Bar.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'BarVariant(String),'
+// @has - '//pre[@class="rust item-decl"]' 'BarVariant(String),'
 // @matches - '//*[@id="variant.BarVariant.fields"]/h4' '^Tuple Fields$'
 // @has - '//*[@id="variant.BarVariant.field.0"]' '0: String'
 // @has - '//*[@id="variant.BarVariant.fields"]//*[@class="docblock"]' 'Hello docs'
diff --git a/tests/rustdoc/tuples.rs b/tests/rustdoc/tuples.rs
index e716de8b55c8f..0ea5b5bfac908 100644
--- a/tests/rustdoc/tuples.rs
+++ b/tests/rustdoc/tuples.rs
@@ -1,20 +1,20 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.tuple0.html //pre 'pub fn tuple0(x: ())'
-// @snapshot link_unit - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link_unit - '//pre[@class="rust item-decl"]/code'
 pub fn tuple0(x: ()) -> () { x }
 // @has foo/fn.tuple1.html //pre 'pub fn tuple1(x: (i32,)) -> (i32,)'
-// @snapshot link1_i32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link1_i32 - '//pre[@class="rust item-decl"]/code'
 pub fn tuple1(x: (i32,)) -> (i32,) { x }
 // @has foo/fn.tuple2.html //pre 'pub fn tuple2(x: (i32, i32)) -> (i32, i32)'
-// @snapshot link2_i32 - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link2_i32 - '//pre[@class="rust item-decl"]/code'
 pub fn tuple2(x: (i32, i32)) -> (i32, i32) { x }
 // @has foo/fn.tuple1_t.html //pre 'pub fn tuple1_t(x: (T,)) -> (T,)'
-// @snapshot link1_t - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link1_t - '//pre[@class="rust item-decl"]/code'
 pub fn tuple1_t(x: (T,)) -> (T,) { x }
 // @has foo/fn.tuple2_t.html //pre 'pub fn tuple2_t(x: (T, T)) -> (T, T)'
-// @snapshot link2_t - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link2_t - '//pre[@class="rust item-decl"]/code'
 pub fn tuple2_t(x: (T, T)) -> (T, T) { x }
 // @has foo/fn.tuple2_tu.html //pre 'pub fn tuple2_tu(x: (T, U)) -> (T, U)'
-// @snapshot link2_tu - '//div[@class="item-decl"]/pre[@class="rust"]/code'
+// @snapshot link2_tu - '//pre[@class="rust item-decl"]/code'
 pub fn tuple2_tu(x: (T, U)) -> (T, U) { x }
diff --git a/tests/rustdoc/unit-return.rs b/tests/rustdoc/unit-return.rs
index 353cd1c477249..6ddfa0c4d5ca2 100644
--- a/tests/rustdoc/unit-return.rs
+++ b/tests/rustdoc/unit-return.rs
@@ -4,14 +4,14 @@
 
 extern crate unit_return;
 
-// @has 'foo/fn.f0.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'F: FnMut(u8) + Clone'
+// @has 'foo/fn.f0.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u8) + Clone'
 pub fn f0(f: F) {}
 
-// @has 'foo/fn.f1.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'F: FnMut(u16) + Clone'
+// @has 'foo/fn.f1.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u16) + Clone'
 pub fn f1 () + Clone>(f: F) {}
 
-// @has 'foo/fn.f2.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'F: FnMut(u32) + Clone'
+// @has 'foo/fn.f2.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u32) + Clone'
 pub use unit_return::f2;
 
-// @has 'foo/fn.f3.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'F: FnMut(u64) + Clone'
+// @has 'foo/fn.f3.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u64) + Clone'
 pub use unit_return::f3;
diff --git a/tests/rustdoc/where-sized.rs b/tests/rustdoc/where-sized.rs
index c0c085e6ac725..c1ac834b2fcb8 100644
--- a/tests/rustdoc/where-sized.rs
+++ b/tests/rustdoc/where-sized.rs
@@ -1,6 +1,6 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.foo.html
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo(_: &X)'
-// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where X: ?Sized,'
+// @has - '//pre[@class="rust item-decl"]' 'pub fn foo(_: &X)'
+// @has - '//pre[@class="rust item-decl"]' 'where X: ?Sized,'
 pub fn foo(_: &X) where X: ?Sized {}
diff --git a/tests/rustdoc/where.SWhere_Simd_item-decl.html b/tests/rustdoc/where.SWhere_Simd_item-decl.html
index f84cb3753cb93..6f151f2328e4f 100644
--- a/tests/rustdoc/where.SWhere_Simd_item-decl.html
+++ b/tests/rustdoc/where.SWhere_Simd_item-decl.html
@@ -1 +1 @@
-
\ No newline at end of file
+
pub struct Simd<T>(_)
where
    T: MyTrait
;
\ No newline at end of file diff --git a/tests/rustdoc/where.SWhere_TraitWhere_item-decl.html b/tests/rustdoc/where.SWhere_TraitWhere_item-decl.html index 85b626674274c..11df902f3720f 100644 --- a/tests/rustdoc/where.SWhere_TraitWhere_item-decl.html +++ b/tests/rustdoc/where.SWhere_TraitWhere_item-decl.html @@ -1,8 +1,8 @@ -
pub trait TraitWhere {
+
pub trait TraitWhere {
     type Item<'a>
    where
        Self: 'a
; fn func(self)
    where
        Self: Sized
, { ... } fn lines(self) -> Lines<Self>
    where
        Self: Sized
, { ... } -}
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/rustdoc/where.rs b/tests/rustdoc/where.rs index 644a005824452..4c34c7e51d937 100644 --- a/tests/rustdoc/where.rs +++ b/tests/rustdoc/where.rs @@ -22,13 +22,13 @@ impl Delta where D: MyTrait { pub struct Echo(E); // @has 'foo/struct.Simd.html' -// @snapshot SWhere_Simd_item-decl - '//div[@class="item-decl"]' +// @snapshot SWhere_Simd_item-decl - '//pre[@class="rust item-decl"]' pub struct Simd([T; 1]) where T: MyTrait; // @has 'foo/trait.TraitWhere.html' -// @snapshot SWhere_TraitWhere_item-decl - '//div[@class="item-decl"]' +// @snapshot SWhere_TraitWhere_item-decl - '//pre[@class="rust item-decl"]' pub trait TraitWhere { type Item<'a> where Self: 'a; @@ -57,6 +57,6 @@ pub enum Foxtrot { Foxtrot1(F) } // "impl MyTrait for Foxtrotwhere F: MyTrait" impl MyTrait for Foxtrotwhere F: MyTrait {} -// @has foo/type.Golf.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \ // "type Golfwhere T: Clone, = (T, T)" pub type Golf where T: Clone = (T, T); diff --git a/tests/rustdoc/whitespace-after-where-clause.enum.html b/tests/rustdoc/whitespace-after-where-clause.enum.html index eeb22878f3c63..904d461103617 100644 --- a/tests/rustdoc/whitespace-after-where-clause.enum.html +++ b/tests/rustdoc/whitespace-after-where-clause.enum.html @@ -1,4 +1,4 @@ -
pub enum Cow<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ +
pub enum Cow<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ Borrowed(&'a B), Whatever(u32), -}
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.enum2.html b/tests/rustdoc/whitespace-after-where-clause.enum2.html index c8037c2a8df5a..7bc9b780197bb 100644 --- a/tests/rustdoc/whitespace-after-where-clause.enum2.html +++ b/tests/rustdoc/whitespace-after-where-clause.enum2.html @@ -1,4 +1,4 @@ -
pub enum Cow2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
+
pub enum Cow2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
     Borrowed(&'a B),
     Whatever(u32),
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.rs b/tests/rustdoc/whitespace-after-where-clause.rs index 4b740b970fc20..b540c7c97c1f4 100644 --- a/tests/rustdoc/whitespace-after-where-clause.rs +++ b/tests/rustdoc/whitespace-after-where-clause.rs @@ -4,7 +4,7 @@ #![crate_name = "foo"] // @has 'foo/trait.ToOwned.html' -// @snapshot trait - '//*[@class="item-decl"]' +// @snapshot trait - '//*[@class="rust item-decl"]' pub trait ToOwned where T: Clone { @@ -14,7 +14,7 @@ where T: Clone } // @has 'foo/trait.ToOwned2.html' -// @snapshot trait2 - '//*[@class="item-decl"]' +// @snapshot trait2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub trait ToOwned2 { type Owned; @@ -23,7 +23,7 @@ pub trait ToOwned2 { } // @has 'foo/enum.Cow.html' -// @snapshot enum - '//*[@class="item-decl"]' +// @snapshot enum - '//*[@class="rust item-decl"]' pub enum Cow<'a, B: ?Sized + 'a> where B: ToOwned, @@ -33,7 +33,7 @@ where } // @has 'foo/enum.Cow2.html' -// @snapshot enum2 - '//*[@class="item-decl"]' +// @snapshot enum2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub enum Cow2<'a, B: ?Sized + ToOwned + 'a> { Borrowed(&'a B), @@ -41,7 +41,7 @@ pub enum Cow2<'a, B: ?Sized + ToOwned + 'a> { } // @has 'foo/struct.Struct.html' -// @snapshot struct - '//*[@class="item-decl"]' +// @snapshot struct - '//*[@class="rust item-decl"]' pub struct Struct<'a, B: ?Sized + 'a> where B: ToOwned, @@ -51,7 +51,7 @@ where } // @has 'foo/struct.Struct2.html' -// @snapshot struct2 - '//*[@class="item-decl"]' +// @snapshot struct2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub struct Struct2<'a, B: ?Sized + ToOwned + 'a> { pub a: &'a B, @@ -59,7 +59,7 @@ pub struct Struct2<'a, B: ?Sized + ToOwned + 'a> { } // @has 'foo/union.Union.html' -// @snapshot union - '//*[@class="item-decl"]' +// @snapshot union - '//*[@class="rust item-decl"]' pub union Union<'a, B: ?Sized + 'a> where B: ToOwned, @@ -69,7 +69,7 @@ where } // @has 'foo/union.Union2.html' -// @snapshot union2 - '//*[@class="item-decl"]' +// @snapshot union2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub union Union2<'a, B: ?Sized + ToOwned + 'a> { a: &'a B, diff --git a/tests/rustdoc/whitespace-after-where-clause.struct.html b/tests/rustdoc/whitespace-after-where-clause.struct.html index 5892270b2f930..54faee9e4052b 100644 --- a/tests/rustdoc/whitespace-after-where-clause.struct.html +++ b/tests/rustdoc/whitespace-after-where-clause.struct.html @@ -1,4 +1,4 @@ -
pub struct Struct<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ +
pub struct Struct<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ pub a: &'a B, pub b: u32, -}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.struct2.html b/tests/rustdoc/whitespace-after-where-clause.struct2.html index d3952b0c56699..d872d516c0943 100644 --- a/tests/rustdoc/whitespace-after-where-clause.struct2.html +++ b/tests/rustdoc/whitespace-after-where-clause.struct2.html @@ -1,4 +1,4 @@ -
pub struct Struct2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
+
pub struct Struct2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
     pub a: &'a B,
     pub b: u32,
-}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.trait.html b/tests/rustdoc/whitespace-after-where-clause.trait.html index a2df06e7736af..bc3653de52d16 100644 --- a/tests/rustdoc/whitespace-after-where-clause.trait.html +++ b/tests/rustdoc/whitespace-after-where-clause.trait.html @@ -1,6 +1,6 @@ -
pub trait ToOwned<T>where
    T: Clone,
{ +
pub trait ToOwned<T>where
    T: Clone,
{ type Owned; fn to_owned(&self) -> Self::Owned; fn whatever(&self) -> T; -}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.trait2.html b/tests/rustdoc/whitespace-after-where-clause.trait2.html index 2bfd6f7685a67..eda4ca72acc18 100644 --- a/tests/rustdoc/whitespace-after-where-clause.trait2.html +++ b/tests/rustdoc/whitespace-after-where-clause.trait2.html @@ -1,6 +1,6 @@ -
pub trait ToOwned2<T: Clone> {
+
pub trait ToOwned2<T: Clone> {
     type Owned;
 
     fn to_owned(&self) -> Self::Owned;
     fn whatever(&self) -> T;
-}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.union.html b/tests/rustdoc/whitespace-after-where-clause.union.html index 066f8f87b160b..03a26280ba2cf 100644 --- a/tests/rustdoc/whitespace-after-where-clause.union.html +++ b/tests/rustdoc/whitespace-after-where-clause.union.html @@ -1,3 +1,3 @@ -
pub union Union<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ +
pub union Union<'a, B>where
    B: ToOwned<dyn Clone> + ?Sized + 'a,
{ /* private fields */ -}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/whitespace-after-where-clause.union2.html b/tests/rustdoc/whitespace-after-where-clause.union2.html index 6b48c5dbd3e28..fc78e9b6039b0 100644 --- a/tests/rustdoc/whitespace-after-where-clause.union2.html +++ b/tests/rustdoc/whitespace-after-where-clause.union2.html @@ -1,3 +1,3 @@ -
pub union Union2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
+
pub union Union2<'a, B: ?Sized + ToOwned<dyn Clone> + 'a> {
     /* private fields */
-}
\ No newline at end of file +} \ No newline at end of file diff --git a/tests/rustdoc/wrapping.rs b/tests/rustdoc/wrapping.rs index 178b8adc3f04a..dd5c700329f14 100644 --- a/tests/rustdoc/wrapping.rs +++ b/tests/rustdoc/wrapping.rs @@ -1,5 +1,5 @@ use std::fmt::Debug; -// @has 'wrapping/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn foo() -> impl Debug' -// @count - '//div[@class="item-decl"]/pre[@class="rust"]/br' 0 +// @has 'wrapping/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo() -> impl Debug' +// @count - '//pre[@class="rust item-decl"]/br' 0 pub fn foo() -> impl Debug {} diff --git a/tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr b/tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr index 59192a1ecc3f4..de92841d7f18e 100644 --- a/tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr +++ b/tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr @@ -10,7 +10,7 @@ LL | || ) -> () LL | | { LL | | loop {} LL | | } - | |__^ expected `&Layout`, found struct `Layout` + | |__^ expected `&Layout`, found `Layout` | note: function defined here --> $DIR/alloc-error-handler-bad-signature-1.rs:10:4 diff --git a/tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr b/tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr index 7d23c2fc05ac3..7a495380f2ba1 100644 --- a/tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr +++ b/tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr @@ -9,12 +9,12 @@ LL | || ) { | ||_- arguments to this function are incorrect LL | | loop {} LL | | } - | |__^ expected struct `Layout`, found struct `core::alloc::Layout` + | |__^ expected `Layout`, found `core::alloc::Layout` | - = note: struct `core::alloc::Layout` and struct `Layout` have similar names, but are actually distinct types -note: struct `core::alloc::Layout` is defined in crate `core` + = note: `core::alloc::Layout` and `Layout` have similar names, but are actually distinct types +note: `core::alloc::Layout` is defined in crate `core` --> $SRC_DIR/core/src/alloc/layout.rs:LL:COL -note: struct `Layout` is defined in the current crate +note: `Layout` is defined in the current crate --> $DIR/alloc-error-handler-bad-signature-2.rs:7:1 | LL | struct Layout; diff --git a/tests/ui/argument-suggestions/formal-and-expected-differ.stderr b/tests/ui/argument-suggestions/formal-and-expected-differ.stderr index 905875b527769..6076b7ccb8ff6 100644 --- a/tests/ui/argument-suggestions/formal-and-expected-differ.stderr +++ b/tests/ui/argument-suggestions/formal-and-expected-differ.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/formal-and-expected-differ.rs:22:29 | LL | let _: U<_, u32> = U(1, S(3u32)); - | - ^^^^^^^ expected `f32`, found `u32` + | - ^^^^^^^ expected `S`, found `S` | | | arguments to this struct are incorrect | @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/formal-and-expected-differ.rs:22:24 | LL | let _: U<_, u32> = U(1, S(3u32)); - | --------- ^^^^^^^^^^^^^ expected `u32`, found `f32` + | --------- ^^^^^^^^^^^^^ expected `U<_, u32>`, found `U` | | | expected due to this | diff --git a/tests/ui/argument-suggestions/invalid_arguments.stderr b/tests/ui/argument-suggestions/invalid_arguments.stderr index 303f086957853..d26f33d098be0 100644 --- a/tests/ui/argument-suggestions/invalid_arguments.stderr +++ b/tests/ui/argument-suggestions/invalid_arguments.stderr @@ -100,7 +100,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:24:18 | LL | three_arg_diff(X{}, 1.0, ""); - | -------------- ^^^ expected `i32`, found struct `X` + | -------------- ^^^ expected `i32`, found `X` | | | arguments to this function are incorrect | @@ -114,7 +114,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:25:21 | LL | three_arg_diff(1, X {}, ""); - | -------------- ^^^^ expected `f32`, found struct `X` + | -------------- ^^^^ expected `f32`, found `X` | | | arguments to this function are incorrect | @@ -128,7 +128,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:26:26 | LL | three_arg_diff(1, 1.0, X {}); - | -------------- ^^^^ expected `&str`, found struct `X` + | -------------- ^^^^ expected `&str`, found `X` | | | arguments to this function are incorrect | @@ -142,9 +142,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:28:3 | LL | three_arg_diff(X {}, X {}, ""); - | ^^^^^^^^^^^^^^ ---- ---- expected `f32`, found struct `X` + | ^^^^^^^^^^^^^^ ---- ---- expected `f32`, found `X` | | - | expected `i32`, found struct `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:8:4 @@ -156,9 +156,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:29:3 | LL | three_arg_diff(X {}, 1.0, X {}); - | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X` | | - | expected `i32`, found struct `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:8:4 @@ -170,9 +170,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:30:3 | LL | three_arg_diff(1, X {}, X {}); - | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X` | | - | expected `f32`, found struct `X` + | expected `f32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:8:4 @@ -184,10 +184,10 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:32:3 | LL | three_arg_diff(X {}, X {}, X {}); - | ^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found `X` | | | - | | expected `f32`, found struct `X` - | expected `i32`, found struct `X` + | | expected `f32`, found `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:8:4 @@ -199,7 +199,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:34:20 | LL | three_arg_repeat(X {}, 1, ""); - | ---------------- ^^^^ expected `i32`, found struct `X` + | ---------------- ^^^^ expected `i32`, found `X` | | | arguments to this function are incorrect | @@ -213,7 +213,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:35:23 | LL | three_arg_repeat(1, X {}, ""); - | ---------------- ^^^^ expected `i32`, found struct `X` + | ---------------- ^^^^ expected `i32`, found `X` | | | arguments to this function are incorrect | @@ -227,7 +227,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:36:26 | LL | three_arg_repeat(1, 1, X {}); - | ---------------- ^^^^ expected `&str`, found struct `X` + | ---------------- ^^^^ expected `&str`, found `X` | | | arguments to this function are incorrect | @@ -241,9 +241,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:38:3 | LL | three_arg_repeat(X {}, X {}, ""); - | ^^^^^^^^^^^^^^^^ ---- ---- expected `i32`, found struct `X` + | ^^^^^^^^^^^^^^^^ ---- ---- expected `i32`, found `X` | | - | expected `i32`, found struct `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:9:4 @@ -255,9 +255,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:39:3 | LL | three_arg_repeat(X {}, 1, X {}); - | ^^^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X` | | - | expected `i32`, found struct `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:9:4 @@ -269,9 +269,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:40:3 | LL | three_arg_repeat(1, X {}, X{}); - | ^^^^^^^^^^^^^^^^ ---- --- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^^^ ---- --- expected `&str`, found `X` | | - | expected `i32`, found struct `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:9:4 @@ -283,10 +283,10 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:42:3 | LL | three_arg_repeat(X {}, X {}, X {}); - | ^^^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found struct `X` + | ^^^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found `X` | | | - | | expected `i32`, found struct `X` - | expected `i32`, found struct `X` + | | expected `i32`, found `X` + | expected `i32`, found `X` | note: function defined here --> $DIR/invalid_arguments.rs:9:4 diff --git a/tests/ui/argument-suggestions/issue-100478.stderr b/tests/ui/argument-suggestions/issue-100478.stderr index df02a312cf11c..e4304988f9bee 100644 --- a/tests/ui/argument-suggestions/issue-100478.stderr +++ b/tests/ui/argument-suggestions/issue-100478.stderr @@ -41,7 +41,7 @@ error[E0308]: arguments to this function are incorrect --> $DIR/issue-100478.rs:36:5 | LL | four_shuffle(T3::default(), T2::default(), T1::default(), T3::default()); - | ^^^^^^^^^^^^ ------------- ------------- ------------- expected struct `T4`, found struct `T3` + | ^^^^^^^^^^^^ ------------- ------------- ------------- expected `T4`, found `T3` | | | | | expected `T3`, found `T1` | expected `T1`, found `T3` diff --git a/tests/ui/argument-suggestions/issue-101097.stderr b/tests/ui/argument-suggestions/issue-101097.stderr index 096f8c226f2aa..7582082ac72ac 100644 --- a/tests/ui/argument-suggestions/issue-101097.stderr +++ b/tests/ui/argument-suggestions/issue-101097.stderr @@ -128,7 +128,7 @@ LL | f(C, C, A, B, A, A); | ^ - - - - - expected `C`, found `A` | | | | | | | | | expected `C`, found `A` - | | | expected struct `B`, found struct `A` + | | | expected `B`, found `A` | | expected `A`, found `C` | expected `A`, found `C` | diff --git a/tests/ui/argument-suggestions/issue-97484.stderr b/tests/ui/argument-suggestions/issue-97484.stderr index caa50f14b43e1..c2e6e001b1791 100644 --- a/tests/ui/argument-suggestions/issue-97484.stderr +++ b/tests/ui/argument-suggestions/issue-97484.stderr @@ -4,7 +4,7 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied LL | foo(&&A, B, C, D, E, F, G); | ^^^ - - - - argument of type `F` unexpected | | | | - | | | expected `&E`, found struct `E` + | | | expected `&E`, found `E` | | argument of type `C` unexpected | argument of type `B` unexpected | diff --git a/tests/ui/argument-suggestions/mixed_cases.stderr b/tests/ui/argument-suggestions/mixed_cases.stderr index 8c525db1ac66c..8cf48060a6352 100644 --- a/tests/ui/argument-suggestions/mixed_cases.stderr +++ b/tests/ui/argument-suggestions/mixed_cases.stderr @@ -41,7 +41,7 @@ error[E0061]: this function takes 3 arguments but 2 arguments were supplied LL | three_args(1, X {}); | ^^^^^^^^^^--------- | | | - | | expected `f32`, found struct `X` + | | expected `f32`, found `X` | an argument of type `&str` is missing | note: function defined here @@ -78,7 +78,7 @@ error[E0308]: arguments to this function are incorrect LL | three_args("", X {}, 1); | ^^^^^^^^^^ -- ---- - expected `&str`, found `{integer}` | | | - | | expected `f32`, found struct `X` + | | expected `f32`, found `X` | expected `i32`, found `&'static str` | note: function defined here diff --git a/tests/ui/argument-suggestions/two-mismatch-notes.stderr b/tests/ui/argument-suggestions/two-mismatch-notes.stderr index 7873cf964cbbc..38cf23ddc3895 100644 --- a/tests/ui/argument-suggestions/two-mismatch-notes.stderr +++ b/tests/ui/argument-suggestions/two-mismatch-notes.stderr @@ -4,14 +4,15 @@ error[E0308]: arguments to this function are incorrect LL | foo(f, w); | ^^^ | -note: expected `i32`, found `u32` +note: expected fn pointer, found fn item --> $DIR/two-mismatch-notes.rs:10:9 | LL | foo(f, w); | ^ = note: expected fn pointer `fn(i32)` found fn item `fn(u32) {f}` -note: expected `i32`, found `isize` + = note: when the arguments and return types match, functions can be coerced to function pointers +note: expected `Wrapper`, found `Wrapper` --> $DIR/two-mismatch-notes.rs:10:12 | LL | foo(f, w); diff --git a/tests/ui/array-slice-vec/array-not-vector.rs b/tests/ui/array-slice-vec/array-not-vector.rs index 5e46f015baf62..d8b5b10d59148 100644 --- a/tests/ui/array-slice-vec/array-not-vector.rs +++ b/tests/ui/array-slice-vec/array-not-vector.rs @@ -1,12 +1,12 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types - //~| expected `i32`, found array + //~| expected `i32`, found `[{integer}; 3]` let x: &[i32] = &[1, 2, 3]; let _y: &i32 = x; //~^ ERROR mismatched types //~| expected reference `&i32` //~| found reference `&[i32]` - //~| expected `i32`, found slice + //~| expected `&i32`, found `&[i32]` } diff --git a/tests/ui/array-slice-vec/array-not-vector.stderr b/tests/ui/array-slice-vec/array-not-vector.stderr index 0e187d9072a8a..f20d99524dccd 100644 --- a/tests/ui/array-slice-vec/array-not-vector.stderr +++ b/tests/ui/array-slice-vec/array-not-vector.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/array-not-vector.rs:2:19 | LL | let _x: i32 = [1, 2, 3]; - | --- ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]` + | --- ^^^^^^^^^ expected `i32`, found `[{integer}; 3]` | | | expected due to this @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/array-not-vector.rs:7:20 | LL | let _y: &i32 = x; - | ---- ^ expected `i32`, found slice `[i32]` + | ---- ^ expected `&i32`, found `&[i32]` | | | expected due to this | diff --git a/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr b/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr index e3b3b040f6644..47008e1d99946 100644 --- a/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr +++ b/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/slice-to-vec-comparison.rs:4:9 | LL | a > b; - | ^ expected array of 0 elements, found struct `Vec` + | ^ expected `&[_; 0]`, found `&Vec` | = note: expected reference `&[_; 0]` found reference `&Vec` diff --git a/tests/ui/associated-consts/associated-const-generic-obligations.stderr b/tests/ui/associated-consts/associated-const-generic-obligations.stderr index f45fa0ad55cd1..d45868151b166 100644 --- a/tests/ui/associated-consts/associated-const-generic-obligations.stderr +++ b/tests/ui/associated-consts/associated-const-generic-obligations.stderr @@ -2,7 +2,7 @@ error[E0326]: implemented const `FROM` has an incompatible type for trait --> $DIR/associated-const-generic-obligations.rs:14:17 | LL | const FROM: &'static str = "foo"; - | ^^^^^^^^^^^^ expected associated type, found `&str` + | ^^^^^^^^^^^^ expected associated type, found `&'static str` | note: type in trait --> $DIR/associated-const-generic-obligations.rs:10:17 diff --git a/tests/ui/associated-type-bounds/elision.stderr b/tests/ui/associated-type-bounds/elision.stderr index ea30246274965..b64a4dab2065d 100644 --- a/tests/ui/associated-type-bounds/elision.stderr +++ b/tests/ui/associated-type-bounds/elision.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/elision.rs:5:79 | LL | fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } - | ----------------------------- -------------- ^^^^^^^^ expected `&()`, found type parameter `impl Iterator` + | ----------------------------- -------------- ^^^^^^^^ expected `Option<&()>`, found `Option>` | | | | | expected `Option<&'static ()>` because of return type | this type parameter diff --git a/tests/ui/associated-type-bounds/inside-adt.stderr b/tests/ui/associated-type-bounds/inside-adt.stderr index dbfcfa5806309..1668b613b25b1 100644 --- a/tests/ui/associated-type-bounds/inside-adt.stderr +++ b/tests/ui/associated-type-bounds/inside-adt.stderr @@ -95,7 +95,7 @@ LL | union U1 { f: ManuallyDrop> } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `ManuallyDrop<(dyn Iterator + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator + 'static)` - = note: required because it appears within the type `ManuallyDrop<(dyn Iterator + 'static)>` + = note: required because it appears within the type `ManuallyDrop>` = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -114,7 +114,7 @@ LL | union U3 { f: ManuallyDrop> } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `ManuallyDrop<(dyn Iterator + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator + 'static)` - = note: required because it appears within the type `ManuallyDrop<(dyn Iterator + 'static)>` + = note: required because it appears within the type `ManuallyDrop>` = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size diff --git a/tests/ui/associated-type-bounds/issue-71443-1.stderr b/tests/ui/associated-type-bounds/issue-71443-1.stderr index a9459ee743283..15cc9646b2c8e 100644 --- a/tests/ui/associated-type-bounds/issue-71443-1.stderr +++ b/tests/ui/associated-type-bounds/issue-71443-1.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn hello Iterator>() { | - help: try adding a return type: `-> Incorrect` LL | Incorrect - | ^^^^^^^^^ expected `()`, found struct `Incorrect` + | ^^^^^^^^^ expected `()`, found `Incorrect` error: aborting due to previous error diff --git a/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr b/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr index d6b18d4ed32e7..5fe53a27eb854 100644 --- a/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr +++ b/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:27:23 | LL | fn b() { dent(ModelT, Blue); } - | ---- ^^^^ expected struct `Black`, found struct `Blue` + | ---- ^^^^ expected `Black`, found `Blue` | | | arguments to this function are incorrect | @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:28:23 | LL | fn c() { dent(ModelU, Black); } - | ---- ^^^^^ expected struct `Blue`, found struct `Black` + | ---- ^^^^^ expected `Blue`, found `Black` | | | arguments to this function are incorrect | @@ -30,7 +30,7 @@ error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:32:28 | LL | fn f() { ModelT.chip_paint(Blue); } - | ---------- ^^^^ expected struct `Black`, found struct `Blue` + | ---------- ^^^^ expected `Black`, found `Blue` | | | arguments to this method are incorrect | @@ -44,7 +44,7 @@ error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:33:28 | LL | fn g() { ModelU.chip_paint(Black); } - | ---------- ^^^^^ expected struct `Blue`, found struct `Black` + | ---------- ^^^^^ expected `Blue`, found `Black` | | | arguments to this method are incorrect | diff --git a/tests/ui/associated-types/associated-types-eq-3.rs b/tests/ui/associated-types/associated-types-eq-3.rs index f6988dcf65ebf..380d0e95c13f3 100644 --- a/tests/ui/associated-types/associated-types-eq-3.rs +++ b/tests/ui/associated-types/associated-types-eq-3.rs @@ -23,7 +23,7 @@ fn foo2(x: I) { let _: Bar = x.boo(); //~^ ERROR mismatched types //~| found associated type `::A` - //~| expected struct `Bar`, found associated type + //~| expected `Bar`, found //~| expected struct `Bar` } diff --git a/tests/ui/associated-types/associated-types-eq-3.stderr b/tests/ui/associated-types/associated-types-eq-3.stderr index fbe1a1ee8bcd7..15ce4fc91cb30 100644 --- a/tests/ui/associated-types/associated-types-eq-3.stderr +++ b/tests/ui/associated-types/associated-types-eq-3.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/associated-types-eq-3.rs:23:18 | LL | let _: Bar = x.boo(); - | --- ^^^^^^^ expected struct `Bar`, found associated type + | --- ^^^^^^^ expected `Bar`, found associated type | | | expected due to this | diff --git a/tests/ui/associated-types/associated-types-eq-hr.stderr b/tests/ui/associated-types/associated-types-eq-hr.stderr index 6cff403b318c1..99db0c1bf3bc9 100644 --- a/tests/ui/associated-types/associated-types-eq-hr.stderr +++ b/tests/ui/associated-types/associated-types-eq-hr.stderr @@ -1,8 +1,8 @@ -error[E0271]: type mismatch resolving `for<'x> >::A == &'x isize` +error[E0271]: type mismatch resolving `>::A == &isize` --> $DIR/associated-types-eq-hr.rs:87:11 | LL | foo::(); - | ^^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x isize` + | ^^^^^^^^^^ type mismatch resolving `>::A == &isize` | note: expected this to be `&isize` --> $DIR/associated-types-eq-hr.rs:26:14 @@ -20,11 +20,11 @@ LL | where LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>, | ^^^^^^^^^^^^^ required by this bound in `foo` -error[E0271]: type mismatch resolving `for<'x> >::A == &'x usize` +error[E0271]: type mismatch resolving `>::A == &usize` --> $DIR/associated-types-eq-hr.rs:91:11 | LL | bar::(); - | ^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x usize` + | ^^^^^^^^^ type mismatch resolving `>::A == &usize` | note: expected this to be `&usize` --> $DIR/associated-types-eq-hr.rs:14:14 diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr index 526f425b21e71..ab1a9511ec6c7 100644 --- a/tests/ui/associated-types/issue-43924.stderr +++ b/tests/ui/associated-types/issue-43924.stderr @@ -14,7 +14,7 @@ error[E0599]: no function or associated item named `default` found for trait obj --> $DIR/issue-43924.rs:14:39 | LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); - | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)` + | ^^^^^^^ function or associated item not found in `dyn ToString` error: aborting due to 2 previous errors diff --git a/tests/ui/associated-types/issue-87261.rs b/tests/ui/associated-types/issue-87261.rs index e8548d402fae5..384561f8ccd7e 100644 --- a/tests/ui/associated-types/issue-87261.rs +++ b/tests/ui/associated-types/issue-87261.rs @@ -77,10 +77,10 @@ where fn main() { accepts_trait(returns_opaque()); - //~^ ERROR type mismatch resolving `::Associated == ()` + //~^ ERROR type mismatch resolving `::Associated == ()` accepts_trait(returns_opaque_derived()); - //~^ ERROR type mismatch resolving `::Associated == ()` + //~^ ERROR type mismatch resolving `::Associated == ()` accepts_trait(returns_opaque_foo()); //~^ ERROR type mismatch resolving `::Associated == ()` @@ -89,7 +89,7 @@ fn main() { //~^ ERROR type mismatch resolving `::Associated == ()` accepts_generic_trait(returns_opaque_generic()); - //~^ ERROR type mismatch resolving ` + 'static as GenericTrait<()>>::Associated == ()` + //~^ ERROR type mismatch resolving ` as GenericTrait<()>>::Associated == ()` accepts_generic_trait(returns_opaque_generic_foo()); //~^ ERROR type mismatch resolving ` + Foo as GenericTrait<()>>::Associated == ()` diff --git a/tests/ui/associated-types/issue-87261.stderr b/tests/ui/associated-types/issue-87261.stderr index 2cce6b947025e..f5c6d82471a8b 100644 --- a/tests/ui/associated-types/issue-87261.stderr +++ b/tests/ui/associated-types/issue-87261.stderr @@ -132,7 +132,7 @@ note: required by a bound in `accepts_generic_trait` LL | fn accepts_generic_trait>(_: T) {} | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` -error[E0271]: type mismatch resolving `::Associated == ()` +error[E0271]: type mismatch resolving `::Associated == ()` --> $DIR/issue-87261.rs:79:19 | LL | fn returns_opaque() -> impl Trait + 'static { @@ -155,7 +155,7 @@ help: consider constraining the associated type ` LL | fn returns_opaque() -> impl Trait + 'static { | +++++++++++++++++ -error[E0271]: type mismatch resolving `::Associated == ()` +error[E0271]: type mismatch resolving `::Associated == ()` --> $DIR/issue-87261.rs:82:19 | LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static { @@ -222,7 +222,7 @@ note: required by a bound in `accepts_trait` LL | fn accepts_trait>(_: T) {} | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` -error[E0271]: type mismatch resolving ` + 'static as GenericTrait<()>>::Associated == ()` +error[E0271]: type mismatch resolving ` as GenericTrait<()>>::Associated == ()` --> $DIR/issue-87261.rs:91:27 | LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static { diff --git a/tests/ui/async-await/async-block-control-flow-static-semantics.stderr b/tests/ui/async-await/async-block-control-flow-static-semantics.stderr index c4487eb840abc..a6dbb0716143a 100644 --- a/tests/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/tests/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:49:44 | LL | fn rethrow_targets_async_block_not_fn() -> Result { - | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()` + | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected `Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | @@ -68,7 +68,7 @@ error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:58:50 | LL | fn rethrow_targets_async_block_not_async_fn() -> Result { - | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()` + | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected `Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr index 13e7222551aaf..3c01fca2f4d8d 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr @@ -2,7 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28 | LL | async fn foo(&self) -> i32 { - | ^^^ expected struct `Pin`, found opaque type + | ^^^ expected `Pin>>`, found opaque type | note: type in trait --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22 diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.stderr index 5a9b15e54a008..b8d83d0f28a31 100644 --- a/tests/ui/async-await/in-trait/return-type-suggestion.stderr +++ b/tests/ui/async-await/in-trait/return-type-suggestion.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | Ok(()) | ^^^^^^- help: consider using a semicolon here: `;` | | - | expected `()`, found enum `Result` + | expected `()`, found `Result<(), _>` | = note: expected unit type `()` found enum `Result<(), _>` diff --git a/tests/ui/async-await/issue-61076.rs b/tests/ui/async-await/issue-61076.rs index 750fad8393bbf..3cde5cca3c3cd 100644 --- a/tests/ui/async-await/issue-61076.rs +++ b/tests/ui/async-await/issue-61076.rs @@ -89,7 +89,7 @@ async fn match_() { match tuple() { //~ HELP consider `await`ing on the `Future` //~^ NOTE this expression has type `impl Future` Tuple(_) => {} //~ ERROR mismatched types - //~^ NOTE expected opaque type, found struct `Tuple` + //~^ NOTE expected opaque type, found `Tuple` //~| NOTE expected opaque type `impl Future` } } diff --git a/tests/ui/async-await/issue-61076.stderr b/tests/ui/async-await/issue-61076.stderr index 33839ea59392d..5a7316edd01f5 100644 --- a/tests/ui/async-await/issue-61076.stderr +++ b/tests/ui/async-await/issue-61076.stderr @@ -62,7 +62,7 @@ LL | match tuple() { | ------- this expression has type `impl Future` LL | LL | Tuple(_) => {} - | ^^^^^^^^ expected opaque type, found struct `Tuple` + | ^^^^^^^^ expected opaque type, found `Tuple` | note: while checking the return type of the `async fn` --> $DIR/issue-61076.rs:56:21 diff --git a/tests/ui/async-await/issue-98634.rs b/tests/ui/async-await/issue-98634.rs index b0d38687f01c4..169cc7f9b21ea 100644 --- a/tests/ui/async-await/issue-98634.rs +++ b/tests/ui/async-await/issue-98634.rs @@ -43,8 +43,8 @@ impl Runtime { fn main() { Runtime.block_on(async { StructAsync { callback }.await; - //~^ ERROR expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` - //~| ERROR expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` - //~| ERROR expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` + //~^ ERROR expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` + //~| ERROR expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` + //~| ERROR expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` }); } diff --git a/tests/ui/async-await/issue-98634.stderr b/tests/ui/async-await/issue-98634.stderr index 5160e48d88afd..08ea5bdc574fa 100644 --- a/tests/ui/async-await/issue-98634.stderr +++ b/tests/ui/async-await/issue-98634.stderr @@ -1,8 +1,8 @@ -error[E0271]: expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` +error[E0271]: expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` --> $DIR/issue-98634.rs:45:23 | LL | StructAsync { callback }.await; - | ^^^^^^^^ expected struct `Pin`, found opaque type + | ^^^^^^^^ expected `Pin>>`, found opaque type | note: while checking the return type of the `async fn` --> $DIR/issue-98634.rs:24:21 @@ -17,11 +17,11 @@ note: required by a bound in `StructAsync` LL | pub struct StructAsync Pin>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync` -error[E0271]: expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` +error[E0271]: expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` --> $DIR/issue-98634.rs:45:9 | LL | StructAsync { callback }.await; - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin>>`, found opaque type | note: while checking the return type of the `async fn` --> $DIR/issue-98634.rs:24:21 @@ -36,11 +36,11 @@ note: required by a bound in `StructAsync` LL | pub struct StructAsync Pin>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync` -error[E0271]: expected `fn() -> impl Future {callback}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` +error[E0271]: expected `callback` to be a fn item that returns `Pin>>`, but it returns `impl Future` --> $DIR/issue-98634.rs:45:33 | LL | StructAsync { callback }.await; - | ^^^^^^ expected struct `Pin`, found opaque type + | ^^^^^^ expected `Pin>>`, found opaque type | note: while checking the return type of the `async fn` --> $DIR/issue-98634.rs:24:21 diff --git a/tests/ui/async-await/issues/issue-102206.stderr b/tests/ui/async-await/issues/issue-102206.stderr index 2ab790ac761a0..eef711910a1a0 100644 --- a/tests/ui/async-await/issues/issue-102206.stderr +++ b/tests/ui/async-await/issues/issue-102206.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | std::mem::size_of_val(foo()); | --------------------- ^^^^^ | | | - | | expected reference, found opaque type + | | expected `&_`, found opaque type | | help: consider borrowing here: `&foo()` | arguments to this function are incorrect | diff --git a/tests/ui/async-await/proper-span-for-type-error.stderr b/tests/ui/async-await/proper-span-for-type-error.stderr index 25f05156ce2bc..592ef7faf8137 100644 --- a/tests/ui/async-await/proper-span-for-type-error.stderr +++ b/tests/ui/async-await/proper-span-for-type-error.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/proper-span-for-type-error.rs:8:5 | LL | a().await - | ^^^^^^^^^ expected enum `Result`, found `()` + | ^^^^^^^^^ expected `Result<(), i32>`, found `()` | = note: expected enum `Result<(), i32>` found unit type `()` diff --git a/tests/ui/async-await/suggest-missing-await.stderr b/tests/ui/async-await/suggest-missing-await.stderr index 1196601ace090..2db0666f1ae68 100644 --- a/tests/ui/async-await/suggest-missing-await.stderr +++ b/tests/ui/async-await/suggest-missing-await.stderr @@ -127,7 +127,7 @@ LL | match dummy_result() { | -------------- this expression has type `impl Future>` ... LL | Ok(_) => {} - | ^^^^^ expected opaque type, found enum `Result` + | ^^^^^ expected opaque type, found `Result<_, _>` | note: while checking the return type of the `async fn` --> $DIR/suggest-missing-await.rs:57:28 @@ -148,7 +148,7 @@ LL | match dummy_result() { | -------------- this expression has type `impl Future>` ... LL | Err(_) => {} - | ^^^^^^ expected opaque type, found enum `Result` + | ^^^^^^ expected opaque type, found `Result<_, _>` | note: while checking the return type of the `async fn` --> $DIR/suggest-missing-await.rs:57:28 diff --git a/tests/ui/autoref-autoderef/issue-38940.stderr b/tests/ui/autoref-autoderef/issue-38940.stderr index f0b8405770e8d..8e98bfcd90fbc 100644 --- a/tests/ui/autoref-autoderef/issue-38940.stderr +++ b/tests/ui/autoref-autoderef/issue-38940.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/issue-38940.rs:49:22 | LL | let x: &Bottom = &t; - | ------- ^^ expected struct `Bottom`, found struct `Top` + | ------- ^^ expected `&Bottom`, found `&Top` | | | expected due to this | diff --git a/tests/ui/binding/issue-53114-safety-checks.rs b/tests/ui/binding/issue-53114-safety-checks.rs index d0eb28c571411..e234db516c7da 100644 --- a/tests/ui/binding/issue-53114-safety-checks.rs +++ b/tests/ui/binding/issue-53114-safety-checks.rs @@ -21,13 +21,11 @@ fn let_wild_gets_unsafe_field() { let u2 = U { a: I(1) }; let p = P { a: &2, b: &3 }; let _ = &p.b; //~ ERROR reference to packed field - //~^ WARN will become a hard error let _ = u1.a; // #53114: should eventually signal error as well let _ = &u2.a; //~ ERROR [E0133] // variation on above with `_` in substructure let (_,) = (&p.b,); //~ ERROR reference to packed field - //~^ WARN will become a hard error let (_,) = (u1.a,); //~ ERROR [E0133] let (_,) = (&u2.a,); //~ ERROR [E0133] } @@ -37,13 +35,11 @@ fn match_unsafe_field_to_wild() { let u2 = U { a: I(1) }; let p = P { a: &2, b: &3 }; match &p.b { _ => { } } //~ ERROR reference to packed field - //~^ WARN will become a hard error match u1.a { _ => { } } //~ ERROR [E0133] match &u2.a { _ => { } } //~ ERROR [E0133] // variation on above with `_` in substructure match (&p.b,) { (_,) => { } } //~ ERROR reference to packed field - //~^ WARN will become a hard error match (u1.a,) { (_,) => { } } //~ ERROR [E0133] match (&u2.a,) { (_,) => { } } //~ ERROR [E0133] } diff --git a/tests/ui/binding/issue-53114-safety-checks.stderr b/tests/ui/binding/issue-53114-safety-checks.stderr index 57a065d6d4d2f..5c9d787724778 100644 --- a/tests/ui/binding/issue-53114-safety-checks.stderr +++ b/tests/ui/binding/issue-53114-safety-checks.stderr @@ -1,50 +1,41 @@ -error: reference to packed field is unaligned +error[E0793]: reference to packed field is unaligned --> $DIR/issue-53114-safety-checks.rs:23:13 | LL | let _ = &p.b; | ^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:29:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:28:17 | LL | let (_,) = (&p.b,); | ^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:39:11 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:37:11 | LL | match &p.b { _ => { } } | ^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:45:12 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:42:12 | LL | match (&p.b,) { (_,) => { } } | ^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:26:13 + --> $DIR/issue-53114-safety-checks.rs:25:13 | LL | let _ = &u2.a; | ^^^^^ access to union field @@ -52,7 +43,7 @@ LL | let _ = &u2.a; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:31:17 + --> $DIR/issue-53114-safety-checks.rs:29:17 | LL | let (_,) = (u1.a,); | ^^^^ access to union field @@ -60,7 +51,7 @@ LL | let (_,) = (u1.a,); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:32:17 + --> $DIR/issue-53114-safety-checks.rs:30:17 | LL | let (_,) = (&u2.a,); | ^^^^^ access to union field @@ -68,7 +59,7 @@ LL | let (_,) = (&u2.a,); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:41:11 + --> $DIR/issue-53114-safety-checks.rs:38:11 | LL | match u1.a { _ => { } } | ^^^^ access to union field @@ -76,7 +67,7 @@ LL | match u1.a { _ => { } } = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:42:11 + --> $DIR/issue-53114-safety-checks.rs:39:11 | LL | match &u2.a { _ => { } } | ^^^^^ access to union field @@ -84,7 +75,7 @@ LL | match &u2.a { _ => { } } = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:47:12 + --> $DIR/issue-53114-safety-checks.rs:43:12 | LL | match (u1.a,) { (_,) => { } } | ^^^^ access to union field @@ -92,7 +83,7 @@ LL | match (u1.a,) { (_,) => { } } = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-53114-safety-checks.rs:48:12 + --> $DIR/issue-53114-safety-checks.rs:44:12 | LL | match (&u2.a,) { (_,) => { } } | ^^^^^ access to union field @@ -101,56 +92,5 @@ LL | match (&u2.a,) { (_,) => { } } error: aborting due to 11 previous errors -For more information about this error, try `rustc --explain E0133`. -Future incompatibility report: Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:23:13 - | -LL | let _ = &p.b; - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:29:17 - | -LL | let (_,) = (&p.b,); - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:39:11 - | -LL | match &p.b { _ => { } } - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:45:12 - | -LL | match (&p.b,) { (_,) => { } } - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - +Some errors have detailed explanations: E0133, E0793. +For more information about an error, try `rustc --explain E0133`. diff --git a/tests/ui/binop/binary-op-on-double-ref.fixed b/tests/ui/binop/binary-op-on-double-ref.fixed index de9dc19af29be..586d2568c306f 100644 --- a/tests/ui/binop/binary-op-on-double-ref.fixed +++ b/tests/ui/binop/binary-op-on-double-ref.fixed @@ -3,7 +3,7 @@ fn main() { let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; let vr = v.iter().filter(|x| { *x % 2 == 0 - //~^ ERROR cannot mod `&&{integer}` by `{integer}` + //~^ ERROR cannot calculate the remainder of `&&{integer}` divided by `{integer}` }); println!("{:?}", vr); } diff --git a/tests/ui/binop/binary-op-on-double-ref.rs b/tests/ui/binop/binary-op-on-double-ref.rs index 2616c560cbefb..48ee445466e35 100644 --- a/tests/ui/binop/binary-op-on-double-ref.rs +++ b/tests/ui/binop/binary-op-on-double-ref.rs @@ -3,7 +3,7 @@ fn main() { let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; let vr = v.iter().filter(|x| { x % 2 == 0 - //~^ ERROR cannot mod `&&{integer}` by `{integer}` + //~^ ERROR cannot calculate the remainder of `&&{integer}` divided by `{integer}` }); println!("{:?}", vr); } diff --git a/tests/ui/binop/binary-op-on-double-ref.stderr b/tests/ui/binop/binary-op-on-double-ref.stderr index 34826d2f4bf7a..2e8aeebc681d6 100644 --- a/tests/ui/binop/binary-op-on-double-ref.stderr +++ b/tests/ui/binop/binary-op-on-double-ref.stderr @@ -1,4 +1,4 @@ -error[E0369]: cannot mod `&&{integer}` by `{integer}` +error[E0369]: cannot calculate the remainder of `&&{integer}` divided by `{integer}` --> $DIR/binary-op-on-double-ref.rs:5:11 | LL | x % 2 == 0 diff --git a/tests/ui/binop/issue-28837.rs b/tests/ui/binop/issue-28837.rs index 9719c3afa68c1..54c8838e48f11 100644 --- a/tests/ui/binop/issue-28837.rs +++ b/tests/ui/binop/issue-28837.rs @@ -11,7 +11,7 @@ fn main() { a / a; //~ ERROR cannot divide `A` by `A` - a % a; //~ ERROR cannot mod `A` by `A` + a % a; //~ ERROR cannot calculate the remainder of `A` divided by `A` a & a; //~ ERROR no implementation for `A & A` diff --git a/tests/ui/binop/issue-28837.stderr b/tests/ui/binop/issue-28837.stderr index 6e236ca5296a1..cca1da3b6ac49 100644 --- a/tests/ui/binop/issue-28837.stderr +++ b/tests/ui/binop/issue-28837.stderr @@ -62,7 +62,7 @@ LL | struct A; note: the trait `Div` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL -error[E0369]: cannot mod `A` by `A` +error[E0369]: cannot calculate the remainder of `A` divided by `A` --> $DIR/issue-28837.rs:14:7 | LL | a % a; diff --git a/tests/ui/blind/blind-item-block-middle.stderr b/tests/ui/blind/blind-item-block-middle.stderr index eb64fea943398..63e6d76843d18 100644 --- a/tests/ui/blind/blind-item-block-middle.stderr +++ b/tests/ui/blind/blind-item-block-middle.stderr @@ -7,7 +7,7 @@ LL | mod foo { pub struct bar; } LL | let bar = 5; | ^^^ - this expression has type `{integer}` | | - | expected integer, found struct `bar` + | expected integer, found `bar` | `bar` is interpreted as a unit struct, not a new binding | help: introduce a new binding instead: `other_bar` diff --git a/tests/ui/block-result/consider-removing-last-semi.stderr b/tests/ui/block-result/consider-removing-last-semi.stderr index 9be0367ae383c..d30ab1293431b 100644 --- a/tests/ui/block-result/consider-removing-last-semi.stderr +++ b/tests/ui/block-result/consider-removing-last-semi.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:3:15 | LL | pub fn f() -> String { - | - ^^^^^^ expected struct `String`, found `()` + | - ^^^^^^ expected `String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | 0u8; @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:8:15 | LL | pub fn g() -> String { - | - ^^^^^^ expected struct `String`, found `()` + | - ^^^^^^ expected `String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | "this won't work".to_string(); diff --git a/tests/ui/block-result/issue-13428.stderr b/tests/ui/block-result/issue-13428.stderr index 2b386d10c53c4..c119b69da2294 100644 --- a/tests/ui/block-result/issue-13428.stderr +++ b/tests/ui/block-result/issue-13428.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13428.rs:3:13 | LL | fn foo() -> String { - | --- ^^^^^^ expected struct `String`, found `()` + | --- ^^^^^^ expected `String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 | LL | fn bar() -> String { - | --- ^^^^^^ expected struct `String`, found `()` + | --- ^^^^^^ expected `String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | "foobar".to_string() diff --git a/tests/ui/block-result/issue-13624.rs b/tests/ui/block-result/issue-13624.rs index 4d2844cc5aec8..8f93e5a356fa6 100644 --- a/tests/ui/block-result/issue-13624.rs +++ b/tests/ui/block-result/issue-13624.rs @@ -6,7 +6,7 @@ mod a { pub fn get_enum_struct_variant() -> () { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types - //~| expected `()`, found enum `Enum` + //~| expected `()`, found `Enum` } } @@ -19,7 +19,7 @@ mod b { match enum_struct_variant { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types - //~| expected `()`, found enum `Enum` + //~| expected `()`, found `Enum` } } } diff --git a/tests/ui/block-result/issue-13624.stderr b/tests/ui/block-result/issue-13624.stderr index 13070b4e82131..d41bd057f8246 100644 --- a/tests/ui/block-result/issue-13624.stderr +++ b/tests/ui/block-result/issue-13624.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | pub fn get_enum_struct_variant() -> () { | -- expected `()` because of return type LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum` error[E0308]: mismatched types --> $DIR/issue-13624.rs:20:9 @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | match enum_struct_variant { | ------------------- this expression has type `()` LL | a::Enum::EnumStructVariant { x, y, z } => { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum` error: aborting due to 2 previous errors diff --git a/tests/ui/block-result/issue-22645.stderr b/tests/ui/block-result/issue-22645.stderr index 24341c0f58a80..677b40aaa9dad 100644 --- a/tests/ui/block-result/issue-22645.stderr +++ b/tests/ui/block-result/issue-22645.stderr @@ -20,7 +20,7 @@ LL | fn main() { | - expected `()` because of default return type LL | let b = Bob + 3.5; LL | b + 3 - | ^^^^^ expected `()`, found struct `Bob` + | ^^^^^ expected `()`, found `Bob` error: aborting due to 2 previous errors diff --git a/tests/ui/block-result/issue-5500.rs b/tests/ui/block-result/issue-5500.rs index 577987a4596cb..de7fd39a20caa 100644 --- a/tests/ui/block-result/issue-5500.rs +++ b/tests/ui/block-result/issue-5500.rs @@ -3,5 +3,5 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found reference `&_` - //~| expected `()`, found reference + //~| expected `()`, found `&_` } diff --git a/tests/ui/block-result/issue-5500.stderr b/tests/ui/block-result/issue-5500.stderr index 211a6052864e8..8cd4bd65871a3 100644 --- a/tests/ui/block-result/issue-5500.stderr +++ b/tests/ui/block-result/issue-5500.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn main() { | - expected `()` because of default return type LL | &panic!() - | ^^^^^^^^^ expected `()`, found reference + | ^^^^^^^^^ expected `()`, found `&_` | = note: expected unit type `()` found reference `&_` diff --git a/tests/ui/box/issue-82446.stderr b/tests/ui/box/issue-82446.stderr index 0374737957e48..c03f35884b8a4 100644 --- a/tests/ui/box/issue-82446.stderr +++ b/tests/ui/box/issue-82446.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-82446.rs:11:9 | LL | val - | ^^^ expected struct `Box`, found reference + | ^^^ expected `Box`, found `&Box` | = note: expected struct `Box<(dyn MyTrait + 'static)>` found reference `&Box<(dyn MyTrait + 'static)>` diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr index 4beea83d8a528..c7899338197d8 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.stderr +++ b/tests/ui/c-variadic/variadic-ffi-1.stderr @@ -46,6 +46,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; | = note: expected fn pointer `unsafe extern "C" fn(_, _)` found fn item `unsafe extern "C" fn(_, _, ...) {foo}` + = note: when the arguments and return types match, functions can be coerced to function pointers error[E0308]: mismatched types --> $DIR/variadic-ffi-1.rs:26:54 @@ -57,6 +58,7 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; | = note: expected fn pointer `extern "C" fn(_, _, ...)` found fn item `extern "C" fn(_, _) {bar}` + = note: when the arguments and return types match, functions can be coerced to function pointers error[E0617]: can't pass `f32` to variadic function --> $DIR/variadic-ffi-1.rs:28:19 diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs index 1488f329648bb..c7ee90ea73fd6 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs @@ -20,7 +20,6 @@ fn test_missing_unsafe_warning_on_repr_packed() { let c = || { println!("{}", foo.x); //~^ ERROR: reference to packed field is unaligned - //~| WARNING: this was previously accepted by the compiler but is being phased out let _z = foo.x; }; diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr index 508c4b911b70b..9c2c434572ae5 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr @@ -1,29 +1,13 @@ -error: reference to packed field is unaligned +error[E0793]: reference to packed field is unaligned --> $DIR/repr_packed.rs:21:24 | LL | println!("{}", foo.x); | ^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error -Future incompatibility report: Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/repr_packed.rs:21:24 - | -LL | println!("{}", foo.x); - | ^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/closures/issue-78720.stderr b/tests/ui/closures/issue-78720.stderr index 1e860d32b2a06..5d65c87b0fd61 100644 --- a/tests/ui/closures/issue-78720.stderr +++ b/tests/ui/closures/issue-78720.stderr @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/issue-78720.rs:7:39 | LL | fn map2(self, f: F) -> Map2 {} - | ^^ expected struct `Map2`, found `()` + | ^^ expected `Map2`, found `()` | = note: expected struct `Map2` found unit type `()` diff --git a/tests/ui/coercion/coerce-block-tail-26978.stderr b/tests/ui/coercion/coerce-block-tail-26978.stderr index 384debd487c51..90eb75f2bdfd1 100644 --- a/tests/ui/coercion/coerce-block-tail-26978.stderr +++ b/tests/ui/coercion/coerce-block-tail-26978.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-block-tail-26978.rs:9:9 | LL | f(&{x}); - | ^ expected `i32`, found struct `Box` + | ^ expected `i32`, found `Box` | = note: expected type `i32` found struct `Box` diff --git a/tests/ui/coercion/coerce-block-tail-57749.stderr b/tests/ui/coercion/coerce-block-tail-57749.stderr index d5660c81dbd3e..7e14f42eaafce 100644 --- a/tests/ui/coercion/coerce-block-tail-57749.stderr +++ b/tests/ui/coercion/coerce-block-tail-57749.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-block-tail-57749.rs:33:14 | LL | reset(&{ Homura }); - | ^^^^^^ expected `u32`, found struct `Homura` + | ^^^^^^ expected `u32`, found `Homura` | help: consider dereferencing the type | diff --git a/tests/ui/coercion/coerce-block-tail-83783.stderr b/tests/ui/coercion/coerce-block-tail-83783.stderr index 5f53606ce2225..d556d013bb583 100644 --- a/tests/ui/coercion/coerce-block-tail-83783.stderr +++ b/tests/ui/coercion/coerce-block-tail-83783.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-block-tail-83783.rs:7:32 | LL | _consume_reference::(&async { Box::new(7_i32) }.await); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Box` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `Box` | = note: expected type `i32` found struct `Box` diff --git a/tests/ui/coercion/coerce-block-tail-83850.stderr b/tests/ui/coercion/coerce-block-tail-83850.stderr index bbf6075437043..3cfebb8a54372 100644 --- a/tests/ui/coercion/coerce-block-tail-83850.stderr +++ b/tests/ui/coercion/coerce-block-tail-83850.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-block-tail-83850.rs:5:7 | LL | f(&Box::new([1, 2])); - | - ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found struct `Box` + | - ^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&Box<[{integer}; 2]>` | | | arguments to this function are incorrect | diff --git a/tests/ui/coercion/coerce-block-tail.stderr b/tests/ui/coercion/coerce-block-tail.stderr index 318cf75867b4b..7044fc3cefc4c 100644 --- a/tests/ui/coercion/coerce-block-tail.stderr +++ b/tests/ui/coercion/coerce-block-tail.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-block-tail.rs:4:23 | LL | let _: &i32 = & { Box::new(1i32) }; - | ^^^^^^^^^^^^^^ expected `i32`, found struct `Box` + | ^^^^^^^^^^^^^^ expected `i32`, found `Box` | = note: expected type `i32` found struct `Box` diff --git a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr index 44968244c4d05..f94422a926985 100644 --- a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr +++ b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:9:27 | LL | let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>); - | ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>` | = note: expected struct `Box<[i32]>` found struct `Box<[i32; 3]>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:10:27 | LL | let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>` | = note: expected struct `Box<[i32]>` found struct `Box<[i32; 3]>` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:11:27 | LL | let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>` | = note: expected struct `Box<[i32]>` found struct `Box<[i32; 3]>` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:13:27 | LL | let _ = type_ascribe!(box { |x| (x as u8) }, Box _>); - | ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | ^^^^^^^^^^^^^^^^^^^^^ expected `Box u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:13:33]>` | = note: expected struct `Box u8>` found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:33: 13:36]>` @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:14:27 | LL | let _ = type_ascribe!(box if true { false } else { true }, Box); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box`, found `Box` | = note: expected struct `Box` found struct `Box` @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:15:27 | LL | let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box`, found `Box` | = note: expected struct `Box` found struct `Box` @@ -56,7 +56,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:17:27 | LL | let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]); - | ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -65,7 +65,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:18:27 | LL | let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -74,7 +74,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:19:27 | LL | let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -83,7 +83,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:21:27 | LL | let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _); - | ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:21:30]` | = note: expected reference `&dyn Fn(i32) -> u8` found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:30: 21:33]` @@ -92,7 +92,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:22:27 | LL | let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool` | = note: expected reference `&dyn Debug` found reference `&bool` @@ -101,7 +101,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:23:27 | LL | let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char` | = note: expected reference `&dyn Debug` found reference `&char` @@ -110,7 +110,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:25:27 | LL | let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>); - | ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>` | = note: expected struct `Box<[i32]>` found struct `Box<[i32; 3]>` @@ -119,7 +119,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:26:27 | LL | let _ = type_ascribe!(Box::new(|x| (x as u8)), Box _>); - | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:26:36]>` | = note: expected struct `Box u8>` found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:36: 26:39]>` diff --git a/tests/ui/coercion/coerce-to-bang.stderr b/tests/ui/coercion/coerce-to-bang.stderr index 1207dc7e7a2ff..3c737358adc77 100644 --- a/tests/ui/coercion/coerce-to-bang.stderr +++ b/tests/ui/coercion/coerce-to-bang.stderr @@ -82,7 +82,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:50:21 | LL | let x: [!; 2] = [return, 22]; - | ------ ^^^^^^^^^^^^ expected `!`, found integer + | ------ ^^^^^^^^^^^^ expected `[!; 2]`, found `[{integer}; 2]` | | | expected due to this | diff --git a/tests/ui/coercion/coercion-missing-tail-expected-type.stderr b/tests/ui/coercion/coercion-missing-tail-expected-type.stderr index 4c04bb1135169..288e945f1f8d5 100644 --- a/tests/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/tests/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -12,7 +12,7 @@ error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:8:13 | LL | fn foo() -> Result { - | --- ^^^^^^^^^^^^^^^ expected enum `Result`, found `()` + | --- ^^^^^^^^^^^^^^^ expected `Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | Ok(1); diff --git a/tests/ui/coercion/coercion-slice.rs b/tests/ui/coercion/coercion-slice.rs index b756c8f8203a0..b99235dd37f89 100644 --- a/tests/ui/coercion/coercion-slice.rs +++ b/tests/ui/coercion/coercion-slice.rs @@ -3,5 +3,5 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected `&[i32]`, found array `[{integer}; 1]` + //~| expected `&[i32]`, found `[{integer}; 1]` } diff --git a/tests/ui/coercion/coercion-slice.stderr b/tests/ui/coercion/coercion-slice.stderr index 42dc954ffd5e7..c7b856a57ebc9 100644 --- a/tests/ui/coercion/coercion-slice.stderr +++ b/tests/ui/coercion/coercion-slice.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _: &[i32] = [0]; | ------ ^^^ | | | - | | expected `&[i32]`, found array `[{integer}; 1]` + | | expected `&[i32]`, found `[{integer}; 1]` | | help: consider borrowing here: `&[0]` | expected due to this diff --git a/tests/ui/compare-method/bad-self-type.stderr b/tests/ui/compare-method/bad-self-type.stderr index cad942e646e3e..f632a53f264e0 100644 --- a/tests/ui/compare-method/bad-self-type.stderr +++ b/tests/ui/compare-method/bad-self-type.stderr @@ -4,7 +4,7 @@ error[E0053]: method `poll` has an incompatible type for trait LL | fn poll(self, _: &mut Context<'_>) -> Poll<()> { | ^^^^ | | - | expected struct `Pin`, found struct `MyFuture` + | expected `Pin<&mut MyFuture>`, found `MyFuture` | help: change the self-receiver type to match the trait: `self: Pin<&mut MyFuture>` | = note: expected signature `fn(Pin<&mut MyFuture>, &mut Context<'_>) -> Poll<_>` @@ -16,7 +16,7 @@ error[E0053]: method `foo` has an incompatible type for trait LL | fn foo(self: Box) {} | ------^^^^^^^^^ | | | - | | expected struct `MyFuture`, found struct `Box` + | | expected `MyFuture`, found `Box` | help: change the self-receiver type to match the trait: `self` | note: type in trait @@ -31,7 +31,7 @@ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/bad-self-type.rs:24:18 | LL | fn bar(self) {} - | ^ expected enum `Option`, found `()` + | ^ expected `Option<()>`, found `()` | note: type in trait --> $DIR/bad-self-type.rs:18:21 diff --git a/tests/ui/confuse-field-and-method/issue-33784.stderr b/tests/ui/confuse-field-and-method/issue-33784.stderr index 3906d64c94624..34debb6831734 100644 --- a/tests/ui/confuse-field-and-method/issue-33784.stderr +++ b/tests/ui/confuse-field-and-method/issue-33784.stderr @@ -1,4 +1,4 @@ -error[E0599]: no method named `closure` found for reference `&Obj<[closure@issue-33784.rs:25:43]>` in the current scope +error[E0599]: no method named `closure` found for reference `&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:45]>` in the current scope --> $DIR/issue-33784.rs:27:7 | LL | p.closure(); @@ -9,7 +9,7 @@ help: to call the function stored in `closure`, surround the field access with p LL | (p.closure)(); | + + -error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@issue-33784.rs:25:43]>` in the current scope +error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:45]>` in the current scope --> $DIR/issue-33784.rs:29:7 | LL | q.fn_ptr(); diff --git a/tests/ui/const-generics/defaults/mismatch.stderr b/tests/ui/const-generics/defaults/mismatch.stderr index 52c54aace5f16..9c4f0bc950b2d 100644 --- a/tests/ui/const-generics/defaults/mismatch.stderr +++ b/tests/ui/const-generics/defaults/mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mismatch.rs:7:26 | LL | let e: Example<13> = (); - | ----------- ^^ expected struct `Example`, found `()` + | ----------- ^^ expected `Example`, found `()` | | | expected due to this | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/mismatch.rs:10:32 | LL | let e: Example2 = (); - | ----------------- ^^ expected struct `Example2`, found `()` + | ----------------- ^^ expected `Example2`, found `()` | | | expected due to this | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/mismatch.rs:13:32 | LL | let e: Example3<13, u32> = (); - | ----------------- ^^ expected struct `Example3`, found `()` + | ----------------- ^^ expected `Example3`, found `()` | | | expected due to this | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/mismatch.rs:16:26 | LL | let e: Example3<7> = (); - | ----------- ^^ expected struct `Example3`, found `()` + | ----------- ^^ expected `Example3<7>`, found `()` | | | expected due to this | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/mismatch.rs:19:26 | LL | let e: Example4<7> = (); - | ----------- ^^ expected struct `Example4`, found `()` + | ----------- ^^ expected `Example4<7>`, found `()` | | | expected due to this | diff --git a/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr b/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr index 9baf9790e19b3..511ae58a1dcdd 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-79518-default_trait_method_normalization.rs:16:32 | LL | Self::AssocInstance == [(); std::mem::size_of::()]; - | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); std::mem::size_of::()]` + | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `[(); std::mem::size_of::()]` | | | expected because this is `::Assoc` | diff --git a/tests/ui/const-generics/generic_const_exprs/single-satisfied-ConstEvaluatable-in-probe.rs b/tests/ui/const-generics/generic_const_exprs/single-satisfied-ConstEvaluatable-in-probe.rs new file mode 100644 index 0000000000000..0ba0c5a72efbd --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/single-satisfied-ConstEvaluatable-in-probe.rs @@ -0,0 +1,39 @@ +// check-pass + +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] + +use std::marker::PhantomData; + +pub trait Bytes { + const BYTES: usize; +} + +#[derive(Clone, Debug)] +pub struct Conster +where + OT: Bytes, + [(); OT::BYTES]: Sized, +{ + _offset_type: PhantomData OT>, +} + +impl Conster +where + OT: Bytes, + [(); OT::BYTES]: Sized, +{ + pub fn new() -> Self { + Conster { _offset_type: PhantomData } + } +} + +pub fn make_conster() -> Conster +where + COT: Bytes, + [(); COT::BYTES]: Sized, +{ + Conster::new() +} + +fn main() {} diff --git a/tests/ui/const-generics/issues/issue-67945-1.full.stderr b/tests/ui/const-generics/issues/issue-67945-1.full.stderr index 8e18fcdffab70..8879aec35e599 100644 --- a/tests/ui/const-generics/issues/issue-67945-1.full.stderr +++ b/tests/ui/const-generics/issues/issue-67945-1.full.stderr @@ -5,7 +5,7 @@ LL | struct Bug { | - this type parameter ... LL | let x: S = MaybeUninit::uninit(); - | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` + | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found `MaybeUninit<_>` | | | expected due to this | diff --git a/tests/ui/const-generics/type_mismatch.stderr b/tests/ui/const-generics/type_mismatch.stderr index 8d779bee265cf..b28ae8f7e7101 100644 --- a/tests/ui/const-generics/type_mismatch.stderr +++ b/tests/ui/const-generics/type_mismatch.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/type_mismatch.rs:5:26 | LL | fn bar() -> [u8; N] {} - | --- ^^^^^^^ expected array `[u8; N]`, found `()` + | --- ^^^^^^^ expected `[u8; N]`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/tests/ui/const-generics/type_not_in_scope.stderr b/tests/ui/const-generics/type_not_in_scope.stderr index 16796acb3d285..5f45550a62796 100644 --- a/tests/ui/const-generics/type_not_in_scope.stderr +++ b/tests/ui/const-generics/type_not_in_scope.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/type_not_in_scope.rs:7:33 | LL | fn getn() -> [u8; N] {} - | ---- ^^^^^^^ expected array `[u8; N]`, found `()` + | ---- ^^^^^^^ expected `[u8; N]`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/tests/ui/const-generics/types-mismatch-const-args.full.stderr b/tests/ui/const-generics/types-mismatch-const-args.full.stderr index b6a22df74369a..13cd5d17d4127 100644 --- a/tests/ui/const-generics/types-mismatch-const-args.full.stderr +++ b/tests/ui/const-generics/types-mismatch-const-args.full.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:16:41 | LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 2, 3>`, found `A<'_, u32, 2, 3>` | | | expected due to this | @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:18:41 | LL | let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 4, 3>`, found `A<'_, u32, 2, 3>` | | | expected due to this | diff --git a/tests/ui/const-generics/types-mismatch-const-args.min.stderr b/tests/ui/const-generics/types-mismatch-const-args.min.stderr index 6ac93a08d5d68..cae3adfa128d0 100644 --- a/tests/ui/const-generics/types-mismatch-const-args.min.stderr +++ b/tests/ui/const-generics/types-mismatch-const-args.min.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:16:41 | LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 2, 3>`, found `A<'_, u32, 2, 3>` | | | expected due to this | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:18:41 | LL | let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 4, 3>`, found `A<'_, u32, 2, 3>` | | | expected due to this | diff --git a/tests/ui/consts/const-eval/const-eval-span.rs b/tests/ui/consts/const-eval/const-eval-span.rs index 82f101b47cfeb..1667c77d124c5 100644 --- a/tests/ui/consts/const-eval/const-eval-span.rs +++ b/tests/ui/consts/const-eval/const-eval-span.rs @@ -8,7 +8,7 @@ const CONSTANT: S = S(0); enum E { V = CONSTANT, //~^ ERROR mismatched types - //~| expected `isize`, found struct `S` + //~| expected `isize`, found `S` } fn main() {} diff --git a/tests/ui/consts/const-eval/const-eval-span.stderr b/tests/ui/consts/const-eval/const-eval-span.stderr index c5b001899ff92..fe33ad4905a5c 100644 --- a/tests/ui/consts/const-eval/const-eval-span.stderr +++ b/tests/ui/consts/const-eval/const-eval-span.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-eval-span.rs:9:9 | LL | V = CONSTANT, - | ^^^^^^^^ expected `isize`, found struct `S` + | ^^^^^^^^ expected `isize`, found `S` error: aborting due to previous error diff --git a/tests/ui/consts/const-tup-index-span.rs b/tests/ui/consts/const-tup-index-span.rs index 778a212249c19..18f4f59d3785c 100644 --- a/tests/ui/consts/const-tup-index-span.rs +++ b/tests/ui/consts/const-tup-index-span.rs @@ -2,7 +2,7 @@ const TUP: (usize,) = 5usize << 64; //~^ ERROR mismatched types -//~| expected tuple, found `usize` +//~| expected `(usize,)`, found `usize` const ARR: [i32; TUP.0] = []; //~^ constant diff --git a/tests/ui/consts/const-tup-index-span.stderr b/tests/ui/consts/const-tup-index-span.stderr index ad84680561726..65f0520f8a46e 100644 --- a/tests/ui/consts/const-tup-index-span.stderr +++ b/tests/ui/consts/const-tup-index-span.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-tup-index-span.rs:3:23 | LL | const TUP: (usize,) = 5usize << 64; - | ^^^^^^^^^^^^ expected tuple, found `usize` + | ^^^^^^^^^^^^ expected `(usize,)`, found `usize` | = note: expected tuple `(usize,)` found type `usize` diff --git a/tests/ui/consts/nested_erroneous_ctfe.stderr b/tests/ui/consts/nested_erroneous_ctfe.stderr index d579a54e9836f..b6a1725076bc6 100644 --- a/tests/ui/consts/nested_erroneous_ctfe.stderr +++ b/tests/ui/consts/nested_erroneous_ctfe.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/nested_erroneous_ctfe.rs:2:16 | LL | [9; || [9; []]]; - | ^^ expected `usize`, found array of 0 elements + | ^^ expected `usize`, found `[_; 0]` | = note: expected type `usize` found array `[_; 0]` diff --git a/tests/ui/cross/cross-borrow-trait.stderr b/tests/ui/cross/cross-borrow-trait.stderr index 81f309eae087c..4f5af106613f6 100644 --- a/tests/ui/cross/cross-borrow-trait.stderr +++ b/tests/ui/cross/cross-borrow-trait.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/cross-borrow-trait.rs:10:26 | LL | let _y: &dyn Trait = x; - | ---------- ^ expected `&dyn Trait`, found struct `Box` + | ---------- ^ expected `&dyn Trait`, found `Box` | | | expected due to this | diff --git a/tests/ui/deref-patterns/gate.stderr b/tests/ui/deref-patterns/gate.stderr index 993468b5e826b..b5b79ed3771c3 100644 --- a/tests/ui/deref-patterns/gate.stderr +++ b/tests/ui/deref-patterns/gate.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match String::new() { | ------------- this expression has type `String` LL | "" | _ => {} - | ^^ expected struct `String`, found `&str` + | ^^ expected `String`, found `&str` error: aborting due to previous error diff --git a/tests/ui/derives/deriving-with-repr-packed-2.rs b/tests/ui/derives/deriving-with-repr-packed-2.rs index cbd7432fce4ee..79aca74dfd416 100644 --- a/tests/ui/derives/deriving-with-repr-packed-2.rs +++ b/tests/ui/derives/deriving-with-repr-packed-2.rs @@ -1,5 +1,3 @@ -#![deny(unaligned_references)] - // Check that deriving certain builtin traits on certain packed structs cause // errors. To avoid potentially misaligned references, field copies must be // used, which involves adding `T: Copy` bounds. diff --git a/tests/ui/derives/deriving-with-repr-packed-2.stderr b/tests/ui/derives/deriving-with-repr-packed-2.stderr index 83540739ee3d9..ab3646057a55c 100644 --- a/tests/ui/derives/deriving-with-repr-packed-2.stderr +++ b/tests/ui/derives/deriving-with-repr-packed-2.stderr @@ -1,5 +1,5 @@ error[E0599]: the method `clone` exists for struct `Foo`, but its trait bounds were not satisfied - --> $DIR/deriving-with-repr-packed-2.rs:20:11 + --> $DIR/deriving-with-repr-packed-2.rs:18:11 | LL | pub struct Foo(T, T, T); | ----------------- @@ -19,7 +19,7 @@ LL | _ = x.clone(); note: the following trait bounds were not satisfied: `NonCopy: Clone` `NonCopy: Copy` - --> $DIR/deriving-with-repr-packed-2.rs:7:16 + --> $DIR/deriving-with-repr-packed-2.rs:5:16 | LL | #[derive(Copy, Clone, Default, PartialEq, Eq)] | ^^^^^ unsatisfied trait bound introduced in this `derive` macro diff --git a/tests/ui/derives/deriving-with-repr-packed.rs b/tests/ui/derives/deriving-with-repr-packed.rs index eddf41f55536e..afa91da133dc0 100644 --- a/tests/ui/derives/deriving-with-repr-packed.rs +++ b/tests/ui/derives/deriving-with-repr-packed.rs @@ -1,5 +1,3 @@ -#![deny(unaligned_references)] - // Check that deriving certain builtin traits on certain packed structs cause // errors. To avoid potentially misaligned references, field copies must be // used, which involves adding `T: Copy` bounds. diff --git a/tests/ui/derives/deriving-with-repr-packed.stderr b/tests/ui/derives/deriving-with-repr-packed.stderr index 2cb2a696d9742..7ed84af91bdc3 100644 --- a/tests/ui/derives/deriving-with-repr-packed.stderr +++ b/tests/ui/derives/deriving-with-repr-packed.stderr @@ -1,5 +1,5 @@ warning: byte slice in a packed struct that derives a built-in trait - --> $DIR/deriving-with-repr-packed.rs:33:5 + --> $DIR/deriving-with-repr-packed.rs:31:5 | LL | #[derive(Debug)] | ----- in this derive macro expansion @@ -14,7 +14,7 @@ LL | data: [u8], = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0507]: cannot move out of `self` which is behind a shared reference - --> $DIR/deriving-with-repr-packed.rs:24:10 + --> $DIR/deriving-with-repr-packed.rs:22:10 | LL | #[derive(Debug, Default)] | ----- in this derive macro expansion @@ -29,7 +29,7 @@ error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0507`. Future incompatibility report: Future breakage diagnostic: warning: byte slice in a packed struct that derives a built-in trait - --> $DIR/deriving-with-repr-packed.rs:33:5 + --> $DIR/deriving-with-repr-packed.rs:31:5 | LL | #[derive(Debug)] | ----- in this derive macro expansion diff --git a/tests/ui/destructure-trait-ref.stderr b/tests/ui/destructure-trait-ref.stderr index 18a889837dfdb..38d2018882727 100644 --- a/tests/ui/destructure-trait-ref.stderr +++ b/tests/ui/destructure-trait-ref.stderr @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | let &&x = &1isize as &dyn T; | ^^ ----------------- this expression has type `&dyn T` | | - | expected trait object `dyn T`, found reference + | expected `dyn T`, found `&_` | = note: expected trait object `dyn T` found reference `&_` @@ -38,7 +38,7 @@ error[E0308]: mismatched types LL | let &&&x = &(&1isize as &dyn T); | ^^ -------------------- this expression has type `&&dyn T` | | - | expected trait object `dyn T`, found reference + | expected `dyn T`, found `&_` | = note: expected trait object `dyn T` found reference `&_` @@ -54,7 +54,7 @@ error[E0308]: mismatched types LL | let box box x = Box::new(1isize) as Box; | ^^^^^ ------------------------------ this expression has type `Box` | | - | expected trait object `dyn T`, found struct `Box` + | expected `dyn T`, found `Box<_>` | = note: expected trait object `dyn T` found struct `Box<_>` diff --git a/tests/ui/destructuring-assignment/default-match-bindings-forbidden.stderr b/tests/ui/destructuring-assignment/default-match-bindings-forbidden.stderr index 950e0223e2201..b285ee1f30482 100644 --- a/tests/ui/destructuring-assignment/default-match-bindings-forbidden.stderr +++ b/tests/ui/destructuring-assignment/default-match-bindings-forbidden.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | (x, y) = &(1, 2); | ^^^^^^ ------- this expression has type `&({integer}, {integer})` | | - | expected reference, found tuple + | expected `&({integer}, {integer})`, found `(_, _)` | = note: expected reference `&({integer}, {integer})` found tuple `(_, _)` diff --git a/tests/ui/diagnostic-width/long-E0308.stderr b/tests/ui/diagnostic-width/long-E0308.stderr index 1c99898bc8329..20b018b9f7721 100644 --- a/tests/ui/diagnostic-width/long-E0308.stderr +++ b/tests/ui/diagnostic-width/long-E0308.stderr @@ -16,7 +16,7 @@ LL | | Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok... LL | | Ok("") LL | | )))))))))))))))))))))))))))))) LL | | )))))))))))))))))))))))))))))); - | |__________________________________^ expected struct `Atype`, found enum `Result` + | |__________________________________^ expected `Atype, ...>`, found `Result, ...>` | = note: expected struct `Atype, ...>` the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' @@ -32,7 +32,7 @@ LL | | Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(... LL | | Ok(Ok(Ok(Ok(Ok(Ok(Ok(""))))))) LL | | )))))))))))))))))))))))))))))) LL | | )))))))))))))))))))))))); - | |____________________________^ expected enum `Option`, found enum `Result` + | |____________________________^ expected `Option>`, found `Result, ...>` | = note: expected enum `Option>` the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' @@ -50,7 +50,7 @@ LL | | Atype< ... | LL | | i32 LL | | > = (); - | | - ^^ expected struct `Atype`, found `()` + | | - ^^ expected `Atype, ...>`, found `()` | |_____| | expected due to this | @@ -69,7 +69,7 @@ LL | | Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(... LL | | Ok(Ok(Ok(Ok(Ok(Ok(Ok(""))))))) LL | | )))))))))))))))))))))))))))))) LL | | )))))))))))))))))))))))); - | |____________________________^ expected `()`, found enum `Result` + | |____________________________^ expected `()`, found `Result, ...>` | = note: expected unit type `()` found enum `Result, ...>` diff --git a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr index 6ded03e45b55e..a7ec192592e0d 100644 --- a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr +++ b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:1:24 | LL | const A: [&str; 1] = { "hello" }; - | ^^^^^^^ expected array `[&'static str; 1]`, found `&str` + | ^^^^^^^ expected `[&str; 1]`, found `&str` | help: to create an array, use square brackets instead of curly braces | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:4:19 | LL | const B: &[u32] = &{ 1 }; - | ^^^^^^ expected slice `[u32]`, found integer + | ^^^^^^ expected `&[u32]`, found `&{integer}` | = note: expected reference `&'static [u32]` found reference `&{integer}` @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:7:27 | LL | const C: &&[u32; 1] = &&{ 1 }; - | ^ expected array `[u32; 1]`, found integer + | ^ expected `[u32; 1]`, found integer | help: to create an array, use square brackets instead of curly braces | diff --git a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr index 473468af6eef8..5e48871bb01bb 100644 --- a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr +++ b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match f { | - this expression has type `Foo` LL | Bar { x } => { - | ^^^^^^^^^ expected enum `Foo`, found struct `Bar` + | ^^^^^^^^^ expected `Foo`, found `Bar` | help: try wrapping the pattern in `Foo::Bar` | @@ -22,7 +22,7 @@ LL | match s { LL | S => { | ^ | | - | expected enum `Option`, found struct `S` + | expected `Option`, found `S` | `S` is interpreted as a unit struct, not a new binding | = note: expected enum `Option` @@ -47,7 +47,7 @@ LL | match s { LL | S => { | ^ | | - | expected enum `Result`, found struct `S` + | expected `Result`, found `S` | `S` is interpreted as a unit struct, not a new binding | = note: expected enum `Result` diff --git a/tests/ui/did_you_mean/compatible-variants.stderr b/tests/ui/did_you_mean/compatible-variants.stderr index fe81da19833a7..7b88d93ead112 100644 --- a/tests/ui/did_you_mean/compatible-variants.stderr +++ b/tests/ui/did_you_mean/compatible-variants.stderr @@ -7,7 +7,7 @@ LL | / while false { LL | | LL | | f(); LL | | } - | |_____^ expected enum `Option`, found `()` + | |_____^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -26,7 +26,7 @@ error[E0308]: mismatched types LL | fn b() -> Result<(), ()> { | -------------- expected `Result<(), ()>` because of return type LL | f() - | ^^^ expected enum `Result`, found `()` + | ^^^ expected `Result<(), ()>`, found `()` | = note: expected enum `Result<(), ()>` found unit type `()` @@ -45,7 +45,7 @@ LL | / for _ in [1, 2] { LL | | LL | | f(); LL | | } - | |_____^ expected enum `Option`, found `()` + | |_____^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -62,7 +62,7 @@ error[E0308]: `?` operator has incompatible types --> $DIR/compatible-variants.rs:35:5 | LL | c()? - | ^^^^ expected enum `Option`, found `()` + | ^^^^ expected `Option<()>`, found `()` | = note: `?` operator cannot convert from `()` to `Option<()>` = note: expected enum `Option<()>` @@ -85,7 +85,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:42:25 | LL | let _: Option<()> = while false {}; - | ---------- ^^^^^^^^^^^^^^ expected enum `Option`, found `()` + | ---------- ^^^^^^^^^^^^^^ expected `Option<()>`, found `()` | | | expected due to this | @@ -100,7 +100,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:46:9 | LL | while false {} - | ^^^^^^^^^^^^^^ expected enum `Option`, found `()` + | ^^^^^^^^^^^^^^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -117,7 +117,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:50:31 | LL | let _: Result = 1; - | ---------------- ^ expected enum `Result`, found integer + | ---------------- ^ expected `Result`, found integer | | | expected due to this | @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:53:26 | LL | let _: Option = 1; - | ----------- ^ expected enum `Option`, found integer + | ----------- ^ expected `Option`, found integer | | | expected due to this | @@ -149,7 +149,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:56:28 | LL | let _: Hey = 1; - | ------------- ^ expected enum `Hey`, found integer + | ------------- ^ expected `Hey`, found integer | | | expected due to this | @@ -166,7 +166,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:59:29 | LL | let _: Hey = false; - | -------------- ^^^^^ expected enum `Hey`, found `bool` + | -------------- ^^^^^ expected `Hey`, found `bool` | | | expected due to this | @@ -181,7 +181,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:63:19 | LL | let _ = Foo { bar }; - | ^^^ expected enum `Option`, found `i32` + | ^^^ expected `Option`, found `i32` | = note: expected enum `Option` found type `i32` @@ -194,7 +194,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:80:16 | LL | let a: A = B::Fst; - | - ^^^^^^ expected enum `A`, found enum `B` + | - ^^^^^^ expected `A`, found `B` | | | expected due to this | @@ -207,7 +207,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:86:17 | LL | let a: A2 = B::Fst; - | -- ^^^^^^ expected struct `A2`, found enum `B` + | -- ^^^^^^ expected `A2`, found `B` | | | expected due to this | diff --git a/tests/ui/did_you_mean/issue-42764.stderr b/tests/ui/did_you_mean/issue-42764.stderr index 6a7fd8fe251dc..3819a5a187f97 100644 --- a/tests/ui/did_you_mean/issue-42764.stderr +++ b/tests/ui/did_you_mean/issue-42764.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-42764.rs:11:43 | LL | this_function_expects_a_double_option(n); - | ------------------------------------- ^ expected enum `DoubleOption`, found `usize` + | ------------------------------------- ^ expected `DoubleOption<_>`, found `usize` | | | arguments to this function are incorrect | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/issue-42764.rs:27:33 | LL | let _c = Context { wrapper: Payload{} }; - | ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload` + | ^^^^^^^^^ expected `Wrapper`, found `Payload` | help: try wrapping the expression in `Wrapper` | diff --git a/tests/ui/did_you_mean/recursion_limit_deref.stderr b/tests/ui/did_you_mean/recursion_limit_deref.stderr index a6b5681a68cba..32fb628c4707b 100644 --- a/tests/ui/did_you_mean/recursion_limit_deref.stderr +++ b/tests/ui/did_you_mean/recursion_limit_deref.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/recursion_limit_deref.rs:51:22 | LL | let x: &Bottom = &t; - | ------- ^^ expected struct `Bottom`, found struct `Top` + | ------- ^^ expected `&Bottom`, found `&Top` | | | expected due to this | diff --git a/tests/ui/disambiguate-identical-names.stderr b/tests/ui/disambiguate-identical-names.stderr index 87560c4c79735..7d8293018d27b 100644 --- a/tests/ui/disambiguate-identical-names.stderr +++ b/tests/ui/disambiguate-identical-names.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/disambiguate-identical-names.rs:13:10 | LL | test(&v); - | ---- ^^ expected struct `Vec`, found struct `HashMap` + | ---- ^^ expected `&Vec>`, found `&HashMap` | | | arguments to this function are incorrect | diff --git a/tests/ui/diverging-fn-tail-35849.stderr b/tests/ui/diverging-fn-tail-35849.stderr index 21361489a2c3a..f5b5a4cccad2c 100644 --- a/tests/ui/diverging-fn-tail-35849.stderr +++ b/tests/ui/diverging-fn-tail-35849.stderr @@ -5,7 +5,7 @@ LL | fn assert_sizeof() -> ! { | - expected `!` because of return type LL | unsafe { LL | ::std::mem::transmute::(panic!()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found array `[u8; 8]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `[u8; 8]` | = note: expected type `!` found array `[u8; 8]` diff --git a/tests/ui/dst/dst-bad-assign-3.rs b/tests/ui/dst/dst-bad-assign-3.rs index d05b3937c998c..d199864d99c2d 100644 --- a/tests/ui/dst/dst-bad-assign-3.rs +++ b/tests/ui/dst/dst-bad-assign-3.rs @@ -32,7 +32,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.2 = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected trait object `dyn ToBar`, found struct `Bar1` + //~| expected `dyn ToBar`, found `Bar1` //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type diff --git a/tests/ui/dst/dst-bad-assign-3.stderr b/tests/ui/dst/dst-bad-assign-3.stderr index b326dbbbc1405..6dd3434fd21be 100644 --- a/tests/ui/dst/dst-bad-assign-3.stderr +++ b/tests/ui/dst/dst-bad-assign-3.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-assign-3.rs:33:12 | LL | f5.2 = Bar1 {f: 36}; - | ---- ^^^^^^^^^^^^ expected trait object `dyn ToBar`, found struct `Bar1` + | ---- ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1` | | | expected due to the type of this binding | diff --git a/tests/ui/dst/dst-bad-assign.rs b/tests/ui/dst/dst-bad-assign.rs index 496e01ae00532..c55fb2c3e5709 100644 --- a/tests/ui/dst/dst-bad-assign.rs +++ b/tests/ui/dst/dst-bad-assign.rs @@ -34,7 +34,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected trait object `dyn ToBar`, found struct `Bar1` + //~| expected `dyn ToBar`, found `Bar1` //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type diff --git a/tests/ui/dst/dst-bad-assign.stderr b/tests/ui/dst/dst-bad-assign.stderr index 614f213875129..d8d1057876f4f 100644 --- a/tests/ui/dst/dst-bad-assign.stderr +++ b/tests/ui/dst/dst-bad-assign.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-assign.rs:35:14 | LL | f5.ptr = Bar1 {f: 36}; - | ------ ^^^^^^^^^^^^ expected trait object `dyn ToBar`, found struct `Bar1` + | ------ ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1` | | | expected due to the type of this binding | diff --git a/tests/ui/dst/dst-bad-coerce1.stderr b/tests/ui/dst/dst-bad-coerce1.stderr index 594acff853a0e..ff77bd4cef88f 100644 --- a/tests/ui/dst/dst-bad-coerce1.stderr +++ b/tests/ui/dst/dst-bad-coerce1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:16:29 | LL | let f3: &Fat<[usize]> = f2; - | ------------- ^^ expected slice `[usize]`, found array `[isize; 3]` + | ------------- ^^ expected `&Fat<[usize]>`, found `&Fat<[isize; 3]>` | | | expected due to this | @@ -21,7 +21,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:28:27 | LL | let f3: &([usize],) = f2; - | ----------- ^^ expected slice `[usize]`, found array `[isize; 3]` + | ----------- ^^ expected `&([usize],)`, found `&([isize; 3],)` | | | expected due to this | diff --git a/tests/ui/dst/dst-bad-coerce4.rs b/tests/ui/dst/dst-bad-coerce4.rs index f63da60d281d7..9f297915e58c9 100644 --- a/tests/ui/dst/dst-bad-coerce4.rs +++ b/tests/ui/dst/dst-bad-coerce4.rs @@ -11,7 +11,7 @@ pub fn main() { let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; let f2: &Fat<[isize; 3]> = f1; //~^ ERROR mismatched types - //~| expected array `[isize; 3]`, found slice `[isize]` + //~| expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>` //~| expected reference `&Fat<[isize; 3]>` //~| found reference `&Fat<[isize]>` @@ -19,7 +19,7 @@ pub fn main() { let f1: &([isize],) = &([1, 2, 3],); let f2: &([isize; 3],) = f1; //~^ ERROR mismatched types - //~| expected array `[isize; 3]`, found slice `[isize]` + //~| expected `&([isize; 3],)`, found `&([isize],)` //~| expected reference `&([isize; 3],)` //~| found reference `&([isize],)` } diff --git a/tests/ui/dst/dst-bad-coerce4.stderr b/tests/ui/dst/dst-bad-coerce4.stderr index 4c9954f35208b..46e7dba817c84 100644 --- a/tests/ui/dst/dst-bad-coerce4.stderr +++ b/tests/ui/dst/dst-bad-coerce4.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:12:32 | LL | let f2: &Fat<[isize; 3]> = f1; - | ---------------- ^^ expected array `[isize; 3]`, found slice `[isize]` + | ---------------- ^^ expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>` | | | expected due to this | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:20:30 | LL | let f2: &([isize; 3],) = f1; - | -------------- ^^ expected array `[isize; 3]`, found slice `[isize]` + | -------------- ^^ expected `&([isize; 3],)`, found `&([isize],)` | | | expected due to this | diff --git a/tests/ui/dyn-star/no-implicit-dyn-star.stderr b/tests/ui/dyn-star/no-implicit-dyn-star.stderr index a3f4d21ca94bd..66e1b9a092c36 100644 --- a/tests/ui/dyn-star/no-implicit-dyn-star.stderr +++ b/tests/ui/dyn-star/no-implicit-dyn-star.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/no-implicit-dyn-star.rs:6:48 | LL | dyn_star_foreign::require_dyn_star_display(1usize); - | ------------------------------------------ ^^^^^^ expected trait object `dyn Display`, found `usize` + | ------------------------------------------ ^^^^^^ expected `dyn Display`, found `usize` | | | arguments to this function are incorrect | diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr index 0e580aedeaa92..4604ebeaa8b98 100644 --- a/tests/ui/empty/empty-struct-braces-expr.stderr +++ b/tests/ui/empty/empty-struct-braces-expr.stderr @@ -100,7 +100,7 @@ help: a unit struct with a similar name exists LL | let xe1 = XEmpty2(); | ~~~~~~~ -error[E0599]: no variant or associated item named `Empty3` found for enum `XE` in the current scope +error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:25:19 | LL | let xe3 = XE::Empty3; @@ -109,7 +109,7 @@ LL | let xe3 = XE::Empty3; | variant or associated item not found in `XE` | help: there is a variant with a similar name: `XEmpty3` -error[E0599]: no variant or associated item named `Empty3` found for enum `XE` in the current scope +error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:26:19 | LL | let xe3 = XE::Empty3(); diff --git a/tests/ui/empty/issue-37026.stderr b/tests/ui/empty/issue-37026.stderr index 48a4a5bcad2b5..75c3ab13caccc 100644 --- a/tests/ui/empty/issue-37026.stderr +++ b/tests/ui/empty/issue-37026.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let empty_struct::XEmpty2 = (); | ^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` | | - | expected `()`, found struct `XEmpty2` + | expected `()`, found `XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | let empty_struct::XEmpty6(..) = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` | | - | expected `()`, found struct `XEmpty6` + | expected `()`, found `XEmpty6` error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0071.rs b/tests/ui/error-codes/E0071.rs index bd8469de75da0..678502ba32889 100644 --- a/tests/ui/error-codes/E0071.rs +++ b/tests/ui/error-codes/E0071.rs @@ -3,5 +3,5 @@ type FooAlias = Foo; fn main() { let u = FooAlias { value: 0 }; - //~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071] + //~^ ERROR expected struct, variant or union type, found `Foo` [E0071] } diff --git a/tests/ui/error-codes/E0071.stderr b/tests/ui/error-codes/E0071.stderr index ae312fc400aff..7bd4ddaf26be2 100644 --- a/tests/ui/error-codes/E0071.stderr +++ b/tests/ui/error-codes/E0071.stderr @@ -1,4 +1,4 @@ -error[E0071]: expected struct, variant or union type, found enum `Foo` +error[E0071]: expected struct, variant or union type, found `Foo` --> $DIR/E0071.rs:5:13 | LL | let u = FooAlias { value: 0 }; diff --git a/tests/ui/extern/extern-types-distinct-types.stderr b/tests/ui/extern/extern-types-distinct-types.stderr index ca25aa64eb8be..3e6dc5cefadf2 100644 --- a/tests/ui/extern/extern-types-distinct-types.stderr +++ b/tests/ui/extern/extern-types-distinct-types.stderr @@ -9,7 +9,7 @@ LL | type B; LL | fn foo(r: &A) -> &B { | -- expected `&B` because of return type LL | r - | ^ expected extern type `B`, found extern type `A` + | ^ expected `&B`, found `&A` | = note: expected reference `&B` found reference `&A` diff --git a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr index 1b87ebd9f20ce..d2ad372dfbc5f 100644 --- a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr +++ b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr @@ -95,7 +95,7 @@ LL | fn unsized_local() where Dst: Sized { | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `Dst<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)` -note: required because it appears within the type `Dst<(dyn A + 'static)>` +note: required because it appears within the type `Dst` --> $DIR/feature-gate-trivial_bounds.rs:48:8 | LL | struct Dst { diff --git a/tests/ui/fmt/ifmt-bad-arg.stderr b/tests/ui/fmt/ifmt-bad-arg.stderr index c2619d6df58b3..d716bbe51affc 100644 --- a/tests/ui/fmt/ifmt-bad-arg.stderr +++ b/tests/ui/fmt/ifmt-bad-arg.stderr @@ -302,7 +302,7 @@ error[E0308]: mismatched types LL | println!("{} {:.*} {}", 1, 3.2, 4); | ^^^ | | - | expected `usize`, found floating-point number + | expected `&usize`, found `&{float}` | arguments to this function are incorrect | = note: expected reference `&usize` @@ -317,7 +317,7 @@ error[E0308]: mismatched types LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | ^^^ | | - | expected `usize`, found floating-point number + | expected `&usize`, found `&{float}` | arguments to this function are incorrect | = note: expected reference `&usize` diff --git a/tests/ui/fn/fn-item-type.rs b/tests/ui/fn/fn-item-type.rs index b6ebc867d284b..c094a34b207d9 100644 --- a/tests/ui/fn/fn-item-type.rs +++ b/tests/ui/fn/fn-item-type.rs @@ -34,8 +34,7 @@ fn main() { eq(bar::, bar::>); //~^ ERROR mismatched types //~| found fn item `fn(_) -> _ {bar::>}` - //~| expected struct `String`, found struct `Vec` - //~| different fn items have unique types, even if their signatures are the same + //~| expected `String`, found `Vec` // Make sure we distinguish between trait methods correctly. eq(::foo, ::foo); diff --git a/tests/ui/fn/fn-item-type.stderr b/tests/ui/fn/fn-item-type.stderr index 9d41243ef1191..da90b8b81c855 100644 --- a/tests/ui/fn/fn-item-type.stderr +++ b/tests/ui/fn/fn-item-type.stderr @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/fn-item-type.rs:34:23 | LL | eq(bar::, bar::>); - | -- ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec` + | -- ^^^^^^^^^^^^^^ expected `String`, found `Vec` | | | arguments to this function are incorrect | @@ -53,7 +53,7 @@ LL | fn eq(x: T, y: T) {} = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types - --> $DIR/fn-item-type.rs:41:26 + --> $DIR/fn-item-type.rs:40:26 | LL | eq(::foo, ::foo); | -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16` @@ -71,7 +71,7 @@ LL | fn eq(x: T, y: T) {} = help: consider casting both fn items to fn pointers using `as fn()` error[E0308]: mismatched types - --> $DIR/fn-item-type.rs:46:19 + --> $DIR/fn-item-type.rs:45:19 | LL | eq(foo::, bar:: as fn(isize) -> isize); | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer diff --git a/tests/ui/fn/fn-pointer-mismatch.stderr b/tests/ui/fn/fn-pointer-mismatch.stderr index e0bd60fbc0b5e..a674babcb324b 100644 --- a/tests/ui/fn/fn-pointer-mismatch.stderr +++ b/tests/ui/fn/fn-pointer-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: `if` and `else` have incompatible types --> $DIR/fn-pointer-mismatch.rs:11:43 | LL | let g = if n % 2 == 0 { &foo } else { &bar }; - | ---- ^^^^ expected fn item, found a different fn item + | ---- ^^^^ expected `&fn(u32) -> u32 {foo}`, found `&fn(u32) -> u32 {bar}` | | | expected because of this | @@ -43,41 +43,48 @@ error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:36:29 | LL | let c: fn(u32) -> u32 = &foo; - | -------------- ^^^^ - | | | - | | expected fn pointer, found reference - | | help: consider removing the reference: `foo` + | -------------- ^^^^ expected fn pointer, found `&fn(u32) -> u32 {foo}` + | | | expected due to this | = note: expected fn pointer `fn(u32) -> u32` found reference `&fn(u32) -> u32 {foo}` +help: consider removing the reference + | +LL | let c: fn(u32) -> u32 = foo; + | ~~~ error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:42:30 | LL | let d: &fn(u32) -> u32 = foo; - | --------------- ^^^ - | | | - | | expected `&fn(u32) -> u32`, found fn item - | | help: consider using a reference: `&foo` + | --------------- ^^^ expected `&fn(u32) -> u32`, found fn item + | | | expected due to this | = note: expected reference `&fn(u32) -> u32` found fn item `fn(u32) -> u32 {foo}` +help: consider using a reference + | +LL | let d: &fn(u32) -> u32 = &foo; + | ~~~~ error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:48:30 | LL | let e: &fn(u32) -> u32 = &foo; - | --------------- ^^^^ - | | | - | | expected fn pointer, found fn item - | | help: consider casting to a fn pointer: `&(foo as fn(u32) -> u32)` + | --------------- ^^^^ expected `&fn(u32) -> u32`, found `&fn(u32) -> u32 {foo}` + | | | expected due to this | = note: expected reference `&fn(u32) -> u32` found reference `&fn(u32) -> u32 {foo}` = note: fn items are distinct from fn pointers + = note: when the arguments and return types match, functions can be coerced to function pointers +help: consider casting to a fn pointer + | +LL | let e: &fn(u32) -> u32 = &(foo as fn(u32) -> u32); + | ~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 6 previous errors diff --git a/tests/ui/fn/fn-trait-formatting.stderr b/tests/ui/fn/fn-trait-formatting.stderr index 2a674d3c1d23d..45d543bda5323 100644 --- a/tests/ui/fn/fn-trait-formatting.stderr +++ b/tests/ui/fn/fn-trait-formatting.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:6:17 | LL | let _: () = Box::new(|_: isize| {}) as Box; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box` | | | expected due to this | @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:10:17 | LL | let _: () = Box::new(|_: isize, isize| {}) as Box; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box` | | | expected due to this | @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:14:17 | LL | let _: () = Box::new(|| -> isize { unimplemented!() }) as Box isize>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box isize>` | | | expected due to this | diff --git a/tests/ui/fn/signature-error-reporting-under-verbose.rs b/tests/ui/fn/signature-error-reporting-under-verbose.rs index d7a8c95e8b2ab..12ff113c91347 100644 --- a/tests/ui/fn/signature-error-reporting-under-verbose.rs +++ b/tests/ui/fn/signature-error-reporting-under-verbose.rs @@ -9,7 +9,8 @@ fn needs_ptr(_: fn(i32, u32)) {} fn main() { needs_ptr(foo); //~^ ERROR mismatched types - //~| NOTE expected `u32`, found `i32` + //~| NOTE expected fn pointer, found fn item //~| NOTE expected fn pointer `fn(i32, u32)` //~| NOTE arguments to this function are incorrect + //~| NOTE when the arguments and return types match, functions can be coerced to function pointers } diff --git a/tests/ui/fn/signature-error-reporting-under-verbose.stderr b/tests/ui/fn/signature-error-reporting-under-verbose.stderr index 6260fc8dcec52..f4498db7259e3 100644 --- a/tests/ui/fn/signature-error-reporting-under-verbose.stderr +++ b/tests/ui/fn/signature-error-reporting-under-verbose.stderr @@ -2,12 +2,13 @@ error[E0308]: mismatched types --> $DIR/signature-error-reporting-under-verbose.rs:10:15 | LL | needs_ptr(foo); - | --------- ^^^ expected `u32`, found `i32` + | --------- ^^^ expected fn pointer, found fn item | | | arguments to this function are incorrect | = note: expected fn pointer `fn(i32, u32)` found fn item `fn(i32, i32) {foo}` + = note: when the arguments and return types match, functions can be coerced to function pointers note: function defined here --> $DIR/signature-error-reporting-under-verbose.rs:5:4 | diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name1.rs b/tests/ui/fully-qualified-type/fully-qualified-type-name1.rs index 229c174daa864..bbca22ad2e69d 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name1.rs +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name1.rs @@ -6,5 +6,5 @@ fn main() { x = 5; //~^ ERROR mismatched types //~| NOTE expected enum `Option` - //~| NOTE expected enum `Option`, found integer + //~| NOTE expected `Option`, found integer } diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name1.stderr b/tests/ui/fully-qualified-type/fully-qualified-type-name1.stderr index 4750c5ccdf702..258a8d163936a 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name1.stderr +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name1.stderr @@ -6,7 +6,7 @@ LL | let x: LL | Option; | ------------- expected due to this type LL | x = 5; - | ^ expected enum `Option`, found integer + | ^ expected `Option`, found integer | = note: expected enum `Option` found type `{integer}` diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs b/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs index 94a9f4e5692a3..f26d3be66303d 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs @@ -11,7 +11,7 @@ mod y { fn bar(x: x::Foo) -> y::Foo { return x; //~^ ERROR mismatched types - //~| expected enum `y::Foo`, found enum `x::Foo` + //~| expected `y::Foo`, found `x::Foo` } fn main() { diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr index a8f23f81dea02..c7c0846595d5a 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr @@ -4,15 +4,15 @@ error[E0308]: mismatched types LL | fn bar(x: x::Foo) -> y::Foo { | ------ expected `y::Foo` because of return type LL | return x; - | ^ expected enum `y::Foo`, found enum `x::Foo` + | ^ expected `y::Foo`, found `x::Foo` | - = note: enum `x::Foo` and enum `y::Foo` have similar names, but are actually distinct types -note: enum `x::Foo` is defined in module `crate::x` of the current crate + = note: `x::Foo` and `y::Foo` have similar names, but are actually distinct types +note: `x::Foo` is defined in module `crate::x` of the current crate --> $DIR/fully-qualified-type-name2.rs:4:5 | LL | pub enum Foo { } | ^^^^^^^^^^^^ -note: enum `y::Foo` is defined in module `crate::y` of the current crate +note: `y::Foo` is defined in module `crate::y` of the current crate --> $DIR/fully-qualified-type-name2.rs:8:5 | LL | pub enum Foo { } diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs b/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs index 2486ae009c1ef..41f07bab80966 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs @@ -7,7 +7,7 @@ fn bar(x: usize) -> Option { //~^ ERROR mismatched types //~| expected enum `Option` //~| found type `usize` - //~| expected enum `Option`, found `usize` + //~| expected `Option`, found `usize` } fn main() { diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name4.stderr b/tests/ui/fully-qualified-type/fully-qualified-type-name4.stderr index 778b13f24cf56..6b312202bfed4 100644 --- a/tests/ui/fully-qualified-type/fully-qualified-type-name4.stderr +++ b/tests/ui/fully-qualified-type/fully-qualified-type-name4.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn bar(x: usize) -> Option { | ------------- expected `Option` because of return type LL | return x; - | ^ expected enum `Option`, found `usize` + | ^ expected `Option`, found `usize` | = note: expected enum `Option` found type `usize` diff --git a/tests/ui/function-pointer/unsized-ret.stderr b/tests/ui/function-pointer/unsized-ret.stderr index 6f430687e6d6e..870f1805b5894 100644 --- a/tests/ui/function-pointer/unsized-ret.stderr +++ b/tests/ui/function-pointer/unsized-ret.stderr @@ -23,7 +23,7 @@ LL | foo:: fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&() | required by a bound introduced by this call | = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)` - = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn Display + 'a)` + = note: required because it appears within the type `fn(&()) -> dyn Display` note: required by a bound in `foo` --> $DIR/unsized-ret.rs:5:11 | diff --git a/tests/ui/functions-closures/fn-help-with-err.stderr b/tests/ui/functions-closures/fn-help-with-err.stderr index 83a2b1f58f9c5..da081eb435584 100644 --- a/tests/ui/functions-closures/fn-help-with-err.stderr +++ b/tests/ui/functions-closures/fn-help-with-err.stderr @@ -4,7 +4,7 @@ error[E0425]: cannot find value `oops` in this scope LL | let arc = std::sync::Arc::new(oops); | ^^^^ not found in this scope -error[E0599]: no method named `bar` found for struct `Arc<[closure@fn-help-with-err.rs:18:36]>` in the current scope +error[E0599]: no method named `bar` found for struct `Arc<[closure@$DIR/fn-help-with-err.rs:18:36: 18:38]>` in the current scope --> $DIR/fn-help-with-err.rs:19:10 | LL | arc2.bar(); diff --git a/tests/ui/generator/type-mismatch-signature-deduction.stderr b/tests/ui/generator/type-mismatch-signature-deduction.stderr index b98da1ed8be6e..ef6d896f8afa3 100644 --- a/tests/ui/generator/type-mismatch-signature-deduction.stderr +++ b/tests/ui/generator/type-mismatch-signature-deduction.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch-signature-deduction.rs:14:9 | LL | 5 - | ^ expected enum `Result`, found integer + | ^ expected `Result<{integer}, _>`, found integer | = note: expected enum `Result<{integer}, _>` found type `{integer}` @@ -22,7 +22,7 @@ error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature- --> $DIR/type-mismatch-signature-deduction.rs:5:13 | LL | fn foo() -> impl Generator { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `i32` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<{integer}, _>`, found `i32` | = note: expected enum `Result<{integer}, _>` found type `i32` diff --git a/tests/ui/generic-associated-types/collections-project-default.stderr b/tests/ui/generic-associated-types/collections-project-default.stderr index 5701017dc3471..3c3ae24dd4730 100644 --- a/tests/ui/generic-associated-types/collections-project-default.stderr +++ b/tests/ui/generic-associated-types/collections-project-default.stderr @@ -5,10 +5,11 @@ LL | fn floatify_sibling(ints: &C) -> >::Sibling | ------------------------------------ expected `>::Sibling` because of return type ... LL | res - | ^^^ expected Collection::Sibling, found CollectionFamily::Member + | ^^^ expected `Collection::Sibling`, found `CollectionFamily::Member` | = note: expected associated type `>::Sibling` found associated type `<>::Family as CollectionFamily>::Member` + = note: an associated type was expected, but a different one was found error: aborting due to previous error diff --git a/tests/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr b/tests/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr index 96c4330fec027..3b65b32f45d90 100644 --- a/tests/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr +++ b/tests/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/constraint-assoc-type-suggestion.rs:10:23 | LL | let b: Vec = a; - | -------- ^ expected struct `Vec`, found associated type + | -------- ^ expected `Vec`, found associated type | | | expected due to this | diff --git a/tests/ui/generic-associated-types/issue-79422.extended.stderr b/tests/ui/generic-associated-types/issue-79422.extended.stderr index d79de0ca62792..04184fce921f2 100644 --- a/tests/ui/generic-associated-types/issue-79422.extended.stderr +++ b/tests/ui/generic-associated-types/issue-79422.extended.stderr @@ -14,11 +14,11 @@ help: add missing lifetime argument LL | as Box = dyn RefCont<'_, u8>>>; | ++++ -error[E0271]: type mismatch resolving ` as MapLike>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)` +error[E0271]: type mismatch resolving ` as MapLike>::VRefCont<'_> == dyn RefCont<'_, u8>` --> $DIR/issue-79422.rs:44:13 | LL | let m = Box::new(std::collections::BTreeMap::::new()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving ` as MapLike>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving ` as MapLike>::VRefCont<'_> == dyn RefCont<'_, u8>` | note: expected this to be `(dyn RefCont<'_, u8> + 'static)` --> $DIR/issue-79422.rs:28:25 diff --git a/tests/ui/generics/generic-type-params-name-repr.rs b/tests/ui/generics/generic-type-params-name-repr.rs index 6e0beec663402..d60856b8904bb 100644 --- a/tests/ui/generics/generic-type-params-name-repr.rs +++ b/tests/ui/generics/generic-type-params-name-repr.rs @@ -12,40 +12,40 @@ fn main() { // Ensure that the printed type doesn't include the default type params... let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found `()` + //~| expected `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found `()` + //~| expected `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types - //~| expected struct `HashMap`, found `()` + //~| expected `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` let _: HashMap> = (); //~^ ERROR mismatched types - //~| expected struct `HashMap`, found `()` + //~| expected `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found `()` + //~| expected `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found `()` + //~| expected `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` } diff --git a/tests/ui/generics/generic-type-params-name-repr.stderr b/tests/ui/generics/generic-type-params-name-repr.stderr index 4c3c003965c1f..946f14cc1c638 100644 --- a/tests/ui/generics/generic-type-params-name-repr.stderr +++ b/tests/ui/generics/generic-type-params-name-repr.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:13:25 | LL | let _: Foo = (); - | ---------- ^^ expected struct `Foo`, found `()` + | ---------- ^^ expected `Foo`, found `()` | | | expected due to this | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:20:31 | LL | let _: Foo = (); - | ---------------- ^^ expected struct `Foo`, found `()` + | ---------------- ^^ expected `Foo`, found `()` | | | expected due to this | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:27:37 | LL | let _: HashMap = (); - | ---------------------- ^^ expected struct `HashMap`, found `()` + | ---------------------- ^^ expected `HashMap`, found `()` | | | expected due to this | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:32:51 | LL | let _: HashMap> = (); - | ------------------------------------ ^^ expected struct `HashMap`, found `()` + | ------------------------------------ ^^ expected `HashMap`, found `()` | | | expected due to this | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:39:31 | LL | let _: Foo = (); - | ---------------- ^^ expected struct `Foo`, found `()` + | ---------------- ^^ expected `Foo`, found `()` | | | expected due to this | @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:46:27 | LL | let _: Foo = (); - | ------------ ^^ expected struct `Foo`, found `()` + | ------------ ^^ expected `Foo`, found `()` | | | expected due to this | diff --git a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr index 095a1c6af37bc..6ce56ba4b7ce5 100644 --- a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr +++ b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match [5..4, 99..105, 43..44] { | ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]` LL | [_, 99.., _] => {}, - | ^^ expected struct `Range`, found integer + | ^^ expected `Range<{integer}>`, found integer | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` diff --git a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr index 2ea3205dcd4ac..6f56ecd4c1c9c 100644 --- a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr +++ b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types LL | match [5..4, 99..105, 43..44] { | ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]` LL | [_, 99..] => {}, - | ^^ expected struct `Range`, found integer + | ^^ expected `Range<{integer}>`, found integer | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` diff --git a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr index bbdf0c83f6203..b9b272c4c7cb6 100644 --- a/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr +++ b/tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match [5..4, 99..105, 43..44] { | ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]` LL | [..9, 99..100, _] => {}, - | ^ expected struct `Range`, found integer + | ^ expected `Range<{integer}>`, found integer | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` @@ -17,7 +17,7 @@ LL | match [5..4, 99..105, 43..44] { LL | [..9, 99..100, _] => {}, | ^^ --- this is of type `{integer}` | | - | expected struct `Range`, found integer + | expected `Range<{integer}>`, found integer | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | match [5..4, 99..105, 43..44] { | ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]` LL | [..9, 99..100, _] => {}, - | -- ^^^ expected struct `Range`, found integer + | -- ^^^ expected `Range<{integer}>`, found integer | | | this is of type `{integer}` | diff --git a/tests/ui/half-open-range-patterns/pat-tuple-5.stderr b/tests/ui/half-open-range-patterns/pat-tuple-5.stderr index c608426382d9a..43e7f03b8b4ef 100644 --- a/tests/ui/half-open-range-patterns/pat-tuple-5.stderr +++ b/tests/ui/half-open-range-patterns/pat-tuple-5.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match (0, 1) { | ------ this expression has type `({integer}, {integer})` LL | (PAT ..) => {} - | ^^^ expected tuple, found `u8` + | ^^^ expected `({integer}, {integer})`, found `u8` | = note: expected tuple `({integer}, {integer})` found type `u8` diff --git a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr b/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr index 71e196c32276e..3662cbfb9ba1e 100644 --- a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr +++ b/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr @@ -11,9 +11,9 @@ LL | | ), LL | | ) { | |_- expected `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn Fn(u32) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))` because of return type LL | f - | ^ expected reference, found `u32` + | ^ expected `&dyn Fn(&dyn Fn(&dyn Fn(&...)))`, found `&dyn Fn(u32)` | - = note: expected reference `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a ...) + 'a)) + 'a)) + 'a))` + = note: expected reference `&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&...)))))))))))` the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt' found reference `&dyn Fn(u32)` diff --git a/tests/ui/higher-rank-trait-bounds/issue-30786.rs b/tests/ui/higher-rank-trait-bounds/issue-30786.rs index e5f46f711c2fb..4a6399c8f6246 100644 --- a/tests/ui/higher-rank-trait-bounds/issue-30786.rs +++ b/tests/ui/higher-rank-trait-bounds/issue-30786.rs @@ -1,3 +1,5 @@ +// normalize-stderr-test: "long-type-\d+" -> "long-type-hash" + // rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:118:22 +error[E0599]: the method `filterx` exists for struct `Map`, but its trait bounds were not satisfied + --> $DIR/issue-30786.rs:120:22 | LL | pub struct Map { | -------------------- @@ -8,19 +8,19 @@ LL | pub struct Map { | doesn't satisfy `_: StreamExt` ... LL | let filter = map.filterx(|x: &_| true); - | ^^^^^^^ method cannot be called on `Map` due to unsatisfied trait bounds + | ^^^^^^^ method cannot be called on `Map` due to unsatisfied trait bounds | note: the following trait bounds were not satisfied: - `&'a mut &Map: Stream` - `&'a mut &mut Map: Stream` - `&'a mut Map: Stream` - --> $DIR/issue-30786.rs:96:50 + `&'a mut &Map: Stream` + `&'a mut &mut Map: Stream` + `&'a mut Map: Stream` + --> $DIR/issue-30786.rs:98:50 | LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} | --------- - ^^^^^^ unsatisfied trait bound introduced here -error[E0599]: the method `countx` exists for struct `Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@issue-30786.rs:129:30]>`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:130:24 +error[E0599]: the method `countx` exists for struct `Filter &u64 {identity::}>, [closure@issue-30786.rs:131:30]>`, but its trait bounds were not satisfied + --> $DIR/issue-30786.rs:132:24 | LL | pub struct Filter { | ----------------------- @@ -31,11 +31,12 @@ LL | pub struct Filter { LL | let count = filter.countx(); | ^^^^^^ method cannot be called due to unsatisfied trait bounds | + = note: the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/issue-30786/issue-30786.long-type-hash.txt' note: the following trait bounds were not satisfied: - `&'a mut &Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` - `&'a mut &mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` - `&'a mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` - --> $DIR/issue-30786.rs:96:50 + `&'a mut &Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:131:30: 131:37]>: Stream` + `&'a mut &mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:131:30: 131:37]>: Stream` + `&'a mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:131:30: 131:37]>: Stream` + --> $DIR/issue-30786.rs:98:50 | LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} | --------- - ^^^^^^ unsatisfied trait bound introduced here diff --git a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr b/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr index 810f7c28c004f..86198c3f7fd79 100644 --- a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr +++ b/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr @@ -1,4 +1,4 @@ -error[E0271]: type mismatch resolving `for<'r> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V` +error[E0271]: type mismatch resolving ` as T0<'r, (&u8,)>>::O == <_ as Ty<'r>>::V` --> $DIR/issue-62203-hrtb-ice.rs:39:9 | LL | let v = Unit2.m( @@ -10,7 +10,7 @@ LL | | f: |x| { ... | LL | | }, LL | | }, - | |_________^ type mismatch resolving `for<'r> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V` + | |_________^ type mismatch resolving ` as T0<'r, (&u8,)>>::O == <_ as Ty<'r>>::V` | note: expected this to be `<_ as Ty<'_>>::V` --> $DIR/issue-62203-hrtb-ice.rs:21:14 @@ -42,7 +42,7 @@ LL | | f: |x| { ... | LL | | }, LL | | }, - | |_________^ expected struct `Unit3`, found struct `Unit4` + | |_________^ expected `Unit3`, found `Unit4` | note: required for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]>` to implement `for<'r> T0<'r, (&'r u8,)>` --> $DIR/issue-62203-hrtb-ice.rs:17:16 diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr index 7f73d5e12d196..dc1e40ea560ac 100644 --- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr +++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:35 | LL | fn fuz() -> (usize, Trait) { (42, Struct) } - | ^^^^^^ expected trait object `dyn Trait`, found struct `Struct` + | ^^^^^^ expected `dyn Trait`, found `Struct` | = note: expected trait object `(dyn Trait + 'static)` found struct `Struct` @@ -16,14 +16,14 @@ LL | fn fuz() -> (usize, Trait) { (42, Struct) } | doesn't have a size known at compile-time | = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` - = note: required because it appears within the type `(usize, (dyn Trait + 'static))` + = note: required because it appears within the type `(usize, dyn Trait)` = note: the return type of a function must have a statically known size error[E0308]: mismatched types --> $DIR/dyn-trait-return-should-be-impl-trait.rs:10:39 | LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } - | ^^^^^^ expected trait object `dyn Trait`, found struct `Struct` + | ^^^^^^ expected `dyn Trait`, found `Struct` | = note: expected trait object `(dyn Trait + 'static)` found struct `Struct` @@ -37,7 +37,7 @@ LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } | doesn't have a size known at compile-time | = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` - = note: required because it appears within the type `(usize, (dyn Trait + 'static))` + = note: required because it appears within the type `(usize, dyn Trait)` = note: the return type of a function must have a statically known size error[E0746]: return type cannot have an unboxed trait object @@ -110,7 +110,7 @@ LL | | Struct | | ------ expected because of this LL | | } else { LL | | 42 - | | ^^ expected struct `Struct`, found integer + | | ^^ expected `Struct`, found integer LL | | } | |_____- `if` and `else` have incompatible types @@ -144,7 +144,7 @@ LL | fn bam() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type LL | if true { LL | return Struct; - | ^^^^^^ expected struct `Box`, found struct `Struct` + | ^^^^^^ expected `Box`, found `Struct` | = note: expected struct `Box<(dyn Trait + 'static)>` found struct `Struct` @@ -161,7 +161,7 @@ LL | fn bam() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type ... LL | 42 - | ^^ expected struct `Box`, found integer + | ^^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` @@ -178,7 +178,7 @@ LL | fn baq() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type LL | if true { LL | return 0; - | ^ expected struct `Box`, found integer + | ^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` @@ -195,7 +195,7 @@ LL | fn baq() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type ... LL | 42 - | ^^ expected struct `Box`, found integer + | ^^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` @@ -212,7 +212,7 @@ LL | fn baz() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type LL | if true { LL | Struct - | ^^^^^^ expected struct `Box`, found struct `Struct` + | ^^^^^^ expected `Box`, found `Struct` | = note: expected struct `Box<(dyn Trait + 'static)>` found struct `Struct` @@ -229,7 +229,7 @@ LL | fn baz() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type ... LL | 42 - | ^^ expected struct `Box`, found integer + | ^^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` @@ -246,7 +246,7 @@ LL | fn baw() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type LL | if true { LL | 0 - | ^ expected struct `Box`, found integer + | ^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` @@ -263,7 +263,7 @@ LL | fn baw() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type ... LL | 42 - | ^^ expected struct `Box`, found integer + | ^^ expected `Box`, found integer | = note: expected struct `Box<(dyn Trait + 'static)>` found type `{integer}` diff --git a/tests/ui/impl-trait/equality2.stderr b/tests/ui/impl-trait/equality2.stderr index e399a61023d1e..52f25d2458c91 100644 --- a/tests/ui/impl-trait/equality2.stderr +++ b/tests/ui/impl-trait/equality2.stderr @@ -54,6 +54,7 @@ LL | x = (x.1, | = note: expected opaque type `impl Foo` (`u32`) found opaque type `impl Foo` (`i32`) + = note: distinct uses of `impl Trait` result in different opaque types error[E0308]: mismatched types --> $DIR/equality2.rs:41:10 @@ -69,6 +70,7 @@ LL | x.0); | = note: expected opaque type `impl Foo` (`i32`) found opaque type `impl Foo` (`u32`) + = note: distinct uses of `impl Trait` result in different opaque types error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/impl-trait/in-trait/deep-match.stderr b/tests/ui/impl-trait/in-trait/deep-match.stderr index 034ee5ea4e10c..3eba419c0a3fd 100644 --- a/tests/ui/impl-trait/in-trait/deep-match.stderr +++ b/tests/ui/impl-trait/in-trait/deep-match.stderr @@ -4,7 +4,7 @@ error[E0053]: method `bar` has an incompatible return type for trait LL | fn bar() -> i32 { 0 } | ^^^ | | - | expected struct `Wrapper`, found `i32` + | expected `Wrapper<_>`, found `i32` | return type in trait | = note: expected struct `Wrapper<_>` diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr index 142b1bff1a46a..cc3bdf0e5717e 100644 --- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr +++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | 42 | ^^- help: try using a conversion method: `.to_string()` | | - | expected struct `String`, found integer + | expected `String`, found integer error: aborting due to previous error diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.stderr index 461247a3e3ff4..4742eb37d3e4d 100644 --- a/tests/ui/impl-trait/in-trait/default-body-type-err.stderr +++ b/tests/ui/impl-trait/in-trait/default-body-type-err.stderr @@ -2,7 +2,7 @@ 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` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String` LL | LL | &1i32 | ----- return type was inferred to be `&i32` here diff --git a/tests/ui/impl-trait/issue-102605.stderr b/tests/ui/impl-trait/issue-102605.stderr index d4aba914908fd..6cf0c33ad9190 100644 --- a/tests/ui/impl-trait/issue-102605.stderr +++ b/tests/ui/impl-trait/issue-102605.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-102605.rs:13:20 | LL | convert_result(foo()) - | -------------- ^^^^^ expected enum `Result`, found opaque type + | -------------- ^^^^^ expected `Result<(), _>`, found opaque type | | | arguments to this function are incorrect | diff --git a/tests/ui/impl-trait/issue-99914.stderr b/tests/ui/impl-trait/issue-99914.stderr index 074d5d58d9a30..3b4e130fdebde 100644 --- a/tests/ui/impl-trait/issue-99914.stderr +++ b/tests/ui/impl-trait/issue-99914.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-99914.rs:9:27 | LL | t.and_then(|t| -> _ { bar(t) }); - | ^^^^^^ expected enum `Result`, found opaque type + | ^^^^^^ expected `Result<_, Error>`, found opaque type | note: while checking the return type of the `async fn` --> $DIR/issue-99914.rs:13:23 diff --git a/tests/ui/impl-trait/issues/issue-74282.stderr b/tests/ui/impl-trait/issues/issue-74282.stderr index 5b05fb2810dff..724f3c5d6747c 100644 --- a/tests/ui/impl-trait/issues/issue-74282.stderr +++ b/tests/ui/impl-trait/issues/issue-74282.stderr @@ -10,7 +10,7 @@ LL | Anonymous(|| { | | arguments to this struct are incorrect LL | | 3 LL | | }) - | |_____^ expected closure, found a different closure + | |_____^ expected opaque type, found closure | = note: expected opaque type `Closure` found closure `[closure@$DIR/issue-74282.rs:8:15: 8:17]` @@ -33,7 +33,7 @@ LL | | 3 LL | | }) | | ^- help: consider using a semicolon here: `;` | |______| - | expected `()`, found struct `Anonymous` + | expected `()`, found `Anonymous` error: aborting due to 2 previous errors diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr index 548c89d0a3871..3c2c01dc227b9 100644 --- a/tests/ui/impl-trait/no-method-suggested-traits.stderr +++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr @@ -145,7 +145,7 @@ note: `foo::Bar` defines an item `method2`, perhaps you need to implement it LL | pub trait Bar { | ^^^^^^^^^^^^^ -error[E0599]: no method named `method2` found for struct `Foo` in the current scope +error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope --> $DIR/no-method-suggested-traits.rs:50:37 | LL | no_method_suggested_traits::Foo.method2(); @@ -158,7 +158,7 @@ note: `foo::Bar` defines an item `method2`, perhaps you need to implement it LL | pub trait Bar { | ^^^^^^^^^^^^^ -error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&Foo>>` in the current scope +error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope --> $DIR/no-method-suggested-traits.rs:52:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2(); @@ -171,7 +171,7 @@ note: `foo::Bar` defines an item `method2`, perhaps you need to implement it LL | pub trait Bar { | ^^^^^^^^^^^^^ -error[E0599]: no method named `method2` found for enum `Bar` in the current scope +error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope --> $DIR/no-method-suggested-traits.rs:54:40 | LL | no_method_suggested_traits::Bar::X.method2(); @@ -184,7 +184,7 @@ note: `foo::Bar` defines an item `method2`, perhaps you need to implement it LL | pub trait Bar { | ^^^^^^^^^^^^^ -error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&Bar>>` in the current scope +error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope --> $DIR/no-method-suggested-traits.rs:56:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2(); @@ -255,25 +255,25 @@ error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&usize>>` LL | std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&usize>>` -error[E0599]: no method named `method3` found for struct `Foo` in the current scope +error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope --> $DIR/no-method-suggested-traits.rs:71:37 | LL | no_method_suggested_traits::Foo.method3(); | ^^^^^^^ method not found in `Foo` -error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Foo>>` in the current scope +error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope --> $DIR/no-method-suggested-traits.rs:72:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>` -error[E0599]: no method named `method3` found for enum `Bar` in the current scope +error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope --> $DIR/no-method-suggested-traits.rs:74:40 | LL | no_method_suggested_traits::Bar::X.method3(); | ^^^^^^^ method not found in `Bar` -error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Bar>>` in the current scope +error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope --> $DIR/no-method-suggested-traits.rs:75:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3(); diff --git a/tests/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr b/tests/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr index d6f5a1ac25b64..e5147bcea1662 100644 --- a/tests/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr +++ b/tests/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr @@ -5,7 +5,7 @@ LL | fn can() -> impl NotObjectSafe { | ------------------ expected `A` because of return type ... LL | B - | ^ expected struct `A`, found struct `B` + | ^ expected `A`, found `B` error[E0308]: mismatched types --> $DIR/object-unsafe-trait-in-return-position-impl-trait.rs:43:5 @@ -14,7 +14,7 @@ LL | fn cat() -> impl ObjectSafe { | --------------- expected `A` because of return type ... LL | B - | ^ expected struct `A`, found struct `B` + | ^ expected `A`, found `B` error: aborting due to 2 previous errors diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr index c7c6ca4401266..f7aff41954445 100644 --- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr @@ -15,7 +15,7 @@ LL | type Foo = impl PartialEq<(Foo, i32)>; LL | fn eq(&self, _other: &(Foo, i32)) -> bool { | ^^^^^^^^^^^ | | - | expected struct `Bar`, found opaque type + | expected `a::Bar`, found opaque type | help: change the parameter type to match the trait: `&(a::Bar, i32)` | = note: expected signature `fn(&a::Bar, &(a::Bar, i32)) -> _` @@ -38,7 +38,7 @@ LL | type Foo = impl PartialEq<(Foo, i32)>; LL | fn eq(&self, _other: &(Bar, i32)) -> bool { | ^^^^^^^^^^^ | | - | expected opaque type, found struct `Bar` + | expected opaque type, found `b::Bar` | help: change the parameter type to match the trait: `&(b::Foo, i32)` | = note: expected signature `fn(&b::Bar, &(b::Foo, i32)) -> _` diff --git a/tests/ui/impl-trait/universal-mismatched-type.stderr b/tests/ui/impl-trait/universal-mismatched-type.stderr index 817c573c0919a..a56e542d8345a 100644 --- a/tests/ui/impl-trait/universal-mismatched-type.stderr +++ b/tests/ui/impl-trait/universal-mismatched-type.stderr @@ -6,7 +6,7 @@ LL | fn foo(x: impl Debug) -> String { | | | this type parameter LL | x - | ^ expected struct `String`, found type parameter `impl Debug` + | ^ expected `String`, found type parameter `impl Debug` | = note: expected struct `String` found type parameter `impl Debug` diff --git a/tests/ui/include-macros/mismatched-types.stderr b/tests/ui/include-macros/mismatched-types.stderr index a408877afb61c..4f2880e2f5d49 100644 --- a/tests/ui/include-macros/mismatched-types.stderr +++ b/tests/ui/include-macros/mismatched-types.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:2:20 | LL | let b: &[u8] = include_str!("file.txt"); - | ----- ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str` + | ----- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str` | | | expected due to this | @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 | LL | let s: &str = include_bytes!("file.txt"); - | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found array `[u8; 0]` + | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `&[u8; 0]` | | | expected due to this | diff --git a/tests/ui/inference/deref-suggestion.stderr b/tests/ui/inference/deref-suggestion.stderr index 3db67cdb5370a..1626032ae997d 100644 --- a/tests/ui/inference/deref-suggestion.stderr +++ b/tests/ui/inference/deref-suggestion.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | foo(s); | --- ^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found `&String` + | | expected `String`, found `&String` | arguments to this function are incorrect | note: function defined here @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:30:9 | LL | foo(&"aaa".to_owned()); - | --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String` + | --- ^^^^^^^^^^^^^^^^^ expected `String`, found `&String` | | | arguments to this function are incorrect | @@ -54,7 +54,7 @@ error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:32:9 | LL | foo(&mut "aaa".to_owned()); - | --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String` + | --- ^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String` | | | arguments to this function are incorrect | diff --git a/tests/ui/intrinsics/const-eval-select-bad.rs b/tests/ui/intrinsics/const-eval-select-bad.rs index fa14efad7b4a4..991d1450aff99 100644 --- a/tests/ui/intrinsics/const-eval-select-bad.rs +++ b/tests/ui/intrinsics/const-eval-select-bad.rs @@ -30,7 +30,7 @@ fn baz(n: bool) -> i32 { const fn return_ty_mismatch() { const_eval_select((1,), foo, bar); - //~^ ERROR expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool` + //~^ ERROR expected `bar` to be a fn item that returns `i32`, but it returns `bool` } const fn args_ty_mismatch() { diff --git a/tests/ui/intrinsics/const-eval-select-bad.stderr b/tests/ui/intrinsics/const-eval-select-bad.stderr index fd7d061b6b2e5..d4507a27aeaa1 100644 --- a/tests/ui/intrinsics/const-eval-select-bad.stderr +++ b/tests/ui/intrinsics/const-eval-select-bad.stderr @@ -60,7 +60,7 @@ LL | const_eval_select((), 42, 0xDEADBEEF); note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL -error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool` +error[E0271]: expected `bar` to be a fn item that returns `i32`, but it returns `bool` --> $DIR/const-eval-select-bad.rs:32:34 | LL | const_eval_select((1,), foo, bar); diff --git a/tests/ui/issues/issue-100605.stderr b/tests/ui/issues/issue-100605.stderr index 886e3cd6bb794..be30eef2af48f 100644 --- a/tests/ui/issues/issue-100605.stderr +++ b/tests/ui/issues/issue-100605.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-100605.rs:4:18 | LL | takes_option(&None); - | ------------ ^^^^^ expected enum `Option`, found `&Option<_>` + | ------------ ^^^^^ expected `Option<&String>`, found `&Option<_>` | | | arguments to this function are incorrect | @@ -29,7 +29,7 @@ error[E0308]: mismatched types LL | takes_option(&res); | ------------ ^^^^ | | | - | | expected enum `Option`, found `&Option` + | | expected `Option<&String>`, found `&Option` | | help: you can convert from `&Option` to `Option<&T>` using `.as_ref()`: `res.as_ref()` | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-102964.stderr b/tests/ui/issues/issue-102964.stderr index 4504039097b5d..c0766480a41f4 100644 --- a/tests/ui/issues/issue-102964.stderr +++ b/tests/ui/issues/issue-102964.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-102964.rs:5:41 | LL | fn bar_function(function: Foo) -> RcFoo { - | ------------ ^^^^^^^^ expected struct `Rc`, found `()` + | ------------ ^^^^^^^^ expected `Rc<&dyn Fn(&T)>`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/tests/ui/issues/issue-10764.stderr b/tests/ui/issues/issue-10764.stderr index 4d8a85a139715..fcb45affe2c18 100644 --- a/tests/ui/issues/issue-10764.stderr +++ b/tests/ui/issues/issue-10764.stderr @@ -8,6 +8,7 @@ LL | fn main() { f(bar) } | = note: expected fn pointer `fn()` found fn item `extern "C" fn() {bar}` + = note: when the arguments and return types match, functions can be coerced to function pointers note: function defined here --> $DIR/issue-10764.rs:1:4 | diff --git a/tests/ui/issues/issue-11374.stderr b/tests/ui/issues/issue-11374.stderr index ace77814a3a99..ef28c81d85737 100644 --- a/tests/ui/issues/issue-11374.stderr +++ b/tests/ui/issues/issue-11374.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | c.read_to(v); | ------- ^ | | | - | | expected `&mut [u8]`, found struct `Vec` + | | expected `&mut [u8]`, found `Vec<_>` | | help: consider mutably borrowing here: `&mut v` | arguments to this method are incorrect | diff --git a/tests/ui/issues/issue-11844.stderr b/tests/ui/issues/issue-11844.stderr index 81cf918a1030b..9afd209773b73 100644 --- a/tests/ui/issues/issue-11844.stderr +++ b/tests/ui/issues/issue-11844.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match a { | - this expression has type `Option>` LL | Ok(a) => - | ^^^^^ expected enum `Option`, found enum `Result` + | ^^^^^ expected `Option>`, found `Result<_, _>` | = note: expected enum `Option>` found enum `Result<_, _>` diff --git a/tests/ui/issues/issue-13446.stderr b/tests/ui/issues/issue-13446.stderr index 30fb73dd37282..139c34c8880a6 100644 --- a/tests/ui/issues/issue-13446.stderr +++ b/tests/ui/issues/issue-13446.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13446.rs:3:26 | LL | static VEC: [u32; 256] = vec![]; - | ^^^^^^ expected array `[u32; 256]`, found struct `Vec` + | ^^^^^^ expected `[u32; 256]`, found `Vec<_>` | = note: expected array `[u32; 256]` found struct `Vec<_>` diff --git a/tests/ui/issues/issue-13466.rs b/tests/ui/issues/issue-13466.rs index a420c7704af51..52d4d75d29da2 100644 --- a/tests/ui/issues/issue-13466.rs +++ b/tests/ui/issues/issue-13466.rs @@ -9,12 +9,12 @@ pub fn main() { //~^ ERROR mismatched types //~| expected enum `Option<{integer}>` //~| found enum `Result<_, _>` - //~| expected enum `Option`, found enum `Result` + //~| expected `Option<{integer}>`, found `Result<_, _>` Err(e) => panic!(e) //~^ ERROR mismatched types //~| expected enum `Option<{integer}>` //~| found enum `Result<_, _>` - //~| expected enum `Option`, found enum `Result` + //~| expected `Option<{integer}>`, found `Result<_, _>` }; } diff --git a/tests/ui/issues/issue-13466.stderr b/tests/ui/issues/issue-13466.stderr index c78466f4e8ce1..fd928e45863db 100644 --- a/tests/ui/issues/issue-13466.stderr +++ b/tests/ui/issues/issue-13466.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _x: usize = match Some(1) { | ------- this expression has type `Option<{integer}>` LL | Ok(u) => u, - | ^^^^^ expected enum `Option`, found enum `Result` + | ^^^^^ expected `Option<{integer}>`, found `Result<_, _>` | = note: expected enum `Option<{integer}>` found enum `Result<_, _>` @@ -16,7 +16,7 @@ LL | let _x: usize = match Some(1) { | ------- this expression has type `Option<{integer}>` ... LL | Err(e) => panic!(e) - | ^^^^^^ expected enum `Option`, found enum `Result` + | ^^^^^^ expected `Option<{integer}>`, found `Result<_, _>` | = note: expected enum `Option<{integer}>` found enum `Result<_, _>` diff --git a/tests/ui/issues/issue-14541.rs b/tests/ui/issues/issue-14541.rs index 555ec9f9868c5..2ff1c1f8876cd 100644 --- a/tests/ui/issues/issue-14541.rs +++ b/tests/ui/issues/issue-14541.rs @@ -4,7 +4,7 @@ struct Vec3 { y: f32, z: f32 } fn make(v: Vec2) { let Vec3 { y: _, z: _ } = v; //~^ ERROR mismatched types - //~| expected struct `Vec2`, found struct `Vec3` + //~| expected `Vec2`, found `Vec3` } fn main() { } diff --git a/tests/ui/issues/issue-14541.stderr b/tests/ui/issues/issue-14541.stderr index cf155f428c6a0..b80c68ce47311 100644 --- a/tests/ui/issues/issue-14541.stderr +++ b/tests/ui/issues/issue-14541.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let Vec3 { y: _, z: _ } = v; | ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2` | | - | expected struct `Vec2`, found struct `Vec3` + | expected `Vec2`, found `Vec3` error: aborting due to previous error diff --git a/tests/ui/issues/issue-15783.rs b/tests/ui/issues/issue-15783.rs index 0b1f4545e8804..ceb37a20e3f30 100644 --- a/tests/ui/issues/issue-15783.rs +++ b/tests/ui/issues/issue-15783.rs @@ -9,6 +9,6 @@ fn main() { //~^ ERROR mismatched types //~| expected enum `Option<&[&str]>` //~| found enum `Option<&[&str; 1]>` - //~| expected slice `[&str]`, found array `[&str; 1]` + //~| expected `Option<&[&str]>`, found `Option<&[&str; 1]>` assert_eq!(msg, 3); } diff --git a/tests/ui/issues/issue-15783.stderr b/tests/ui/issues/issue-15783.stderr index 660dfe9ed3d51..598ec7e6053be 100644 --- a/tests/ui/issues/issue-15783.stderr +++ b/tests/ui/issues/issue-15783.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-15783.rs:8:19 | LL | let msg = foo(x); - | --- ^ expected slice `[&str]`, found array `[&str; 1]` + | --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>` | | | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-15896.stderr b/tests/ui/issues/issue-15896.stderr index 038337f5acc8f..ec0d74596aa8d 100644 --- a/tests/ui/issues/issue-15896.stderr +++ b/tests/ui/issues/issue-15896.stderr @@ -5,7 +5,7 @@ LL | let u = match e { | - this expression has type `E` LL | E::B( LL | Tau{t: x}, - | ^^^^^^^^^ expected enum `R`, found struct `Tau` + | ^^^^^^^^^ expected `R`, found `Tau` error: aborting due to previous error diff --git a/tests/ui/issues/issue-16338.stderr b/tests/ui/issues/issue-16338.stderr index 6878600b02983..0f08485e515dd 100644 --- a/tests/ui/issues/issue-16338.stderr +++ b/tests/ui/issues/issue-16338.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let Slice { data: data, len: len } = "foo"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----- this expression has type `&str` | | - | expected `str`, found struct `Slice` + | expected `str`, found `Slice<_>` | = note: expected type `str` found struct `Slice<_>` diff --git a/tests/ui/issues/issue-16401.rs b/tests/ui/issues/issue-16401.rs index 332352ca727ac..19ae7da107ca2 100644 --- a/tests/ui/issues/issue-16401.rs +++ b/tests/ui/issues/issue-16401.rs @@ -9,7 +9,7 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found struct `Slice<_>` - //~| expected `()`, found struct `Slice` + //~| expected `()`, found `Slice<_>` _ => unreachable!() } } diff --git a/tests/ui/issues/issue-16401.stderr b/tests/ui/issues/issue-16401.stderr index f8ea0907099a5..02f9f3ea8fdf7 100644 --- a/tests/ui/issues/issue-16401.stderr +++ b/tests/ui/issues/issue-16401.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match () { | -- this expression has type `()` LL | Slice { data: data, len: len } => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Slice` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Slice<_>` | = note: expected unit type `()` found struct `Slice<_>` diff --git a/tests/ui/issues/issue-18819.stderr b/tests/ui/issues/issue-18819.stderr index 767fdd5caf06a..1fc974b609c11 100644 --- a/tests/ui/issues/issue-18819.stderr +++ b/tests/ui/issues/issue-18819.stderr @@ -4,7 +4,7 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied LL | print_x(X); | ^^^^^^^--- an argument of type `&str` is missing | -note: expected reference, found struct `X` +note: expected `&dyn Foo`, found `X` --> $DIR/issue-18819.rs:16:13 | LL | print_x(X); diff --git a/tests/ui/issues/issue-19521.stderr b/tests/ui/issues/issue-19521.stderr index b6847cd755c3f..13a12acb3605b 100644 --- a/tests/ui/issues/issue-19521.stderr +++ b/tests/ui/issues/issue-19521.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for reference `&'static str` in the --> $DIR/issue-19521.rs:2:8 | LL | "".homura()(); - | ^^^^^^ method not found in `&'static str` + | ^^^^^^ method not found in `&str` error: aborting due to previous error diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr index 5822160107cce..b1c15672051d2 100644 --- a/tests/ui/issues/issue-20225.stderr +++ b/tests/ui/issues/issue-20225.stderr @@ -6,7 +6,7 @@ LL | impl<'a, T> Fn<(&'a T,)> for Foo { LL | extern "rust-call" fn call(&self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(&Foo, (&'a T,))` @@ -20,7 +20,7 @@ LL | impl<'a, T> FnMut<(&'a T,)> for Foo { LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(&mut Foo, (&'a T,))` @@ -35,7 +35,7 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(Foo, (&'a T,))` diff --git a/tests/ui/issues/issue-21332.rs b/tests/ui/issues/issue-21332.rs index 6547f3a9b19ae..4473d00fd5da2 100644 --- a/tests/ui/issues/issue-21332.rs +++ b/tests/ui/issues/issue-21332.rs @@ -4,7 +4,7 @@ impl Iterator for S { type Item = i32; fn next(&mut self) -> Result { Ok(7) } //~^ ERROR method `next` has an incompatible type for trait - //~| expected enum `Option`, found enum `Result` + //~| expected `Option`, found `Result` } fn main() {} diff --git a/tests/ui/issues/issue-21332.stderr b/tests/ui/issues/issue-21332.stderr index 0e1beebf2931a..82549288064a1 100644 --- a/tests/ui/issues/issue-21332.stderr +++ b/tests/ui/issues/issue-21332.stderr @@ -4,7 +4,7 @@ error[E0053]: method `next` has an incompatible type for trait LL | fn next(&mut self) -> Result { Ok(7) } | ^^^^^^^^^^^^^^^^ | | - | expected enum `Option`, found enum `Result` + | expected `Option`, found `Result` | help: change the output type to match the trait: `Option` | = note: expected signature `fn(&mut S) -> Option` diff --git a/tests/ui/issues/issue-24322.stderr b/tests/ui/issues/issue-24322.stderr index 1e4c8ac7c356c..954fd4928126f 100644 --- a/tests/ui/issues/issue-24322.stderr +++ b/tests/ui/issues/issue-24322.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-24322.rs:8:29 | LL | let x: &fn(&B) -> u32 = &B::func; - | -------------- ^^^^^^^^ expected fn pointer, found fn item + | -------------- ^^^^^^^^ expected `&fn(&B) -> u32`, found `&fn(&B) -> u32 {B::func}` | | | expected due to this | diff --git a/tests/ui/issues/issue-24819.rs b/tests/ui/issues/issue-24819.rs index 59c3f2cd114de..fb4cfb7b29e8b 100644 --- a/tests/ui/issues/issue-24819.rs +++ b/tests/ui/issues/issue-24819.rs @@ -4,7 +4,7 @@ fn main() { let mut v = Vec::new(); foo(&mut v); //~^ ERROR mismatched types - //~| expected struct `HashSet`, found struct `Vec` + //~| expected `&mut HashSet`, found `&mut Vec<_>` } fn foo(h: &mut HashSet) { diff --git a/tests/ui/issues/issue-24819.stderr b/tests/ui/issues/issue-24819.stderr index 982a11fef80e8..8b4f1dbce431d 100644 --- a/tests/ui/issues/issue-24819.stderr +++ b/tests/ui/issues/issue-24819.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-24819.rs:5:9 | LL | foo(&mut v); - | --- ^^^^^^ expected struct `HashSet`, found struct `Vec` + | --- ^^^^^^ expected `&mut HashSet`, found `&mut Vec<_>` | | | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-27008.rs b/tests/ui/issues/issue-27008.rs index e04de33f6ef2e..adf8e779e0a04 100644 --- a/tests/ui/issues/issue-27008.rs +++ b/tests/ui/issues/issue-27008.rs @@ -3,5 +3,5 @@ struct S; fn main() { let b = [0; S]; //~^ ERROR mismatched types - //~| expected `usize`, found struct `S` + //~| expected `usize`, found `S` } diff --git a/tests/ui/issues/issue-27008.stderr b/tests/ui/issues/issue-27008.stderr index 5b7e74c1c3012..9d18045aa794c 100644 --- a/tests/ui/issues/issue-27008.stderr +++ b/tests/ui/issues/issue-27008.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-27008.rs:4:17 | LL | let b = [0; S]; - | ^ expected `usize`, found struct `S` + | ^ expected `usize`, found `S` error: aborting due to previous error diff --git a/tests/ui/issues/issue-30123.stderr b/tests/ui/issues/issue-30123.stderr index 7808cbf8aa108..a00a1dbb8843d 100644 --- a/tests/ui/issues/issue-30123.stderr +++ b/tests/ui/issues/issue-30123.stderr @@ -1,4 +1,4 @@ -error[E0599]: no function or associated item named `new_undirected` found for struct `Graph` in the current scope +error[E0599]: no function or associated item named `new_undirected` found for struct `issue_30123_aux::Graph` in the current scope --> $DIR/issue-30123.rs:7:33 | LL | let ug = Graph::::new_undirected(); diff --git a/tests/ui/issues/issue-32122-1.stderr b/tests/ui/issues/issue-32122-1.stderr index 10b0c0967c1e8..b4f5b1296670f 100644 --- a/tests/ui/issues/issue-32122-1.stderr +++ b/tests/ui/issues/issue-32122-1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-32122-1.rs:16:24 | LL | let _: *const u8 = &a; - | --------- ^^ expected `u8`, found struct `Foo` + | --------- ^^ expected `*const u8`, found `&Foo` | | | expected due to this | diff --git a/tests/ui/issues/issue-32122-2.stderr b/tests/ui/issues/issue-32122-2.stderr index 5c3dade8e20c5..02c335c1547fb 100644 --- a/tests/ui/issues/issue-32122-2.stderr +++ b/tests/ui/issues/issue-32122-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-32122-2.rs:27:24 | LL | let _: *const u8 = &a; - | --------- ^^ expected `u8`, found struct `Emm` + | --------- ^^ expected `*const u8`, found `&Emm` | | | expected due to this | diff --git a/tests/ui/issues/issue-33504.stderr b/tests/ui/issues/issue-33504.stderr index d9e7c3b16e76e..a831cf585f4e0 100644 --- a/tests/ui/issues/issue-33504.stderr +++ b/tests/ui/issues/issue-33504.stderr @@ -7,7 +7,7 @@ LL | struct Test; LL | let Test = 1; | ^^^^ - this expression has type `{integer}` | | - | expected integer, found struct `Test` + | expected integer, found `Test` | `Test` is interpreted as a unit struct, not a new binding | help: introduce a new binding instead: `other_test` diff --git a/tests/ui/issues/issue-33941.stderr b/tests/ui/issues/issue-33941.stderr index 668eaabca4c46..e7f4a4fa004ce 100644 --- a/tests/ui/issues/issue-33941.stderr +++ b/tests/ui/issues/issue-33941.stderr @@ -2,7 +2,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but --> $DIR/issue-33941.rs:6:36 | LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^ expected reference, found tuple + | ^^^^^^ expected `&_`, found `(&_, &_)` | = note: expected reference `&_` found tuple `(&_, &_)` @@ -20,7 +20,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but --> $DIR/issue-33941.rs:6:14 | LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_` | = note: expected tuple `(&_, &_)` found reference `&_` @@ -31,7 +31,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but --> $DIR/issue-33941.rs:6:14 | LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_` | = note: expected tuple `(&_, &_)` found reference `&_` diff --git a/tests/ui/issues/issue-35241.stderr b/tests/ui/issues/issue-35241.stderr index d600e934bd577..4a2c15511fe26 100644 --- a/tests/ui/issues/issue-35241.stderr +++ b/tests/ui/issues/issue-35241.stderr @@ -5,7 +5,7 @@ LL | struct Foo(u32); | ---------- `Foo` defines a struct constructor here, which should be called LL | LL | fn test() -> Foo { Foo } - | --- ^^^ expected struct `Foo`, found struct constructor + | --- ^^^ expected `Foo`, found struct constructor | | | expected `Foo` because of return type | diff --git a/tests/ui/issues/issue-3680.rs b/tests/ui/issues/issue-3680.rs index 37c9000c043da..a0e5279812297 100644 --- a/tests/ui/issues/issue-3680.rs +++ b/tests/ui/issues/issue-3680.rs @@ -4,6 +4,6 @@ fn main() { //~^ ERROR mismatched types //~| expected enum `Option<_>` //~| found enum `Result<_, _>` - //~| expected enum `Option`, found enum `Result` + //~| expected `Option<_>`, found `Result<_, _>` } } diff --git a/tests/ui/issues/issue-3680.stderr b/tests/ui/issues/issue-3680.stderr index 29ba44f136afa..0b0ae419e2bf9 100644 --- a/tests/ui/issues/issue-3680.stderr +++ b/tests/ui/issues/issue-3680.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match None { | ---- this expression has type `Option<_>` LL | Err(_) => () - | ^^^^^^ expected enum `Option`, found enum `Result` + | ^^^^^^ expected `Option<_>`, found `Result<_, _>` | = note: expected enum `Option<_>` found enum `Result<_, _>` diff --git a/tests/ui/issues/issue-39970.rs b/tests/ui/issues/issue-39970.rs index f51e3b522e1c5..40d3ae30a87c6 100644 --- a/tests/ui/issues/issue-39970.rs +++ b/tests/ui/issues/issue-39970.rs @@ -17,5 +17,5 @@ impl Visit for () where fn main() { <() as Visit>::visit(); - //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` + //~^ ERROR type mismatch resolving `<() as Array<'a>>::Element == ()` } diff --git a/tests/ui/issues/issue-39970.stderr b/tests/ui/issues/issue-39970.stderr index 0cabdf7f234a8..8344b88c3beab 100644 --- a/tests/ui/issues/issue-39970.stderr +++ b/tests/ui/issues/issue-39970.stderr @@ -1,8 +1,8 @@ -error[E0271]: type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` +error[E0271]: type mismatch resolving `<() as Array<'a>>::Element == ()` --> $DIR/issue-39970.rs:19:5 | LL | <() as Visit>::visit(); - | ^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` + | ^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<() as Array<'a>>::Element == ()` | note: expected this to be `()` --> $DIR/issue-39970.rs:10:20 diff --git a/tests/ui/issues/issue-40749.stderr b/tests/ui/issues/issue-40749.stderr index fa239f744fb25..afc39adec467a 100644 --- a/tests/ui/issues/issue-40749.stderr +++ b/tests/ui/issues/issue-40749.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-40749.rs:2:9 | LL | [0; ..10]; - | ^^^^ expected `usize`, found struct `RangeTo` + | ^^^^ expected `usize`, found `RangeTo<{integer}>` | = note: expected type `usize` found struct `RangeTo<{integer}>` diff --git a/tests/ui/issues/issue-43420-no-over-suggest.stderr b/tests/ui/issues/issue-43420-no-over-suggest.stderr index 58fd1121a6b99..9b141e2bf99af 100644 --- a/tests/ui/issues/issue-43420-no-over-suggest.stderr +++ b/tests/ui/issues/issue-43420-no-over-suggest.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-43420-no-over-suggest.rs:8:9 | LL | foo(&a); - | --- ^^ expected slice `[u16]`, found struct `Vec` + | --- ^^ expected `&[u16]`, found `&Vec` | | | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-4517.rs b/tests/ui/issues/issue-4517.rs index caf85d44aac5c..469304e2cf70f 100644 --- a/tests/ui/issues/issue-4517.rs +++ b/tests/ui/issues/issue-4517.rs @@ -4,5 +4,5 @@ fn main() { let foo: [u8; 4] = [1; 4]; bar(foo); //~^ ERROR mismatched types - //~| expected `usize`, found array `[u8; 4]` + //~| expected `usize`, found `[u8; 4]` } diff --git a/tests/ui/issues/issue-4517.stderr b/tests/ui/issues/issue-4517.stderr index 70b4ca5ec496b..78ee336f19a43 100644 --- a/tests/ui/issues/issue-4517.stderr +++ b/tests/ui/issues/issue-4517.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-4517.rs:5:9 | LL | bar(foo); - | --- ^^^ expected `usize`, found array `[u8; 4]` + | --- ^^^ expected `usize`, found `[u8; 4]` | | | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-48364.stderr b/tests/ui/issues/issue-48364.stderr index 60bbfc0c6e269..a4c88fd880a9d 100644 --- a/tests/ui/issues/issue-48364.stderr +++ b/tests/ui/issues/issue-48364.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-48364.rs:2:21 | LL | b"".starts_with(stringify!(foo)) - | ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str` + | ----------- ^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str` | | | arguments to this method are incorrect | diff --git a/tests/ui/issues/issue-4968.rs b/tests/ui/issues/issue-4968.rs index 634bd698d7705..c8df46dc26740 100644 --- a/tests/ui/issues/issue-4968.rs +++ b/tests/ui/issues/issue-4968.rs @@ -6,5 +6,5 @@ fn main() { //~^ ERROR mismatched types //~| expected type `{integer}` //~| found tuple `(isize, isize)` - //~| expected integer, found tuple + //~| expected integer, found `(isize, isize)` } diff --git a/tests/ui/issues/issue-4968.stderr b/tests/ui/issues/issue-4968.stderr index bbaca4ed28f5b..1ce0333846f44 100644 --- a/tests/ui/issues/issue-4968.stderr +++ b/tests/ui/issues/issue-4968.stderr @@ -7,7 +7,7 @@ LL | fn main() { LL | match 42 { A => () } | -- ^ | | | - | | expected integer, found tuple + | | expected integer, found `(isize, isize)` | | `A` is interpreted as a constant, not a new binding | | help: introduce a new binding instead: `other_a` | this expression has type `{integer}` diff --git a/tests/ui/issues/issue-5100.rs b/tests/ui/issues/issue-5100.rs index 69ed4b0e4328b..53ebdec816493 100644 --- a/tests/ui/issues/issue-5100.rs +++ b/tests/ui/issues/issue-5100.rs @@ -7,7 +7,7 @@ fn main() { match (true, false) { A::B => (), //~^ ERROR mismatched types -//~| expected tuple, found enum `A` +//~| expected `(bool, bool)`, found `A` //~| expected tuple `(bool, bool)` //~| found enum `A` _ => () @@ -39,7 +39,7 @@ fn main() { match (true, false) { &(true, false) => () //~^ ERROR mismatched types -//~| expected tuple, found reference +//~| expected `(bool, bool)`, found `&_` //~| expected tuple `(bool, bool)` //~| found reference `&_` } diff --git a/tests/ui/issues/issue-5100.stderr b/tests/ui/issues/issue-5100.stderr index c87a3e348a2e9..b1680aacd1656 100644 --- a/tests/ui/issues/issue-5100.stderr +++ b/tests/ui/issues/issue-5100.stderr @@ -7,7 +7,7 @@ LL | enum A { B, C } LL | match (true, false) { | ------------- this expression has type `(bool, bool)` LL | A::B => (), - | ^^^^ expected tuple, found enum `A` + | ^^^^ expected `(bool, bool)`, found `A` | = note: expected tuple `(bool, bool)` found enum `A` @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | match (true, false) { | ------------- this expression has type `(bool, bool)` LL | box (true, false) => () - | ^^^^^^^^^^^^^^^^^ expected tuple, found struct `Box` + | ^^^^^^^^^^^^^^^^^ expected `(bool, bool)`, found `Box<_>` | = note: expected tuple `(bool, bool)` found struct `Box<_>` @@ -51,7 +51,7 @@ error[E0308]: mismatched types LL | match (true, false) { | ------------- this expression has type `(bool, bool)` LL | &(true, false) => () - | ^^^^^^^^^^^^^^ expected tuple, found reference + | ^^^^^^^^^^^^^^ expected `(bool, bool)`, found `&_` | = note: expected tuple `(bool, bool)` found reference `&_` diff --git a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr index cc0726bcade32..7180a3d2426d1 100644 --- a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr +++ b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr @@ -2,7 +2,7 @@ error[E0308]: `?` operator has incompatible types --> $DIR/issue-51632-try-desugar-incompatible-types.rs:8:5 | LL | missing_discourses()? - | ^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `isize` + | ^^^^^^^^^^^^^^^^^^^^^ expected `Result`, found `isize` | = note: `?` operator cannot convert from `isize` to `Result` = note: expected enum `Result` diff --git a/tests/ui/issues/issue-53348.rs b/tests/ui/issues/issue-53348.rs index d2f8c77c0ce11..66800d9e92961 100644 --- a/tests/ui/issues/issue-53348.rs +++ b/tests/ui/issues/issue-53348.rs @@ -9,7 +9,7 @@ fn main() { for i in v { a = *i.to_string(); //~^ ERROR mismatched types - //~| NOTE expected struct `String`, found `str` + //~| NOTE expected `String`, found `str` v2.push(a); } } diff --git a/tests/ui/issues/issue-53348.stderr b/tests/ui/issues/issue-53348.stderr index 71d9f5b3dbbff..e4cdb7e889bca 100644 --- a/tests/ui/issues/issue-53348.stderr +++ b/tests/ui/issues/issue-53348.stderr @@ -5,7 +5,7 @@ LL | let mut a = String::new(); | ------------- expected due to this value LL | for i in v { LL | a = *i.to_string(); - | ^^^^^^^^^^^^^^ expected struct `String`, found `str` + | ^^^^^^^^^^^^^^ expected `String`, found `str` error: aborting due to previous error diff --git a/tests/ui/issues/issue-5358-1.rs b/tests/ui/issues/issue-5358-1.rs index f5e32e78d8794..14ee962b722e8 100644 --- a/tests/ui/issues/issue-5358-1.rs +++ b/tests/ui/issues/issue-5358-1.rs @@ -5,7 +5,7 @@ fn main() { match S(Either::Left(5)) { Either::Right(_) => {} //~^ ERROR mismatched types - //~| expected struct `S`, found enum `Either` + //~| expected `S`, found `Either<_, _>` //~| expected struct `S` //~| found enum `Either<_, _>` _ => {} diff --git a/tests/ui/issues/issue-5358-1.stderr b/tests/ui/issues/issue-5358-1.stderr index 9d5b8d9d3fc1b..059462a363e8e 100644 --- a/tests/ui/issues/issue-5358-1.stderr +++ b/tests/ui/issues/issue-5358-1.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match S(Either::Left(5)) { | ------------------ this expression has type `S` LL | Either::Right(_) => {} - | ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either` + | ^^^^^^^^^^^^^^^^ expected `S`, found `Either<_, _>` | = note: expected struct `S` found enum `Either<_, _>` diff --git a/tests/ui/issues/issue-56943.stderr b/tests/ui/issues/issue-56943.stderr index 74ed5ec0fb6f1..c394e620b82fe 100644 --- a/tests/ui/issues/issue-56943.stderr +++ b/tests/ui/issues/issue-56943.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-56943.rs:6:29 | LL | let _: issue_56943::S = issue_56943::S2; - | -------------- ^^^^^^^^^^^^^^^ expected struct `S`, found struct `S2` + | -------------- ^^^^^^^^^^^^^^^ expected `S`, found `S2` | | | expected due to this diff --git a/tests/ui/issues/issue-57362-2.stderr b/tests/ui/issues/issue-57362-2.stderr index 7d08c4643ff2f..37beb587d2767 100644 --- a/tests/ui/issues/issue-57362-2.stderr +++ b/tests/ui/issues/issue-57362-2.stderr @@ -1,8 +1,8 @@ -error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied +error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied --> $DIR/issue-57362-2.rs:22:25 | LL | let x = ::make_g(); - | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds + | ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `for<'a> fn(&'a ()): X` diff --git a/tests/ui/issues/issue-57741-1.stderr b/tests/ui/issues/issue-57741-1.stderr index 789a1f44db267..76f03bab6d157 100644 --- a/tests/ui/issues/issue-57741-1.stderr +++ b/tests/ui/issues/issue-57741-1.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let y = match x { | - this expression has type `Box` LL | S::A { a } | S::B { b: a } => a, - | ^^^^^^^^^^ expected struct `Box`, found enum `S` + | ^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` @@ -15,7 +15,7 @@ error[E0308]: mismatched types LL | let y = match x { | - this expression has type `Box` LL | S::A { a } | S::B { b: a } => a, - | ^^^^^^^^^^^^^ expected struct `Box`, found enum `S` + | ^^^^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` diff --git a/tests/ui/issues/issue-57741.stderr b/tests/ui/issues/issue-57741.stderr index cd277f20ef150..38014ecce7574 100644 --- a/tests/ui/issues/issue-57741.stderr +++ b/tests/ui/issues/issue-57741.stderr @@ -7,7 +7,7 @@ LL | let y = match x { | this expression has type `Box` | help: consider dereferencing the boxed value: `*x` LL | T::A(a) | T::B(a) => a, - | ^^^^^^^ expected struct `Box`, found enum `T` + | ^^^^^^^ expected `Box`, found `T` | = note: expected struct `Box` found enum `T` @@ -21,7 +21,7 @@ LL | let y = match x { | this expression has type `Box` | help: consider dereferencing the boxed value: `*x` LL | T::A(a) | T::B(a) => a, - | ^^^^^^^ expected struct `Box`, found enum `T` + | ^^^^^^^ expected `Box`, found `T` | = note: expected struct `Box` found enum `T` @@ -35,7 +35,7 @@ LL | let y = match x { | this expression has type `Box` | help: consider dereferencing the boxed value: `*x` LL | S::A { a } | S::B { b: a } => a, - | ^^^^^^^^^^ expected struct `Box`, found enum `S` + | ^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` @@ -49,7 +49,7 @@ LL | let y = match x { | this expression has type `Box` | help: consider dereferencing the boxed value: `*x` LL | S::A { a } | S::B { b: a } => a, - | ^^^^^^^^^^^^^ expected struct `Box`, found enum `S` + | ^^^^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` diff --git a/tests/ui/issues/issue-59488.stderr b/tests/ui/issues/issue-59488.stderr index f9846b62a72f8..d45beefa420cb 100644 --- a/tests/ui/issues/issue-59488.stderr +++ b/tests/ui/issues/issue-59488.stderr @@ -15,7 +15,7 @@ error[E0308]: mismatched types --> $DIR/issue-59488.rs:14:11 | LL | foo > 12; - | ^^ expected fn item, found integer + | ^^ expected fn item, found `i32` | = note: expected fn item `fn() -> i32 {foo}` found type `i32` @@ -37,7 +37,7 @@ error[E0308]: mismatched types --> $DIR/issue-59488.rs:18:11 | LL | bar > 13; - | ^^ expected fn item, found integer + | ^^ expected fn item, found `i64` | = note: expected fn item `fn(i64) -> i64 {bar}` found type `i64` diff --git a/tests/ui/issues/issue-61106.stderr b/tests/ui/issues/issue-61106.stderr index 2bc09234116b1..eff3e6e78495e 100644 --- a/tests/ui/issues/issue-61106.stderr +++ b/tests/ui/issues/issue-61106.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | foo(x.clone()); | --- ^^^^^^^^^ | | | - | | expected `&str`, found struct `String` + | | expected `&str`, found `String` | | help: consider borrowing here: `&x` | arguments to this function are incorrect | diff --git a/tests/ui/issues/issue-6458-4.stderr b/tests/ui/issues/issue-6458-4.stderr index 168ececac31eb..66ccfdff23664 100644 --- a/tests/ui/issues/issue-6458-4.stderr +++ b/tests/ui/issues/issue-6458-4.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-6458-4.rs:1:20 | LL | fn foo(b: bool) -> Result { - | --- ^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()` + | --- ^^^^^^^^^^^^^^^^^^^ expected `Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | Err("bar".to_string()); diff --git a/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr b/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr index 37e2c3bddc8cf..6fde44eaf0ced 100644 --- a/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr +++ b/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving ` as Deref>::Target == Rc --> $DIR/issue-67039-unsound-pin-partialeq.rs:25:29 | LL | let _ = Pin::new(Apple) == Rc::pin(Apple); - | ^^ expected struct `Apple`, found struct `Rc` + | ^^ expected `Apple`, found `Rc` | = note: expected struct `Apple` found struct `Rc` diff --git a/tests/ui/issues/issue-69306.stderr b/tests/ui/issues/issue-69306.stderr index 61ec5d3180cc3..570677298ffa9 100644 --- a/tests/ui/issues/issue-69306.stderr +++ b/tests/ui/issues/issue-69306.stderr @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | impl S0 { | - this type parameter LL | const C: S0 = Self(0); - | ^^^^^^^ expected `u8`, found type parameter `T` + | ^^^^^^^ expected `S0`, found `S0` | = note: expected struct `S0` found struct `S0` @@ -89,7 +89,7 @@ error[E0308]: mismatched types LL | impl S1 { | - this type parameter LL | const C: S1 = Self(0, 1); - | ^^^^^^^^^^ expected `u8`, found type parameter `T` + | ^^^^^^^^^^ expected `S1`, found `S1` | = note: expected struct `S1` found struct `S1` @@ -126,7 +126,7 @@ LL | fn map(x: U) -> S2 { | | | expected type parameter LL | Self(x) - | ^^^^^^^ expected type parameter `U`, found type parameter `T` + | ^^^^^^^ expected `S2`, found `S2` | = note: expected struct `S2` found struct `S2` diff --git a/tests/ui/issues/issue-7061.stderr b/tests/ui/issues/issue-7061.stderr index 27034378d3fc9..a209f8a4249f1 100644 --- a/tests/ui/issues/issue-7061.stderr +++ b/tests/ui/issues/issue-7061.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-7061.rs:4:46 | LL | fn foo(&'a mut self) -> Box { self } - | -------------- ^^^^ expected struct `Box`, found `&mut BarStruct` + | -------------- ^^^^ expected `Box`, found `&mut BarStruct` | | | expected `Box` because of return type | diff --git a/tests/ui/issues/issue-7092.rs b/tests/ui/issues/issue-7092.rs index 85bfbf90d9a2f..c3c96c7d3f61d 100644 --- a/tests/ui/issues/issue-7092.rs +++ b/tests/ui/issues/issue-7092.rs @@ -5,7 +5,7 @@ fn foo(x: Whatever) { match x { Some(field) => //~^ ERROR mismatched types -//~| expected enum `Whatever`, found enum `Option` +//~| expected `Whatever`, found `Option<_>` //~| expected enum `Whatever` //~| found enum `Option<_>` field.access(), diff --git a/tests/ui/issues/issue-7092.stderr b/tests/ui/issues/issue-7092.stderr index 59e8d75e236e1..e35379fd1cfef 100644 --- a/tests/ui/issues/issue-7092.stderr +++ b/tests/ui/issues/issue-7092.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match x { | - this expression has type `Whatever` LL | Some(field) => - | ^^^^^^^^^^^ expected enum `Whatever`, found enum `Option` + | ^^^^^^^^^^^ expected `Whatever`, found `Option<_>` | = note: expected enum `Whatever` found enum `Option<_>` diff --git a/tests/ui/issues/issue-71676-1.stderr b/tests/ui/issues/issue-71676-1.stderr index 2104634eb9355..164641ff77512 100644 --- a/tests/ui/issues/issue-71676-1.stderr +++ b/tests/ui/issues/issue-71676-1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-71676-1.rs:43:24 | LL | let _: *const u8 = &a; - | --------- ^^ expected `u8`, found struct `Emm` + | --------- ^^ expected `*const u8`, found `&Emm` | | | expected due to this | @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/issue-71676-1.rs:49:24 | LL | let _: *const u8 = &mut a; - | --------- ^^^^^^ expected `u8`, found struct `Emm` + | --------- ^^^^^^ expected `*const u8`, found `&mut Emm` | | | expected due to this | @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/issue-71676-1.rs:52:22 | LL | let _: *mut u8 = &mut a; - | ------- ^^^^^^ expected `u8`, found struct `Emm` + | ------- ^^^^^^ expected `*mut u8`, found `&mut Emm` | | | expected due to this | diff --git a/tests/ui/issues/issue-74236/main.stderr b/tests/ui/issues/issue-74236/main.stderr index 55e94ae72c779..5cd64e48ab88b 100644 --- a/tests/ui/issues/issue-74236/main.stderr +++ b/tests/ui/issues/issue-74236/main.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let () = dep::Renamed; | ^^ ------------ this expression has type `Renamed` | | - | expected struct `Renamed`, found `()` + | expected `Renamed`, found `()` error: aborting due to previous error diff --git a/tests/ui/issues/issue-76191.stderr b/tests/ui/issues/issue-76191.stderr index 13749804796b2..32d9105b25997 100644 --- a/tests/ui/issues/issue-76191.stderr +++ b/tests/ui/issues/issue-76191.stderr @@ -9,7 +9,7 @@ LL | match n { LL | RANGE => {} | ^^^^^ | | - | expected `i32`, found struct `RangeInclusive` + | expected `i32`, found `RangeInclusive` | `RANGE` is interpreted as a constant, not a new binding | = note: expected type `i32` @@ -31,7 +31,7 @@ LL | match n { LL | RANGE2 => {} | ^^^^^^ | | - | expected `i32`, found struct `RangeInclusive` + | expected `i32`, found `RangeInclusive` | `RANGE2` is interpreted as a constant, not a new binding | = note: expected type `i32` diff --git a/tests/ui/issues/issue-7867.rs b/tests/ui/issues/issue-7867.rs index 3074052f14f20..e9fd10c6613d4 100644 --- a/tests/ui/issues/issue-7867.rs +++ b/tests/ui/issues/issue-7867.rs @@ -6,7 +6,7 @@ fn main() { match (true, false) { A::B => (), //~^ ERROR mismatched types - //~| expected tuple, found enum `A` + //~| expected `(bool, bool)`, found `A` //~| expected tuple `(bool, bool)` //~| found enum `A` _ => () diff --git a/tests/ui/issues/issue-7867.stderr b/tests/ui/issues/issue-7867.stderr index 0d3121d60455d..4fb1af344cda6 100644 --- a/tests/ui/issues/issue-7867.stderr +++ b/tests/ui/issues/issue-7867.stderr @@ -7,7 +7,7 @@ LL | enum A { B, C } LL | match (true, false) { | ------------- this expression has type `(bool, bool)` LL | A::B => (), - | ^^^^ expected tuple, found enum `A` + | ^^^^ expected `(bool, bool)`, found `A` | = note: expected tuple `(bool, bool)` found enum `A` diff --git a/tests/ui/json/json-bom-plus-crlf-multifile.stderr b/tests/ui/json/json-bom-plus-crlf-multifile.stderr index 02f3bc687cba9..84040e8050e96 100644 --- a/tests/ui/json/json-bom-plus-crlf-multifile.stderr +++ b/tests/ui/json/json-bom-plus-crlf-multifile.stderr @@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/tests/ui/json/json-bom-plus-crlf.stderr b/tests/ui/json/json-bom-plus-crlf.stderr index df6bd7286a615..b0f450e9ecc14 100644 --- a/tests/ui/json/json-bom-plus-crlf.stderr +++ b/tests/ui/json/json-bom-plus-crlf.stderr @@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. @@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/tests/ui/kindck/kindck-send-object1.stderr b/tests/ui/kindck/kindck-send-object1.stderr index 11f597fee91be..19ef4f6fc68d4 100644 --- a/tests/ui/kindck/kindck-send-object1.stderr +++ b/tests/ui/kindck/kindck-send-object1.stderr @@ -20,7 +20,7 @@ LL | assert_send::>(); | = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)` = note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send` - = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` + = note: required because it appears within the type `Box` note: required by a bound in `assert_send` --> $DIR/kindck-send-object1.rs:5:18 | diff --git a/tests/ui/lang-items/lang-item-missing-generator.rs b/tests/ui/lang-items/lang-item-missing-generator.rs deleted file mode 100644 index 9b9aff38e524e..0000000000000 --- a/tests/ui/lang-items/lang-item-missing-generator.rs +++ /dev/null @@ -1,21 +0,0 @@ -// error-pattern: requires `generator` lang_item -#![feature(no_core, lang_items, unboxed_closures, tuple_trait)] -#![no_core] - -#[lang = "sized"] pub trait Sized { } - -#[lang = "tuple_trait"] pub trait Tuple { } - -#[lang = "fn_once"] -#[rustc_paren_sugar] -pub trait FnOnce { - type Output; - - extern "rust-call" fn call_once(self, args: Args) -> Self::Output; -} - -pub fn abc() -> impl FnOnce(f32) { - |_| {} -} - -fn main() {} diff --git a/tests/ui/lang-items/lang-item-missing-generator.stderr b/tests/ui/lang-items/lang-item-missing-generator.stderr deleted file mode 100644 index a24fdb5fb6506..0000000000000 --- a/tests/ui/lang-items/lang-item-missing-generator.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0635]: unknown feature `tuple_trait` - --> $DIR/lang-item-missing-generator.rs:2:51 - | -LL | #![feature(no_core, lang_items, unboxed_closures, tuple_trait)] - | ^^^^^^^^^^^ - -error: requires `generator` lang_item - --> $DIR/lang-item-missing-generator.rs:17:17 - | -LL | pub fn abc() -> impl FnOnce(f32) { - | ^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0635`. diff --git a/tests/ui/let-else/accidental-if.stderr b/tests/ui/let-else/accidental-if.stderr index 5474a67aac45a..57e5259173078 100644 --- a/tests/ui/let-else/accidental-if.stderr +++ b/tests/ui/let-else/accidental-if.stderr @@ -10,10 +10,10 @@ help: add a block here LL | if let Some(y) = x else { | ^ help: remove the `if` if you meant to write a `let...else` statement - --> $DIR/accidental-if.rs:3:5 | -LL | if let Some(y) = x else { - | ^^ +LL - if let Some(y) = x else { +LL + let Some(y) = x else { + | error: aborting due to previous error diff --git a/tests/ui/let-else/issue-94176.stderr b/tests/ui/let-else/issue-94176.stderr index 0cb97aceebfd5..6a015aced6f4e 100644 --- a/tests/ui/let-else/issue-94176.stderr +++ b/tests/ui/let-else/issue-94176.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-94176.rs:5:32 | LL | pub fn test(a: Option) -> Option { - | ---- ^^^^^^^^^^^ expected enum `Option`, found `()` + | ---- ^^^^^^^^^^^ expected `Option`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/tests/ui/let-else/let-else-deref-coercion.stderr b/tests/ui/let-else/let-else-deref-coercion.stderr index bf78a079cdfa9..143b838bac500 100644 --- a/tests/ui/let-else/let-else-deref-coercion.stderr +++ b/tests/ui/let-else/let-else-deref-coercion.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let Bar::Present(z) = self else { | ^^^^^^^^^^^^^^^ ---- this expression has type `&mut Foo` | | - | expected struct `Foo`, found enum `Bar` + | expected `Foo`, found `Bar` error[E0308]: mismatched types --> $DIR/let-else-deref-coercion.rs:68:13 @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | let Bar(z) = x; | ^^^^^^ - this expression has type `&mut irrefutable::Foo` | | - | expected struct `Foo`, found struct `Bar` + | expected `Foo`, found `Bar` error: aborting due to 2 previous errors diff --git a/tests/ui/let-else/let-else-non-diverging.stderr b/tests/ui/let-else/let-else-non-diverging.stderr index 78551fcc434a8..661d905cd0783 100644 --- a/tests/ui/let-else/let-else-non-diverging.stderr +++ b/tests/ui/let-else/let-else-non-diverging.stderr @@ -5,7 +5,7 @@ LL | let Some(x) = Some(1) else { | ________________________________^ LL | | Some(2) LL | | }; - | |_____^ expected `!`, found enum `Option` + | |_____^ expected `!`, found `Option<{integer}>` | = note: expected type `!` found enum `Option<{integer}>` @@ -32,7 +32,7 @@ error[E0308]: `else` clause of `let...else` does not diverge --> $DIR/let-else-non-diverging.rs:10:32 | LL | let Some(x) = Some(1) else { Some(2) }; - | ^^^^^^^^^^^ expected `!`, found enum `Option` + | ^^^^^^^^^^^ expected `!`, found `Option<{integer}>` | = note: expected type `!` found enum `Option<{integer}>` @@ -43,7 +43,7 @@ error[E0308]: `else` clause of `let...else` does not diverge --> $DIR/let-else-non-diverging.rs:15:32 | LL | let Some(x) = Some(1) else { foo::() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited` + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `Uninhabited` | = note: expected type `!` found enum `Uninhabited` diff --git a/tests/ui/let-else/let-else-ref-bindings.stderr b/tests/ui/let-else/let-else-ref-bindings.stderr index 56b9e073330a6..ada1805e7256f 100644 --- a/tests/ui/let-else/let-else-ref-bindings.stderr +++ b/tests/ui/let-else/let-else-ref-bindings.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:16:38 | LL | let Some(ref a): Option<&[u8]> = some else { return }; - | ^^^^ expected `&[u8]`, found struct `Vec` + | ^^^^ expected `Option<&[u8]>`, found `Option>` | = note: expected enum `Option<&[u8]>` found enum `Option>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:20:38 | LL | let Some(ref a): Option<&[u8]> = &some else { return }; - | ^^^^^ expected enum `Option`, found `&Option>` + | ^^^^^ expected `Option<&[u8]>`, found `&Option>` | = note: expected enum `Option<&[u8]>` found reference `&Option>` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:24:34 | LL | let Some(a): Option<&[u8]> = some else { return }; - | ------------- ^^^^ expected `&[u8]`, found struct `Vec` + | ------------- ^^^^ expected `Option<&[u8]>`, found `Option>` | | | expected due to this | @@ -31,7 +31,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:27:34 | LL | let Some(a): Option<&[u8]> = &some else { return }; - | ------------- ^^^^^ expected enum `Option`, found `&Option>` + | ------------- ^^^^^ expected `Option<&[u8]>`, found `&Option>` | | | expected due to this | @@ -42,7 +42,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:44:46 | LL | let Some(ref mut a): Option<&mut [u8]> = some else { return }; - | ^^^^ expected `&mut [u8]`, found struct `Vec` + | ^^^^ expected `Option<&mut [u8]>`, found `Option>` | = note: expected enum `Option<&mut [u8]>` found enum `Option>` @@ -51,7 +51,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:48:46 | LL | let Some(ref mut a): Option<&mut [u8]> = &mut some else { return }; - | ^^^^^^^^^ expected enum `Option`, found mutable reference + | ^^^^^^^^^ expected `Option<&mut [u8]>`, found `&mut Option>` | = note: expected enum `Option<&mut [u8]>` found mutable reference `&mut Option>` @@ -60,7 +60,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:52:38 | LL | let Some(a): Option<&mut [u8]> = some else { return }; - | ----------------- ^^^^ expected `&mut [u8]`, found struct `Vec` + | ----------------- ^^^^ expected `Option<&mut [u8]>`, found `Option>` | | | expected due to this | @@ -71,7 +71,7 @@ error[E0308]: mismatched types --> $DIR/let-else-ref-bindings.rs:55:38 | LL | let Some(a): Option<&mut [u8]> = &mut some else { return }; - | ----------------- ^^^^^^^^^ expected enum `Option`, found mutable reference + | ----------------- ^^^^^^^^^ expected `Option<&mut [u8]>`, found `&mut Option>` | | | expected due to this | diff --git a/tests/ui/lifetimes/issue-17728.stderr b/tests/ui/lifetimes/issue-17728.stderr index 3b25902d757e0..535073d6ebb0f 100644 --- a/tests/ui/lifetimes/issue-17728.stderr +++ b/tests/ui/lifetimes/issue-17728.stderr @@ -9,7 +9,7 @@ LL | | "n" | "north" => RoomDirection::North, LL | | "down" => RoomDirection::Down, | | ------------------- this and all prior arms are found to be of type `RoomDirection` LL | | _ => None - | | ^^^^ expected enum `RoomDirection`, found enum `Option` + | | ^^^^ expected `RoomDirection`, found `Option<_>` LL | | } | |_____- `match` arms have incompatible types | diff --git a/tests/ui/lifetimes/issue-26638.stderr b/tests/ui/lifetimes/issue-26638.stderr index 98d39d614d0e9..4dfacb9380115 100644 --- a/tests/ui/lifetimes/issue-26638.stderr +++ b/tests/ui/lifetimes/issue-26638.stderr @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/issue-26638.rs:1:69 | LL | fn parse_type(iter: Box+'static>) -> &str { iter.next() } - | ---- ^^^^^^^^^^^ expected `&str`, found enum `Option` + | ---- ^^^^^^^^^^^ expected `&str`, found `Option<&str>` | | | expected `&'static str` because of return type | @@ -60,7 +60,7 @@ error[E0308]: mismatched types --> $DIR/issue-26638.rs:5:47 | LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } - | ---- ^^^^^^ expected `str`, found `u8` + | ---- ^^^^^^ expected `&str`, found `&u8` | | | expected `&'static str` because of return type | diff --git a/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr b/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr index cca8cd9bd89f1..294476107ef78 100644 --- a/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr +++ b/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/tuple-mismatch.rs:6:20 | LL | yield ((), ()); - | ^^ expected tuple, found `()` + | ^^ expected `((), ())`, found `()` | = note: expected tuple `((), ())` found unit type `()` diff --git a/tests/ui/lint/unaligned_references.rs b/tests/ui/lint/unaligned_references.rs index e547f031a9cfd..04b66885e8522 100644 --- a/tests/ui/lint/unaligned_references.rs +++ b/tests/ui/lint/unaligned_references.rs @@ -1,5 +1,3 @@ -#![deny(unaligned_references)] - #[repr(packed)] pub struct Good { data: u64, @@ -20,20 +18,14 @@ fn main() { let good = Good { data: 0, ptr: &0, data2: [0, 0], aligned: [0; 32] }; let _ = &good.ptr; //~ ERROR reference to packed field - //~^ previously accepted let _ = &good.data; //~ ERROR reference to packed field - //~^ previously accepted // Error even when turned into raw pointer immediately. let _ = &good.data as *const _; //~ ERROR reference to packed field - //~^ previously accepted let _: *const _ = &good.data; //~ ERROR reference to packed field - //~^ previously accepted // Error on method call. let _ = good.data.clone(); //~ ERROR reference to packed field - //~^ previously accepted // Error for nested fields. let _ = &good.data2[0]; //~ ERROR reference to packed field - //~^ previously accepted let _ = &*good.ptr; // ok, behind a pointer let _ = &good.aligned; // ok, has align 1 @@ -43,7 +35,6 @@ fn main() { unsafe { let packed2 = Packed2 { x: 0, y: 0, z: 0 }; let _ = &packed2.x; //~ ERROR reference to packed field - //~^ previously accepted let _ = &packed2.y; // ok, has align 2 in packed(2) struct let _ = &packed2.z; // ok, has align 1 } @@ -88,7 +79,6 @@ fn main() { }, ); let _ref = &m1.1.a; //~ ERROR reference to packed field - //~^ previously accepted let m2 = Misalign( 0, @@ -98,6 +88,5 @@ fn main() { }, ); let _ref = &m2.1.a; //~ ERROR reference to packed field - //~^ previously accepted } } diff --git a/tests/ui/lint/unaligned_references.stderr b/tests/ui/lint/unaligned_references.stderr index 346f49b921e5c..07b59464bdece 100644 --- a/tests/ui/lint/unaligned_references.stderr +++ b/tests/ui/lint/unaligned_references.stderr @@ -1,259 +1,84 @@ -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:22:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:20:17 | LL | let _ = &good.ptr; | ^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:24:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:21:17 | LL | let _ = &good.data; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:27:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:23:17 | LL | let _ = &good.data as *const _; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:29:27 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:24:27 | LL | let _: *const _ = &good.data; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:32:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:26:17 | LL | let _ = good.data.clone(); | ^^^^^^^^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:35:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:28:17 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:45:17 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:37:17 | LL | let _ = &packed2.x; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:90:20 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:81:20 | LL | let _ref = &m1.1.a; | ^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:100:20 +error[E0793]: reference to packed field is unaligned + --> $DIR/unaligned_references.rs:90:20 | LL | let _ref = &m2.1.a; | ^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) error: aborting due to 9 previous errors -Future incompatibility report: Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:22:17 - | -LL | let _ = &good.ptr; - | ^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:24:17 - | -LL | let _ = &good.data; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:27:17 - | -LL | let _ = &good.data as *const _; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:29:27 - | -LL | let _: *const _ = &good.data; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:32:17 - | -LL | let _ = good.data.clone(); - | ^^^^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:35:17 - | -LL | let _ = &good.data2[0]; - | ^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:45:17 - | -LL | let _ = &packed2.x; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:90:20 - | -LL | let _ref = &m1.1.a; - | ^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:100:20 - | -LL | let _ref = &m2.1.a; - | ^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:9 - | -LL | #![deny(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/lint/unaligned_references_external_macro.rs b/tests/ui/lint/unaligned_references_external_macro.rs index cb597c38e7792..b655a2a8f63a2 100644 --- a/tests/ui/lint/unaligned_references_external_macro.rs +++ b/tests/ui/lint/unaligned_references_external_macro.rs @@ -3,7 +3,6 @@ extern crate unaligned_references_external_crate; unaligned_references_external_crate::mac! { //~ERROR reference to packed field is unaligned - //~^ previously accepted #[repr(packed)] pub struct X { pub field: u16 diff --git a/tests/ui/lint/unaligned_references_external_macro.stderr b/tests/ui/lint/unaligned_references_external_macro.stderr index c46ca6742a50f..5b08f433e3280 100644 --- a/tests/ui/lint/unaligned_references_external_macro.stderr +++ b/tests/ui/lint/unaligned_references_external_macro.stderr @@ -1,8 +1,7 @@ -error: reference to packed field is unaligned +error[E0793]: reference to packed field is unaligned --> $DIR/unaligned_references_external_macro.rs:5:1 | LL | / unaligned_references_external_crate::mac! { -LL | | LL | | #[repr(packed)] LL | | pub struct X { LL | | pub field: u16 @@ -10,52 +9,10 @@ LL | | } LL | | } | |_^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references_external_macro.rs:5:1 - | -LL | / unaligned_references_external_crate::mac! { -LL | | -LL | | #[repr(packed)] -LL | | pub struct X { -LL | | pub field: u16 -LL | | } -LL | | } - | |_^ = note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error -Future incompatibility report: Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/unaligned_references_external_macro.rs:5:1 - | -LL | / unaligned_references_external_crate::mac! { -LL | | -LL | | #[repr(packed)] -LL | | pub struct X { -LL | | pub field: u16 -LL | | } -LL | | } - | |_^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/unaligned_references_external_macro.rs:5:1 - | -LL | / unaligned_references_external_crate::mac! { -LL | | -LL | | #[repr(packed)] -LL | | pub struct X { -LL | | pub field: u16 -LL | | } -LL | | } - | |_^ - = note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info) - +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/loops/loop-break-value.stderr b/tests/ui/loops/loop-break-value.stderr index ccb27c3507076..5525dbb9005d3 100644 --- a/tests/ui/loops/loop-break-value.stderr +++ b/tests/ui/loops/loop-break-value.stderr @@ -167,7 +167,7 @@ error[E0308]: mismatched types --> $DIR/loop-break-value.rs:80:15 | LL | break (break, break); - | ^^^^^^^^^^^^^^ expected `()`, found tuple + | ^^^^^^^^^^^^^^ expected `()`, found `(!, !)` | = note: expected unit type `()` found tuple `(!, !)` diff --git a/tests/ui/match/issue-12552.stderr b/tests/ui/match/issue-12552.stderr index 4b027eba2c25e..195192fbd8240 100644 --- a/tests/ui/match/issue-12552.stderr +++ b/tests/ui/match/issue-12552.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match t { | - this expression has type `Result<_, {integer}>` LL | Some(k) => match k { - | ^^^^^^^ expected enum `Result`, found enum `Option` + | ^^^^^^^ expected `Result<_, {integer}>`, found `Option<_>` | = note: expected enum `Result<_, {integer}>` found enum `Option<_>` @@ -20,7 +20,7 @@ LL | match t { | - this expression has type `Result<_, {integer}>` ... LL | None => () - | ^^^^ expected enum `Result`, found enum `Option` + | ^^^^ expected `Result<_, {integer}>`, found `Option<_>` | = note: expected enum `Result<_, {integer}>` found enum `Option<_>` diff --git a/tests/ui/match/issue-91058.stderr b/tests/ui/match/issue-91058.stderr index ec1d7e21fa53c..12f37274b6b21 100644 --- a/tests/ui/match/issue-91058.stderr +++ b/tests/ui/match/issue-91058.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match array { | ----- this expression has type `[S; 1]` LL | [()] => {} - | ^^ expected struct `S`, found `()` + | ^^ expected `S`, found `()` error: aborting due to previous error diff --git a/tests/ui/match/match-struct.rs b/tests/ui/match/match-struct.rs index 7a54c54b98cb8..4da7b436ba8a8 100644 --- a/tests/ui/match/match-struct.rs +++ b/tests/ui/match/match-struct.rs @@ -5,7 +5,7 @@ fn main() { match (S { a: 1 }) { E::C(_) => (), //~^ ERROR mismatched types - //~| expected struct `S`, found enum `E` + //~| expected `S`, found `E` _ => () } } diff --git a/tests/ui/match/match-struct.stderr b/tests/ui/match/match-struct.stderr index a475bd5e5819c..fdc6fd77077e0 100644 --- a/tests/ui/match/match-struct.stderr +++ b/tests/ui/match/match-struct.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match (S { a: 1 }) { | ------------ this expression has type `S` LL | E::C(_) => (), - | ^^^^^^^ expected struct `S`, found enum `E` + | ^^^^^^^ expected `S`, found `E` error: aborting due to previous error diff --git a/tests/ui/match/match-tag-nullary.stderr b/tests/ui/match/match-tag-nullary.stderr index a6add31d1c510..aac873c760e75 100644 --- a/tests/ui/match/match-tag-nullary.stderr +++ b/tests/ui/match/match-tag-nullary.stderr @@ -5,7 +5,7 @@ LL | enum B { B } | - unit variant defined here LL | LL | fn main() { let x: A = A::A; match x { B::B => { } } } - | - ^^^^ expected enum `A`, found enum `B` + | - ^^^^ expected `A`, found `B` | | | this expression has type `A` diff --git a/tests/ui/match/match-tag-unary.stderr b/tests/ui/match/match-tag-unary.stderr index 31f77bdff8b1f..25e8152d8cf50 100644 --- a/tests/ui/match/match-tag-unary.stderr +++ b/tests/ui/match/match-tag-unary.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/match-tag-unary.rs:4:43 | LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } } - | - ^^^^^^^ expected enum `A`, found enum `B` + | - ^^^^^^^ expected `A`, found `B` | | | this expression has type `A` diff --git a/tests/ui/methods/issues/issue-61525.stderr b/tests/ui/methods/issues/issue-61525.stderr index 3e73b950a14e0..32e269b7ad89f 100644 --- a/tests/ui/methods/issues/issue-61525.stderr +++ b/tests/ui/methods/issues/issue-61525.stderr @@ -21,7 +21,7 @@ error[E0308]: mismatched types --> $DIR/issue-61525.rs:14:33 | LL | 1.query::("") - | --------------------- ^^ expected trait object `dyn ToString`, found `&str` + | --------------------- ^^ expected `dyn ToString`, found `&str` | | | arguments to this method are incorrect | diff --git a/tests/ui/methods/issues/issue-90315.stderr b/tests/ui/methods/issues/issue-90315.stderr index 4d3c086ff6e8c..0466bb0a0c997 100644 --- a/tests/ui/methods/issues/issue-90315.stderr +++ b/tests/ui/methods/issues/issue-90315.stderr @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/issue-90315.rs:28:8 | LL | if 1..(end + 1).is_empty() { - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` @@ -77,7 +77,7 @@ error[E0308]: mismatched types --> $DIR/issue-90315.rs:34:8 | LL | if 1..(end + 1).is_sorted() { - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` @@ -97,7 +97,7 @@ error[E0308]: mismatched types --> $DIR/issue-90315.rs:40:21 | LL | let _res: i32 = 3..6.take(2).sum(); - | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Range` + | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found `Range<{integer}>` | | | expected due to this | @@ -119,7 +119,7 @@ error[E0308]: mismatched types --> $DIR/issue-90315.rs:45:21 | LL | let _sum: i32 = 3..6.sum(); - | --- ^^^^^^^^^^ expected `i32`, found struct `Range` + | --- ^^^^^^^^^^ expected `i32`, found `Range<{integer}>` | | | expected due to this | @@ -158,7 +158,7 @@ error[E0308]: mismatched types --> $DIR/issue-90315.rs:62:8 | LL | if 1..end.error_method() { - | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>` | = note: expected type `bool` found struct `std::ops::Range<{integer}>` diff --git a/tests/ui/methods/method-self-arg-1.rs b/tests/ui/methods/method-self-arg-1.rs index f589f20d81ddf..5912b4ec2c3cb 100644 --- a/tests/ui/methods/method-self-arg-1.rs +++ b/tests/ui/methods/method-self-arg-1.rs @@ -9,9 +9,9 @@ impl Foo { fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types - //~| expected `&Foo`, found struct `Foo` + //~| expected `&Foo`, found `Foo` Foo::bar(&42); //~ ERROR mismatched types - //~| expected struct `Foo`, found integer + //~| expected `&Foo`, found `&{integer}` //~| expected reference `&Foo` //~| found reference `&{integer}` } diff --git a/tests/ui/methods/method-self-arg-1.stderr b/tests/ui/methods/method-self-arg-1.stderr index 01fec6fcaaeec..32ab8dced2198 100644 --- a/tests/ui/methods/method-self-arg-1.stderr +++ b/tests/ui/methods/method-self-arg-1.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | Foo::bar(x); | -------- ^ | | | - | | expected `&Foo`, found struct `Foo` + | | expected `&Foo`, found `Foo` | | help: consider borrowing here: `&x` | arguments to this function are incorrect | @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/method-self-arg-1.rs:13:14 | LL | Foo::bar(&42); - | -------- ^^^ expected struct `Foo`, found integer + | -------- ^^^ expected `&Foo`, found `&{integer}` | | | arguments to this function are incorrect | diff --git a/tests/ui/mismatched_types/abridged.stderr b/tests/ui/mismatched_types/abridged.stderr index ff1a836c9aec0..6d2fb1ce9cf62 100644 --- a/tests/ui/mismatched_types/abridged.stderr +++ b/tests/ui/mismatched_types/abridged.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn a() -> Foo { | --- expected `Foo` because of return type LL | Some(Foo { bar: 1 }) - | ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Option` + | ^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option` | = note: expected struct `Foo` found enum `Option` @@ -15,7 +15,7 @@ error[E0308]: mismatched types LL | fn a2() -> Foo { | --- expected `Foo` because of return type LL | Ok(Foo { bar: 1}) - | ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Result` + | ^^^^^^^^^^^^^^^^^ expected `Foo`, found `Result` | = note: expected struct `Foo` found enum `Result` @@ -26,7 +26,7 @@ error[E0308]: mismatched types LL | fn b() -> Option { | ----------- expected `Option` because of return type LL | Foo { bar: 1 } - | ^^^^^^^^^^^^^^ expected enum `Option`, found struct `Foo` + | ^^^^^^^^^^^^^^ expected `Option`, found `Foo` | = note: expected enum `Option` found struct `Foo` @@ -41,7 +41,7 @@ error[E0308]: mismatched types LL | fn c() -> Result { | ---------------- expected `Result` because of return type LL | Foo { bar: 1 } - | ^^^^^^^^^^^^^^ expected enum `Result`, found struct `Foo` + | ^^^^^^^^^^^^^^ expected `Result`, found `Foo` | = note: expected enum `Result` found struct `Foo` @@ -57,7 +57,7 @@ LL | fn d() -> X, String> { | ---------------------------- expected `X, String>` because of return type ... LL | x - | ^ expected struct `String`, found integer + | ^ expected `X, String>`, found `X, {integer}>` | = note: expected struct `X, String>` found struct `X, {integer}>` @@ -69,7 +69,7 @@ LL | fn e() -> X, String> { | ---------------------------- expected `X, String>` because of return type ... LL | x - | ^ expected struct `String`, found integer + | ^ expected `X, String>`, found `X, String>` | = note: expected struct `X, _>` found struct `X, _>` @@ -80,7 +80,7 @@ error[E0308]: mismatched types LL | fn f() -> String { | ------ expected `String` because of return type LL | 1+2 - | ^^^ expected struct `String`, found integer + | ^^^ expected `String`, found integer | help: try using a conversion method | @@ -93,7 +93,7 @@ error[E0308]: mismatched types LL | fn g() -> String { | ------ expected `String` because of return type LL | -2 - | ^^ expected struct `String`, found integer + | ^^ expected `String`, found integer | help: try using a conversion method | diff --git a/tests/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr b/tests/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr index 2f814445bbadf..54abb50d6e8c7 100644 --- a/tests/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr +++ b/tests/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr @@ -6,7 +6,7 @@ LL | | S | | - expected because of this LL | | } else { LL | | Y - | | ^ expected struct `S`, found struct `Y` + | | ^ expected `S`, found `Y` LL | | } | |_____- `if` and `else` have incompatible types @@ -17,7 +17,7 @@ LL | / match true { LL | | true => S, | | - this is found to be of type `S` LL | | false => Y, - | | ^ expected struct `S`, found struct `Y` + | | ^ expected `S`, found `Y` LL | | } | |_____- `match` arms have incompatible types diff --git a/tests/ui/mismatched_types/issue-106182.stderr b/tests/ui/mismatched_types/issue-106182.stderr index ac3ab8e9895c4..96ab3a029914e 100644 --- a/tests/ui/mismatched_types/issue-106182.stderr +++ b/tests/ui/mismatched_types/issue-106182.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match x { | - this expression has type `&_S` LL | _S(& (mut _y), _v) => { - | ^^^^^^^^^^ expected `u32`, found reference + | ^^^^^^^^^^ expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` diff --git a/tests/ui/mismatched_types/issue-38371-unfixable.stderr b/tests/ui/mismatched_types/issue-38371-unfixable.stderr index 3c5e765abfbe2..318285598a0b5 100644 --- a/tests/ui/mismatched_types/issue-38371-unfixable.stderr +++ b/tests/ui/mismatched_types/issue-38371-unfixable.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types LL | fn bgh(&&bar: u32) {} | ^^^^^ --- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` diff --git a/tests/ui/mismatched_types/issue-38371.stderr b/tests/ui/mismatched_types/issue-38371.stderr index f43427f9832d0..19335c446c3e7 100644 --- a/tests/ui/mismatched_types/issue-38371.stderr +++ b/tests/ui/mismatched_types/issue-38371.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo(&_a: Foo) {} | ^^^ --- expected due to this | | - | expected struct `Foo`, found reference + | expected `Foo`, found `&_` | = note: expected struct `Foo` found reference `&_` @@ -20,7 +20,7 @@ error[E0308]: mismatched types LL | fn agh(&&_a: &u32) {} | ^^^ ---- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` diff --git a/tests/ui/mismatched_types/non_zero_assigned_something.stderr b/tests/ui/mismatched_types/non_zero_assigned_something.stderr index d4b2c902f9b2e..57db71f889cf7 100644 --- a/tests/ui/mismatched_types/non_zero_assigned_something.stderr +++ b/tests/ui/mismatched_types/non_zero_assigned_something.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/non_zero_assigned_something.rs:2:35 | LL | let _: std::num::NonZeroU64 = 1; - | -------------------- ^ expected struct `NonZeroU64`, found integer + | -------------------- ^ expected `NonZeroU64`, found integer | | | expected due to this | @@ -15,7 +15,7 @@ error[E0308]: mismatched types --> $DIR/non_zero_assigned_something.rs:6:43 | LL | let _: Option = 1; - | ---------------------------- ^ expected enum `Option`, found integer + | ---------------------------- ^ expected `Option`, found integer | | | expected due to this | diff --git a/tests/ui/mismatched_types/normalize-fn-sig.stderr b/tests/ui/mismatched_types/normalize-fn-sig.stderr index 6c55f29c5d153..e3a0646550cb2 100644 --- a/tests/ui/mismatched_types/normalize-fn-sig.stderr +++ b/tests/ui/mismatched_types/normalize-fn-sig.stderr @@ -2,12 +2,13 @@ error[E0308]: mismatched types --> $DIR/normalize-fn-sig.rs:14:22 | LL | needs_i32_ref_fn(foo::<()>); - | ---------------- ^^^^^^^^^ expected `&i32`, found `i32` + | ---------------- ^^^^^^^^^ expected fn pointer, found fn item | | | arguments to this function are incorrect | = note: expected fn pointer `fn(&'static i32, i32)` found fn item `fn(i32, &'static i32) {foo::<()>}` + = note: when the arguments and return types match, functions can be coerced to function pointers note: function defined here --> $DIR/normalize-fn-sig.rs:11:4 | diff --git a/tests/ui/mismatched_types/ref-pat-suggestions.stderr b/tests/ui/mismatched_types/ref-pat-suggestions.stderr index 63eaa3930b1c3..62824004db5bf 100644 --- a/tests/ui/mismatched_types/ref-pat-suggestions.stderr +++ b/tests/ui/mismatched_types/ref-pat-suggestions.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn _f0(&_a: u32) {} | ^^^ --- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -41,7 +41,7 @@ error[E0308]: mismatched types LL | fn _f2(&&_a: &u32) {} | ^^^ ---- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -57,7 +57,7 @@ error[E0308]: mismatched types LL | fn _f3(&mut &_a: &mut u32) {} | ^^^ -------- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -106,7 +106,7 @@ LL | let _: fn(u32) = |&_a| (); | ^-- | || | |expected due to this - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -145,7 +145,7 @@ LL | let _: fn(&u32) = |&&_a| (); | ^-- | || | |expected due to this - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -162,7 +162,7 @@ LL | let _: fn(&mut u32) = |&mut &_a| (); | ^-- | || | |expected due to this - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -212,7 +212,7 @@ error[E0308]: mismatched types LL | let _ = |&_a: u32| (); | ^^^ --- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -249,7 +249,7 @@ error[E0308]: mismatched types LL | let _ = |&&_a: &u32| (); | ^^^ ---- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` @@ -265,7 +265,7 @@ error[E0308]: mismatched types LL | let _ = |&mut &_a: &mut u32| (); | ^^^ -------- expected due to this | | - | expected `u32`, found reference + | expected `u32`, found `&_` | = note: expected type `u32` found reference `&_` diff --git a/tests/ui/mismatched_types/show_module.stderr b/tests/ui/mismatched_types/show_module.stderr index 5e48e0955aae9..4bbeaaab93755 100644 --- a/tests/ui/mismatched_types/show_module.stderr +++ b/tests/ui/mismatched_types/show_module.stderr @@ -4,15 +4,15 @@ error[E0308]: mismatched types LL | fn foo() -> Foo { | --- expected `baz::Foo` because of return type LL | meh::Foo - | ^^^^^^^^ expected struct `baz::Foo`, found struct `meh::Foo` + | ^^^^^^^^ expected `baz::Foo`, found `meh::Foo` | - = note: struct `meh::Foo` and struct `baz::Foo` have similar names, but are actually distinct types -note: struct `meh::Foo` is defined in module `crate::meh` of the current crate + = note: `meh::Foo` and `baz::Foo` have similar names, but are actually distinct types +note: `meh::Foo` is defined in module `crate::meh` of the current crate --> $DIR/show_module.rs:8:5 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ -note: struct `baz::Foo` is defined in module `crate::blah::baz` of the current crate +note: `baz::Foo` is defined in module `crate::blah::baz` of the current crate --> $DIR/show_module.rs:3:9 | LL | pub struct Foo; diff --git a/tests/ui/mismatched_types/similar_paths.stderr b/tests/ui/mismatched_types/similar_paths.stderr index 46a383325526d..3e44fb759296a 100644 --- a/tests/ui/mismatched_types/similar_paths.stderr +++ b/tests/ui/mismatched_types/similar_paths.stderr @@ -4,12 +4,12 @@ error[E0308]: mismatched types LL | pub fn foo() -> Option { | ---------- expected `Option` because of return type LL | Some(42_u8) - | ^^^^^^^^^^^ expected enum `Option`, found enum `std::option::Option` + | ^^^^^^^^^^^ expected `Option`, found `std::option::Option` | - = note: enum `std::option::Option` and enum `Option` have similar names, but are actually distinct types -note: enum `std::option::Option` is defined in crate `core` + = note: `std::option::Option` and `Option` have similar names, but are actually distinct types +note: `std::option::Option` is defined in crate `core` --> $SRC_DIR/core/src/option.rs:LL:COL -note: enum `Option` is defined in the current crate +note: `Option` is defined in the current crate --> $DIR/similar_paths.rs:1:1 | LL | enum Option { diff --git a/tests/ui/mismatched_types/similar_paths_primitive.stderr b/tests/ui/mismatched_types/similar_paths_primitive.stderr index 8a2f73945e841..80e78a4e4fa3c 100644 --- a/tests/ui/mismatched_types/similar_paths_primitive.stderr +++ b/tests/ui/mismatched_types/similar_paths_primitive.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/similar_paths_primitive.rs:8:9 | LL | foo(true); - | --- ^^^^ expected struct `bool`, found `bool` + | --- ^^^^ expected `bool`, found a different `bool` | | | arguments to this function are incorrect | - = note: bool and struct `bool` have similar names, but are actually distinct types + = note: bool and `bool` have similar names, but are actually distinct types = note: bool is a primitive defined by the language -note: struct `bool` is defined in the current crate +note: `bool` is defined in the current crate --> $DIR/similar_paths_primitive.rs:3:1 | LL | struct bool; diff --git a/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr b/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr index f58b9c3ec16de..40182a75a989a 100644 --- a/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr +++ b/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr @@ -6,7 +6,7 @@ LL | | S | | - expected because of this LL | | } else { LL | | Y - | | ^ expected struct `S`, found struct `Y` + | | ^ expected `S`, found `Y` LL | | } | |_____- `if` and `else` have incompatible types | @@ -28,7 +28,7 @@ LL | / match true { LL | | true => S, | | - this is found to be of type `S` LL | | false => Y, - | | ^ expected struct `S`, found struct `Y` + | | ^ expected `S`, found `Y` LL | | } | |_____- `match` arms have incompatible types | diff --git a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr index 35871afb58b9a..c5d0eef10265b 100644 --- a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr +++ b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/suggest-removing-tuple-struct-field.rs:11:13 | LL | some_fn(value.0); - | ------- ^^^^^^^ expected struct `MyWrapper`, found `u32` + | ------- ^^^^^^^ expected `MyWrapper`, found `u32` | | | arguments to this function are incorrect | @@ -21,7 +21,7 @@ error[E0308]: mismatched types --> $DIR/suggest-removing-tuple-struct-field.rs:12:13 | LL | some_fn(my_wrapper!(123).0); - | ------- ^^^^^^^^^^^^^^^^^^ expected struct `MyWrapper`, found `u32` + | ------- ^^^^^^^^^^^^^^^^^^ expected `MyWrapper`, found `u32` | | | arguments to this function are incorrect | diff --git a/tests/ui/mismatched_types/wrap-suggestion-privacy.stderr b/tests/ui/mismatched_types/wrap-suggestion-privacy.stderr index fdd92cbfc4437..e20a0aa0e2aee 100644 --- a/tests/ui/mismatched_types/wrap-suggestion-privacy.stderr +++ b/tests/ui/mismatched_types/wrap-suggestion-privacy.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/wrap-suggestion-privacy.rs:12:19 | LL | needs_wrapper(0); - | ------------- ^ expected struct `Wrapper`, found integer + | ------------- ^ expected `Wrapper`, found integer | | | arguments to this function are incorrect | @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/wrap-suggestion-privacy.rs:17:20 | LL | needs_wrapping(0); - | -------------- ^ expected struct `Wrapping`, found integer + | -------------- ^ expected `Wrapping`, found integer | | | arguments to this function are incorrect | @@ -42,7 +42,7 @@ error[E0308]: mismatched types --> $DIR/wrap-suggestion-privacy.rs:22:17 | LL | needs_ready(Some(0)); - | ----------- ^^^^^^^ expected struct `Ready`, found enum `Option` + | ----------- ^^^^^^^ expected `Ready`, found `Option<{integer}>` | | | arguments to this function are incorrect | diff --git a/tests/ui/mut/mut-cross-borrowing.stderr b/tests/ui/mut/mut-cross-borrowing.stderr index ee739d6286a51..8401827e51f82 100644 --- a/tests/ui/mut/mut-cross-borrowing.stderr +++ b/tests/ui/mut/mut-cross-borrowing.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | f(x) | - ^ | | | - | | expected `&mut isize`, found struct `Box` + | | expected `&mut isize`, found `Box<{integer}>` | | help: consider mutably borrowing here: `&mut x` | arguments to this function are incorrect | diff --git a/tests/ui/never_type/diverging-tuple-parts-39485.stderr b/tests/ui/never_type/diverging-tuple-parts-39485.stderr index 52d07ae170c41..ded13e2707f5f 100644 --- a/tests/ui/never_type/diverging-tuple-parts-39485.stderr +++ b/tests/ui/never_type/diverging-tuple-parts-39485.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/diverging-tuple-parts-39485.rs:8:5 | LL | &panic!() - | ^^^^^^^^^ expected `()`, found reference + | ^^^^^^^^^ expected `()`, found `&_` | = note: expected unit type `()` found reference `&_` @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | fn f() -> isize { | ----- expected `isize` because of return type LL | (return 1, return 2) - | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found tuple + | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `(!, !)` | = note: expected type `isize` found tuple `(!, !)` diff --git a/tests/ui/never_type/issue-10176.rs b/tests/ui/never_type/issue-10176.rs index 6277aa05eb365..5ac4359c5016f 100644 --- a/tests/ui/never_type/issue-10176.rs +++ b/tests/ui/never_type/issue-10176.rs @@ -3,7 +3,7 @@ fn f() -> isize { //~^ ERROR mismatched types //~| expected type `isize` //~| found tuple `(!, !)` -//~| expected `isize`, found tuple +//~| expected `isize`, found `(!, !)` } fn main() {} diff --git a/tests/ui/never_type/issue-10176.stderr b/tests/ui/never_type/issue-10176.stderr index cd5361ffad398..3f381b9aea9b2 100644 --- a/tests/ui/never_type/issue-10176.stderr +++ b/tests/ui/never_type/issue-10176.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn f() -> isize { | ----- expected `isize` because of return type LL | (return 1, return 2) - | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found tuple + | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `(!, !)` | = note: expected type `isize` found tuple `(!, !)` diff --git a/tests/ui/never_type/issue-52443.stderr b/tests/ui/never_type/issue-52443.stderr index 33b7a9185d0eb..99dfce8690343 100644 --- a/tests/ui/never_type/issue-52443.stderr +++ b/tests/ui/never_type/issue-52443.stderr @@ -19,7 +19,7 @@ error[E0308]: mismatched types --> $DIR/issue-52443.rs:2:10 | LL | [(); & { loop { continue } } ]; - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` found reference `&_` diff --git a/tests/ui/never_type/issue-96335.stderr b/tests/ui/never_type/issue-96335.stderr index e148b983e8e9d..c3d80a425e057 100644 --- a/tests/ui/never_type/issue-96335.stderr +++ b/tests/ui/never_type/issue-96335.stderr @@ -19,7 +19,7 @@ error[E0308]: mismatched types LL | 0.....{loop{}1}; | ----^^^^^^^^^^^ | | | - | | expected integer, found struct `RangeTo` + | | expected integer, found `RangeTo<{integer}>` | arguments to this function are incorrect | = note: expected type `{integer}` diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr index 6e96f40c0e0d8..d1e94bc702cae 100644 --- a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr +++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr @@ -1,8 +1,8 @@ -error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied +error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25 | LL | let x = ::make_g(); - | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds + | ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `for<'a> fn(&'a ()): X` @@ -17,7 +17,7 @@ error[E0599]: no function or associated item named `make_f` found for fn pointer --> $DIR/issue-57642-higher-ranked-subtype.rs:35:25 | LL | let x = ::make_f(); - | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())` + | ^^^^^^ function or associated item not found in `fn(&())` | = help: items from traits can only be used if the trait is implemented and in scope note: `Y` defines an item `make_f`, perhaps you need to implement it diff --git a/tests/ui/noexporttypeexe.rs b/tests/ui/noexporttypeexe.rs index 964ac9a300e8f..d473ad6c9c93e 100644 --- a/tests/ui/noexporttypeexe.rs +++ b/tests/ui/noexporttypeexe.rs @@ -11,5 +11,5 @@ fn main() { //~^ ERROR mismatched types //~| expected type `isize` //~| found enum `Option` - //~| expected `isize`, found enum `Option` + //~| expected `isize`, found `Option` } diff --git a/tests/ui/noexporttypeexe.stderr b/tests/ui/noexporttypeexe.stderr index 7fc239613e2d7..26bafd31d011b 100644 --- a/tests/ui/noexporttypeexe.stderr +++ b/tests/ui/noexporttypeexe.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/noexporttypeexe.rs:10:18 | LL | let x: isize = noexporttypelib::foo(); - | ----- ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found enum `Option` + | ----- ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `Option` | | | expected due to this | diff --git a/tests/ui/object-pointer-types.stderr b/tests/ui/object-pointer-types.stderr index a477425edc81b..2c8df3b616fb8 100644 --- a/tests/ui/object-pointer-types.stderr +++ b/tests/ui/object-pointer-types.stderr @@ -20,7 +20,7 @@ error[E0599]: no method named `managed` found for struct `Box<(dyn Foo + 'static --> $DIR/object-pointer-types.rs:23:7 | LL | x.managed(); - | ^^^^^^^ method not found in `Box<(dyn Foo + 'static)>` + | ^^^^^^^ method not found in `Box` error: aborting due to 3 previous errors diff --git a/tests/ui/or-patterns/already-bound-name.stderr b/tests/ui/or-patterns/already-bound-name.stderr index 368782c1e0d01..795c46acb5d31 100644 --- a/tests/ui/or-patterns/already-bound-name.stderr +++ b/tests/ui/or-patterns/already-bound-name.stderr @@ -88,7 +88,7 @@ error[E0308]: mismatched types LL | let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1)); | - ^ ------- this expression has type `E>` | | | - | | expected integer, found enum `E` + | | expected integer, found `E<{integer}>` | first introduced with type `{integer}` here | = note: expected type `{integer}` diff --git a/tests/ui/or-patterns/nested-undelimited-precedence.stderr b/tests/ui/or-patterns/nested-undelimited-precedence.stderr index 2e25d8b3e7b0d..5a63e621f4a3a 100644 --- a/tests/ui/or-patterns/nested-undelimited-precedence.stderr +++ b/tests/ui/or-patterns/nested-undelimited-precedence.stderr @@ -42,7 +42,7 @@ error[E0308]: mismatched types LL | let &A(_) | B(_): F = A(3); | ^^^^^ - expected due to this | | - | expected enum `F`, found reference + | expected `F`, found `&_` | = note: expected enum `F` found reference `&_` @@ -53,7 +53,7 @@ error[E0308]: mismatched types LL | let &&A(_) | B(_): F = A(3); | ^^^^^^ - expected due to this | | - | expected enum `F`, found reference + | expected `F`, found `&_` | = note: expected enum `F` found reference `&_` @@ -64,7 +64,7 @@ error[E0308]: mismatched types LL | let &mut A(_) | B(_): F = A(3); | ^^^^^^^^^ - expected due to this | | - | expected enum `F`, found `&mut _` + | expected `F`, found `&mut _` | = note: expected enum `F` found mutable reference `&mut _` @@ -75,7 +75,7 @@ error[E0308]: mismatched types LL | let &&mut A(_) | B(_): F = A(3); | ^^^^^^^^^^ - expected due to this | | - | expected enum `F`, found reference + | expected `F`, found `&_` | = note: expected enum `F` found reference `&_` diff --git a/tests/ui/packed/issue-27060-rpass.rs b/tests/ui/packed/issue-27060-rpass.rs deleted file mode 100644 index d9159f6669d60..0000000000000 --- a/tests/ui/packed/issue-27060-rpass.rs +++ /dev/null @@ -1,23 +0,0 @@ -// run-pass -#![allow(dead_code)] -#[repr(packed)] -pub struct Good { - data: &'static u32, - data2: [&'static u32; 2], - aligned: [u8; 32], -} - -// kill this test when that turns to a hard error -#[allow(unaligned_references)] -fn main() { - let good = Good { data: &0, data2: [&0, &0], aligned: [0; 32] }; - - let _ = &good.data; // ok - let _ = &good.data2[0]; // ok - - let _ = &good.data; - let _ = &good.data2[0]; - let _ = &*good.data; // ok, behind a pointer - let _ = &good.aligned; // ok, has align 1 - let _ = &good.aligned[2]; // ok, has align 1 -} diff --git a/tests/ui/packed/issue-27060-rpass.stderr b/tests/ui/packed/issue-27060-rpass.stderr deleted file mode 100644 index adf9ae9f56f5a..0000000000000 --- a/tests/ui/packed/issue-27060-rpass.stderr +++ /dev/null @@ -1,68 +0,0 @@ -Future incompatibility report: Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/issue-27060-rpass.rs:15:13 - | -LL | let _ = &good.data; // ok - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/issue-27060-rpass.rs:11:9 - | -LL | #[allow(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/issue-27060-rpass.rs:16:13 - | -LL | let _ = &good.data2[0]; // ok - | ^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/issue-27060-rpass.rs:11:9 - | -LL | #[allow(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/issue-27060-rpass.rs:18:13 - | -LL | let _ = &good.data; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/issue-27060-rpass.rs:11:9 - | -LL | #[allow(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/issue-27060-rpass.rs:19:13 - | -LL | let _ = &good.data2[0]; - | ^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/issue-27060-rpass.rs:11:9 - | -LL | #[allow(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - diff --git a/tests/ui/packed/issue-27060.rs b/tests/ui/packed/issue-27060.rs index 886a00239f98c..a0e944caa0b55 100644 --- a/tests/ui/packed/issue-27060.rs +++ b/tests/ui/packed/issue-27060.rs @@ -13,14 +13,10 @@ fn main() { }; let _ = &good.data; //~ ERROR reference to packed field - //~| hard error let _ = &good.data2[0]; //~ ERROR reference to packed field - //~| hard error let _ = &good.data; //~ ERROR reference to packed field - //~| hard error let _ = &good.data2[0]; //~ ERROR reference to packed field - //~| hard error let _ = &*good.data; // ok, behind a pointer let _ = &good.aligned; // ok, has align 1 let _ = &good.aligned[2]; // ok, has align 1 diff --git a/tests/ui/packed/issue-27060.stderr b/tests/ui/packed/issue-27060.stderr index 85e08fa02dd17..b4753284f725d 100644 --- a/tests/ui/packed/issue-27060.stderr +++ b/tests/ui/packed/issue-27060.stderr @@ -1,99 +1,39 @@ -error: reference to packed field is unaligned +error[E0793]: reference to packed field is unaligned --> $DIR/issue-27060.rs:15:13 | LL | let _ = &good.data; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:17:13 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-27060.rs:16:13 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:20:13 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-27060.rs:18:13 | LL | let _ = &good.data; | ^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:22:13 +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-27060.rs:19:13 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) error: aborting due to 4 previous errors -Future incompatibility report: Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:15:13 - | -LL | let _ = &good.data; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:17:13 - | -LL | let _ = &good.data2[0]; - | ^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:20:13 - | -LL | let _ = &good.data; - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - -Future breakage diagnostic: -error: reference to packed field is unaligned - --> $DIR/issue-27060.rs:22:13 - | -LL | let _ = &good.data2[0]; - | ^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - = note: `#[deny(unaligned_references)]` on by default - +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/packed/packed-struct-borrow-element-64bit.rs b/tests/ui/packed/packed-struct-borrow-element-64bit.rs index 00bddfe40b25b..63315ea66737a 100644 --- a/tests/ui/packed/packed-struct-borrow-element-64bit.rs +++ b/tests/ui/packed/packed-struct-borrow-element-64bit.rs @@ -1,4 +1,3 @@ -// run-pass (note: this is spec-UB, but it works for now) // ignore-32bit (needs `usize` to be 8-aligned to reproduce all the errors below) #![allow(dead_code)] // ignore-emscripten weird assertion? @@ -9,10 +8,8 @@ struct Foo4C { baz: usize } -#[warn(unaligned_references)] pub fn main() { let foo = Foo4C { bar: 1, baz: 2 }; - let brw = &foo.baz; //~WARN reference to packed field is unaligned - //~^ previously accepted + let brw = &foo.baz; //~ERROR reference to packed field is unaligned assert_eq!(*brw, 2); } diff --git a/tests/ui/packed/packed-struct-borrow-element-64bit.stderr b/tests/ui/packed/packed-struct-borrow-element-64bit.stderr index fb2f5615c5399..32943b0f07b8c 100644 --- a/tests/ui/packed/packed-struct-borrow-element-64bit.stderr +++ b/tests/ui/packed/packed-struct-borrow-element-64bit.stderr @@ -1,35 +1,12 @@ -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element-64bit.rs:15:15 +error[E0793]: reference to packed field is unaligned + --> $DIR/packed-struct-borrow-element-64bit.rs:13:15 | LL | let brw = &foo.baz; | ^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/packed-struct-borrow-element-64bit.rs:12:8 - | -LL | #[warn(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -warning: 1 warning emitted -Future incompatibility report: Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element-64bit.rs:15:15 - | -LL | let brw = &foo.baz; - | ^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/packed-struct-borrow-element-64bit.rs:12:8 - | -LL | #[warn(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ +error: aborting due to previous error +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/packed/packed-struct-borrow-element.rs b/tests/ui/packed/packed-struct-borrow-element.rs index a6ee90cef44f0..6cbeca44bbcbf 100644 --- a/tests/ui/packed/packed-struct-borrow-element.rs +++ b/tests/ui/packed/packed-struct-borrow-element.rs @@ -1,4 +1,3 @@ -// run-pass (note: this is spec-UB, but it works for now) #![allow(dead_code)] // ignore-emscripten weird assertion? @@ -20,15 +19,12 @@ struct Foo4C { baz: usize } -#[warn(unaligned_references)] pub fn main() { let foo = Foo1 { bar: 1, baz: 2 }; - let brw = &foo.baz; //~WARN reference to packed field is unaligned - //~^ previously accepted + let brw = &foo.baz; //~ERROR reference to packed field is unaligned assert_eq!(*brw, 2); let foo = Foo2 { bar: 1, baz: 2 }; - let brw = &foo.baz; //~WARN reference to packed field is unaligned - //~^ previously accepted + let brw = &foo.baz; //~ERROR reference to packed field is unaligned assert_eq!(*brw, 2); } diff --git a/tests/ui/packed/packed-struct-borrow-element.stderr b/tests/ui/packed/packed-struct-borrow-element.stderr index 75d55c4f6930d..29d867fc5b9ad 100644 --- a/tests/ui/packed/packed-struct-borrow-element.stderr +++ b/tests/ui/packed/packed-struct-borrow-element.stderr @@ -1,63 +1,21 @@ -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element.rs:26:15 +error[E0793]: reference to packed field is unaligned + --> $DIR/packed-struct-borrow-element.rs:24:15 | LL | let brw = &foo.baz; | ^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/packed-struct-borrow-element.rs:23:8 - | -LL | #[warn(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element.rs:31:15 +error[E0793]: reference to packed field is unaligned + --> $DIR/packed-struct-borrow-element.rs:28:15 | LL | let brw = &foo.baz; | ^^^^^^^^ | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -warning: 2 warnings emitted - -Future incompatibility report: Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element.rs:26:15 - | -LL | let brw = &foo.baz; - | ^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/packed-struct-borrow-element.rs:23:8 - | -LL | #[warn(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - -Future breakage diagnostic: -warning: reference to packed field is unaligned - --> $DIR/packed-struct-borrow-element.rs:31:15 - | -LL | let brw = &foo.baz; - | ^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) -note: the lint level is defined here - --> $DIR/packed-struct-borrow-element.rs:23:8 - | -LL | #[warn(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0793`. diff --git a/tests/ui/parser/issues/issue-87812-path.stderr b/tests/ui/parser/issues/issue-87812-path.stderr index f8ee0517533c6..d045f4821ff35 100644 --- a/tests/ui/parser/issues/issue-87812-path.stderr +++ b/tests/ui/parser/issues/issue-87812-path.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-87812-path.rs:3:24 | LL | let _: usize = $f; - | ----- ^^ expected `usize`, found struct `Baz` + | ----- ^^ expected `usize`, found `Baz` | | | expected due to this ... diff --git a/tests/ui/parser/recover-range-pats.stderr b/tests/ui/parser/recover-range-pats.stderr index c54f13e018521..5b69ca5cd6dfa 100644 --- a/tests/ui/parser/recover-range-pats.stderr +++ b/tests/ui/parser/recover-range-pats.stderr @@ -314,7 +314,7 @@ error[E0308]: mismatched types LL | if let X.. .0 = 0 {} | - ^^ - this expression has type `u8` | | | - | | expected integer, found floating-point number + | | expected `u8`, found floating-point number | this is of type `u8` | = note: expected type `u8` @@ -351,7 +351,7 @@ error[E0308]: mismatched types LL | if let X..=.0 = 0 {} | - ^^ - this expression has type `u8` | | | - | | expected integer, found floating-point number + | | expected `u8`, found floating-point number | this is of type `u8` | = note: expected type `u8` @@ -388,7 +388,7 @@ error[E0308]: mismatched types LL | if let X... .0 = 0 {} | - ^^ - this expression has type `u8` | | | - | | expected integer, found floating-point number + | | expected `u8`, found floating-point number | this is of type `u8` | = note: expected type `u8` diff --git a/tests/ui/parser/unclosed-delimiter-in-dep.stderr b/tests/ui/parser/unclosed-delimiter-in-dep.stderr index 1366ef1bba8bf..d1725c60dbbea 100644 --- a/tests/ui/parser/unclosed-delimiter-in-dep.stderr +++ b/tests/ui/parser/unclosed-delimiter-in-dep.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/unclosed-delimiter-in-dep.rs:4:20 | LL | let _: usize = unclosed_delim_mod::new(); - | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found enum `Result` + | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `Result` | | | expected due to this | diff --git a/tests/ui/pattern/for-loop-bad-item.stderr b/tests/ui/pattern/for-loop-bad-item.stderr index f064a25a9c9a4..67c6d6f01a17f 100644 --- a/tests/ui/pattern/for-loop-bad-item.stderr +++ b/tests/ui/pattern/for-loop-bad-item.stderr @@ -25,7 +25,7 @@ error[E0308]: mismatched types LL | for Some(Qux(_)) | None in [Some(""), None] { | ^^^^^^ ---------------- this is an iterator with items of type `Option<&str>` | | - | expected `str`, found struct `Qux` + | expected `str`, found `Qux` error: aborting due to 2 previous errors diff --git a/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr index 75a231f6b4ba3..daab3a862c2e1 100644 --- a/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr +++ b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let P() = U {}; | ^^^ ---- this expression has type `U` | | - | expected struct `U`, found struct `P` + | expected `U`, found `P<_>` | = note: expected struct `U` found struct `P<_>` diff --git a/tests/ui/pattern/pat-struct-field-expr-has-type.stderr b/tests/ui/pattern/pat-struct-field-expr-has-type.stderr index 3a61d4293b01d..0290752931067 100644 --- a/tests/ui/pattern/pat-struct-field-expr-has-type.stderr +++ b/tests/ui/pattern/pat-struct-field-expr-has-type.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match (S { f: 42 }) { | ------------- this expression has type `S` LL | S { f: Ok(_) } => {} - | ^^^^^ expected `u8`, found enum `Result` + | ^^^^^ expected `u8`, found `Result<_, _>` | = note: expected type `u8` found enum `Result<_, _>` diff --git a/tests/ui/pattern/pat-type-err-formal-param.stderr b/tests/ui/pattern/pat-type-err-formal-param.stderr index 206713a4bfc33..4f482c52a98f8 100644 --- a/tests/ui/pattern/pat-type-err-formal-param.stderr +++ b/tests/ui/pattern/pat-type-err-formal-param.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo(Tuple(_): String) {} | ^^^^^^^^ ------ expected due to this | | - | expected struct `String`, found struct `Tuple` + | expected `String`, found `Tuple` error: aborting due to previous error diff --git a/tests/ui/pattern/pat-type-err-let-stmt.stderr b/tests/ui/pattern/pat-type-err-let-stmt.stderr index 090bd67117eab..b68b69a78a2f7 100644 --- a/tests/ui/pattern/pat-type-err-let-stmt.stderr +++ b/tests/ui/pattern/pat-type-err-let-stmt.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/pat-type-err-let-stmt.rs:6:29 | LL | let Ok(0): Option = 42u8; - | ---------- ^^^^ expected enum `Option`, found `u8` + | ---------- ^^^^ expected `Option`, found `u8` | | | expected due to this | @@ -19,7 +19,7 @@ error[E0308]: mismatched types LL | let Ok(0): Option = 42u8; | ^^^^^ ---------- expected due to this | | - | expected enum `Option`, found enum `Result` + | expected `Option`, found `Result<_, _>` | = note: expected enum `Option` found enum `Result<_, _>` @@ -30,7 +30,7 @@ error[E0308]: mismatched types LL | let Ok(0): Option; | ^^^^^ ---------- expected due to this | | - | expected enum `Option`, found enum `Result` + | expected `Option`, found `Result<_, _>` | = note: expected enum `Option` found enum `Result<_, _>` @@ -41,7 +41,7 @@ error[E0308]: mismatched types LL | let Ok(0) = 42u8; | ^^^^^ ---- this expression has type `u8` | | - | expected `u8`, found enum `Result` + | expected `u8`, found `Result<_, _>` | = note: expected type `u8` found enum `Result<_, _>` diff --git a/tests/ui/pattern/pattern-error-continue.rs b/tests/ui/pattern/pattern-error-continue.rs index 0702a9986fc1c..bed949439237a 100644 --- a/tests/ui/pattern/pattern-error-continue.rs +++ b/tests/ui/pattern/pattern-error-continue.rs @@ -21,7 +21,7 @@ fn main() { match 'c' { S { .. } => (), //~^ ERROR mismatched types - //~| expected `char`, found struct `S` + //~| expected `char`, found `S` _ => () } diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr index 4c2eff63ab5e8..e1349fb02ea76 100644 --- a/tests/ui/pattern/pattern-error-continue.stderr +++ b/tests/ui/pattern/pattern-error-continue.stderr @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | match 'c' { | --- this expression has type `char` LL | S { .. } => (), - | ^^^^^^^^ expected `char`, found struct `S` + | ^^^^^^^^ expected `char`, found `S` error[E0308]: mismatched types --> $DIR/pattern-error-continue.rs:28:7 diff --git a/tests/ui/pattern/pattern-ident-path-generics.stderr b/tests/ui/pattern/pattern-ident-path-generics.stderr index 01b082bd35b02..62283dfe9b64f 100644 --- a/tests/ui/pattern/pattern-ident-path-generics.stderr +++ b/tests/ui/pattern/pattern-ident-path-generics.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match Some("foo") { | ----------- this expression has type `Option<&str>` LL | None:: => {} - | ^^^^^^^^^^^^^ expected `&str`, found `isize` + | ^^^^^^^^^^^^^ expected `Option<&str>`, found `Option` | = note: expected enum `Option<&str>` found enum `Option` diff --git a/tests/ui/pattern/pattern-tyvar.stderr b/tests/ui/pattern/pattern-tyvar.stderr index f1e2a9d72cec8..4eb00254861d5 100644 --- a/tests/ui/pattern/pattern-tyvar.stderr +++ b/tests/ui/pattern/pattern-tyvar.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match t { | - this expression has type `Bar` LL | Bar::T1(_, Some::(x)) => { - | ^^^^^^^^^^^^^^^^ expected struct `Vec`, found `isize` + | ^^^^^^^^^^^^^^^^ expected `Option>`, found `Option` | = note: expected enum `Option>` found enum `Option` diff --git a/tests/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr b/tests/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr index f5a5f1ab37ae6..a8d0d62360406 100644 --- a/tests/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr +++ b/tests/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return-2.rs:9:41 | LL | let value: &bool = unsafe { &42 }; - | ^^^ expected `bool`, found integer + | ^^^ expected `&bool`, found `&{integer}` | = note: expected reference `&bool` found reference `&{integer}` diff --git a/tests/ui/print_type_sizes/async.stdout b/tests/ui/print_type_sizes/async.stdout index 6e47bb4930dc5..4588c0ebd81b0 100644 --- a/tests/ui/print_type_sizes/async.stdout +++ b/tests/ui/print_type_sizes/async.stdout @@ -1,15 +1,15 @@ print-type-size type: `[async fn body@$DIR/async.rs:8:36: 11:2]`: 16386 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Suspend0`: 16385 bytes -print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes -print-type-size field `.arg`: 8192 bytes -print-type-size field `.__awaitee`: 1 bytes +print-type-size upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size local `.arg`: 8192 bytes +print-type-size local `.__awaitee`: 1 bytes print-type-size variant `Unresumed`: 8192 bytes -print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Returned`: 8192 bytes -print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Panicked`: 8192 bytes -print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes diff --git a/tests/ui/print_type_sizes/generator.stdout b/tests/ui/print_type_sizes/generator.stdout index 28d4a6e6cff40..13d850a66902f 100644 --- a/tests/ui/print_type_sizes/generator.stdout +++ b/tests/ui/print_type_sizes/generator.stdout @@ -1,10 +1,10 @@ print-type-size type: `[generator@$DIR/generator.rs:10:5: 10:14]`: 8193 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Unresumed`: 8192 bytes -print-type-size field `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Returned`: 8192 bytes -print-type-size field `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Panicked`: 8192 bytes -print-type-size field `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Suspend0`: 8192 bytes -print-type-size field `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes +print-type-size upvar `.array`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes diff --git a/tests/ui/print_type_sizes/generator_discr_placement.stdout b/tests/ui/print_type_sizes/generator_discr_placement.stdout index 7f8f4ccae7c14..b294b2d139c3c 100644 --- a/tests/ui/print_type_sizes/generator_discr_placement.stdout +++ b/tests/ui/print_type_sizes/generator_discr_placement.stdout @@ -2,10 +2,10 @@ print-type-size type: `[generator@$DIR/generator_discr_placement.rs:11:13: 11:15 print-type-size discriminant: 1 bytes print-type-size variant `Suspend0`: 7 bytes print-type-size padding: 3 bytes -print-type-size field `.w`: 4 bytes, alignment: 4 bytes +print-type-size local `.w`: 4 bytes, alignment: 4 bytes print-type-size variant `Suspend1`: 7 bytes print-type-size padding: 3 bytes -print-type-size field `.z`: 4 bytes, alignment: 4 bytes +print-type-size local `.z`: 4 bytes, alignment: 4 bytes print-type-size variant `Unresumed`: 0 bytes print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes diff --git a/tests/ui/proc-macro/break-token-spans.stderr b/tests/ui/proc-macro/break-token-spans.stderr index 0a0322b8a3ee2..e69cc3b8cf598 100644 --- a/tests/ui/proc-macro/break-token-spans.stderr +++ b/tests/ui/proc-macro/break-token-spans.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/break-token-spans.rs:14:32 | LL | let a: Option>= true; - | ------------------ ^^^^ expected enum `Option`, found `bool` + | ------------------ ^^^^ expected `Option>`, found `bool` | | | expected due to this | diff --git a/tests/ui/proc-macro/issue-37788.stderr b/tests/ui/proc-macro/issue-37788.stderr index 345520d4852ae..e437bb90b1dfa 100644 --- a/tests/ui/proc-macro/issue-37788.stderr +++ b/tests/ui/proc-macro/issue-37788.stderr @@ -7,7 +7,7 @@ LL | // Test that constructing the `visible_parent_map` (in `cstore_impl.rs` LL | std::cell::Cell::new(0) | ^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;` | | - | expected `()`, found struct `Cell` + | expected `()`, found `Cell<{integer}>` | = note: expected unit type `()` found struct `Cell<{integer}>` diff --git a/tests/ui/proc-macro/resolved-located-at.stderr b/tests/ui/proc-macro/resolved-located-at.stderr index 422820e9d8bd5..0b4dbcba68287 100644 --- a/tests/ui/proc-macro/resolved-located-at.stderr +++ b/tests/ui/proc-macro/resolved-located-at.stderr @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | fn main() { | - expected `()` because of default return type LL | resolve_located_at!(a b) - | ^ expected `()`, found struct `S` + | ^ expected `()`, found `S` | = note: this error originates in the macro `resolve_located_at` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/range/issue-54505-no-literals.stderr b/tests/ui/range/issue-54505-no-literals.stderr index 070dc844563c9..d112983848dee 100644 --- a/tests/ui/range/issue-54505-no-literals.stderr +++ b/tests/ui/range/issue-54505-no-literals.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::Range { start: 0, end: 1 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `Range` + | | expected `&_`, found `Range<{integer}>` | | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }` | arguments to this function are incorrect | @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::Range { start: 0, end: 1 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `Range` + | | expected `&_`, found `Range<{integer}>` | | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }` | arguments to this function are incorrect | @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::RangeFrom { start: 1 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeFrom` + | | expected `&_`, found `RangeFrom<{integer}>` | | help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }` | arguments to this function are incorrect | @@ -58,7 +58,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::RangeFrom { start: 1 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeFrom` + | | expected `&_`, found `RangeFrom<{integer}>` | | help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }` | arguments to this function are incorrect | @@ -76,7 +76,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::RangeFull {}); | ---------- ^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeFull` + | | expected `&_`, found `RangeFull` | | help: consider borrowing here: `&std::ops::RangeFull {}` | arguments to this function are incorrect | @@ -94,7 +94,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::RangeFull {}); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeFull` + | | expected `&_`, found `RangeFull` | | help: consider borrowing here: `&::std::ops::RangeFull {}` | arguments to this function are incorrect | @@ -112,7 +112,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::RangeInclusive::new(0, 1)); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeInclusive` + | | expected `&_`, found `RangeInclusive<{integer}>` | | help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)` | arguments to this function are incorrect | @@ -130,7 +130,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::RangeInclusive::new(0, 1)); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeInclusive` + | | expected `&_`, found `RangeInclusive<{integer}>` | | help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)` | arguments to this function are incorrect | @@ -148,7 +148,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::RangeTo { end: 5 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeTo` + | | expected `&_`, found `RangeTo<{integer}>` | | help: consider borrowing here: `&std::ops::RangeTo { end: 5 }` | arguments to this function are incorrect | @@ -166,7 +166,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::RangeTo { end: 5 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeTo` + | | expected `&_`, found `RangeTo<{integer}>` | | help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }` | arguments to this function are incorrect | @@ -184,7 +184,7 @@ error[E0308]: mismatched types LL | take_range(std::ops::RangeToInclusive { end: 5 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeToInclusive` + | | expected `&_`, found `RangeToInclusive<{integer}>` | | help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }` | arguments to this function are incorrect | @@ -202,7 +202,7 @@ error[E0308]: mismatched types LL | take_range(::std::ops::RangeToInclusive { end: 5 }); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | - | | expected reference, found struct `RangeToInclusive` + | | expected `&_`, found `RangeToInclusive<{integer}>` | | help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }` | arguments to this function are incorrect | diff --git a/tests/ui/range/issue-54505-no-std.stderr b/tests/ui/range/issue-54505-no-std.stderr index 9fb0e54a8a9bf..a6a9f89da7493 100644 --- a/tests/ui/range/issue-54505-no-std.stderr +++ b/tests/ui/range/issue-54505-no-std.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | take_range(0..1); | ---------- ^^^^ | | | - | | expected reference, found struct `Range` + | | expected `&_`, found `Range<{integer}>` | | help: consider borrowing here: `&(0..1)` | arguments to this function are incorrect | @@ -34,7 +34,7 @@ error[E0308]: mismatched types LL | take_range(1..); | ---------- ^^^ | | | - | | expected reference, found struct `RangeFrom` + | | expected `&_`, found `RangeFrom<{integer}>` | | help: consider borrowing here: `&(1..)` | arguments to this function are incorrect | @@ -52,7 +52,7 @@ error[E0308]: mismatched types LL | take_range(..); | ---------- ^^ | | | - | | expected reference, found struct `RangeFull` + | | expected `&_`, found `RangeFull` | | help: consider borrowing here: `&(..)` | arguments to this function are incorrect | @@ -70,7 +70,7 @@ error[E0308]: mismatched types LL | take_range(0..=1); | ---------- ^^^^^ | | | - | | expected reference, found struct `RangeInclusive` + | | expected `&_`, found `RangeInclusive<{integer}>` | | help: consider borrowing here: `&(0..=1)` | arguments to this function are incorrect | @@ -88,7 +88,7 @@ error[E0308]: mismatched types LL | take_range(..5); | ---------- ^^^ | | | - | | expected reference, found struct `RangeTo` + | | expected `&_`, found `RangeTo<{integer}>` | | help: consider borrowing here: `&(..5)` | arguments to this function are incorrect | @@ -106,7 +106,7 @@ error[E0308]: mismatched types LL | take_range(..=42); | ---------- ^^^^^ | | | - | | expected reference, found struct `RangeToInclusive` + | | expected `&_`, found `RangeToInclusive<{integer}>` | | help: consider borrowing here: `&(..=42)` | arguments to this function are incorrect | diff --git a/tests/ui/range/issue-54505.stderr b/tests/ui/range/issue-54505.stderr index 9eec169404cdf..eda047b507a33 100644 --- a/tests/ui/range/issue-54505.stderr +++ b/tests/ui/range/issue-54505.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | take_range(0..1); | ---------- ^^^^ | | | - | | expected reference, found struct `Range` + | | expected `&_`, found `Range<{integer}>` | | help: consider borrowing here: `&(0..1)` | arguments to this function are incorrect | @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | take_range(1..); | ---------- ^^^ | | | - | | expected reference, found struct `RangeFrom` + | | expected `&_`, found `RangeFrom<{integer}>` | | help: consider borrowing here: `&(1..)` | arguments to this function are incorrect | @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | take_range(..); | ---------- ^^ | | | - | | expected reference, found struct `RangeFull` + | | expected `&_`, found `RangeFull` | | help: consider borrowing here: `&(..)` | arguments to this function are incorrect | @@ -58,7 +58,7 @@ error[E0308]: mismatched types LL | take_range(0..=1); | ---------- ^^^^^ | | | - | | expected reference, found struct `RangeInclusive` + | | expected `&_`, found `RangeInclusive<{integer}>` | | help: consider borrowing here: `&(0..=1)` | arguments to this function are incorrect | @@ -76,7 +76,7 @@ error[E0308]: mismatched types LL | take_range(..5); | ---------- ^^^ | | | - | | expected reference, found struct `RangeTo` + | | expected `&_`, found `RangeTo<{integer}>` | | help: consider borrowing here: `&(..5)` | arguments to this function are incorrect | @@ -94,7 +94,7 @@ error[E0308]: mismatched types LL | take_range(..=42); | ---------- ^^^^^ | | | - | | expected reference, found struct `RangeToInclusive` + | | expected `&_`, found `RangeToInclusive<{integer}>` | | help: consider borrowing here: `&(..=42)` | arguments to this function are incorrect | diff --git a/tests/ui/range/issue-73553-misinterp-range-literal.stderr b/tests/ui/range/issue-73553-misinterp-range-literal.stderr index d08d9b1345d4a..77595b3678ebc 100644 --- a/tests/ui/range/issue-73553-misinterp-range-literal.stderr +++ b/tests/ui/range/issue-73553-misinterp-range-literal.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | demo(tell(1)..tell(10)); | ---- ^^^^^^^^^^^^^^^^^ | | | - | | expected `&Range`, found struct `Range` + | | expected `&Range`, found `Range` | | help: consider borrowing here: `&(tell(1)..tell(10))` | arguments to this function are incorrect | @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | demo(1..10); | ---- ^^^^^ | | | - | | expected `&Range`, found struct `Range` + | | expected `&Range`, found `Range<{integer}>` | | help: consider borrowing here: `&(1..10)` | arguments to this function are incorrect | diff --git a/tests/ui/regions/issue-102374.stderr b/tests/ui/regions/issue-102374.stderr index 157850693ab50..af64b6867bb0c 100644 --- a/tests/ui/regions/issue-102374.stderr +++ b/tests/ui/regions/issue-102374.stderr @@ -7,7 +7,7 @@ LL | f | ^ expected `i32`, found fn pointer | = note: expected type `i32` - found fn pointer `for<'z1, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x, 'y, 'z, 'z0> fn(Cell<...>)` + found fn pointer `fn(Cell<...>)` the full type name has been written to '$TEST_BUILD_DIR/regions/issue-102374/issue-102374.long-type-hash.txt' error: aborting due to previous error diff --git a/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr index 3b62c7b61c1b1..bb5bc6f66a5f2 100644 --- a/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr +++ b/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr @@ -6,6 +6,7 @@ LL | let _: fn(&mut &isize, &mut &isize) = a; | = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)` found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}` + = note: when the arguments and return types match, functions can be coerced to function pointers error: aborting due to previous error diff --git a/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr index 8a18a234b5c4e..dbe9e9b1a2e56 100644 --- a/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr +++ b/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -6,6 +6,7 @@ LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; | = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f> fn(&'a mut &'b isize, &'c mut &'d isize, &'e mut &'f isize)` found fn item `for<'a, 'b, 'c> fn(&'a mut &isize, &'b mut &isize, &'c mut &isize) {a::<'_, '_, '_>}` + = note: when the arguments and return types match, functions can be coerced to function pointers error: aborting due to previous error diff --git a/tests/ui/regions/regions-fn-subtyping-return-static-fail.stderr b/tests/ui/regions/regions-fn-subtyping-return-static-fail.stderr index 8d82ff958ff3a..766a3d0337c06 100644 --- a/tests/ui/regions/regions-fn-subtyping-return-static-fail.stderr +++ b/tests/ui/regions/regions-fn-subtyping-return-static-fail.stderr @@ -8,6 +8,7 @@ LL | want_G(baz); | = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S` found fn item `for<'a> fn(&'a S) -> &'a S {baz}` + = note: when the arguments and return types match, functions can be coerced to function pointers note: function defined here --> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4 | diff --git a/tests/ui/regions/regions-lifetime-bounds-on-fns.stderr b/tests/ui/regions/regions-lifetime-bounds-on-fns.stderr index 17a9019436a1e..df0fd069edcad 100644 --- a/tests/ui/regions/regions-lifetime-bounds-on-fns.stderr +++ b/tests/ui/regions/regions-lifetime-bounds-on-fns.stderr @@ -6,6 +6,7 @@ LL | let _: fn(&mut &isize, &mut &isize) = a; | = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)` found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}` + = note: when the arguments and return types match, functions can be coerced to function pointers error: aborting due to previous error diff --git a/tests/ui/reify-intrinsic.stderr b/tests/ui/reify-intrinsic.stderr index 310b6c224e0e7..9f9034a30c736 100644 --- a/tests/ui/reify-intrinsic.stderr +++ b/tests/ui/reify-intrinsic.stderr @@ -8,6 +8,7 @@ LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::tr | = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize` found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` + = note: when the arguments and return types match, functions can be coerced to function pointers error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid --> $DIR/reify-intrinsic.rs:11:13 diff --git a/tests/ui/repeat-expr/repeat_count.rs b/tests/ui/repeat-expr/repeat_count.rs index 96abff4ab413f..18610bc5bb086 100644 --- a/tests/ui/repeat-expr/repeat_count.rs +++ b/tests/ui/repeat-expr/repeat_count.rs @@ -30,5 +30,5 @@ fn main() { } let g = [0; G { g: () }]; //~^ ERROR mismatched types - //~| expected `usize`, found struct `G` + //~| expected `usize`, found `G` } diff --git a/tests/ui/repeat-expr/repeat_count.stderr b/tests/ui/repeat-expr/repeat_count.stderr index e222c141f8b6a..8a1ed8f3b9c7c 100644 --- a/tests/ui/repeat-expr/repeat_count.stderr +++ b/tests/ui/repeat-expr/repeat_count.stderr @@ -34,7 +34,7 @@ error[E0308]: mismatched types --> $DIR/repeat_count.rs:31:17 | LL | let g = [0; G { g: () }]; - | ^^^^^^^^^^^ expected `usize`, found struct `G` + | ^^^^^^^^^^^ expected `usize`, found `G` error[E0308]: mismatched types --> $DIR/repeat_count.rs:19:17 diff --git a/tests/ui/resolve/name-clash-nullary.stderr b/tests/ui/resolve/name-clash-nullary.stderr index 76c4b5914c167..fffd3027afdb3 100644 --- a/tests/ui/resolve/name-clash-nullary.stderr +++ b/tests/ui/resolve/name-clash-nullary.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let None: isize = 42; | ^^^^ ----- expected due to this | | - | expected `isize`, found enum `Option` + | expected `isize`, found `Option<_>` | = note: expected type `isize` found enum `Option<_>` diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index a24fe4d23ea25..3c051429fd0e9 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -267,7 +267,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: Z = Z::Fn; - | - ^^^^^ expected enum `Z`, found enum constructor + | - ^^^^^ expected `Z`, found enum constructor | | | expected due to this | @@ -308,7 +308,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: E = m::E::Fn; - | - ^^^^^^^^ expected enum `E`, found enum constructor + | - ^^^^^^^^ expected `E`, found enum constructor | | | expected due to this | @@ -349,7 +349,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: E = E::Fn; - | - ^^^^^ expected enum `E`, found enum constructor + | - ^^^^^ expected `E`, found enum constructor | | | expected due to this | diff --git a/tests/ui/resolve/resolve-inconsistent-names.stderr b/tests/ui/resolve/resolve-inconsistent-names.stderr index 773c9f6cd1114..023db303dd0f1 100644 --- a/tests/ui/resolve/resolve-inconsistent-names.stderr +++ b/tests/ui/resolve/resolve-inconsistent-names.stderr @@ -87,7 +87,7 @@ error[E0308]: mismatched types LL | match x { | - this expression has type `(E, E)` LL | (A, B) | (ref B, c) | (c, A) => () - | - ^^^^^ expected enum `E`, found `&E` + | - ^^^^^ expected `E`, found `&E` | | | first introduced with type `E` here | diff --git a/tests/ui/return/return-type.stderr b/tests/ui/return/return-type.stderr index 5af136e601123..60d538eba882a 100644 --- a/tests/ui/return/return-type.stderr +++ b/tests/ui/return/return-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/return-type.rs:10:5 | LL | foo(4 as usize) - | ^^^^^^^^^^^^^^^ expected `()`, found struct `S` + | ^^^^^^^^^^^^^^^ expected `()`, found `S` | = note: expected unit type `()` found struct `S` diff --git a/tests/ui/return/tail-expr-as-potential-return.stderr b/tests/ui/return/tail-expr-as-potential-return.stderr index 9183b4599ba6d..ccb208fc6c4ae 100644 --- a/tests/ui/return/tail-expr-as-potential-return.stderr +++ b/tests/ui/return/tail-expr-as-potential-return.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | / if x { LL | | Err(42) - | | ^^^^^^^ expected `()`, found enum `Result` + | | ^^^^^^^ expected `()`, found `Result<_, {integer}>` LL | | //| HELP you might have meant to return this value LL | | } | |_____- expected this to be `()` @@ -35,7 +35,7 @@ error[E0308]: mismatched types | LL | / if x { LL | | Err(42) - | | ^^^^^^^ expected `()`, found enum `Result` + | | ^^^^^^^ expected `()`, found `Result<_, {integer}>` LL | | //| HELP you might have meant to return this value LL | | } | |_____- expected this to be `()` diff --git a/tests/ui/rfc-2005-default-binding-mode/const.stderr b/tests/ui/rfc-2005-default-binding-mode/const.stderr index 0f567125432b2..fc06de90a0031 100644 --- a/tests/ui/rfc-2005-default-binding-mode/const.stderr +++ b/tests/ui/rfc-2005-default-binding-mode/const.stderr @@ -9,7 +9,7 @@ LL | match &f { LL | FOO => {}, | ^^^ | | - | expected `&Foo`, found struct `Foo` + | expected `&Foo`, found `Foo` | `FOO` is interpreted as a constant, not a new binding | help: introduce a new binding instead: `other_foo` diff --git a/tests/ui/rfc-2005-default-binding-mode/lit.stderr b/tests/ui/rfc-2005-default-binding-mode/lit.stderr index 11bc170cdfa1b..181f57899a910 100644 --- a/tests/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/tests/ui/rfc-2005-default-binding-mode/lit.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match &s { | -- this expression has type `&&str` LL | "abc" => true, - | ^^^^^ expected `&str`, found `str` + | ^^^^^ expected `&&str`, found `&str` | = note: expected reference `&&str` found reference `&'static str` @@ -15,7 +15,7 @@ error[E0308]: mismatched types LL | match &s { | -- this expression has type `&&[u8]` LL | b"abc" => true, - | ^^^^^^ expected `&[u8]`, found array `[u8; 3]` + | ^^^^^^ expected `&&[u8]`, found `&[u8; 3]` | = note: expected reference `&&[u8]` found reference `&'static [u8; 3]` diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr index f8ed156b57e39..c209caab5ecb6 100644 --- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr +++ b/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found enum `UninhabitedEnum` + | ^ expected `A`, found `UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions.rs:27:5 @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found struct `UninhabitedTupleStruct` + | ^ expected `A`, found `UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:31:5 @@ -20,7 +20,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found struct `UninhabitedStruct` + | ^ expected `A`, found `UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:35:5 @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found enum `UninhabitedVariants` + | ^ expected `A`, found `UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr index fd2c56974bd4a..289433edf6292 100644 --- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr +++ b/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found enum `UninhabitedEnum` + | ^ expected `A`, found `UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:34:5 @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found struct `UninhabitedTupleStruct` + | ^ expected `A`, found `UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:38:5 @@ -20,7 +20,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found struct `UninhabitedStruct` + | ^ expected `A`, found `UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:42:5 @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A { | - expected `A` because of return type LL | x - | ^ expected struct `A`, found enum `UninhabitedVariants` + | ^ expected `A`, found `UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/tests/ui/rfc-2294-if-let-guard/typeck.stderr b/tests/ui/rfc-2294-if-let-guard/typeck.stderr index dd1f4826fe051..4ce97a68a911a 100644 --- a/tests/ui/rfc-2294-if-let-guard/typeck.stderr +++ b/tests/ui/rfc-2294-if-let-guard/typeck.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | Ok(x) if let Err(_) = x => {}, | ^^^^^^ - this expression has type `Option` | | - | expected enum `Option`, found enum `Result` + | expected `Option`, found `Result<_, _>` | = note: expected enum `Option` found enum `Result<_, _>` @@ -15,7 +15,7 @@ error[E0308]: mismatched types LL | Ok(x) if let 0 = x => {}, | ^ - this expression has type `Option` | | - | expected enum `Option`, found integer + | expected `Option`, found integer | = note: expected enum `Option` found type `{integer}` diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 3028f8dbdbf77..81933173c25c1 100644 --- a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -1516,7 +1516,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:157:8 | LL | if true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1525,7 +1525,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:161:8 | LL | if ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeTo` | = note: expected type `bool` found struct `RangeTo` @@ -1534,7 +1534,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:165:8 | LL | if (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom` | = note: expected type `bool` found struct `RangeFrom` @@ -1545,7 +1545,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1554,7 +1554,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:171:8 | LL | if let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1565,7 +1565,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1574,7 +1574,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:175:8 | LL | if let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1585,7 +1585,7 @@ error[E0308]: mismatched types LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` | | - | expected fn pointer, found struct `Range` + | expected fn pointer, found `Range<_>` | = note: expected fn pointer `fn() -> bool` found struct `std::ops::Range<_>` @@ -1607,7 +1607,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:182:8 | LL | if let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1618,7 +1618,7 @@ error[E0308]: mismatched types LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1639,7 +1639,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:190:8 | LL | if let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1710,7 +1710,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:249:11 | LL | while true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1719,7 +1719,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:253:11 | LL | while ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeTo` | = note: expected type `bool` found struct `RangeTo` @@ -1728,7 +1728,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:257:11 | LL | while (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom` | = note: expected type `bool` found struct `RangeFrom` @@ -1739,7 +1739,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1748,7 +1748,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:263:11 | LL | while let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1759,7 +1759,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1768,7 +1768,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:267:11 | LL | while let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1779,7 +1779,7 @@ error[E0308]: mismatched types LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` | | - | expected fn pointer, found struct `Range` + | expected fn pointer, found `Range<_>` | = note: expected fn pointer `fn() -> bool` found struct `std::ops::Range<_>` @@ -1801,7 +1801,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:274:11 | LL | while let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1812,7 +1812,7 @@ error[E0308]: mismatched types LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1833,7 +1833,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:282:11 | LL | while let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1883,7 +1883,7 @@ error[E0308]: mismatched types LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr b/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr index f34ccecdd45e6..9bc3e754126db 100644 --- a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr +++ b/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr @@ -38,10 +38,10 @@ help: add a block here LL | if let Some(n) = opt else { | ^ help: remove the `if` if you meant to write a `let...else` statement - --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:5 | -LL | if let Some(n) = opt else { - | ^^ +LL - if let Some(n) = opt else { +LL + let Some(n) = opt else { + | error: this `if` expression is missing a block after the condition --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:5 @@ -106,7 +106,7 @@ error[E0308]: mismatched types --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19 | LL | let Some(n) = opt && n == 1 else { - | ^^^ expected `bool`, found enum `Option` + | ^^^ expected `bool`, found `Option` | = note: expected type `bool` found enum `Option` @@ -117,7 +117,7 @@ error[E0308]: mismatched types LL | let Some(n) = opt && n == 1 else { | ^^^^^^^ ------------- this expression has type `bool` | | - | expected `bool`, found enum `Option` + | expected `bool`, found `Option<_>` | = note: expected type `bool` found enum `Option<_>` @@ -126,7 +126,7 @@ error[E0308]: mismatched types --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19 | LL | let Some(n) = opt && let another = n else { - | ^^^ expected `bool`, found enum `Option` + | ^^^ expected `bool`, found `Option` | = note: expected type `bool` found enum `Option` @@ -137,7 +137,7 @@ error[E0308]: mismatched types LL | let Some(n) = opt && let another = n else { | ^^^^^^^ ---------------------- this expression has type `bool` | | - | expected `bool`, found enum `Option` + | expected `bool`, found `Option<_>` | = note: expected type `bool` found enum `Option<_>` diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr index 07f6dc906c6bb..b0ac5dc44ad9a 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr @@ -5,16 +5,19 @@ LL | #[target_feature(enable = "sse2")] | ---------------------------------- `#[target_feature]` added here ... LL | let foo: fn() = foo; - | ---- ^^^ - | | | - | | cannot coerce functions with `#[target_feature]` to safe function pointers - | | help: consider casting to a fn pointer: `foo as fn()` + | ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers + | | | expected due to this | = note: expected fn pointer `fn()` found fn item `fn() {foo}` = note: fn items are distinct from fn pointers = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers + = note: when the arguments and return types match, functions can be coerced to function pointers +help: consider casting to a fn pointer + | +LL | let foo: fn() = foo as fn(); + | ~~~~~~~~~~~ error: aborting due to previous error diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr index 07f6dc906c6bb..b0ac5dc44ad9a 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr @@ -5,16 +5,19 @@ LL | #[target_feature(enable = "sse2")] | ---------------------------------- `#[target_feature]` added here ... LL | let foo: fn() = foo; - | ---- ^^^ - | | | - | | cannot coerce functions with `#[target_feature]` to safe function pointers - | | help: consider casting to a fn pointer: `foo as fn()` + | ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers + | | | expected due to this | = note: expected fn pointer `fn()` found fn item `fn() {foo}` = note: fn items are distinct from fn pointers = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers + = note: when the arguments and return types match, functions can be coerced to function pointers +help: consider casting to a fn pointer + | +LL | let foo: fn() = foo as fn(); + | ~~~~~~~~~~~ error: aborting due to previous error diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr index 2217b8c049863..48e46d3d1d1aa 100644 --- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr +++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/feature-gate.rs:22:11 | LL | ..m1 - | ^^ expected struct `State2`, found struct `State1` + | ^^ expected `Machine`, found `Machine` | = note: expected struct `Machine` found struct `Machine` diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr index 5957ea7c9efdd..831731ba47419 100644 --- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr +++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-92010-trait-bound-not-satisfied.rs:8:43 | LL | fn y(&self, y: f64) -> Self { P{y, .. self.clone() } } - | ^^^^^^^^^^^^ expected struct `P`, found `&P` + | ^^^^^^^^^^^^ expected `P`, found `&P` | = note: expected struct `P` found reference `&P` diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr index 6f31b1a962078..f31b311c732d6 100644 --- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr +++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-generic-update.rs:46:11 | LL | ..m1 - | ^^ expected `i32`, found `f64` + | ^^ expected `Machine<'_, i32, f64>`, found `Machine<'_, f64, f64>` | = note: expected struct `Machine<'_, i32, _>` found struct `Machine<'_, f64, _>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/type-generic-update.rs:51:11 | LL | ..m1 - | ^^ expected `i32`, found `f64` + | ^^ expected `Machine<'_, i32, i32>`, found `Machine<'_, f64, f64>` | = note: expected struct `Machine<'_, i32, i32>` found struct `Machine<'_, f64, f64>` diff --git a/tests/ui/self/issue-61882.stderr b/tests/ui/self/issue-61882.stderr index dd7194dc2e840..96f4e41de174b 100644 --- a/tests/ui/self/issue-61882.stderr +++ b/tests/ui/self/issue-61882.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/issue-61882.rs:4:22 | LL | const B: A = Self(0); - | ^^^^^^^ expected `u8`, found `bool` + | ^^^^^^^ expected `A`, found `A` | = note: expected struct `A` found struct `A` diff --git a/tests/ui/slightly-nice-generic-literal-messages.rs b/tests/ui/slightly-nice-generic-literal-messages.rs index a48598ce8d5a0..268009f65a5c1 100644 --- a/tests/ui/slightly-nice-generic-literal-messages.rs +++ b/tests/ui/slightly-nice-generic-literal-messages.rs @@ -8,7 +8,7 @@ fn main() { //~^ ERROR mismatched types //~| expected struct `Foo<{float}, _>` //~| found type `{integer}` - //~| expected struct `Foo`, found integer + //~| expected `Foo<{float}, _>`, found integer } } diff --git a/tests/ui/slightly-nice-generic-literal-messages.stderr b/tests/ui/slightly-nice-generic-literal-messages.stderr index 14f01f0ebdf73..83ef522ab46e8 100644 --- a/tests/ui/slightly-nice-generic-literal-messages.stderr +++ b/tests/ui/slightly-nice-generic-literal-messages.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match Foo(1.1, marker::PhantomData) { | ----------------------------- this expression has type `Foo<{float}, _>` LL | 1 => {} - | ^ expected struct `Foo`, found integer + | ^ expected `Foo<{float}, _>`, found integer | = note: expected struct `Foo<{float}, _>` found type `{integer}` diff --git a/tests/ui/span/coerce-suggestions.stderr b/tests/ui/span/coerce-suggestions.stderr index db784d5fe6cfc..bb30f000ea7e8 100644 --- a/tests/ui/span/coerce-suggestions.stderr +++ b/tests/ui/span/coerce-suggestions.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:7:20 | LL | let x: usize = String::new(); - | ----- ^^^^^^^^^^^^^ expected `usize`, found struct `String` + | ----- ^^^^^^^^^^^^^ expected `usize`, found `String` | | | expected due to this @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | let x: &str = String::new(); | ---- ^^^^^^^^^^^^^ | | | - | | expected `&str`, found struct `String` + | | expected `&str`, found `String` | | help: consider borrowing here: `&String::new()` | expected due to this @@ -63,7 +63,7 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:21:9 | LL | s = format!("foo"); - | ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String` + | ^^^^^^^^^^^^^^ expected `&mut String`, found `String` | = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/span/issue-33884.stderr b/tests/ui/span/issue-33884.stderr index aee1530851773..8cece07cd48c2 100644 --- a/tests/ui/span/issue-33884.stderr +++ b/tests/ui/span/issue-33884.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-33884.rs:6:22 | LL | stream.write_fmt(format!("message received")) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Arguments`, found struct `String` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Arguments<'_>`, found `String` | = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/span/issue-39018.stderr b/tests/ui/span/issue-39018.stderr index 5d4d692b2cffb..771f21c45da68 100644 --- a/tests/ui/span/issue-39018.stderr +++ b/tests/ui/span/issue-39018.stderr @@ -80,7 +80,7 @@ error[E0308]: mismatched types LL | let _ = a + b; | ^ | | - | expected `&str`, found struct `String` + | expected `&str`, found `String` | help: consider borrowing here: `&b` error[E0369]: cannot add `String` to `&String` diff --git a/tests/ui/specialization/specialization-default-types.stderr b/tests/ui/specialization/specialization-default-types.stderr index 61a556a931168..ecccf29a107dc 100644 --- a/tests/ui/specialization/specialization-default-types.stderr +++ b/tests/ui/specialization/specialization-default-types.stderr @@ -16,7 +16,7 @@ LL | default type Output = Box; LL | default fn generate(self) -> Self::Output { | ------------ expected `::Output` because of return type LL | Box::new(self) - | ^^^^^^^^^^^^^^ expected associated type, found struct `Box` + | ^^^^^^^^^^^^^^ expected associated type, found `Box` | = note: expected associated type `::Output` found struct `Box` @@ -27,7 +27,7 @@ error[E0308]: mismatched types LL | fn trouble(t: T) -> Box { | ------ expected `Box` because of return type LL | Example::generate(t) - | ^^^^^^^^^^^^^^^^^^^^ expected struct `Box`, found associated type + | ^^^^^^^^^^^^^^^^^^^^ expected `Box`, found associated type | = note: expected struct `Box` found associated type `::Output` diff --git a/tests/ui/static/bad-const-type.rs b/tests/ui/static/bad-const-type.rs index 934ee353da292..24fd67ecbaacd 100644 --- a/tests/ui/static/bad-const-type.rs +++ b/tests/ui/static/bad-const-type.rs @@ -1,4 +1,4 @@ static i: String = 10; //~^ ERROR mismatched types -//~| expected struct `String`, found integer +//~| expected `String`, found integer fn main() { println!("{}", i); } diff --git a/tests/ui/static/bad-const-type.stderr b/tests/ui/static/bad-const-type.stderr index dcc1ee07cbd04..2e930f4596e04 100644 --- a/tests/ui/static/bad-const-type.stderr +++ b/tests/ui/static/bad-const-type.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | static i: String = 10; | ^^- help: try using a conversion method: `.to_string()` | | - | expected struct `String`, found integer + | expected `String`, found integer error: aborting due to previous error diff --git a/tests/ui/static/issue-5216.stderr b/tests/ui/static/issue-5216.stderr index 1afff28f0b4e1..99c8b1aa131a7 100644 --- a/tests/ui/static/issue-5216.stderr +++ b/tests/ui/static/issue-5216.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-5216.rs:3:21 | LL | pub static C: S = S(f); - | - ^ expected struct `Box`, found fn item + | - ^ expected `Box`, found fn item | | | arguments to this struct are incorrect | @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/issue-5216.rs:8:19 | LL | pub static D: T = g; - | ^ expected struct `Box`, found fn item + | ^ expected `Box`, found fn item | = note: expected struct `Box<(dyn FnMut() + Sync + 'static)>` found fn item `fn() {g}` diff --git a/tests/ui/static/static-reference-to-fn-1.stderr b/tests/ui/static/static-reference-to-fn-1.stderr index f68939d0ec8c9..b68352b518314 100644 --- a/tests/ui/static/static-reference-to-fn-1.stderr +++ b/tests/ui/static/static-reference-to-fn-1.stderr @@ -2,14 +2,16 @@ error[E0308]: mismatched types --> $DIR/static-reference-to-fn-1.rs:17:15 | LL | func: &foo, - | ^^^^ - | | - | expected fn pointer, found fn item - | help: consider casting to a fn pointer: `&(foo as fn() -> Option)` + | ^^^^ expected `&fn() -> Option`, found `&fn() -> Option {foo}` | = note: expected reference `&fn() -> Option` found reference `&fn() -> Option {foo}` = note: fn items are distinct from fn pointers + = note: when the arguments and return types match, functions can be coerced to function pointers +help: consider casting to a fn pointer + | +LL | func: &(foo as fn() -> Option), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/tests/ui/str/str-lit-type-mismatch.stderr b/tests/ui/str/str-lit-type-mismatch.stderr index 6b56cd6f3fc12..5ae7df5a2ecd1 100644 --- a/tests/ui/str/str-lit-type-mismatch.stderr +++ b/tests/ui/str/str-lit-type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/str-lit-type-mismatch.rs:2:20 | LL | let x: &[u8] = "foo"; - | ----- ^^^^^ expected slice `[u8]`, found `str` + | ----- ^^^^^ expected `&[u8]`, found `&str` | | | expected due to this | @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/str-lit-type-mismatch.rs:3:23 | LL | let y: &[u8; 4] = "baaa"; - | -------- ^^^^^^ expected array `[u8; 4]`, found `str` + | -------- ^^^^^^ expected `&[u8; 4]`, found `&str` | | | expected due to this | @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/str-lit-type-mismatch.rs:4:19 | LL | let z: &str = b"foo"; - | ---- ^^^^^^ expected `str`, found array `[u8; 3]` + | ---- ^^^^^^ expected `&str`, found `&[u8; 3]` | | | expected due to this | diff --git a/tests/ui/structs/struct-base-wrong-type.stderr b/tests/ui/structs/struct-base-wrong-type.stderr index b039ce2cc9209..1299af72ba935 100644 --- a/tests/ui/structs/struct-base-wrong-type.stderr +++ b/tests/ui/structs/struct-base-wrong-type.stderr @@ -2,25 +2,25 @@ error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:7:33 | LL | static foo: Foo = Foo { a: 2, ..bar }; - | ^^^ expected struct `Foo`, found struct `Bar` + | ^^^ expected `Foo`, found `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:8:35 | LL | static foo_i: Foo = Foo { a: 2, ..4 }; - | ^ expected struct `Foo`, found integer + | ^ expected `Foo`, found integer error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:12:27 | LL | let f = Foo { a: 2, ..b }; - | ^ expected struct `Foo`, found struct `Bar` + | ^ expected `Foo`, found `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:13:34 | LL | let f__isize = Foo { a: 2, ..4 }; - | ^ expected struct `Foo`, found integer + | ^ expected `Foo`, found integer error: aborting due to 4 previous errors diff --git a/tests/ui/structs/struct-path-self-type-mismatch.stderr b/tests/ui/structs/struct-path-self-type-mismatch.stderr index b55a2cbf7527c..cddc1356194bf 100644 --- a/tests/ui/structs/struct-path-self-type-mismatch.stderr +++ b/tests/ui/structs/struct-path-self-type-mismatch.stderr @@ -34,7 +34,7 @@ LL | | LL | | inner: u LL | | LL | | } - | |_________^ expected type parameter `U`, found type parameter `T` + | |_________^ expected `Foo`, found `Foo` | = note: expected struct `Foo` found struct `Foo` diff --git a/tests/ui/structs/struct-record-suggestion.stderr b/tests/ui/structs/struct-record-suggestion.stderr index 9b751d1b66c54..38274f8d9c0d5 100644 --- a/tests/ui/structs/struct-record-suggestion.stderr +++ b/tests/ui/structs/struct-record-suggestion.stderr @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/struct-record-suggestion.rs:23:20 | LL | let q = B { b: 1..Default::default() }; - | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `Range<{integer}>` | = note: expected type `u32` found struct `std::ops::Range<{integer}>` diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr index 3d64fc601df98..3e3f9ea06eff3 100644 --- a/tests/ui/structs/structure-constructor-type-mismatch.stderr +++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr @@ -104,7 +104,7 @@ error[E0308]: mismatched types LL | match (Point { x: 1, y: 2 }) { | ---------------------- this expression has type `Point<{integer}>` LL | PointF:: { .. } => {} - | ^^^^^^^^^^^^^^^^^^^^ expected integer, found `f32` + | ^^^^^^^^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point` | = note: expected struct `Point<{integer}>` found struct `Point` @@ -115,7 +115,7 @@ error[E0308]: mismatched types LL | match (Point { x: 1, y: 2 }) { | ---------------------- this expression has type `Point<{integer}>` LL | PointF { .. } => {} - | ^^^^^^^^^^^^^ expected integer, found `f32` + | ^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point` | = note: expected struct `Point<{integer}>` found struct `Point` @@ -126,7 +126,7 @@ error[E0308]: mismatched types LL | match (Pair { x: 1, y: 2 }) { | --------------------- this expression has type `Pair<{integer}, {integer}>` LL | PairF:: { .. } => {} - | ^^^^^^^^^^^^^^^^^^^ expected integer, found `f32` + | ^^^^^^^^^^^^^^^^^^^ expected `Pair<{integer}, {integer}>`, found `Pair` | = note: expected struct `Pair<{integer}, {integer}>` found struct `Pair` diff --git a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr index bc097bf6eb451..e973636381600 100644 --- a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -4,7 +4,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied LL | let _: Option<(i32, bool)> = Some(1, 2); | ^^^^ - argument of type `{integer}` unexpected | -note: expected tuple, found integer +note: expected `(i32, bool)`, found integer --> $DIR/args-instead-of-tuple-errors.rs:6:39 | LL | let _: Option<(i32, bool)> = Some(1, 2); @@ -31,7 +31,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied LL | int_bool(1, 2); | ^^^^^^^^ - argument of type `{integer}` unexpected | -note: expected tuple, found integer +note: expected `(i32, bool)`, found integer --> $DIR/args-instead-of-tuple-errors.rs:8:14 | LL | int_bool(1, 2); @@ -65,7 +65,7 @@ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple-errors.rs:14:34 | LL | let _: Option<(i32,)> = Some(5_usize); - | ---- ^^^^^^^ expected tuple, found `usize` + | ---- ^^^^^^^ expected `(i32,)`, found `usize` | | | arguments to this enum variant are incorrect | @@ -85,7 +85,7 @@ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple-errors.rs:17:34 | LL | let _: Option<(i32,)> = Some((5_usize)); - | ---- ^^^^^^^^^ expected tuple, found `usize` + | ---- ^^^^^^^^^ expected `(i32,)`, found `usize` | | | arguments to this enum variant are incorrect | diff --git a/tests/ui/suggestions/args-instead-of-tuple.stderr b/tests/ui/suggestions/args-instead-of-tuple.stderr index 3ed9dbf4abbc6..0bdf10b0d63a4 100644 --- a/tests/ui/suggestions/args-instead-of-tuple.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple.stderr @@ -41,7 +41,7 @@ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple.rs:14:34 | LL | let _: Option<(i32,)> = Some(3); - | ---- ^ expected tuple, found integer + | ---- ^ expected `(i32,)`, found integer | | | arguments to this enum variant are incorrect | @@ -58,7 +58,7 @@ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple.rs:17:34 | LL | let _: Option<(i32,)> = Some((3)); - | ---- ^^^ expected tuple, found integer + | ---- ^^^ expected `(i32,)`, found integer | | | arguments to this enum variant are incorrect | diff --git a/tests/ui/suggestions/as-ref.stderr b/tests/ui/suggestions/as-ref.stderr index deafa9f48d459..0ee343ebf9f11 100644 --- a/tests/ui/suggestions/as-ref.stderr +++ b/tests/ui/suggestions/as-ref.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:7:29 | LL | opt.map(|arg| takes_ref(arg)); - | --- --------- ^^^ expected `&Foo`, found struct `Foo` + | --- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().map` @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:8:39 | LL | opt.and_then(|arg| Some(takes_ref(arg))); - | -------- --------- ^^^ expected `&Foo`, found struct `Foo` + | -------- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().and_then` @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:10:29 | LL | opt.map(|arg| takes_ref(arg)); - | --- --------- ^^^ expected `&Foo`, found struct `Foo` + | --- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().map` @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:11:37 | LL | opt.and_then(|arg| Ok(takes_ref(arg))); - | -------- --------- ^^^ expected `&Foo`, found struct `Foo` + | -------- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().and_then` @@ -64,7 +64,7 @@ error[E0308]: mismatched types LL | let y: Option<&usize> = x; | -------------- ^ | | | - | | expected enum `Option`, found `&Option` + | | expected `Option<&usize>`, found `&Option` | | help: you can convert from `&Option` to `Option<&T>` using `.as_ref()`: `x.as_ref()` | expected due to this | @@ -75,7 +75,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:15:37 | LL | let y: Result<&usize, &usize> = x; - | ---------------------- ^ expected enum `Result`, found reference + | ---------------------- ^ expected `Result<&usize, &usize>`, found `&Result` | | | expected due to this | @@ -90,7 +90,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:19:36 | LL | let y: Result<&usize, usize> = x; - | --------------------- ^ expected enum `Result`, found reference + | --------------------- ^ expected `Result<&usize, usize>`, found `&Result` | | | expected due to this | @@ -101,7 +101,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:22:42 | LL | multiple_ref_opt.map(|arg| takes_ref(arg)); - | --- --------- ^^^ expected `&Foo`, found struct `Foo` + | --- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().map` @@ -116,7 +116,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:23:52 | LL | multiple_ref_opt.and_then(|arg| Some(takes_ref(arg))); - | -------- --------- ^^^ expected `&Foo`, found struct `Foo` + | -------- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().and_then` @@ -131,7 +131,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:25:45 | LL | multiple_ref_result.map(|arg| takes_ref(arg)); - | --- --------- ^^^ expected `&Foo`, found struct `Foo` + | --- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().map` @@ -146,7 +146,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:26:53 | LL | multiple_ref_result.and_then(|arg| Ok(takes_ref(arg))); - | -------- --------- ^^^ expected `&Foo`, found struct `Foo` + | -------- --------- ^^^ expected `&Foo`, found `Foo` | | | | | arguments to this function are incorrect | help: consider using `as_ref` instead: `as_ref().and_then` diff --git a/tests/ui/suggestions/boxed-variant-field.stderr b/tests/ui/suggestions/boxed-variant-field.stderr index 9ae36a06a7155..1adbc05406cbe 100644 --- a/tests/ui/suggestions/boxed-variant-field.stderr +++ b/tests/ui/suggestions/boxed-variant-field.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/boxed-variant-field.rs:9:31 | LL | Ty::List(elem) => foo(elem), - | --- ^^^^ expected enum `Ty`, found struct `Box` + | --- ^^^^ expected `Ty`, found `Box` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/call-boxed.stderr b/tests/ui/suggestions/call-boxed.stderr index 9b619ac9a3f50..9b31ee07cca7d 100644 --- a/tests/ui/suggestions/call-boxed.stderr +++ b/tests/ui/suggestions/call-boxed.stderr @@ -6,7 +6,7 @@ LL | let mut x = 1i32; LL | let y = Box::new(|| 1); | -- the found closure LL | x = y; - | ^ expected `i32`, found struct `Box` + | ^ expected `i32`, found `Box<[closure@call-boxed.rs:3:22]>` | = note: expected type `i32` found struct `Box<[closure@$DIR/call-boxed.rs:3:22: 3:24]>` diff --git a/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr index 965dbb9679d24..11d9b8391f6d2 100644 --- a/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr +++ b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo(mut s: String) -> String { | ------ expected `String` because of return type LL | s.push_str("asdf") - | ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `()` + | ^^^^^^^^^^^^^^^^^^ expected `String`, found `()` | note: method `push_str` modifies its receiver in-place --> $DIR/chain-method-call-mutation-in-place.rs:3:7 diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr index 26ab515d9b4b6..45593035b9d60 100644 --- a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr +++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr @@ -26,7 +26,7 @@ error[E0308]: mismatched types LL | fn wut(t: &Foo) -> Foo { | --- expected `Foo` because of return type LL | t.clone() - | ^^^^^^^^^ expected struct `Foo`, found `&Foo` + | ^^^^^^^^^ expected `Foo`, found `&Foo` | note: `Foo` does not implement `Clone`, so `&Foo` was cloned instead --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5 diff --git a/tests/ui/suggestions/const-in-struct-pat.stderr b/tests/ui/suggestions/const-in-struct-pat.stderr index c8b93f3dc48f4..f344ac06db1f8 100644 --- a/tests/ui/suggestions/const-in-struct-pat.stderr +++ b/tests/ui/suggestions/const-in-struct-pat.stderr @@ -7,7 +7,7 @@ LL | struct foo; LL | let Thing { foo } = t; | ^^^ - this expression has type `Thing` | | - | expected struct `String`, found struct `foo` + | expected `String`, found `foo` | `foo` is interpreted as a unit struct, not a new binding | help: bind the struct field to a different name instead diff --git a/tests/ui/suggestions/copied-and-cloned.stderr b/tests/ui/suggestions/copied-and-cloned.stderr index a6336281b4072..0678081418248 100644 --- a/tests/ui/suggestions/copied-and-cloned.stderr +++ b/tests/ui/suggestions/copied-and-cloned.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/copied-and-cloned.rs:7:26 | LL | expect::>(x); - | -------------------- ^ expected `()`, found `&()` + | -------------------- ^ expected `Option<()>`, found `Option<&()>` | | | arguments to this function are incorrect | @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/copied-and-cloned.rs:11:30 | LL | expect::>(x); - | ------------------------ ^ expected `()`, found `&()` + | ------------------------ ^ expected `Result<(), ()>`, found `Result<&(), _>` | | | arguments to this function are incorrect | @@ -42,7 +42,7 @@ error[E0308]: mismatched types --> $DIR/copied-and-cloned.rs:16:30 | LL | expect::>(x); - | ------------------------ ^ expected struct `String`, found `&String` + | ------------------------ ^ expected `Option`, found `Option<&String>` | | | arguments to this function are incorrect | @@ -62,7 +62,7 @@ error[E0308]: mismatched types --> $DIR/copied-and-cloned.rs:20:34 | LL | expect::>(x); - | ---------------------------- ^ expected struct `String`, found `&String` + | ---------------------------- ^ expected `Result`, found `Result<&String, _>` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index 5dc4e64446fb2..c6867270ad81e 100644 --- a/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | / intrinsic_match! { LL | | "abc" LL | | }; - | |_____^ expected `&str`, found struct `String` + | |_____^ expected `&str`, found `String` | = note: this error originates in the macro `format` which comes from the expansion of the macro `intrinsic_match` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr index 67f4ac08de2c5..866d3fab46e73 100644 --- a/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/hidden-child.rs:9:26 | LL | let x: Option = 1i32; - | ----------- ^^^^ expected enum `Option`, found `i32` + | ----------- ^^^^ expected `Option`, found `i32` | | | expected due to this | diff --git a/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr index d92b812791014..f8029e452bb77 100644 --- a/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/hidden-parent.rs:6:26 | LL | let x: Option = 1i32; - | ----------- ^^^^ expected enum `Option`, found `i32` + | ----------- ^^^^ expected `Option`, found `i32` | | | expected due to this | diff --git a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index b1e04dab8f623..90ea062395283 100644 --- a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -5,7 +5,7 @@ LL | fn foo + Send + 'static>(x: F) -> BoxFuture<'static, | - this type parameter ----------------------- expected `Pin + Send + 'static)>>` because of return type LL | // We could instead use an `async` block, but this way we have no std spans. LL | x - | ^ expected struct `Pin`, found type parameter `F` + | ^ expected `Pin>`, found type parameter `F` | = note: expected struct `Pin + Send + 'static)>>` found type parameter `F` @@ -20,7 +20,7 @@ error[E0308]: mismatched types LL | fn bar + Send + 'static>(x: F) -> BoxFuture<'static, i32> { | ----------------------- expected `Pin + Send + 'static)>>` because of return type LL | Box::new(x) - | ^^^^^^^^^^^ expected struct `Pin`, found struct `Box` + | ^^^^^^^^^^^ expected `Pin>`, found `Box` | = note: expected struct `Pin + Send + 'static)>>` found struct `Box` @@ -32,7 +32,7 @@ error[E0308]: mismatched types LL | fn baz + Send + 'static>(x: F) -> BoxFuture<'static, i32> { | - this type parameter LL | Pin::new(x) - | -------- ^ expected struct `Box`, found type parameter `F` + | -------- ^ expected `Box + Send>`, found type parameter `F` | | | arguments to this function are incorrect | help: use `Box::pin` to pin and box this expression: `Box::pin` @@ -74,7 +74,7 @@ LL | | 42 LL | | } | | ^ | | | - | |_____expected struct `Pin`, found `async` block + | |_____expected `Pin>`, found `async` block | arguments to this function are incorrect | = note: expected struct `Pin + Send>>` diff --git a/tests/ui/suggestions/field-access.stderr b/tests/ui/suggestions/field-access.stderr index b9f0f788b8c3c..007bc6ecf9379 100644 --- a/tests/ui/suggestions/field-access.stderr +++ b/tests/ui/suggestions/field-access.stderr @@ -7,7 +7,7 @@ LL | Fst, LL | if let B::Fst = a {}; | ^^^^^^ - this expression has type `A` | | - | expected struct `A`, found enum `B` + | expected `A`, found `B` | help: you might have meant to use field `b` whose type is `B` | @@ -24,7 +24,7 @@ LL | match a { | - this expression has type `A` ... LL | B::Fst => (), - | ^^^^^^ expected struct `A`, found enum `B` + | ^^^^^^ expected `A`, found `B` | help: you might have meant to use field `b` whose type is `B` | @@ -41,7 +41,7 @@ LL | match a { | - this expression has type `A` ... LL | B::Snd => (), - | ^^^^^^ expected struct `A`, found enum `B` + | ^^^^^^ expected `A`, found `B` | help: you might have meant to use field `b` whose type is `B` | @@ -55,7 +55,7 @@ LL | match foo { | --- this expression has type `Foo` LL | LL | 1u32 => (), - | ^^^^ expected union `Foo`, found `u32` + | ^^^^ expected `Foo`, found `u32` | help: you might have meant to use field `bar` whose type is `u32` | diff --git a/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 4cbcd31fa5ec1..4f981a1637414 100644 --- a/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -23,7 +23,7 @@ LL | struct S(usize, usize); | -------- `S` defines a struct constructor here, which should be called ... LL | let _: S = S; - | - ^ expected struct `S`, found struct constructor + | - ^ expected `S`, found struct constructor | | | expected due to this | @@ -59,7 +59,7 @@ LL | struct V(); | -------- `V` defines a struct constructor here, which should be called ... LL | let _: V = V; - | - ^ expected struct `V`, found struct constructor + | - ^ expected `V`, found struct constructor | | | expected due to this | @@ -113,7 +113,7 @@ LL | A(usize), | - `A` defines an enum variant constructor here, which should be called ... LL | let _: E = E::A; - | - ^^^^ expected enum `E`, found enum constructor + | - ^^^^ expected `E`, found enum constructor | | | expected due to this | diff --git a/tests/ui/suggestions/format-borrow.stderr b/tests/ui/suggestions/format-borrow.stderr index 8ed2b9c9a6330..3ea0d208cbb7f 100644 --- a/tests/ui/suggestions/format-borrow.stderr +++ b/tests/ui/suggestions/format-borrow.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/format-borrow.rs:2:21 | LL | let a: String = &String::from("a"); - | ------ ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String` + | ------ ^^^^^^^^^^^^^^^^^^ expected `String`, found `&String` | | | expected due to this | @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/format-borrow.rs:4:21 | LL | let b: String = &format!("b"); - | ------ ^^^^^^^^^^^^^ expected struct `String`, found `&String` + | ------ ^^^^^^^^^^^^^ expected `String`, found `&String` | | | expected due to this | @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/format-borrow.rs:6:21 | LL | let c: String = &mut format!("c"); - | ------ ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String` + | ------ ^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String` | | | expected due to this | @@ -56,7 +56,7 @@ error[E0308]: mismatched types --> $DIR/format-borrow.rs:8:21 | LL | let d: String = &mut (format!("d")); - | ------ ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String` + | ------ ^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String` | | | expected due to this | diff --git a/tests/ui/suggestions/into-convert.stderr b/tests/ui/suggestions/into-convert.stderr index d43104a217240..704b280a985f4 100644 --- a/tests/ui/suggestions/into-convert.stderr +++ b/tests/ui/suggestions/into-convert.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/into-convert.rs:6:16 | LL | let x: A = B; - | - ^ expected struct `A`, found struct `B` + | - ^ expected `A`, found `B` | | | expected due to this | @@ -15,7 +15,7 @@ error[E0308]: mismatched types --> $DIR/into-convert.rs:10:24 | LL | let y: Arc = PathBuf::new(); - | --------- ^^^^^^^^^^^^^^ expected struct `Arc`, found struct `PathBuf` + | --------- ^^^^^^^^^^^^^^ expected `Arc`, found `PathBuf` | | | expected due to this | @@ -30,7 +30,7 @@ error[E0308]: mismatched types --> $DIR/into-convert.rs:14:24 | LL | let z: AtomicU32 = 1; - | --------- ^ expected struct `AtomicU32`, found integer + | --------- ^ expected `AtomicU32`, found integer | | | expected due to this | diff --git a/tests/ui/suggestions/issue-101065.stderr b/tests/ui/suggestions/issue-101065.stderr index 6f7ecd24ca428..9f77ead42944f 100644 --- a/tests/ui/suggestions/issue-101065.stderr +++ b/tests/ui/suggestions/issue-101065.stderr @@ -7,7 +7,7 @@ LL | | FakeResult::Ok(FakeResult::Ok(())) | | ---------------------------------- expected because of this LL | | } else { LL | | FakeResult::Ok(()) - | | ^^^^^^^^^^^^^^^^^^ expected enum `FakeResult`, found `()` + | | ^^^^^^^^^^^^^^^^^^ expected `FakeResult>`, found `FakeResult<()>` LL | | }; | |_____- `if` and `else` have incompatible types | diff --git a/tests/ui/suggestions/issue-101465.stderr b/tests/ui/suggestions/issue-101465.stderr index e2ca7771257da..2aec3c863af55 100644 --- a/tests/ui/suggestions/issue-101465.stderr +++ b/tests/ui/suggestions/issue-101465.stderr @@ -5,7 +5,7 @@ LL | / match true { LL | | true => B, | | - this is found to be of type `B` LL | | false => C, - | | ^ expected struct `B`, found struct `C` + | | ^ expected `B`, found `C` LL | | LL | | } | |_____- `match` arms have incompatible types diff --git a/tests/ui/suggestions/issue-101984.stderr b/tests/ui/suggestions/issue-101984.stderr index 81758a7007c21..151587d422230 100644 --- a/tests/ui/suggestions/issue-101984.stderr +++ b/tests/ui/suggestions/issue-101984.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let (cmp, router) = self.router.at()?; | ^^^^^^^^^^^^^ ----------------- this expression has type `Match<&(for<'a> fn(&'a ()), Box)>` | | - | expected struct `Match`, found tuple + | expected `Match<&(fn(&()), Box)>`, found `(_, _)` | = note: expected struct `Match<&(for<'a> fn(&'a ()), Box)>` found tuple `(_, _)` diff --git a/tests/ui/suggestions/issue-102892.stderr b/tests/ui/suggestions/issue-102892.stderr index a3dbc7cb861ff..e64a89ffe3308 100644 --- a/tests/ui/suggestions/issue-102892.stderr +++ b/tests/ui/suggestions/issue-102892.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-102892.rs:15:26 | LL | let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too - | ------ ^^^^^^ expected tuple, found `&(A, B)` + | ------ ^^^^^^ expected `(A, B)`, found `&(A, B)` | | | expected due to this | @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/issue-102892.rs:20:32 | LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too - | ^^^^^^^^^^^^^^ expected tuple, found `&mut (A, B)` + | ^^^^^^^^^^^^^^ expected `(A, B)`, found `&mut (A, B)` | = note: expected tuple `(A, B)` found mutable reference `&mut (A, B)` @@ -40,7 +40,7 @@ error[E0308]: mismatched types --> $DIR/issue-102892.rs:20:48 | LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too - | ^^^^^^^^^^ expected struct `A`, found `&A` + | ^^^^^^^^^^ expected `A`, found `&A` | help: consider removing the borrow | diff --git a/tests/ui/suggestions/issue-105494.stderr b/tests/ui/suggestions/issue-105494.stderr index 5aa3f2af738f4..4cb4a399a7245 100644 --- a/tests/ui/suggestions/issue-105494.stderr +++ b/tests/ui/suggestions/issue-105494.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-105494.rs:2:19 | LL | let _v: i32 = (1 as i32).to_string(); - | --- ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` + | --- ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String` | | | expected due to this | @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/issue-105494.rs:5:19 | LL | let _v: i32 = (1 as i128).to_string(); - | --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` + | --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String` | | | expected due to this @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/issue-105494.rs:7:20 | LL | let _v: &str = "foo".to_string(); - | ---- ^^^^^^^^^^^^^^^^^ expected `&str`, found struct `String` + | ---- ^^^^^^^^^^^^^^^^^ expected `&str`, found `String` | | | expected due to this | @@ -41,7 +41,7 @@ LL | let mut path: String = "/usr".to_string(); | ------ expected due to this type ... LL | path = format!("{}/{}", path, folder).as_str(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&str` | help: try removing the method call | diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr index 1e66fe3af2414..4e91dfc82d2f0 100644 --- a/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-106443-sugg-clone-for-arg.rs:11:9 | LL | foo(s); - | --- ^ expected struct `S`, found `&S` + | --- ^ expected `S`, found `&S` | | | arguments to this function are incorrect | @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/issue-106443-sugg-clone-for-arg.rs:17:9 | LL | bar(t); - | --- ^ expected struct `T`, found `&T` + | --- ^ expected `T`, found `&T` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/issue-52820.stderr b/tests/ui/suggestions/issue-52820.stderr index 09269ed4eee99..a67d75014171f 100644 --- a/tests/ui/suggestions/issue-52820.stderr +++ b/tests/ui/suggestions/issue-52820.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-52820.rs:12:9 | LL | guts, - | ^^^^ expected struct `String`, found `&str` + | ^^^^ expected `String`, found `&str` | help: try using a conversion method | @@ -16,7 +16,7 @@ LL | brains: guts.clone(), | ^^^^^-----^^ | | | | | help: try using a conversion method: `to_string` - | expected struct `String`, found `&str` + | expected `String`, found `&str` error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/issue-53692.stderr b/tests/ui/suggestions/issue-53692.stderr index 3a1b624f402f0..469a538411fb1 100644 --- a/tests/ui/suggestions/issue-53692.stderr +++ b/tests/ui/suggestions/issue-53692.stderr @@ -5,7 +5,7 @@ LL | let items_clone: Vec = ref_items.clone(); | -------- ^^^^^^^^^^-----^^ | | | | | | | help: try using a conversion method: `to_vec` - | | expected struct `Vec`, found `&[i32]` + | | expected `Vec`, found `&[i32]` | expected due to this | = note: expected struct `Vec` @@ -18,7 +18,7 @@ LL | let string: String = s.clone(); | ------ ^^-----^^ | | | | | | | help: try using a conversion method: `to_string` - | | expected struct `String`, found `&str` + | | expected `String`, found `&str` | expected due to this error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/issue-59819.stderr b/tests/ui/suggestions/issue-59819.stderr index 40e4c7b78499c..43acf9549c29a 100644 --- a/tests/ui/suggestions/issue-59819.stderr +++ b/tests/ui/suggestions/issue-59819.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-59819.rs:28:18 | LL | let y: i32 = x; - | --- ^ expected `i32`, found struct `Foo` + | --- ^ expected `i32`, found `Foo` | | | expected due to this | @@ -30,7 +30,7 @@ error[E0308]: mismatched types LL | let g: String = f; | ------ ^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found struct `Bar` + | | expected `String`, found `Bar` | expected due to this error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/issue-83943.stderr b/tests/ui/suggestions/issue-83943.stderr index 885106e8429bc..c73667f09cbeb 100644 --- a/tests/ui/suggestions/issue-83943.stderr +++ b/tests/ui/suggestions/issue-83943.stderr @@ -8,7 +8,7 @@ LL | | } else { LL | | "B" | | ^^^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found `&str` + | | expected `String`, found `&str` LL | | }; | |_____- `if` and `else` have incompatible types diff --git a/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr b/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr index 8c9a41a202767..da6f7641be53b 100644 --- a/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr +++ b/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-86100-tuple-paren-comma.rs:9:22 | LL | let _x: (i32,) = (5); - | ------ ^^^ expected tuple, found integer + | ------ ^^^ expected `(i32,)`, found integer | | | expected due to this | @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/issue-86100-tuple-paren-comma.rs:13:9 | LL | foo((Some(3))); - | --- ^^^^^^^^^ expected tuple, found enum `Option` + | --- ^^^^^^^^^ expected `(_,)`, found `Option<{integer}>` | | | arguments to this function are incorrect | @@ -37,7 +37,7 @@ error[E0308]: mismatched types --> $DIR/issue-86100-tuple-paren-comma.rs:17:22 | LL | let _s = S { _s: ("abc".to_string()) }; - | ^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `String` + | ^^^^^^^^^^^^^^^^^^^ expected `(String,)`, found `String` | = note: expected tuple `(String,)` found struct `String` diff --git a/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr index 611f7d5ddda78..7d1da7d24eeb8 100644 --- a/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr +++ b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-90213-expected-boxfuture-self-ice.rs:9:19 | LL | Self::foo(None) - | --------- ^^^^ expected struct `Box`, found enum `Option` + | --------- ^^^^ expected `Box>`, found `Option<_>` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/match-ergonomics.stderr b/tests/ui/suggestions/match-ergonomics.stderr index aa2b407bf5616..a3e059e8ac646 100644 --- a/tests/ui/suggestions/match-ergonomics.stderr +++ b/tests/ui/suggestions/match-ergonomics.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match &x[..] { | ------ this expression has type `&[i32]` LL | [&v] => {}, - | ^^ expected `i32`, found reference + | ^^ expected `i32`, found `&_` | = note: expected type `i32` found reference `&_` @@ -36,7 +36,7 @@ error[E0308]: mismatched types LL | match y { | - this expression has type `i32` LL | &v => {}, - | ^^ expected `i32`, found reference + | ^^ expected `i32`, found `&_` | = note: expected type `i32` found reference `&_` @@ -52,7 +52,7 @@ error[E0308]: mismatched types LL | if let [&v] = &x[..] {} | ^^ ------ this expression has type `&[i32]` | | - | expected `i32`, found reference + | expected `i32`, found `&_` | = note: expected type `i32` found reference `&_` diff --git a/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr index 00aa7d18a968c..51ea5b35ae114 100644 --- a/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr +++ b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr @@ -16,7 +16,7 @@ LL | / match c { LL | | "baz" => Box::new(Baz), | | ------------- this is found to be of type `Box` LL | | _ => Box::new(Bar), - | | ^^^^^^^^^^^^^ expected struct `Baz`, found struct `Bar` + | | ^^^^^^^^^^^^^ expected `Box`, found `Box` LL | | }; | |_____- `match` arms have incompatible types | @@ -39,7 +39,7 @@ error[E0308]: mismatched types --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:23:22 | LL | fn wrong(c: &str) -> Box { - | ----- ^^^^^^^^^^^^ expected struct `Box`, found `()` + | ----- ^^^^^^^^^^^^ expected `Box`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/tests/ui/suggestions/method-access-to-range-literal-typo.stderr b/tests/ui/suggestions/method-access-to-range-literal-typo.stderr index f421408944bb3..54a16b8efa748 100644 --- a/tests/ui/suggestions/method-access-to-range-literal-typo.stderr +++ b/tests/ui/suggestions/method-access-to-range-literal-typo.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | fn method(&self) -> Option<&Vec> { | ---------------- expected `Option<&Vec>` because of return type LL | self.option..as_ref().map(|x| x) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&Vec>`, found `Range>>` | = note: expected enum `Option<&Vec>` found struct `std::ops::Range>>` @@ -32,7 +32,7 @@ error[E0308]: mismatched types LL | fn method2(&self) -> Option<&u8> { | ----------- expected `Option<&u8>` because of return type LL | self.option..foo().get(0) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&u8>`, found `Range>>` | = note: expected enum `Option<&u8>` found struct `std::ops::Range>>` diff --git a/tests/ui/suggestions/mut-ref-reassignment.stderr b/tests/ui/suggestions/mut-ref-reassignment.stderr index b3cb6dd06142b..b86a04c7cd3d1 100644 --- a/tests/ui/suggestions/mut-ref-reassignment.stderr +++ b/tests/ui/suggestions/mut-ref-reassignment.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn suggestion(opt: &mut Option) { | ------------------- expected due to this parameter type LL | opt = None; - | ^^^^ expected mutable reference, found enum `Option` + | ^^^^ expected `&mut Option`, found `Option<_>` | = note: expected mutable reference `&mut Option` found enum `Option<_>` @@ -19,7 +19,7 @@ error[E0308]: mismatched types LL | fn no_suggestion(opt: &mut Result) { | ----------------------- expected due to this parameter type LL | opt = None - | ^^^^ expected mutable reference, found enum `Option` + | ^^^^ expected `&mut Result`, found `Option<_>` | = note: expected mutable reference `&mut Result` found enum `Option<_>` @@ -30,7 +30,7 @@ error[E0308]: mismatched types LL | fn suggestion2(opt: &mut Option) { | ------------------- expected due to this parameter type LL | opt = Some(String::new()) - | ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `Option` + | ^^^^^^^^^^^^^^^^^^^ expected `&mut Option`, found `Option` | = note: expected mutable reference `&mut Option` found enum `Option` @@ -45,7 +45,7 @@ error[E0308]: mismatched types LL | fn no_suggestion2(opt: &mut Option) { | ------------------- expected due to this parameter type LL | opt = Some(42) - | ^^^^^^^^ expected mutable reference, found enum `Option` + | ^^^^^^^^ expected `&mut Option`, found `Option<{integer}>` | = note: expected mutable reference `&mut Option` found enum `Option<{integer}>` diff --git a/tests/ui/suggestions/option-to-bool.stderr b/tests/ui/suggestions/option-to-bool.stderr index 4050c7be82a0a..e042f07daeb1c 100644 --- a/tests/ui/suggestions/option-to-bool.stderr +++ b/tests/ui/suggestions/option-to-bool.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/option-to-bool.rs:4:16 | LL | if true && x {} - | ---- ^ expected `bool`, found enum `Option` + | ---- ^ expected `bool`, found `Option` | | | expected because this is `bool` | diff --git a/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 9588eedc98b4a..fee83eb5c1815 100644 --- a/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:10:20 | LL | let _: usize = S {}; - | ----- ^^^^ expected `usize`, found struct `S` + | ----- ^^^^ expected `usize`, found `S` | | | expected due to this @@ -30,7 +30,7 @@ error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:12:20 | LL | let _: usize = X {}; - | ----- ^^^^ expected `usize`, found struct `X` + | ----- ^^^^ expected `usize`, found `X` | | | expected due to this diff --git a/tests/ui/suggestions/recover-invalid-float-invalid.rs b/tests/ui/suggestions/recover-invalid-float-invalid.rs new file mode 100644 index 0000000000000..79430d8c0513d --- /dev/null +++ b/tests/ui/suggestions/recover-invalid-float-invalid.rs @@ -0,0 +1,24 @@ +// Check that suggestions to add a zero to integers with a preceding dot only appear when the change +// will result in a valid floating point literal. + +fn main() {} + +fn a() { + _ = .3u32; + //~^ ERROR expected expression, found `.` +} + +fn b() { + _ = .0b0; + //~^ ERROR expected expression, found `.` +} + +fn c() { + _ = .0o07; + //~^ ERROR expected expression, found `.` +} + +fn d() { + _ = .0x0ABC; + //~^ ERROR expected expression, found `.` +} diff --git a/tests/ui/suggestions/recover-invalid-float-invalid.stderr b/tests/ui/suggestions/recover-invalid-float-invalid.stderr new file mode 100644 index 0000000000000..5764afc1a21fa --- /dev/null +++ b/tests/ui/suggestions/recover-invalid-float-invalid.stderr @@ -0,0 +1,26 @@ +error: expected expression, found `.` + --> $DIR/recover-invalid-float-invalid.rs:7:9 + | +LL | _ = .3u32; + | ^ expected expression + +error: expected expression, found `.` + --> $DIR/recover-invalid-float-invalid.rs:12:9 + | +LL | _ = .0b0; + | ^ expected expression + +error: expected expression, found `.` + --> $DIR/recover-invalid-float-invalid.rs:17:9 + | +LL | _ = .0o07; + | ^ expected expression + +error: expected expression, found `.` + --> $DIR/recover-invalid-float-invalid.rs:22:9 + | +LL | _ = .0x0ABC; + | ^ expected expression + +error: aborting due to 4 previous errors + diff --git a/tests/ui/suggestions/return-bindings.stderr b/tests/ui/suggestions/return-bindings.stderr index c14fb336773d1..6f906c27ba943 100644 --- a/tests/ui/suggestions/return-bindings.stderr +++ b/tests/ui/suggestions/return-bindings.stderr @@ -18,7 +18,7 @@ LL | let s: String = if let Some(s) = opt_str { | ______________________________________________^ LL | | LL | | } else { - | |_____^ expected struct `String`, found `()` + | |_____^ expected `String`, found `()` | help: consider returning the local binding `s` | @@ -31,7 +31,7 @@ error[E0308]: mismatched types --> $DIR/return-bindings.rs:14:11 | LL | fn c() -> Option { - | - ^^^^^^^^^^^ expected enum `Option`, found `()` + | - ^^^^^^^^^^^ expected `Option`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | @@ -50,7 +50,7 @@ LL | let s: String = if let Some(s) = opt_str { | ______________________________________________^ LL | | LL | | } else { - | |_____^ expected struct `String`, found `()` + | |_____^ expected `String`, found `()` | help: consider returning the local binding `s` | @@ -67,7 +67,7 @@ LL | let s = if let Some(s) = opt_str { LL | | } else { | |_____- expected because of this LL | String::new() - | ^^^^^^^^^^^^^ expected `()`, found struct `String` + | ^^^^^^^^^^^^^ expected `()`, found `String` | help: consider returning the local binding `s` | @@ -80,7 +80,7 @@ error[E0308]: mismatched types --> $DIR/return-bindings.rs:37:20 | LL | Some(s) => {} - | ^^ expected struct `String`, found `()` + | ^^ expected `String`, found `()` | help: consider returning the local binding `s` | @@ -95,7 +95,7 @@ LL | let s = match opt_str { LL | | Some(s) => {} | | -- this is found to be of type `()` LL | | None => String::new(), - | | ^^^^^^^^^^^^^ expected `()`, found struct `String` + | | ^^^^^^^^^^^^^ expected `()`, found `String` LL | | LL | | }; | |_____- `match` arms have incompatible types diff --git a/tests/ui/suggestions/shadowed-lplace-method-2.stderr b/tests/ui/suggestions/shadowed-lplace-method-2.stderr index 94eef15f3306e..2956360980ec7 100644 --- a/tests/ui/suggestions/shadowed-lplace-method-2.stderr +++ b/tests/ui/suggestions/shadowed-lplace-method-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/shadowed-lplace-method-2.rs:22:17 | LL | *x.foo(0) = (); - | --------- ^^ expected struct `X`, found `()` + | --------- ^^ expected `X`, found `()` | | | expected due to the type of this binding | diff --git a/tests/ui/suggestions/shadowed-lplace-method.stderr b/tests/ui/suggestions/shadowed-lplace-method.stderr index 91d0d1200d436..33824c4cbc750 100644 --- a/tests/ui/suggestions/shadowed-lplace-method.stderr +++ b/tests/ui/suggestions/shadowed-lplace-method.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/shadowed-lplace-method.rs:9:24 | LL | *rc.borrow_mut() = false; - | ---------------- ^^^^^ expected struct `Rc`, found `bool` + | ---------------- ^^^^^ expected `Rc>`, found `bool` | | | expected due to the type of this binding | diff --git a/tests/ui/suggestions/suggest-box.stderr b/tests/ui/suggestions/suggest-box.stderr index 2bdaa4e9780eb..9a4e9fef43c57 100644 --- a/tests/ui/suggestions/suggest-box.stderr +++ b/tests/ui/suggestions/suggest-box.stderr @@ -8,7 +8,7 @@ LL | let _x: Box Result<(), ()>> = || { LL | | Err(())?; LL | | Ok(()) LL | | }; - | |_____^ expected struct `Box`, found closure + | |_____^ expected `Box Result<(), ()>>`, found closure | = note: expected struct `Box Result<(), ()>>` found closure `[closure@$DIR/suggest-box.rs:4:47: 4:49]` diff --git a/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr index 9b6dba7e9e75b..3fb3047d866c6 100644 --- a/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr +++ b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/suggest-full-enum-variant-for-local-module.rs:9:28 | LL | let _: option::O<()> = (); - | ------------- ^^ expected enum `O`, found `()` + | ------------- ^^ expected `O<()>`, found `()` | | | expected due to this | diff --git a/tests/ui/suggestions/suggest-remove-deref.stderr b/tests/ui/suggestions/suggest-remove-deref.stderr index f5d810e36f035..4253838eb5265 100644 --- a/tests/ui/suggestions/suggest-remove-deref.stderr +++ b/tests/ui/suggestions/suggest-remove-deref.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/suggest-remove-deref.rs:13:9 | LL | foo(*hello); - | --- ^^^^^^ expected reference, found struct `S` + | --- ^^^^^^ expected `&_`, found `S` | | | arguments to this function are incorrect | @@ -23,7 +23,7 @@ error[E0308]: mismatched types --> $DIR/suggest-remove-deref.rs:21:9 | LL | bar(*s); - | --- ^^ expected `&String`, found struct `String` + | --- ^^ expected `&String`, found `String` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/suggest-using-chars.stderr b/tests/ui/suggestions/suggest-using-chars.stderr index 99bcfb08a0892..ba80ec6a2019c 100644 --- a/tests/ui/suggestions/suggest-using-chars.stderr +++ b/tests/ui/suggestions/suggest-using-chars.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `iter` found for reference `&'static str` in the c --> $DIR/suggest-using-chars.rs:2:19 | LL | let _ = "foo".iter(); - | ^^^^ method not found in `&'static str` + | ^^^^ method not found in `&str` | help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars` | @@ -13,7 +13,7 @@ error[E0599]: no method named `foo` found for reference `&'static str` in the cu --> $DIR/suggest-using-chars.rs:3:19 | LL | let _ = "foo".foo(); - | ^^^ method not found in `&'static str` + | ^^^ method not found in `&str` error[E0599]: no method named `iter` found for struct `String` in the current scope --> $DIR/suggest-using-chars.rs:4:33 diff --git a/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr index 34eaa8322c870..8b48ee9f1247b 100644 --- a/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr +++ b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18 | LL | let _: f64 = 0..10; - | --- ^^^^^ expected `f64`, found struct `Range` + | --- ^^^^^ expected `f64`, found `Range<{integer}>` | | | expected due to this | @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:3:18 | LL | let _: f64 = 1..; - | --- ^^^ expected `f64`, found struct `RangeFrom` + | --- ^^^ expected `f64`, found `RangeFrom<{integer}>` | | | expected due to this | @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:4:18 | LL | let _: f64 = ..10; - | --- ^^^^ expected `f64`, found struct `RangeTo` + | --- ^^^^ expected `f64`, found `RangeTo<{integer}>` | | | expected due to this | @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18 | LL | let _: f64 = std::ops::Range { start: 0, end: 1 }; - | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `Range` + | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found `Range<{integer}>` | | | expected due to this | diff --git a/tests/ui/suppressed-error.rs b/tests/ui/suppressed-error.rs index 256ec1713d4c1..1e39be4608091 100644 --- a/tests/ui/suppressed-error.rs +++ b/tests/ui/suppressed-error.rs @@ -3,6 +3,6 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found tuple `(_, _)` -//~| expected `()`, found tuple +//~| expected `()`, found return x; } diff --git a/tests/ui/suppressed-error.stderr b/tests/ui/suppressed-error.stderr index c2874ae9a14b8..11d70f8a43369 100644 --- a/tests/ui/suppressed-error.stderr +++ b/tests/ui/suppressed-error.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let (x, y) = (); | ^^^^^^ -- this expression has type `()` | | - | expected `()`, found tuple + | expected `()`, found `(_, _)` | = note: expected unit type `()` found tuple `(_, _)` diff --git a/tests/ui/switched-expectations.stderr b/tests/ui/switched-expectations.stderr index 82fea0f14bd29..744d8483bd3de 100644 --- a/tests/ui/switched-expectations.stderr +++ b/tests/ui/switched-expectations.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/switched-expectations.rs:3:30 | LL | let ref string: String = var; - | ^^^ expected struct `String`, found `i32` + | ^^^ expected `String`, found `i32` error: aborting due to previous error diff --git a/tests/ui/tag-that-dare-not-speak-its-name.rs b/tests/ui/tag-that-dare-not-speak-its-name.rs index 36e22f0b5f1a7..0e76ec246d7c3 100644 --- a/tests/ui/tag-that-dare-not-speak-its-name.rs +++ b/tests/ui/tag-that-dare-not-speak-its-name.rs @@ -12,5 +12,5 @@ fn main() { //~^ ERROR mismatched types //~| expected type `char` //~| found enum `Option<_>` - //~| expected `char`, found enum `Option` + //~| expected `char`, found `Option<_>` } diff --git a/tests/ui/tag-that-dare-not-speak-its-name.stderr b/tests/ui/tag-that-dare-not-speak-its-name.stderr index 96bab152612fd..f53abe53bf134 100644 --- a/tests/ui/tag-that-dare-not-speak-its-name.stderr +++ b/tests/ui/tag-that-dare-not-speak-its-name.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/tag-that-dare-not-speak-its-name.rs:11:20 | LL | let x : char = last(y); - | ---- ^^^^^^^ expected `char`, found enum `Option` + | ---- ^^^^^^^ expected `char`, found `Option<_>` | | | expected due to this | diff --git a/tests/ui/terr-in-field.rs b/tests/ui/terr-in-field.rs index aa801fd0a6c64..cfe350ef86db2 100644 --- a/tests/ui/terr-in-field.rs +++ b/tests/ui/terr-in-field.rs @@ -11,7 +11,7 @@ struct Bar { fn want_foo(f: Foo) {} fn have_bar(b: Bar) { want_foo(b); //~ ERROR mismatched types - //~| expected struct `Foo`, found struct `Bar` + //~| expected `Foo`, found `Bar` } fn main() {} diff --git a/tests/ui/terr-in-field.stderr b/tests/ui/terr-in-field.stderr index d2fda09c0767f..09df4b34bb52d 100644 --- a/tests/ui/terr-in-field.stderr +++ b/tests/ui/terr-in-field.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/terr-in-field.rs:13:14 | LL | want_foo(b); - | -------- ^ expected struct `Foo`, found struct `Bar` + | -------- ^ expected `Foo`, found `Bar` | | | arguments to this function are incorrect | diff --git a/tests/ui/terr-sorts.stderr b/tests/ui/terr-sorts.stderr index 5a61a2fab1265..8f1975374a576 100644 --- a/tests/ui/terr-sorts.stderr +++ b/tests/ui/terr-sorts.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/terr-sorts.rs:10:14 | LL | want_foo(b); - | -------- ^ expected struct `Foo`, found struct `Box` + | -------- ^ expected `Foo`, found `Box` | | | arguments to this function are incorrect | diff --git a/tests/ui/traits/issue-52893.stderr b/tests/ui/traits/issue-52893.stderr index a11867c03a689..006cb3a7b72c7 100644 --- a/tests/ui/traits/issue-52893.stderr +++ b/tests/ui/traits/issue-52893.stderr @@ -5,7 +5,7 @@ LL | impl AddClass for Class

| - this type parameter ... LL | builder.push(output); - | ---- ^^^^^^ expected type parameter `F`, found struct `Class` + | ---- ^^^^^^ expected type parameter `F`, found `Class

` | | | arguments to this method are incorrect | diff --git a/tests/ui/traits/issue-68295.stderr b/tests/ui/traits/issue-68295.stderr index cb6e6e0769cb8..671a97666fdaa 100644 --- a/tests/ui/traits/issue-68295.stderr +++ b/tests/ui/traits/issue-68295.stderr @@ -5,7 +5,7 @@ LL | fn crash(input: Matrix) -> Matrix | ----------------- expected `Matrix` because of return type ... LL | input.into_owned() - | ^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type + | ^^^^^^^^^^^^^^^^^^ expected `Matrix`, found `Matrix` | = note: expected struct `Matrix<_, _, u32>` found struct `Matrix<_, _, <() as Allocator>::Buffer>` diff --git a/tests/ui/traits/new-solver/unsize-good.rs b/tests/ui/traits/new-solver/unsize-good.rs new file mode 100644 index 0000000000000..87ed9cfd10ae4 --- /dev/null +++ b/tests/ui/traits/new-solver/unsize-good.rs @@ -0,0 +1,25 @@ +// compile-flags: -Ztrait-solver=next +// check-pass + +#![feature(unsized_tuple_coercion)] + +trait Foo {} + +impl Foo for i32 {} + +fn main() { + // Unsizing via struct + let _: Box = Box::new(1i32); + + // Slice unsizing + let y = [1, 2, 3]; + let _: &[i32] = &y; + + // Tuple unsizing + let hi = (1i32,); + let _: &(dyn Foo,) = &hi; + + // Dropping auto traits + let a: &(dyn Foo + Send) = &1; + let _: &dyn Foo = a; +} diff --git a/tests/ui/traits/new-solver/upcast-right-substs.rs b/tests/ui/traits/new-solver/upcast-right-substs.rs new file mode 100644 index 0000000000000..c19c82acf24ff --- /dev/null +++ b/tests/ui/traits/new-solver/upcast-right-substs.rs @@ -0,0 +1,14 @@ +// compile-flags: -Ztrait-solver=next +// check-pass + +#![feature(trait_upcasting)] + +trait Foo: Bar + Bar {} + +trait Bar {} + +fn main() { + let x: &dyn Foo = todo!(); + let y: &dyn Bar = x; + let z: &dyn Bar = x; +} diff --git a/tests/ui/traits/new-solver/upcast-wrong-substs.rs b/tests/ui/traits/new-solver/upcast-wrong-substs.rs new file mode 100644 index 0000000000000..f2d04d932bbcb --- /dev/null +++ b/tests/ui/traits/new-solver/upcast-wrong-substs.rs @@ -0,0 +1,13 @@ +// compile-flags: -Ztrait-solver=next + +#![feature(trait_upcasting)] + +trait Foo: Bar + Bar {} + +trait Bar {} + +fn main() { + let x: &dyn Foo = todo!(); + let y: &dyn Bar = x; + //~^ ERROR mismatched types +} diff --git a/tests/ui/traits/new-solver/upcast-wrong-substs.stderr b/tests/ui/traits/new-solver/upcast-wrong-substs.stderr new file mode 100644 index 0000000000000..8623f395f5978 --- /dev/null +++ b/tests/ui/traits/new-solver/upcast-wrong-substs.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/upcast-wrong-substs.rs:11:30 + | +LL | let y: &dyn Bar = x; + | --------------- ^ expected trait `Bar`, found trait `Foo` + | | + | expected due to this + | + = note: expected reference `&dyn Bar` + found reference `&dyn Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/transmutability/issue-101739-1.stderr b/tests/ui/transmutability/issue-101739-1.stderr index 5fa741f26fd07..7c6b533ef5f71 100644 --- a/tests/ui/transmutability/issue-101739-1.stderr +++ b/tests/ui/transmutability/issue-101739-1.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-101739-1.rs:8:50 | LL | Dst: BikeshedIntrinsicFrom, - | ^^^^^^^^^^^^^^^^ expected struct `Assume`, found `bool` + | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` error: aborting due to 2 previous errors diff --git a/tests/ui/tuple/add-tuple-within-arguments.stderr b/tests/ui/tuple/add-tuple-within-arguments.stderr index 2e20a4cca0845..6849128eaddde 100644 --- a/tests/ui/tuple/add-tuple-within-arguments.stderr +++ b/tests/ui/tuple/add-tuple-within-arguments.stderr @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/add-tuple-within-arguments.rs:8:15 | LL | bar("hi", "hi", "hi"); - | --- ^^^^ expected tuple, found `&str` + | --- ^^^^ expected `(&str,)`, found `&str` | | | arguments to this function are incorrect | diff --git a/tests/ui/tuple/wrong_argument_ice-3.stderr b/tests/ui/tuple/wrong_argument_ice-3.stderr index 0a503e1fe58c1..75dfe716395a5 100644 --- a/tests/ui/tuple/wrong_argument_ice-3.stderr +++ b/tests/ui/tuple/wrong_argument_ice-3.stderr @@ -4,7 +4,7 @@ error[E0061]: this method takes 1 argument but 2 arguments were supplied LL | groups.push(new_group, vec![process]); | ^^^^ ------------- argument of type `Vec<&Process>` unexpected | -note: expected tuple, found struct `Vec` +note: expected `(Vec, Vec)`, found `Vec` --> $DIR/wrong_argument_ice-3.rs:9:21 | LL | groups.push(new_group, vec![process]); diff --git a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index eb58ee73ca21b..db75a520c6587 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17 | LL | let _: u8 = ::V; - | -- ^^^^^^^ expected `u8`, found enum `E2` + | -- ^^^^^^^ expected `u8`, found `E2` | | | expected due to this diff --git a/tests/ui/type-alias-impl-trait/issue-98604.rs b/tests/ui/type-alias-impl-trait/issue-98604.rs index 32c2f9ed51edf..d07fc9822a02d 100644 --- a/tests/ui/type-alias-impl-trait/issue-98604.rs +++ b/tests/ui/type-alias-impl-trait/issue-98604.rs @@ -7,5 +7,5 @@ async fn test() {} #[allow(unused_must_use)] fn main() { Box::new(test) as AsyncFnPtr; - //~^ ERROR expected `fn() -> impl Future {test}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` + //~^ ERROR expected `test` to be a fn item that returns `Pin>>`, but it returns `impl Future } diff --git a/tests/ui/type-alias-impl-trait/issue-98604.stderr b/tests/ui/type-alias-impl-trait/issue-98604.stderr index 92d01eb0d3d5e..c5a4b5217d7a0 100644 --- a/tests/ui/type-alias-impl-trait/issue-98604.stderr +++ b/tests/ui/type-alias-impl-trait/issue-98604.stderr @@ -1,8 +1,8 @@ -error[E0271]: expected `fn() -> impl Future {test}` to be a fn item that returns `Pin + 'static)>>`, but it returns `impl Future` +error[E0271]: expected `test` to be a fn item that returns `Pin>>`, but it returns `impl Future` --> $DIR/issue-98604.rs:9:5 | LL | Box::new(test) as AsyncFnPtr; - | ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type + | ^^^^^^^^^^^^^^ expected `Pin>>`, found opaque type | note: while checking the return type of the `async fn` --> $DIR/issue-98604.rs:5:17 diff --git a/tests/ui/type-alias-impl-trait/issue-98608.rs b/tests/ui/type-alias-impl-trait/issue-98608.rs index 1f89af0457653..5e026ea4096c3 100644 --- a/tests/ui/type-alias-impl-trait/issue-98608.rs +++ b/tests/ui/type-alias-impl-trait/issue-98608.rs @@ -4,7 +4,7 @@ fn hi() -> impl Sized { fn main() { let b: Box Box> = Box::new(hi); - //~^ ERROR expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box`, but it returns `impl Sized` + //~^ ERROR expected `hi` to be a fn item that returns `Box`, but it returns `impl Sized` let boxed = b(); let null = *boxed; println!("{null:?}"); diff --git a/tests/ui/type-alias-impl-trait/issue-98608.stderr b/tests/ui/type-alias-impl-trait/issue-98608.stderr index 916a58451baa2..506d40cb7768f 100644 --- a/tests/ui/type-alias-impl-trait/issue-98608.stderr +++ b/tests/ui/type-alias-impl-trait/issue-98608.stderr @@ -1,11 +1,11 @@ -error[E0271]: expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box`, but it returns `impl Sized` +error[E0271]: expected `hi` to be a fn item that returns `Box`, but it returns `impl Sized` --> $DIR/issue-98608.rs:6:39 | LL | fn hi() -> impl Sized { | ---------- the found opaque type ... LL | let b: Box Box> = Box::new(hi); - | ^^^^^^^^^^^^ expected struct `Box`, found opaque type + | ^^^^^^^^^^^^ expected `Box`, found opaque type | = note: expected struct `Box` found opaque type `impl Sized` diff --git a/tests/ui/type-alias-impl-trait/unnameable_type.stderr b/tests/ui/type-alias-impl-trait/unnameable_type.stderr index 7dc6efc4b1b6b..e9032433494a6 100644 --- a/tests/ui/type-alias-impl-trait/unnameable_type.stderr +++ b/tests/ui/type-alias-impl-trait/unnameable_type.stderr @@ -15,7 +15,7 @@ LL | type MyPrivate = impl Sized; LL | fn dont_define_this(_private: MyPrivate) {} | ^^^^^^^^^ | | - | expected struct `Private`, found opaque type + | expected `Private`, found opaque type | help: change the parameter type to match the trait: `Private` | note: type in trait diff --git a/tests/ui/type-inference/issue-30225.stderr b/tests/ui/type-inference/issue-30225.stderr index ccd05fa6bfb09..72c33d16cabe0 100644 --- a/tests/ui/type-inference/issue-30225.stderr +++ b/tests/ui/type-inference/issue-30225.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-30225.rs:31:9 | LL | u = v; // mark $0 and $1 in a subtype relationship - | ^ expected struct `A`, found struct `B` + | ^ expected `A`, found `B` error: aborting due to previous error diff --git a/tests/ui/type/type-ascription-precedence.stderr b/tests/ui/type/type-ascription-precedence.stderr index edc5aeffdcd65..d6d1e1d7d0293 100644 --- a/tests/ui/type/type-ascription-precedence.stderr +++ b/tests/ui/type/type-ascription-precedence.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:31:7 | LL | &(S: &S); - | ^ expected `&S`, found struct `S` + | ^ expected `&S`, found `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:35:7 | LL | *(S: Z); - | ^ expected struct `Z`, found struct `S` + | ^ expected `Z`, found `S` error[E0614]: type `Z` cannot be dereferenced --> $DIR/type-ascription-precedence.rs:35:5 @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:40:7 | LL | -(S: Z); - | ^ expected struct `Z`, found struct `S` + | ^ expected `Z`, found `S` error[E0600]: cannot apply unary operator `-` to type `Z` --> $DIR/type-ascription-precedence.rs:40:5 @@ -40,19 +40,19 @@ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:45:5 | LL | (S + Z): Z; - | ^^^^^^^ expected struct `Z`, found struct `S` + | ^^^^^^^ expected `Z`, found `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:49:5 | LL | (S * Z): Z; - | ^^^^^^^ expected struct `Z`, found struct `S` + | ^^^^^^^ expected `Z`, found `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:53:5 | LL | (S .. S): S; - | ^^^^^^^^ expected struct `S`, found struct `Range` + | ^^^^^^^^ expected `S`, found `Range` | = note: expected struct `S` found struct `std::ops::Range` diff --git a/tests/ui/type/type-ascription-soundness.stderr b/tests/ui/type/type-ascription-soundness.stderr index 522d5b2e37555..778836a2e06a8 100644 --- a/tests/ui/type/type-ascription-soundness.stderr +++ b/tests/ui/type/type-ascription-soundness.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:7:31 | LL | let ref x = type_ascribe!(arr, &[u8]); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` + | ^^^ expected `&[u8]`, found `&[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:8:35 | LL | let ref mut x = type_ascribe!(arr, &[u8]); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` + | ^^^ expected `&[u8]`, found `&[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:9:25 | LL | match type_ascribe!(arr, &[u8]) { - | ^^^ expected slice `[u8]`, found array `[u8; 3]` + | ^^^ expected `&[u8]`, found `&[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:12:30 | LL | let _len = type_ascribe!(arr, &[u8]).len(); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` + | ^^^ expected `&[u8]`, found `&[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` diff --git a/tests/ui/type/type-check/coerce-result-return-value-2.stderr b/tests/ui/type/type-check/coerce-result-return-value-2.stderr index 5992162341e6e..b2c409e07b8c7 100644 --- a/tests/ui/type/type-check/coerce-result-return-value-2.stderr +++ b/tests/ui/type/type-check/coerce-result-return-value-2.stderr @@ -5,7 +5,7 @@ LL | fn foo4(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type LL | match true { LL | true => x, - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` @@ -21,7 +21,7 @@ LL | fn foo5(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type LL | match true { LL | true => return x, - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` @@ -37,7 +37,7 @@ LL | let _: Result<(), B> = { | ____________________________^ LL | | Err(A); LL | | }; - | |_____^ expected enum `Result`, found `()` + | |_____^ expected `Result<(), B>`, found `()` | = note: expected enum `Result<(), B>` found unit type `()` diff --git a/tests/ui/type/type-check/coerce-result-return-value.stderr b/tests/ui/type/type-check/coerce-result-return-value.stderr index 550153520782c..adec2f612ae0e 100644 --- a/tests/ui/type/type-check/coerce-result-return-value.stderr +++ b/tests/ui/type/type-check/coerce-result-return-value.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo1(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type LL | x - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` @@ -19,7 +19,7 @@ error[E0308]: mismatched types LL | fn foo2(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type LL | return x; - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` @@ -35,7 +35,7 @@ LL | fn foo3(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type LL | if true { LL | x - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` @@ -51,7 +51,7 @@ LL | fn foo3(x: Result<(), A>) -> Result<(), B> { | ------------- expected `Result<(), B>` because of return type ... LL | x - | ^ expected struct `B`, found struct `A` + | ^ expected `Result<(), B>`, found `Result<(), A>` | = note: expected enum `Result<_, B>` found enum `Result<_, A>` diff --git a/tests/ui/type/type-check/point-at-inference-2.stderr b/tests/ui/type/type-check/point-at-inference-2.stderr index 13227c5e245bd..1d2777ad69a21 100644 --- a/tests/ui/type/type-check/point-at-inference-2.stderr +++ b/tests/ui/type/type-check/point-at-inference-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/point-at-inference-2.rs:5:9 | LL | bar(v); - | --- ^ expected `i32`, found `&{integer}` + | --- ^ expected `Vec`, found `Vec<&{integer}>` | | | arguments to this function are incorrect | @@ -21,7 +21,7 @@ LL | baz(&v); | - here the type of `v` is inferred to be `Vec<&i32>` LL | baz(&v); LL | bar(v); - | --- ^ expected `i32`, found `&i32` + | --- ^ expected `Vec`, found `Vec<&i32>` | | | arguments to this function are incorrect | @@ -39,7 +39,7 @@ error[E0308]: mismatched types LL | baz(&v); | - here the type of `v` is inferred to be `Vec<&i32>` LL | bar(v); - | --- ^ expected `i32`, found `&i32` + | --- ^ expected `Vec`, found `Vec<&i32>` | | | arguments to this function are incorrect | diff --git a/tests/ui/type/type-check/point-at-inference.stderr b/tests/ui/type/type-check/point-at-inference.stderr index 70428fe841b9c..a76b4f90c734b 100644 --- a/tests/ui/type/type-check/point-at-inference.stderr +++ b/tests/ui/type/type-check/point-at-inference.stderr @@ -5,7 +5,7 @@ LL | foo.push(i); | - this is of type `&{integer}`, which causes `foo` to be inferred as `Vec<&{integer}>` ... LL | bar(foo); - | --- ^^^ expected `i32`, found `&{integer}` + | --- ^^^ expected `Vec`, found `Vec<&{integer}>` | | | arguments to this function are incorrect | diff --git a/tests/ui/type/type-mismatch-same-crate-name.rs b/tests/ui/type/type-mismatch-same-crate-name.rs index c9cdc874c02ea..2a59bd9945083 100644 --- a/tests/ui/type/type-mismatch-same-crate-name.rs +++ b/tests/ui/type/type-mismatch-same-crate-name.rs @@ -16,7 +16,7 @@ fn main() { a::try_foo(foo2); //~^ ERROR mismatched types //~| perhaps two different versions of crate `crate_a1` - //~| expected struct `main::a::Foo` + //~| expected `main::a::Foo`, found a different `main::a::Foo` a::try_bar(bar2); //~^ ERROR mismatched types //~| perhaps two different versions of crate `crate_a1` diff --git a/tests/ui/type/type-mismatch-same-crate-name.stderr b/tests/ui/type/type-mismatch-same-crate-name.stderr index fcafd315ebf54..504812f5867a6 100644 --- a/tests/ui/type/type-mismatch-same-crate-name.stderr +++ b/tests/ui/type/type-mismatch-same-crate-name.stderr @@ -2,17 +2,17 @@ error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:16:20 | LL | a::try_foo(foo2); - | ---------- ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` + | ---------- ^^^^ expected `main::a::Foo`, found a different `main::a::Foo` | | | arguments to this function are incorrect | - = note: struct `main::a::Foo` and struct `main::a::Foo` have similar names, but are actually distinct types -note: struct `main::a::Foo` is defined in crate `crate_a2` + = note: `main::a::Foo` and `main::a::Foo` have similar names, but are actually distinct types +note: `main::a::Foo` is defined in crate `crate_a2` --> $DIR/auxiliary/crate_a2.rs:1:1 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ -note: struct `main::a::Foo` is defined in crate `crate_a1` +note: `main::a::Foo` is defined in crate `crate_a1` --> $DIR/auxiliary/crate_a1.rs:1:1 | LL | pub struct Foo; diff --git a/tests/ui/type/type-mismatch.stderr b/tests/ui/type/type-mismatch.stderr index 6c187bad0725c..67a1f893050cd 100644 --- a/tests/ui/type/type-mismatch.stderr +++ b/tests/ui/type/type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:17:17 | LL | want::(f); - | ----------- ^ expected struct `foo`, found `usize` + | ----------- ^ expected `foo`, found `usize` | | | arguments to this function are incorrect | @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:18:17 | LL | want::(f); - | ----------- ^ expected struct `bar`, found `usize` + | ----------- ^ expected `bar`, found `usize` | | | arguments to this function are incorrect | @@ -30,7 +30,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:19:24 | LL | want::>(f); - | ------------------ ^ expected struct `Foo`, found `usize` + | ------------------ ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:20:27 | LL | want::>(f); - | --------------------- ^ expected struct `Foo`, found `usize` + | --------------------- ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -62,7 +62,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:21:22 | LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found `usize` + | ---------------- ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -78,7 +78,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:22:25 | LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found `usize` + | ------------------- ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -94,7 +94,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:23:22 | LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found `usize` + | ---------------- ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -110,7 +110,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:24:25 | LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found `usize` + | ------------------- ^ expected `Foo`, found `usize` | | | arguments to this function are incorrect | @@ -126,7 +126,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:28:19 | LL | want::(f); - | ------------- ^ expected `usize`, found struct `foo` + | ------------- ^ expected `usize`, found `foo` | | | arguments to this function are incorrect | @@ -140,7 +140,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:29:17 | LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `foo` + | ----------- ^ expected `bar`, found `foo` | | | arguments to this function are incorrect | @@ -154,7 +154,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:30:24 | LL | want::>(f); - | ------------------ ^ expected struct `Foo`, found struct `foo` + | ------------------ ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -170,7 +170,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:31:27 | LL | want::>(f); - | --------------------- ^ expected struct `Foo`, found struct `foo` + | --------------------- ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -186,7 +186,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:32:22 | LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found struct `foo` + | ---------------- ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -202,7 +202,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:33:25 | LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found struct `foo` + | ------------------- ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -218,7 +218,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:34:22 | LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found struct `foo` + | ---------------- ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -234,7 +234,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:35:25 | LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found struct `foo` + | ------------------- ^ expected `Foo`, found `foo` | | | arguments to this function are incorrect | @@ -250,7 +250,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:39:19 | LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` + | ------------- ^ expected `usize`, found `Foo` | | | arguments to this function are incorrect | @@ -266,7 +266,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:40:17 | LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` + | ----------- ^ expected `foo`, found `Foo` | | | arguments to this function are incorrect | @@ -282,7 +282,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:41:17 | LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` + | ----------- ^ expected `bar`, found `Foo` | | | arguments to this function are incorrect | @@ -298,7 +298,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:42:24 | LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` + | ------------------ ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -314,7 +314,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:43:27 | LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` + | --------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -330,7 +330,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:44:25 | LL | want::>(f); - | ------------------- ^ expected struct `B`, found struct `A` + | ------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -346,7 +346,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:45:22 | LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` + | ---------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -362,7 +362,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:46:25 | LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` + | ------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -380,7 +380,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ----------------- ^ | | | - | | expected `&Foo`, found struct `Foo` + | | expected `&Foo`, found `Foo` | | help: consider borrowing here: `&f` | arguments to this function are incorrect | @@ -396,7 +396,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:48:26 | LL | want::<&Foo>(f); - | -------------------- ^ expected `&Foo`, found struct `Foo` + | -------------------- ^ expected `&Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -412,7 +412,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:52:19 | LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` + | ------------- ^ expected `usize`, found `Foo` | | | arguments to this function are incorrect | @@ -428,7 +428,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:53:17 | LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` + | ----------- ^ expected `foo`, found `Foo` | | | arguments to this function are incorrect | @@ -444,7 +444,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:54:17 | LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` + | ----------- ^ expected `bar`, found `Foo` | | | arguments to this function are incorrect | @@ -460,7 +460,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:55:24 | LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` + | ------------------ ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -476,7 +476,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:56:27 | LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` + | --------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -492,7 +492,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:57:22 | LL | want::>(f); - | ---------------- ^ expected struct `A`, found struct `B` + | ---------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -508,7 +508,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:58:22 | LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` + | ---------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -524,7 +524,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:59:25 | LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` + | ------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -540,7 +540,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:60:23 | LL | want::<&Foo>(f); - | ----------------- ^ expected `&Foo`, found struct `Foo` + | ----------------- ^ expected `&Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -558,7 +558,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | -------------------- ^ | | | - | | expected `&Foo`, found struct `Foo` + | | expected `&Foo`, found `Foo` | | help: consider borrowing here: `&f` | arguments to this function are incorrect | @@ -574,7 +574,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:65:19 | LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` + | ------------- ^ expected `usize`, found `Foo` | | | arguments to this function are incorrect | @@ -590,7 +590,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:66:17 | LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` + | ----------- ^ expected `foo`, found `Foo` | | | arguments to this function are incorrect | @@ -606,7 +606,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:67:17 | LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` + | ----------- ^ expected `bar`, found `Foo` | | | arguments to this function are incorrect | @@ -622,7 +622,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:68:24 | LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` + | ------------------ ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -638,7 +638,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:69:27 | LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` + | --------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -654,7 +654,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:70:22 | LL | want::>(f); - | ---------------- ^ expected struct `A`, found struct `B` + | ---------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -670,7 +670,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:71:25 | LL | want::>(f); - | ------------------- ^ expected struct `B`, found struct `A` + | ------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -686,7 +686,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:72:22 | LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` + | ---------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -702,7 +702,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:73:25 | LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` + | ------------------- ^ expected `Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -718,7 +718,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:74:23 | LL | want::<&Foo>(f); - | ----------------- ^ expected `&Foo`, found struct `Foo` + | ----------------- ^ expected `&Foo`, found `Foo` | | | arguments to this function are incorrect | @@ -734,7 +734,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:75:26 | LL | want::<&Foo>(f); - | -------------------- ^ expected `&Foo`, found struct `Foo` + | -------------------- ^ expected `&Foo`, found `Foo` | | | arguments to this function are incorrect | diff --git a/tests/ui/typeck/assign-non-lval-derefmut.stderr b/tests/ui/typeck/assign-non-lval-derefmut.stderr index e394cf8206ede..b26d16da01521 100644 --- a/tests/ui/typeck/assign-non-lval-derefmut.stderr +++ b/tests/ui/typeck/assign-non-lval-derefmut.stderr @@ -30,7 +30,7 @@ error[E0308]: mismatched types LL | let mut y = x.lock().unwrap(); | ----------------- expected due to this value LL | y = 2; - | ^ expected struct `MutexGuard`, found integer + | ^ expected `MutexGuard<'_, usize>`, found integer | = note: expected struct `MutexGuard<'_, usize>` found type `{integer}` diff --git a/tests/ui/typeck/bad-type-in-vec-push.stderr b/tests/ui/typeck/bad-type-in-vec-push.stderr index e4c99ec8e701f..882854acb1d84 100644 --- a/tests/ui/typeck/bad-type-in-vec-push.stderr +++ b/tests/ui/typeck/bad-type-in-vec-push.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | vector.sort(); | ------ here the type of `vector` is inferred to be `Vec<_>` LL | result.push(vector); - | ---- ^^^^^^ expected integer, found struct `Vec` + | ---- ^^^^^^ expected integer, found `Vec<_>` | | | arguments to this method are incorrect | diff --git a/tests/ui/typeck/conversion-methods.stderr b/tests/ui/typeck/conversion-methods.stderr index 091502bdda34a..a9b5078ccdde3 100644 --- a/tests/ui/typeck/conversion-methods.stderr +++ b/tests/ui/typeck/conversion-methods.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | ------ ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found `&str` + | | expected `String`, found `&str` | expected due to this error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise"); | ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_path_buf()` | | | - | | expected struct `PathBuf`, found `&Path` + | | expected `PathBuf`, found `&Path` | expected due to this error[E0308]: mismatched types @@ -22,14 +22,14 @@ error[E0308]: mismatched types LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here | ------ ^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found integer + | | expected `String`, found integer | expected due to this error[E0308]: mismatched types --> $DIR/conversion-methods.rs:12:47 | LL | let _prove_piercing_earnest: Vec = &[1, 2, 3]; - | ---------- ^^^^^^^^^^ expected struct `Vec`, found `&[{integer}; 3]` + | ---------- ^^^^^^^^^^ expected `Vec`, found `&[{integer}; 3]` | | | expected due to this | diff --git a/tests/ui/typeck/deref-multi.stderr b/tests/ui/typeck/deref-multi.stderr index bd6575c73d244..4346e273d0d66 100644 --- a/tests/ui/typeck/deref-multi.stderr +++ b/tests/ui/typeck/deref-multi.stderr @@ -58,7 +58,7 @@ error[E0308]: mismatched types LL | fn d(x: std::sync::Mutex<&i32>) -> i32 { | --- expected `i32` because of return type LL | x.lock().unwrap() - | ^^^^^^^^^^^^^^^^^ expected `i32`, found struct `MutexGuard` + | ^^^^^^^^^^^^^^^^^ expected `i32`, found `MutexGuard<'_, &i32>` | = note: expected type `i32` found struct `MutexGuard<'_, &i32>` diff --git a/tests/ui/typeck/explain_clone_autoref.rs b/tests/ui/typeck/explain_clone_autoref.rs index 9279e4c3901db..4d21574700ad9 100644 --- a/tests/ui/typeck/explain_clone_autoref.rs +++ b/tests/ui/typeck/explain_clone_autoref.rs @@ -9,5 +9,5 @@ fn clone_thing(nc: &NotClone) -> NotClone { nc.clone() //~^ ERROR mismatched type //~| NOTE `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead - //~| NOTE expected struct `NotClone`, found `&NotClone` + //~| NOTE expected `NotClone`, found `&NotClone` } diff --git a/tests/ui/typeck/explain_clone_autoref.stderr b/tests/ui/typeck/explain_clone_autoref.stderr index ff36e18d28301..4539da4389b3b 100644 --- a/tests/ui/typeck/explain_clone_autoref.stderr +++ b/tests/ui/typeck/explain_clone_autoref.stderr @@ -5,7 +5,7 @@ LL | fn clone_thing(nc: &NotClone) -> NotClone { | -------- expected `NotClone` because of return type LL | LL | nc.clone() - | ^^^^^^^^^^ expected struct `NotClone`, found `&NotClone` + | ^^^^^^^^^^ expected `NotClone`, found `&NotClone` | note: `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead --> $DIR/explain_clone_autoref.rs:9:5 diff --git a/tests/ui/typeck/issue-100246.stderr b/tests/ui/typeck/issue-100246.stderr index 8b77de94e89f8..428a0792091e6 100644 --- a/tests/ui/typeck/issue-100246.stderr +++ b/tests/ui/typeck/issue-100246.stderr @@ -2,7 +2,7 @@ error[E0308]: `?` operator has incompatible types --> $DIR/issue-100246.rs:28:24 | LL | let other: Other = downcast()?; - | ^^^^^^^^^^^ expected struct `Other`, found reference + | ^^^^^^^^^^^ expected `Other`, found `&_` | = note: `?` operator cannot convert from `&_` to `Other` = note: expected struct `Other` diff --git a/tests/ui/typeck/issue-13853.stderr b/tests/ui/typeck/issue-13853.stderr index 876ac2c67ef3f..11d34f5b93b0c 100644 --- a/tests/ui/typeck/issue-13853.stderr +++ b/tests/ui/typeck/issue-13853.stderr @@ -5,7 +5,7 @@ LL | fn nodes<'a, I: Iterator>(&self) -> I | - this type parameter - expected `I` because of return type ... LL | self.iter() - | ^^^^^^^^^^^ expected type parameter `I`, found struct `Iter` + | ^^^^^^^^^^^ expected type parameter `I`, found `Iter<'_, N>` | = note: expected type parameter `I` found struct `std::slice::Iter<'_, N>` @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | iterate(graph); | ------- ^^^^^ | | | - | | expected reference, found struct `Vec` + | | expected `&_`, found `Vec` | | help: consider borrowing here: `&graph` | arguments to this function are incorrect | diff --git a/tests/ui/typeck/issue-31173.stderr b/tests/ui/typeck/issue-31173.stderr index f3be99f9bcb4b..8346c9a0aaecc 100644 --- a/tests/ui/typeck/issue-31173.stderr +++ b/tests/ui/typeck/issue-31173.stderr @@ -2,7 +2,7 @@ error[E0271]: expected `TakeWhile<&mut IntoIter, [closure@issue-31173.rs:7:2 --> $DIR/issue-31173.rs:11:10 | LL | .cloned() - | ^^^^^^ expected reference, found `u8` + | ^^^^^^ expected `&_`, found `u8` | = note: expected reference `&_` found type `u8` diff --git a/tests/ui/typeck/issue-46112.stderr b/tests/ui/typeck/issue-46112.stderr index 8f5ff51fbe100..26fc21dda06ae 100644 --- a/tests/ui/typeck/issue-46112.stderr +++ b/tests/ui/typeck/issue-46112.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-46112.rs:9:21 | LL | fn main() { test(Ok(())); } - | -- ^^ expected enum `Option`, found `()` + | -- ^^ expected `Option<()>`, found `()` | | | arguments to this enum variant are incorrect | diff --git a/tests/ui/typeck/issue-50687-ice-on-borrow.stderr b/tests/ui/typeck/issue-50687-ice-on-borrow.stderr index e6a0edac4b111..9e48ccefd86b9 100644 --- a/tests/ui/typeck/issue-50687-ice-on-borrow.stderr +++ b/tests/ui/typeck/issue-50687-ice-on-borrow.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-50687-ice-on-borrow.rs:40:17 | LL | let _: () = Borrow::borrow(&owned); - | -- ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found reference + | -- ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&_` | | | expected due to this | diff --git a/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr b/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr index b92a6f2ec2b48..dc4bc5b5f44bb 100644 --- a/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr +++ b/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn ice(x: Box>) { | - help: try adding a return type: `-> (dyn Iterator + 'static)` LL | *x - | ^^ expected `()`, found trait object `dyn Iterator` + | ^^ expected `()`, found `dyn Iterator` | = note: expected unit type `()` found trait object `(dyn Iterator + 'static)` diff --git a/tests/ui/typeck/issue-67971.stderr b/tests/ui/typeck/issue-67971.stderr index 5d07f9cc748ea..d50ed9cf13bb4 100644 --- a/tests/ui/typeck/issue-67971.stderr +++ b/tests/ui/typeck/issue-67971.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-67971.rs:3:24 | LL | fn foo(ctx: &mut S) -> String { - | --- ^^^^^^ expected struct `String`, found `()` + | --- ^^^^^^ expected `String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/tests/ui/typeck/issue-84160.stderr b/tests/ui/typeck/issue-84160.stderr index 24c188b3fcb70..4d456ae842f62 100644 --- a/tests/ui/typeck/issue-84160.stderr +++ b/tests/ui/typeck/issue-84160.stderr @@ -5,7 +5,7 @@ LL | fn mismatched_types_with_reference(x: &u32) -> &u32 { | ---- expected `&u32` because of return type ... LL | return "test"; - | ^^^^^^ expected `u32`, found `str` + | ^^^^^^ expected `&u32`, found `&str` | = note: expected reference `&u32` found reference `&'static str` diff --git a/tests/ui/typeck/issue-84768.stderr b/tests/ui/typeck/issue-84768.stderr index 09f3aee2d9ec5..63936f9979f48 100644 --- a/tests/ui/typeck/issue-84768.stderr +++ b/tests/ui/typeck/issue-84768.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-84768.rs:7:42 | LL | ::call_once(f, 1) - | --------------------------------- ^ expected tuple, found integer + | --------------------------------- ^ expected `(&mut u8,)`, found integer | | | arguments to this function are incorrect | diff --git a/tests/ui/typeck/issue-89856.stderr b/tests/ui/typeck/issue-89856.stderr index 5fa1ae1a54f72..6b9cbe52c2553 100644 --- a/tests/ui/typeck/issue-89856.stderr +++ b/tests/ui/typeck/issue-89856.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-89856.rs:6:20 | LL | take_str_maybe(option); - | -------------- ^^^^^^ expected `str`, found struct `String` + | -------------- ^^^^^^ expected `Option<&str>`, found `Option<&String>` | | | arguments to this function are incorrect | diff --git a/tests/ui/typeck/issue-91450-inner-ty-error.stderr b/tests/ui/typeck/issue-91450-inner-ty-error.stderr index 32f4c8f6fdf82..7ca5446c2e7ab 100644 --- a/tests/ui/typeck/issue-91450-inner-ty-error.stderr +++ b/tests/ui/typeck/issue-91450-inner-ty-error.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-91450-inner-ty-error.rs:4:13 | LL | fn foo() -> Option<_> {} - | --- ^^^^^^^^^ expected enum `Option`, found `()` + | --- ^^^^^^^^^ expected `Option<_>`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/tests/ui/typeck/issue-92481.stderr b/tests/ui/typeck/issue-92481.stderr index cd778a649b621..c3acbd2c067c5 100644 --- a/tests/ui/typeck/issue-92481.stderr +++ b/tests/ui/typeck/issue-92481.stderr @@ -49,7 +49,7 @@ LL | fn r({) { LL | / Ok { LL | | d..||_=m LL | | } - | |_____^ expected `()`, found enum `Result` + | |_____^ expected `()`, found `Result<_, _>` | = note: expected unit type `()` found enum `Result<_, _>` diff --git a/tests/ui/typeck/issue-96530.stderr b/tests/ui/typeck/issue-96530.stderr index 4b4568b1de9b2..3a67ef0260b41 100644 --- a/tests/ui/typeck/issue-96530.stderr +++ b/tests/ui/typeck/issue-96530.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-96530.rs:9:11 | LL | ..man.clone() - | ^^^^^^^^^^^ expected struct `Person`, found `&Person` + | ^^^^^^^^^^^ expected `Person`, found `&Person` error: aborting due to previous error diff --git a/tests/ui/typeck/return_type_containing_closure.rs b/tests/ui/typeck/return_type_containing_closure.rs index 29624e08a2e80..8b826daeede48 100644 --- a/tests/ui/typeck/return_type_containing_closure.rs +++ b/tests/ui/typeck/return_type_containing_closure.rs @@ -2,7 +2,7 @@ fn foo() { //~ HELP a return type might be missing here vec!['a'].iter().map(|c| c) //~^ ERROR mismatched types [E0308] - //~| NOTE expected `()`, found struct `Map` + //~| NOTE expected `()`, found `Map, ...>` //~| NOTE expected unit type `()` //~| HELP consider using a semicolon here } diff --git a/tests/ui/typeck/return_type_containing_closure.stderr b/tests/ui/typeck/return_type_containing_closure.stderr index 101aee39559c3..f9a240963997b 100644 --- a/tests/ui/typeck/return_type_containing_closure.stderr +++ b/tests/ui/typeck/return_type_containing_closure.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/return_type_containing_closure.rs:3:5 | LL | vec!['a'].iter().map(|c| c) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Map` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Map, ...>` | = note: expected unit type `()` found struct `Map, [closure@$DIR/return_type_containing_closure.rs:3:26: 3:29]>` diff --git a/tests/ui/typeck/typeck_type_placeholder_mismatch.rs b/tests/ui/typeck/typeck_type_placeholder_mismatch.rs index 2f9cfcf8dbb5a..718b6deed1bb1 100644 --- a/tests/ui/typeck/typeck_type_placeholder_mismatch.rs +++ b/tests/ui/typeck/typeck_type_placeholder_mismatch.rs @@ -14,7 +14,7 @@ fn test1() { //~^ ERROR mismatched types //~| expected struct `Foo<_>` //~| found struct `Bar` - //~| expected struct `Foo`, found struct `Bar` + //~| expected `Foo<_>`, found `Bar` let y: Foo = x; } @@ -23,5 +23,5 @@ fn test2() { //~^ ERROR mismatched types //~| expected struct `Foo<_>` //~| found struct `Bar` - //~| expected struct `Foo`, found struct `Bar` + //~| expected `Foo<_>`, found `Bar` } diff --git a/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr b/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr index 867412a24b282..bf8e0bbb519c4 100644 --- a/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/typeck_type_placeholder_mismatch.rs:13:21 | LL | let x: Foo<_> = Bar::(PhantomData); - | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar` | | | expected due to this | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/typeck_type_placeholder_mismatch.rs:22:21 | LL | let x: Foo<_> = Bar::(PhantomData); - | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar` | | | expected due to this | diff --git a/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr b/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr index 99ec517834003..482fd3cb44def 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr @@ -1,4 +1,4 @@ -error[E0599]: no method named `call` found for closure `[closure@unboxed-closures-static-call-wrong-trait.rs:6:26]` in the current scope +error[E0599]: no method named `call` found for closure `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:29]` in the current scope --> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10 | LL | mut_.call((0, )); diff --git a/tests/ui/unsized-locals/suggest-borrow.stderr b/tests/ui/unsized-locals/suggest-borrow.stderr index 08745eab28d16..d456c16de0dc8 100644 --- a/tests/ui/unsized-locals/suggest-borrow.stderr +++ b/tests/ui/unsized-locals/suggest-borrow.stderr @@ -18,7 +18,7 @@ error[E0308]: mismatched types LL | let x: &[u8] = vec!(1, 2, 3)[..]; | ----- ^^^^^^^^^^^^^^^^^ | | | - | | expected `&[u8]`, found slice `[{integer}]` + | | expected `&[u8]`, found `[{integer}]` | | help: consider borrowing here: `&vec!(1, 2, 3)[..]` | expected due to this @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/suggest-borrow.rs:4:19 | LL | let x: [u8] = &vec!(1, 2, 3)[..]; - | ---- ^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found `&[{integer}]` + | ---- ^^^^^^^^^^^^^^^^^^ expected `[u8]`, found `&[{integer}]` | | | expected due to this | diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index c96c59afc5a54..bfb7c3957f420 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -9,7 +9,7 @@ LL | | move || println!("{a}") | | expected because of this LL | | } else { LL | | Box::new(move || println!("{}", b)) - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found struct `Box` + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found `Box<[closure@box-instead-of-dyn-fn.rs:10:18]>` LL | | LL | | } | |_____- `if` and `else` have incompatible types diff --git a/tests/ui/unsized/param-mentioned-by-different-field.stderr b/tests/ui/unsized/param-mentioned-by-different-field.stderr index d18fa6456f3ee..b1ad0cb5b88ea 100644 --- a/tests/ui/unsized/param-mentioned-by-different-field.stderr +++ b/tests/ui/unsized/param-mentioned-by-different-field.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/param-mentioned-by-different-field.rs:8:25 | LL | let y: &Foo<[u8]> = &x; - | ---------- ^^ expected slice `[u8]`, found array `[u8; 1]` + | ---------- ^^ expected `&Foo<[u8]>`, found `&Foo<[u8; 1]>` | | | expected due to this | diff --git a/tests/ui/wf/wf-unsafe-trait-obj-match.stderr b/tests/ui/wf/wf-unsafe-trait-obj-match.stderr index 96fc1d36b9cfa..d2b41630976ad 100644 --- a/tests/ui/wf/wf-unsafe-trait-obj-match.stderr +++ b/tests/ui/wf/wf-unsafe-trait-obj-match.stderr @@ -5,7 +5,7 @@ LL | / match opt() { LL | | Some(()) => &S, | | -- this is found to be of type `&S` LL | | None => &R, - | | ^^ expected struct `S`, found struct `R` + | | ^^ expected `&S`, found `&R` LL | | } | |_____- `match` arms have incompatible types | diff --git a/tests/ui/wrong-mul-method-signature.stderr b/tests/ui/wrong-mul-method-signature.stderr index 504a6032b01f9..25a92f5ec12a7 100644 --- a/tests/ui/wrong-mul-method-signature.stderr +++ b/tests/ui/wrong-mul-method-signature.stderr @@ -16,7 +16,7 @@ error[E0053]: method `mul` has an incompatible type for trait LL | fn mul(self, s: f64) -> Vec2 { | ^^^ | | - | expected struct `Vec2`, found `f64` + | expected `Vec2`, found `f64` | help: change the parameter type to match the trait: `Vec2` | = note: expected signature `fn(Vec2, Vec2) -> f64` @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order - | ----------------------- ^^^ expected struct `Vec2`, found floating-point number + | ----------------------- ^^^ expected `Vec2`, found floating-point number | | | expected because this is `Vec2` @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:19 | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order - | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found `f64` + | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Vec2`, found `f64` | | | expected due to this diff --git a/x.py b/x.py index 6df4033d55d72..5dee953a31899 100755 --- a/x.py +++ b/x.py @@ -22,7 +22,8 @@ pass rust_dir = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.join(rust_dir, "src", "bootstrap")) +# For the import below, have Python search in src/bootstrap first. +sys.path.insert(0, os.path.join(rust_dir, "src", "bootstrap")) import bootstrap bootstrap.main()