1
Fork 0

Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov

diagnostics: shorten paths of unique symbols

This is a step towards implementing a fix for #50310, and continuation of the discussion in [Pre-RFC: Nicer Types In Diagnostics - compiler - Rust Internals](https://internals.rust-lang.org/t/pre-rfc-nicer-types-in-diagnostics/11139). Impressed upon me from previous discussion in #21934 that an RFC for this is not needed, and I should just come up with code.

The recent improvements to `use` suggestions that I've contributed have given rise to this implementation. Contrary to previous suggestions, it's rather simple logic, and I believe it only reduces the amount of cognitive load that a developer would need when reading type errors.

-----

If a symbol name can only be imported from one place, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path to the last component.

This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable from anywhere.
This commit is contained in:
bors 2020-09-03 23:27:45 +00:00
commit af3c6e733a
1316 changed files with 4820 additions and 4497 deletions

View file

@ -4,6 +4,7 @@ use crate::type_::Type;
use rustc_codegen_ssa::traits::*; use rustc_codegen_ssa::traits::*;
use rustc_middle::bug; use rustc_middle::bug;
use rustc_middle::ty::layout::{FnAbiExt, TyAndLayout}; use rustc_middle::ty::layout::{FnAbiExt, TyAndLayout};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, Ty, TypeFoldable}; use rustc_middle::ty::{self, Ty, TypeFoldable};
use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape}; use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape};
use rustc_target::abi::{Int, Pointer, F32, F64}; use rustc_target::abi::{Int, Pointer, F32, F64};
@ -57,7 +58,7 @@ fn uncached_llvm_type<'a, 'tcx>(
ty::Adt(..) | ty::Closure(..) | ty::Foreign(..) | ty::Generator(..) | ty::Str ty::Adt(..) | ty::Closure(..) | ty::Foreign(..) | ty::Generator(..) | ty::Str
if !cx.sess().fewer_names() => if !cx.sess().fewer_names() =>
{ {
let mut name = layout.ty.to_string(); let mut name = with_no_trimmed_paths(|| layout.ty.to_string());
if let (&ty::Adt(def, _), &Variants::Single { index }) = if let (&ty::Adt(def, _), &Variants::Single { index }) =
(&layout.ty.kind, &layout.variants) (&layout.ty.kind, &layout.variants)
{ {

View file

@ -16,6 +16,7 @@ use rustc_middle::mir;
use rustc_middle::mir::interpret::{AllocId, ConstValue, Pointer, Scalar}; use rustc_middle::mir::interpret::{AllocId, ConstValue, Pointer, Scalar};
use rustc_middle::mir::AssertKind; use rustc_middle::mir::AssertKind;
use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt}; use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, Instance, Ty, TypeFoldable}; use rustc_middle::ty::{self, Instance, Ty, TypeFoldable};
use rustc_span::source_map::Span; use rustc_span::source_map::Span;
use rustc_span::{sym, Symbol}; use rustc_span::{sym, Symbol};
@ -479,14 +480,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
UninitValid => !layout.might_permit_raw_init(bx, /*zero:*/ false).unwrap(), UninitValid => !layout.might_permit_raw_init(bx, /*zero:*/ false).unwrap(),
}; };
if do_panic { if do_panic {
let msg_str = if layout.abi.is_uninhabited() { let msg_str = with_no_trimmed_paths(|| {
// Use this error even for the other intrinsics as it is more precise. if layout.abi.is_uninhabited() {
format!("attempted to instantiate uninhabited type `{}`", ty) // Use this error even for the other intrinsics as it is more precise.
} else if intrinsic == ZeroValid { format!("attempted to instantiate uninhabited type `{}`", ty)
format!("attempted to zero-initialize type `{}`, which is invalid", ty) } else if intrinsic == ZeroValid {
} else { format!("attempted to zero-initialize type `{}`, which is invalid", ty)
format!("attempted to leave type `{}` uninitialized, which is invalid", ty) } else {
}; format!("attempted to leave type `{}` uninitialized, which is invalid", ty)
}
});
let msg = bx.const_str(Symbol::intern(&msg_str)); let msg = bx.const_str(Symbol::intern(&msg_str));
let location = self.get_caller_location(bx, span).immediate(); let location = self.get_caller_location(bx, span).immediate();

View file

@ -32,7 +32,7 @@ use rustc_save_analysis as save;
use rustc_save_analysis::DumpHandler; use rustc_save_analysis::DumpHandler;
use rustc_serialize::json::{self, ToJson}; use rustc_serialize::json::{self, ToJson};
use rustc_session::config::nightly_options; use rustc_session::config::nightly_options;
use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest}; use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest, TrimmedDefPaths};
use rustc_session::getopts; use rustc_session::getopts;
use rustc_session::lint::{Lint, LintId}; use rustc_session::lint::{Lint, LintId};
use rustc_session::{config, DiagnosticOutput, Session}; use rustc_session::{config, DiagnosticOutput, Session};
@ -126,6 +126,7 @@ impl Callbacks for TimePassesCallbacks {
// time because it will mess up the --prints output. See #64339. // time because it will mess up the --prints output. See #64339.
self.time_passes = config.opts.prints.is_empty() self.time_passes = config.opts.prints.is_empty()
&& (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time); && (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
config.opts.trimmed_def_paths = TrimmedDefPaths::GoodPath;
} }
} }

View file

@ -4,6 +4,7 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(backtrace)]
#![feature(nll)] #![feature(nll)]
#[macro_use] #[macro_use]
@ -296,9 +297,11 @@ struct HandlerInner {
/// This is not necessarily the count that's reported to the user once /// This is not necessarily the count that's reported to the user once
/// compilation ends. /// compilation ends.
err_count: usize, err_count: usize,
warn_count: usize,
deduplicated_err_count: usize, deduplicated_err_count: usize,
emitter: Box<dyn Emitter + sync::Send>, emitter: Box<dyn Emitter + sync::Send>,
delayed_span_bugs: Vec<Diagnostic>, delayed_span_bugs: Vec<Diagnostic>,
delayed_good_path_bugs: Vec<Diagnostic>,
/// This set contains the `DiagnosticId` of all emitted diagnostics to avoid /// This set contains the `DiagnosticId` of all emitted diagnostics to avoid
/// emitting the same diagnostic with extended help (`--teach`) twice, which /// emitting the same diagnostic with extended help (`--teach`) twice, which
@ -361,13 +364,15 @@ impl Drop for HandlerInner {
if !self.has_errors() { if !self.has_errors() {
let bugs = std::mem::replace(&mut self.delayed_span_bugs, Vec::new()); let bugs = std::mem::replace(&mut self.delayed_span_bugs, Vec::new());
let has_bugs = !bugs.is_empty(); self.flush_delayed(bugs, "no errors encountered even though `delay_span_bug` issued");
for bug in bugs { }
self.emit_diagnostic(&bug);
} if !self.has_any_message() {
if has_bugs { let bugs = std::mem::replace(&mut self.delayed_good_path_bugs, Vec::new());
panic!("no errors encountered even though `delay_span_bug` issued"); self.flush_delayed(
} bugs,
"no warnings or errors encountered even though `delayed_good_path_bugs` issued",
);
} }
} }
} }
@ -422,10 +427,12 @@ impl Handler {
inner: Lock::new(HandlerInner { inner: Lock::new(HandlerInner {
flags, flags,
err_count: 0, err_count: 0,
warn_count: 0,
deduplicated_err_count: 0, deduplicated_err_count: 0,
deduplicated_warn_count: 0, deduplicated_warn_count: 0,
emitter, emitter,
delayed_span_bugs: Vec::new(), delayed_span_bugs: Vec::new(),
delayed_good_path_bugs: Vec::new(),
taught_diagnostics: Default::default(), taught_diagnostics: Default::default(),
emitted_diagnostic_codes: Default::default(), emitted_diagnostic_codes: Default::default(),
emitted_diagnostics: Default::default(), emitted_diagnostics: Default::default(),
@ -448,11 +455,13 @@ impl Handler {
pub fn reset_err_count(&self) { pub fn reset_err_count(&self) {
let mut inner = self.inner.borrow_mut(); let mut inner = self.inner.borrow_mut();
inner.err_count = 0; inner.err_count = 0;
inner.warn_count = 0;
inner.deduplicated_err_count = 0; inner.deduplicated_err_count = 0;
inner.deduplicated_warn_count = 0; inner.deduplicated_warn_count = 0;
// actually free the underlying memory (which `clear` would not do) // actually free the underlying memory (which `clear` would not do)
inner.delayed_span_bugs = Default::default(); inner.delayed_span_bugs = Default::default();
inner.delayed_good_path_bugs = Default::default();
inner.taught_diagnostics = Default::default(); inner.taught_diagnostics = Default::default();
inner.emitted_diagnostic_codes = Default::default(); inner.emitted_diagnostic_codes = Default::default();
inner.emitted_diagnostics = Default::default(); inner.emitted_diagnostics = Default::default();
@ -629,6 +638,10 @@ impl Handler {
self.inner.borrow_mut().delay_span_bug(span, msg) self.inner.borrow_mut().delay_span_bug(span, msg)
} }
pub fn delay_good_path_bug(&self, msg: &str) {
self.inner.borrow_mut().delay_good_path_bug(msg)
}
pub fn span_bug_no_panic(&self, span: impl Into<MultiSpan>, msg: &str) { pub fn span_bug_no_panic(&self, span: impl Into<MultiSpan>, msg: &str) {
self.emit_diag_at_span(Diagnostic::new(Bug, msg), span); self.emit_diag_at_span(Diagnostic::new(Bug, msg), span);
} }
@ -768,6 +781,8 @@ impl HandlerInner {
} }
if diagnostic.is_error() { if diagnostic.is_error() {
self.bump_err_count(); self.bump_err_count();
} else {
self.bump_warn_count();
} }
} }
@ -859,6 +874,9 @@ impl HandlerInner {
fn has_errors_or_delayed_span_bugs(&self) -> bool { fn has_errors_or_delayed_span_bugs(&self) -> bool {
self.has_errors() || !self.delayed_span_bugs.is_empty() self.has_errors() || !self.delayed_span_bugs.is_empty()
} }
fn has_any_message(&self) -> bool {
self.err_count() > 0 || self.warn_count > 0
}
fn abort_if_errors(&mut self) { fn abort_if_errors(&mut self) {
self.emit_stashed_diagnostics(); self.emit_stashed_diagnostics();
@ -892,6 +910,15 @@ impl HandlerInner {
self.delay_as_bug(diagnostic) self.delay_as_bug(diagnostic)
} }
fn delay_good_path_bug(&mut self, msg: &str) {
let mut diagnostic = Diagnostic::new(Level::Bug, msg);
if self.flags.report_delayed_bugs {
self.emit_diagnostic(&diagnostic);
}
diagnostic.note(&format!("delayed at {}", std::backtrace::Backtrace::force_capture()));
self.delayed_good_path_bugs.push(diagnostic);
}
fn failure(&mut self, msg: &str) { fn failure(&mut self, msg: &str) {
self.emit_diagnostic(&Diagnostic::new(FailureNote, msg)); self.emit_diagnostic(&Diagnostic::new(FailureNote, msg));
} }
@ -925,11 +952,25 @@ impl HandlerInner {
self.delayed_span_bugs.push(diagnostic); self.delayed_span_bugs.push(diagnostic);
} }
fn flush_delayed(&mut self, bugs: Vec<Diagnostic>, explanation: &str) {
let has_bugs = !bugs.is_empty();
for bug in bugs {
self.emit_diagnostic(&bug);
}
if has_bugs {
panic!("{}", explanation);
}
}
fn bump_err_count(&mut self) { fn bump_err_count(&mut self) {
self.err_count += 1; self.err_count += 1;
self.panic_if_treat_err_as_bug(); self.panic_if_treat_err_as_bug();
} }
fn bump_warn_count(&mut self) {
self.warn_count += 1;
}
fn panic_if_treat_err_as_bug(&self) { fn panic_if_treat_err_as_bug(&self) {
if self.treat_err_as_bug() { if self.treat_err_as_bug() {
let s = match (self.err_count(), self.flags.treat_err_as_bug.unwrap_or(0)) { let s = match (self.err_count(), self.flags.treat_err_as_bug.unwrap_or(0)) {

View file

@ -611,11 +611,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
let sig = self.tcx.fn_sig(did); let sig = self.tcx.fn_sig(did);
let bound_output = sig.output(); let bound_output = sig.output();
let output = bound_output.skip_binder(); let output = bound_output.skip_binder();
err.span_label(e.span, &format!("this method call resolves to `{:?}`", output)); err.span_label(e.span, &format!("this method call resolves to `{}`", output));
let kind = &output.kind; let kind = &output.kind;
if let ty::Projection(proj) = kind { if let ty::Projection(proj) = kind {
if let Some(span) = self.tcx.hir().span_if_local(proj.item_def_id) { if let Some(span) = self.tcx.hir().span_if_local(proj.item_def_id) {
err.span_label(span, &format!("`{:?}` defined here", output)); err.span_label(span, &format!("`{}` defined here", output));
} }
} }
} }

View file

@ -58,8 +58,8 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
.tcx() .tcx()
.sess .sess
.struct_span_err(sp, "`impl` item signature doesn't match `trait` item signature"); .struct_span_err(sp, "`impl` item signature doesn't match `trait` item signature");
err.span_label(sp, &format!("found `{:?}`", found)); err.span_label(sp, &format!("found `{}`", found));
err.span_label(trait_sp, &format!("expected `{:?}`", expected)); err.span_label(trait_sp, &format!("expected `{}`", expected));
// Get the span of all the used type parameters in the method. // Get the span of all the used type parameters in the method.
let assoc_item = self.tcx().associated_item(trait_def_id); let assoc_item = self.tcx().associated_item(trait_def_id);
@ -92,7 +92,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
err.note_expected_found(&"", expected, &"", found); err.note_expected_found(&"", expected, &"", found);
} else { } else {
// This fallback shouldn't be necessary, but let's keep it in just in case. // This fallback shouldn't be necessary, but let's keep it in just in case.
err.note(&format!("expected `{:?}`\n found `{:?}`", expected, found)); err.note(&format!("expected `{}`\n found `{}`", expected, found));
} }
err.span_help( err.span_help(
type_param_span, type_param_span,

View file

@ -518,6 +518,7 @@ fn test_debugging_options_tracking_hash() {
untracked!(time_llvm_passes, true); untracked!(time_llvm_passes, true);
untracked!(time_passes, true); untracked!(time_passes, true);
untracked!(trace_macros, true); untracked!(trace_macros, true);
untracked!(trim_diagnostic_paths, false);
untracked!(ui_testing, true); untracked!(ui_testing, true);
untracked!(unpretty, Some("expanded".to_string())); untracked!(unpretty, Some("expanded".to_string()));
untracked!(unstable_options, true); untracked!(unstable_options, true);

View file

@ -40,6 +40,7 @@ use rustc_hir::{ForeignItemKind, GenericParamKind, PatKind};
use rustc_hir::{HirId, HirIdSet, Node}; use rustc_hir::{HirId, HirIdSet, Node};
use rustc_index::vec::Idx; use rustc_index::vec::Idx;
use rustc_middle::lint::LintDiagnosticBuilder; use rustc_middle::lint::LintDiagnosticBuilder;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::subst::{GenericArgKind, Subst}; use rustc_middle::ty::subst::{GenericArgKind, Subst};
use rustc_middle::ty::{self, layout::LayoutError, Ty, TyCtxt}; use rustc_middle::ty::{self, layout::LayoutError, Ty, TyCtxt};
use rustc_session::lint::FutureIncompatibleInfo; use rustc_session::lint::FutureIncompatibleInfo;
@ -2040,7 +2041,9 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
// using zeroed or uninitialized memory. // using zeroed or uninitialized memory.
// We are extremely conservative with what we warn about. // We are extremely conservative with what we warn about.
let conjured_ty = cx.typeck_results().expr_ty(expr); let conjured_ty = cx.typeck_results().expr_ty(expr);
if let Some((msg, span)) = ty_find_init_error(cx.tcx, conjured_ty, init) { if let Some((msg, span)) =
with_no_trimmed_paths(|| ty_find_init_error(cx.tcx, conjured_ty, init))
{
cx.struct_span_lint(INVALID_VALUE, expr.span, |lint| { cx.struct_span_lint(INVALID_VALUE, expr.span, |lint| {
let mut err = lint.build(&format!( let mut err = lint.build(&format!(
"the type `{}` does not permit {}", "the type `{}` does not permit {}",

View file

@ -31,6 +31,7 @@ use rustc_middle::lint::LintDiagnosticBuilder;
use rustc_middle::middle::privacy::AccessLevels; use rustc_middle::middle::privacy::AccessLevels;
use rustc_middle::middle::stability; use rustc_middle::middle::stability;
use rustc_middle::ty::layout::{LayoutError, TyAndLayout}; use rustc_middle::ty::layout::{LayoutError, TyAndLayout};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, print::Printer, subst::GenericArg, Ty, TyCtxt}; use rustc_middle::ty::{self, print::Printer, subst::GenericArg, Ty, TyCtxt};
use rustc_session::lint::{add_elided_lifetime_in_path_suggestion, BuiltinLintDiagnostics}; use rustc_session::lint::{add_elided_lifetime_in_path_suggestion, BuiltinLintDiagnostics};
use rustc_session::lint::{FutureIncompatibleInfo, Level, Lint, LintBuffer, LintId}; use rustc_session::lint::{FutureIncompatibleInfo, Level, Lint, LintBuffer, LintId};
@ -795,10 +796,12 @@ impl<'tcx> LateContext<'tcx> {
} }
// This shouldn't ever be needed, but just in case: // This shouldn't ever be needed, but just in case:
Ok(vec![match trait_ref { with_no_trimmed_paths(|| {
Some(trait_ref) => Symbol::intern(&format!("{:?}", trait_ref)), Ok(vec![match trait_ref {
None => Symbol::intern(&format!("<{}>", self_ty)), Some(trait_ref) => Symbol::intern(&format!("{:?}", trait_ref)),
}]) None => Symbol::intern(&format!("<{}>", self_ty)),
}])
})
} }
fn path_append_impl( fn path_append_impl(
@ -812,12 +815,16 @@ impl<'tcx> LateContext<'tcx> {
// This shouldn't ever be needed, but just in case: // This shouldn't ever be needed, but just in case:
path.push(match trait_ref { path.push(match trait_ref {
Some(trait_ref) => Symbol::intern(&format!( Some(trait_ref) => with_no_trimmed_paths(|| {
"<impl {} for {}>", Symbol::intern(&format!(
trait_ref.print_only_trait_path(), "<impl {} for {}>",
self_ty trait_ref.print_only_trait_path(),
)), self_ty
None => Symbol::intern(&format!("<impl {}>", self_ty)), ))
}),
None => {
with_no_trimmed_paths(|| Symbol::intern(&format!("<impl {}>", self_ty)))
}
}); });
Ok(path) Ok(path)

View file

@ -392,7 +392,7 @@ fn add_query_description_impl(
#tcx: TyCtxt<'tcx>, #tcx: TyCtxt<'tcx>,
#key: #arg, #key: #arg,
) -> Cow<'static, str> { ) -> Cow<'static, str> {
format!(#desc).into() ::rustc_middle::ty::print::with_no_trimmed_paths(|| format!(#desc).into())
} }
}; };

View file

@ -13,6 +13,7 @@ use rustc_hir as hir;
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX}; use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
use rustc_hir::{self, HirId}; use rustc_hir::{self, HirId};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE}; use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
use rustc_session::lint::{BuiltinLintDiagnostics, Lint, LintBuffer}; use rustc_session::lint::{BuiltinLintDiagnostics, Lint, LintBuffer};
use rustc_session::parse::feature_err_issue; use rustc_session::parse::feature_err_issue;
@ -308,7 +309,7 @@ impl<'tcx> TyCtxt<'tcx> {
// #[rustc_deprecated] however wants to emit down the whole // #[rustc_deprecated] however wants to emit down the whole
// hierarchy. // hierarchy.
if !skip || depr_entry.attr.is_since_rustc_version { if !skip || depr_entry.attr.is_since_rustc_version {
let path = &self.def_path_str(def_id); let path = &with_no_trimmed_paths(|| self.def_path_str(def_id));
let kind = self.def_kind(def_id).descr(def_id); let kind = self.def_kind(def_id).descr(def_id);
let (message, lint) = deprecation_message(&depr_entry.attr, kind, path); let (message, lint) = deprecation_message(&depr_entry.attr, kind, path);
late_report_deprecation( late_report_deprecation(

View file

@ -108,6 +108,7 @@ use rustc_data_structures::sync::{HashMapExt, Lock};
use rustc_data_structures::tiny_list::TinyList; use rustc_data_structures::tiny_list::TinyList;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_serialize::{Decodable, Encodable}; use rustc_serialize::{Decodable, Encodable};
use rustc_target::abi::{Endian, Size}; use rustc_target::abi::{Endian, Size};
@ -145,7 +146,7 @@ pub struct GlobalId<'tcx> {
impl GlobalId<'tcx> { impl GlobalId<'tcx> {
pub fn display(self, tcx: TyCtxt<'tcx>) -> String { pub fn display(self, tcx: TyCtxt<'tcx>) -> String {
let instance_name = tcx.def_path_str(self.instance.def.def_id()); let instance_name = with_no_trimmed_paths(|| tcx.def_path_str(self.instance.def.def_id()));
if let Some(promoted) = self.promoted { if let Some(promoted) = self.promoted {
format!("{}::{:?}", instance_name, promoted) format!("{}::{:?}", instance_name, promoted)
} else { } else {

View file

@ -1255,6 +1255,11 @@ rustc_queries! {
storage(ArenaCacheSelector<'tcx>) storage(ArenaCacheSelector<'tcx>)
desc { "calculating the visible parent map" } desc { "calculating the visible parent map" }
} }
query trimmed_def_paths(_: CrateNum)
-> FxHashMap<DefId, Symbol> {
storage(ArenaCacheSelector<'tcx>)
desc { "calculating trimmed def paths" }
}
query missing_extern_crate_item(_: CrateNum) -> bool { query missing_extern_crate_item(_: CrateNum) -> bool {
eval_always eval_always
desc { "seeing if we're missing an `extern crate` item for this crate" } desc { "seeing if we're missing an `extern crate` item for this crate" }

View file

@ -944,7 +944,7 @@ pub struct GlobalCtxt<'tcx> {
maybe_unused_extern_crates: Vec<(LocalDefId, Span)>, maybe_unused_extern_crates: Vec<(LocalDefId, Span)>,
/// A map of glob use to a set of names it actually imports. Currently only /// A map of glob use to a set of names it actually imports. Currently only
/// used in save-analysis. /// used in save-analysis.
glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>, pub(crate) glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>,
/// Extern prelude entries. The value is `true` if the entry was introduced /// Extern prelude entries. The value is `true` if the entry was introduced
/// via `extern crate` item and not `--extern` option or compiler built-in. /// via `extern crate` item and not `--extern` option or compiler built-in.
pub extern_prelude: FxHashMap<Symbol, bool>, pub extern_prelude: FxHashMap<Symbol, bool>,

View file

@ -260,10 +260,11 @@ impl<'tcx> fmt::Display for Instance<'tcx> {
InstanceDef::ReifyShim(_) => write!(f, " - shim(reify)"), InstanceDef::ReifyShim(_) => write!(f, " - shim(reify)"),
InstanceDef::Intrinsic(_) => write!(f, " - intrinsic"), InstanceDef::Intrinsic(_) => write!(f, " - intrinsic"),
InstanceDef::Virtual(_, num) => write!(f, " - virtual#{}", num), InstanceDef::Virtual(_, num) => write!(f, " - virtual#{}", num),
InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({:?})", ty), InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({})", ty),
InstanceDef::ClosureOnceShim { .. } => write!(f, " - shim"), InstanceDef::ClosureOnceShim { .. } => write!(f, " - shim"),
InstanceDef::DropGlue(_, ty) => write!(f, " - shim({:?})", ty), InstanceDef::DropGlue(_, None) => write!(f, " - shim(None)"),
InstanceDef::CloneShim(_, ty) => write!(f, " - shim({:?})", ty), InstanceDef::DropGlue(_, Some(ty)) => write!(f, " - shim(Some({}))", ty),
InstanceDef::CloneShim(_, ty) => write!(f, " - shim({})", ty),
} }
} }
} }

View file

@ -174,9 +174,9 @@ pub enum LayoutError<'tcx> {
impl<'tcx> fmt::Display for LayoutError<'tcx> { impl<'tcx> fmt::Display for LayoutError<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self { match *self {
LayoutError::Unknown(ty) => write!(f, "the type `{:?}` has an unknown layout", ty), LayoutError::Unknown(ty) => write!(f, "the type `{}` has an unknown layout", ty),
LayoutError::SizeOverflow(ty) => { LayoutError::SizeOverflow(ty) => {
write!(f, "the type `{:?}` is too big for the current architecture", ty) write!(f, "the type `{}` is too big for the current architecture", ty)
} }
} }
} }

View file

@ -3101,6 +3101,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
erase_regions::provide(providers); erase_regions::provide(providers);
layout::provide(providers); layout::provide(providers);
util::provide(providers); util::provide(providers);
print::provide(providers);
super::util::bug::provide(providers); super::util::bug::provide(providers);
*providers = ty::query::Providers { *providers = ty::query::Providers {
trait_impls_of: trait_def::trait_impls_of_provider, trait_impls_of: trait_def::trait_impls_of_provider,

View file

@ -7,10 +7,13 @@ use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::Float; use rustc_apfloat::Float;
use rustc_ast as ast; use rustc_ast as ast;
use rustc_attr::{SignedInt, UnsignedInt}; use rustc_attr::{SignedInt, UnsignedInt};
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Namespace}; use rustc_hir::def::{self, CtorKind, DefKind, Namespace};
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::def_id::{CrateNum, DefId, DefIdSet, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
use rustc_hir::ItemKind;
use rustc_session::config::TrimmedDefPaths;
use rustc_span::symbol::{kw, Ident, Symbol}; use rustc_span::symbol::{kw, Ident, Symbol};
use rustc_target::abi::{Integer, Size}; use rustc_target::abi::{Integer, Size};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
@ -52,6 +55,7 @@ macro_rules! define_scoped_cx {
thread_local! { thread_local! {
static FORCE_IMPL_FILENAME_LINE: Cell<bool> = Cell::new(false); static FORCE_IMPL_FILENAME_LINE: Cell<bool> = Cell::new(false);
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = Cell::new(false); static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = Cell::new(false);
static NO_TRIMMED_PATH: Cell<bool> = Cell::new(false);
static NO_QUERIES: Cell<bool> = Cell::new(false); static NO_QUERIES: Cell<bool> = Cell::new(false);
} }
@ -94,6 +98,18 @@ pub fn with_crate_prefix<F: FnOnce() -> R, R>(f: F) -> R {
}) })
} }
/// Prevent path trimming if it is turned on. Path trimming affects `Display` impl
/// of various rustc types, for example `std::vec::Vec` would be trimmed to `Vec`,
/// if no other `Vec` is found.
pub fn with_no_trimmed_paths<F: FnOnce() -> R, R>(f: F) -> R {
NO_TRIMMED_PATH.with(|flag| {
let old = flag.replace(true);
let result = f();
flag.set(old);
result
})
}
/// The "region highlights" are used to control region printing during /// The "region highlights" are used to control region printing during
/// specific error messages. When a "region highlight" is enabled, it /// specific error messages. When a "region highlight" is enabled, it
/// gives an alternate way to print specific regions. For now, we /// gives an alternate way to print specific regions. For now, we
@ -243,6 +259,28 @@ pub trait PrettyPrinter<'tcx>:
self.try_print_visible_def_path_recur(def_id, &mut callers) self.try_print_visible_def_path_recur(def_id, &mut callers)
} }
/// Try to see if this path can be trimmed to a unique symbol name.
fn try_print_trimmed_def_path(
mut self,
def_id: DefId,
) -> Result<(Self::Path, bool), Self::Error> {
if !self.tcx().sess.opts.debugging_opts.trim_diagnostic_paths
|| matches!(self.tcx().sess.opts.trimmed_def_paths, TrimmedDefPaths::Never)
|| NO_TRIMMED_PATH.with(|flag| flag.get())
|| SHOULD_PREFIX_WITH_CRATE.with(|flag| flag.get())
{
return Ok((self, false));
}
match self.tcx().trimmed_def_paths(LOCAL_CRATE).get(&def_id) {
None => return Ok((self, false)),
Some(symbol) => {
self.write_str(&symbol.as_str())?;
return Ok((self, true));
}
}
}
/// Does the work of `try_print_visible_def_path`, building the /// Does the work of `try_print_visible_def_path`, building the
/// full definition path recursively before attempting to /// full definition path recursively before attempting to
/// post-process it into the valid and visible version that /// post-process it into the valid and visible version that
@ -1324,6 +1362,11 @@ impl<F: fmt::Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F> {
define_scoped_cx!(self); define_scoped_cx!(self);
if substs.is_empty() { if substs.is_empty() {
match self.try_print_trimmed_def_path(def_id)? {
(cx, true) => return Ok(cx),
(cx, false) => self = cx,
}
match self.try_print_visible_def_path(def_id)? { match self.try_print_visible_def_path(def_id)? {
(cx, true) => return Ok(cx), (cx, true) => return Ok(cx),
(cx, false) => self = cx, (cx, false) => self = cx,
@ -2064,3 +2107,134 @@ define_print_and_forward_display! {
} }
} }
} }
fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, Namespace, DefId)) {
// Iterate all local crate items no matter where they are defined.
let hir = tcx.hir();
for item in hir.krate().items.values() {
if item.ident.name.as_str().is_empty() {
continue;
}
match item.kind {
ItemKind::Use(_, _) => {
continue;
}
_ => {}
}
if let Some(local_def_id) = hir.definitions().opt_hir_id_to_local_def_id(item.hir_id) {
let def_id = local_def_id.to_def_id();
let ns = tcx.def_kind(def_id).ns().unwrap_or(Namespace::TypeNS);
collect_fn(&item.ident, ns, def_id);
}
}
// Now take care of extern crate items.
let queue = &mut Vec::new();
let mut seen_defs: DefIdSet = Default::default();
for &cnum in tcx.crates().iter() {
let def_id = DefId { krate: cnum, index: CRATE_DEF_INDEX };
// Ignore crates that are not direct dependencies.
match tcx.extern_crate(def_id) {
None => continue,
Some(extern_crate) => {
if !extern_crate.is_direct() {
continue;
}
}
}
queue.push(def_id);
}
// Iterate external crate defs but be mindful about visibility
while let Some(def) = queue.pop() {
for child in tcx.item_children(def).iter() {
if child.vis != ty::Visibility::Public {
continue;
}
match child.res {
def::Res::Def(DefKind::AssocTy, _) => {}
def::Res::Def(defkind, def_id) => {
if let Some(ns) = defkind.ns() {
collect_fn(&child.ident, ns, def_id);
}
if seen_defs.insert(def_id) {
queue.push(def_id);
}
}
_ => {}
}
}
}
}
/// The purpose of this function is to collect public symbols names that are unique across all
/// crates in the build. Later, when printing about types we can use those names instead of the
/// full exported path to them.
///
/// So essentially, if a symbol name can only be imported from one place for a type, and as
/// long as it was not glob-imported anywhere in the current crate, we can trim its printed
/// path and print only the name.
///
/// This has wide implications on error messages with types, for example, shortening
/// `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere.
///
/// The implementation uses similar import discovery logic to that of 'use' suggestions.
fn trimmed_def_paths(tcx: TyCtxt<'_>, crate_num: CrateNum) -> FxHashMap<DefId, Symbol> {
assert_eq!(crate_num, LOCAL_CRATE);
let mut map = FxHashMap::default();
if let TrimmedDefPaths::GoodPath = tcx.sess.opts.trimmed_def_paths {
// For good paths causing this bug, the `rustc_middle::ty::print::with_no_trimmed_paths`
// wrapper can be used to suppress this query, in exchange for full paths being formatted.
tcx.sess.delay_good_path_bug("trimmed_def_paths constructed");
}
let unique_symbols_rev: &mut FxHashMap<(Namespace, Symbol), Option<DefId>> =
&mut FxHashMap::default();
for symbol_set in tcx.glob_map.values() {
for symbol in symbol_set {
unique_symbols_rev.insert((Namespace::TypeNS, *symbol), None);
unique_symbols_rev.insert((Namespace::ValueNS, *symbol), None);
unique_symbols_rev.insert((Namespace::MacroNS, *symbol), None);
}
}
for_each_def(tcx, |ident, ns, def_id| {
use std::collections::hash_map::Entry::{Occupied, Vacant};
match unique_symbols_rev.entry((ns, ident.name)) {
Occupied(mut v) => match v.get() {
None => {}
Some(existing) => {
if *existing != def_id {
v.insert(None);
}
}
},
Vacant(v) => {
v.insert(Some(def_id));
}
}
});
for ((_, symbol), opt_def_id) in unique_symbols_rev.drain() {
if let Some(def_id) = opt_def_id {
map.insert(def_id, symbol);
}
}
map
}
pub fn provide(providers: &mut ty::query::Providers) {
*providers = ty::query::Providers { trimmed_def_paths, ..*providers };
}

View file

@ -5,7 +5,7 @@
use crate::mir::interpret; use crate::mir::interpret;
use crate::mir::ProjectionKind; use crate::mir::ProjectionKind;
use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use crate::ty::print::{FmtPrinter, Printer}; use crate::ty::print::{with_no_trimmed_paths, FmtPrinter, Printer};
use crate::ty::{self, InferConst, Lift, Ty, TyCtxt}; use crate::ty::{self, InferConst, Lift, Ty, TyCtxt};
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::Namespace; use rustc_hir::def::Namespace;
@ -20,7 +20,9 @@ use std::sync::Arc;
impl fmt::Debug for ty::TraitDef { impl fmt::Debug for ty::TraitDef {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
ty::tls::with(|tcx| { ty::tls::with(|tcx| {
FmtPrinter::new(tcx, f, Namespace::TypeNS).print_def_path(self.def_id, &[])?; with_no_trimmed_paths(|| {
FmtPrinter::new(tcx, f, Namespace::TypeNS).print_def_path(self.def_id, &[])
})?;
Ok(()) Ok(())
}) })
} }
@ -29,7 +31,9 @@ impl fmt::Debug for ty::TraitDef {
impl fmt::Debug for ty::AdtDef { impl fmt::Debug for ty::AdtDef {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
ty::tls::with(|tcx| { ty::tls::with(|tcx| {
FmtPrinter::new(tcx, f, Namespace::TypeNS).print_def_path(self.did, &[])?; with_no_trimmed_paths(|| {
FmtPrinter::new(tcx, f, Namespace::TypeNS).print_def_path(self.did, &[])
})?;
Ok(()) Ok(())
}) })
} }
@ -50,7 +54,7 @@ impl fmt::Debug for ty::UpvarBorrow<'tcx> {
impl fmt::Debug for ty::ExistentialTraitRef<'tcx> { impl fmt::Debug for ty::ExistentialTraitRef<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self, f) with_no_trimmed_paths(|| fmt::Display::fmt(self, f))
} }
} }
@ -183,13 +187,13 @@ impl fmt::Debug for ty::FloatVarValue {
impl fmt::Debug for ty::TraitRef<'tcx> { impl fmt::Debug for ty::TraitRef<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self, f) with_no_trimmed_paths(|| fmt::Display::fmt(self, f))
} }
} }
impl fmt::Debug for Ty<'tcx> { impl fmt::Debug for Ty<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self, f) with_no_trimmed_paths(|| fmt::Display::fmt(self, f))
} }
} }

View file

@ -10,6 +10,7 @@ use rustc_hir::def::DefKind;
use rustc_middle::mir; use rustc_middle::mir;
use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::mir::interpret::ErrorHandled;
use rustc_middle::traits::Reveal; use rustc_middle::traits::Reveal;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, subst::Subst, TyCtxt}; use rustc_middle::ty::{self, subst::Subst, TyCtxt};
use rustc_span::source_map::Span; use rustc_span::source_map::Span;
use rustc_target::abi::{Abi, LayoutOf}; use rustc_target::abi::{Abi, LayoutOf};
@ -33,7 +34,8 @@ fn eval_body_using_ecx<'mir, 'tcx>(
assert!(!layout.is_unsized()); assert!(!layout.is_unsized());
let ret = ecx.allocate(layout, MemoryKind::Stack); let ret = ecx.allocate(layout, MemoryKind::Stack);
let name = ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id())); let name =
with_no_trimmed_paths(|| ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id())));
let prom = cid.promoted.map_or(String::new(), |p| format!("::promoted[{:?}]", p)); let prom = cid.promoted.map_or(String::new(), |p| format!("::promoted[{:?}]", p));
trace!("eval_body_using_ecx: pushing stack frame for global: {}{}", name, prom); trace!("eval_body_using_ecx: pushing stack frame for global: {}{}", name, prom);
@ -290,7 +292,7 @@ pub fn const_eval_raw_provider<'tcx>(
// The next two lines concatenated contain some discussion: // The next two lines concatenated contain some discussion:
// https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/ // https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/
// subject/anon_const_instance_printing/near/135980032 // subject/anon_const_instance_printing/near/135980032
let instance = key.value.instance.to_string(); let instance = with_no_trimmed_paths(|| key.value.instance.to_string());
trace!("const eval: {:?} ({})", key, instance); trace!("const eval: {:?} ({})", key, instance);
} }

View file

@ -26,18 +26,22 @@ use super::{
macro_rules! throw_validation_failure { macro_rules! throw_validation_failure {
($where:expr, { $( $what_fmt:expr ),+ } $( expected { $( $expected_fmt:expr ),+ } )?) => {{ ($where:expr, { $( $what_fmt:expr ),+ } $( expected { $( $expected_fmt:expr ),+ } )?) => {{
let mut msg = String::new(); let msg = rustc_middle::ty::print::with_no_trimmed_paths(|| {
msg.push_str("encountered "); let mut msg = String::new();
write!(&mut msg, $($what_fmt),+).unwrap(); msg.push_str("encountered ");
let where_ = &$where; write!(&mut msg, $($what_fmt),+).unwrap();
if !where_.is_empty() { let where_ = &$where;
msg.push_str(" at "); if !where_.is_empty() {
write_path(&mut msg, where_); msg.push_str(" at ");
} write_path(&mut msg, where_);
$( }
msg.push_str(", but expected "); $(
write!(&mut msg, $($expected_fmt),+).unwrap(); msg.push_str(", but expected ");
)? write!(&mut msg, $($expected_fmt),+).unwrap();
)?
msg
});
throw_ub!(ValidationFailure(msg)) throw_ub!(ValidationFailure(msg))
}}; }};
} }

View file

@ -100,6 +100,7 @@ use rustc_data_structures::sync;
use rustc_hir::def_id::{CrateNum, DefIdSet, LOCAL_CRATE}; use rustc_hir::def_id::{CrateNum, DefIdSet, LOCAL_CRATE};
use rustc_middle::mir::mono::MonoItem; use rustc_middle::mir::mono::MonoItem;
use rustc_middle::mir::mono::{CodegenUnit, Linkage}; use rustc_middle::mir::mono::{CodegenUnit, Linkage};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::query::Providers; use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt; use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::Symbol; use rustc_span::symbol::Symbol;
@ -374,7 +375,7 @@ fn collect_and_partition_mono_items<'tcx>(
let mut item_keys: Vec<_> = items let mut item_keys: Vec<_> = items
.iter() .iter()
.map(|i| { .map(|i| {
let mut output = i.to_string(); let mut output = with_no_trimmed_paths(|| i.to_string());
output.push_str(" @@"); output.push_str(" @@");
let mut empty = Vec::new(); let mut empty = Vec::new();
let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty); let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);

View file

@ -2,6 +2,7 @@ use rustc_hir as hir;
use rustc_index::vec::Idx; use rustc_index::vec::Idx;
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
use rustc_middle::mir::Field; use rustc_middle::mir::Field;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_session::lint; use rustc_session::lint;
use rustc_span::Span; use rustc_span::Span;
@ -118,7 +119,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
} }
if let Some(non_sm_ty) = structural { if let Some(non_sm_ty) = structural {
let msg = match non_sm_ty { let msg = with_no_trimmed_paths(|| match non_sm_ty {
traits::NonStructuralMatchTy::Adt(adt_def) => { traits::NonStructuralMatchTy::Adt(adt_def) => {
let path = self.tcx().def_path_str(adt_def.did); let path = self.tcx().def_path_str(adt_def.did);
format!( format!(
@ -148,7 +149,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
traits::NonStructuralMatchTy::Foreign => { traits::NonStructuralMatchTy::Foreign => {
bug!("use of a value of a foreign type inside a pattern") bug!("use of a value of a foreign type inside a pattern")
} }
}; });
// double-check there even *is* a semantic `PartialEq` to dispatch to. // double-check there even *is* a semantic `PartialEq` to dispatch to.
// //

View file

@ -21,7 +21,7 @@ use rustc_hir_pretty::{enum_def_to_string, fn_to_string, ty_to_string};
use rustc_middle::hir::map::Map; use rustc_middle::hir::map::Map;
use rustc_middle::middle::cstore::ExternCrate; use rustc_middle::middle::cstore::ExternCrate;
use rustc_middle::middle::privacy::AccessLevels; use rustc_middle::middle::privacy::AccessLevels;
use rustc_middle::ty::{self, DefIdTree, TyCtxt}; use rustc_middle::ty::{self, print::with_no_trimmed_paths, DefIdTree, TyCtxt};
use rustc_middle::{bug, span_bug}; use rustc_middle::{bug, span_bug};
use rustc_session::config::{CrateType, Input, OutputType}; use rustc_session::config::{CrateType, Input, OutputType};
use rustc_session::output::{filename_for_metadata, out_filename}; use rustc_session::output::{filename_for_metadata, out_filename};
@ -989,32 +989,34 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(
config: Option<Config>, config: Option<Config>,
mut handler: H, mut handler: H,
) { ) {
tcx.dep_graph.with_ignore(|| { with_no_trimmed_paths(|| {
info!("Dumping crate {}", cratename); tcx.dep_graph.with_ignore(|| {
info!("Dumping crate {}", cratename);
// Privacy checking requires and is done after type checking; use a // Privacy checking requires and is done after type checking; use a
// fallback in case the access levels couldn't have been correctly computed. // fallback in case the access levels couldn't have been correctly computed.
let access_levels = match tcx.sess.compile_status() { let access_levels = match tcx.sess.compile_status() {
Ok(..) => tcx.privacy_access_levels(LOCAL_CRATE), Ok(..) => tcx.privacy_access_levels(LOCAL_CRATE),
Err(..) => tcx.arena.alloc(AccessLevels::default()), Err(..) => tcx.arena.alloc(AccessLevels::default()),
}; };
let save_ctxt = SaveContext { let save_ctxt = SaveContext {
tcx, tcx,
maybe_typeck_results: None, maybe_typeck_results: None,
access_levels: &access_levels, access_levels: &access_levels,
span_utils: SpanUtils::new(&tcx.sess), span_utils: SpanUtils::new(&tcx.sess),
config: find_config(config), config: find_config(config),
impl_counter: Cell::new(0), impl_counter: Cell::new(0),
}; };
let mut visitor = DumpVisitor::new(save_ctxt); let mut visitor = DumpVisitor::new(save_ctxt);
visitor.dump_crate_info(cratename, tcx.hir().krate()); visitor.dump_crate_info(cratename, tcx.hir().krate());
visitor.dump_compilation_options(input, cratename); visitor.dump_compilation_options(input, cratename);
visitor.process_crate(tcx.hir().krate()); visitor.process_crate(tcx.hir().krate());
handler.save(&visitor.save_ctxt, &visitor.analysis()) handler.save(&visitor.save_ctxt, &visitor.analysis())
})
}) })
} }

View file

@ -328,6 +328,23 @@ impl Default for ErrorOutputType {
} }
} }
/// Parameter to control path trimming.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum TrimmedDefPaths {
/// `try_print_trimmed_def_path` never prints a trimmed path and never calls the expensive query
Never,
/// `try_print_trimmed_def_path` calls the expensive query, the query doesn't call `delay_good_path_bug`
Always,
/// `try_print_trimmed_def_path` calls the expensive query, the query calls `delay_good_path_bug`
GoodPath,
}
impl Default for TrimmedDefPaths {
fn default() -> Self {
Self::Never
}
}
/// Use tree-based collections to cheaply get a deterministic `Hash` implementation. /// Use tree-based collections to cheaply get a deterministic `Hash` implementation.
/// *Do not* switch `BTreeMap` out for an unsorted container type! That would break /// *Do not* switch `BTreeMap` out for an unsorted container type! That would break
/// dependency tracking for command-line arguments. /// dependency tracking for command-line arguments.
@ -621,6 +638,7 @@ impl Default for Options {
unstable_features: UnstableFeatures::Disallow, unstable_features: UnstableFeatures::Disallow,
debug_assertions: true, debug_assertions: true,
actually_rustdoc: false, actually_rustdoc: false,
trimmed_def_paths: TrimmedDefPaths::default(),
cli_forced_codegen_units: None, cli_forced_codegen_units: None,
cli_forced_thinlto_off: false, cli_forced_thinlto_off: false,
remap_path_prefix: Vec::new(), remap_path_prefix: Vec::new(),
@ -1811,6 +1829,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
unstable_features: UnstableFeatures::from_environment(), unstable_features: UnstableFeatures::from_environment(),
debug_assertions, debug_assertions,
actually_rustdoc: false, actually_rustdoc: false,
trimmed_def_paths: TrimmedDefPaths::default(),
cli_forced_codegen_units: codegen_units, cli_forced_codegen_units: codegen_units,
cli_forced_thinlto_off: disable_thinlto, cli_forced_thinlto_off: disable_thinlto,
remap_path_prefix, remap_path_prefix,
@ -2057,7 +2076,7 @@ crate mod dep_tracking {
use super::{ use super::{
CFGuard, CrateType, DebugInfo, ErrorOutputType, LinkerPluginLto, LtoCli, OptLevel, CFGuard, CrateType, DebugInfo, ErrorOutputType, LinkerPluginLto, LtoCli, OptLevel,
OutputTypes, Passes, SanitizerSet, SourceFileHashAlgorithm, SwitchWithOptPath, OutputTypes, Passes, SanitizerSet, SourceFileHashAlgorithm, SwitchWithOptPath,
SymbolManglingVersion, SymbolManglingVersion, TrimmedDefPaths,
}; };
use crate::lint; use crate::lint;
use crate::utils::NativeLibKind; use crate::utils::NativeLibKind;
@ -2138,6 +2157,7 @@ crate mod dep_tracking {
impl_dep_tracking_hash_via_hash!(SwitchWithOptPath); impl_dep_tracking_hash_via_hash!(SwitchWithOptPath);
impl_dep_tracking_hash_via_hash!(SymbolManglingVersion); impl_dep_tracking_hash_via_hash!(SymbolManglingVersion);
impl_dep_tracking_hash_via_hash!(Option<SourceFileHashAlgorithm>); impl_dep_tracking_hash_via_hash!(Option<SourceFileHashAlgorithm>);
impl_dep_tracking_hash_via_hash!(TrimmedDefPaths);
impl_dep_tracking_hash_for_sortable_vec_of!(String); impl_dep_tracking_hash_for_sortable_vec_of!(String);
impl_dep_tracking_hash_for_sortable_vec_of!(PathBuf); impl_dep_tracking_hash_for_sortable_vec_of!(PathBuf);

View file

@ -125,6 +125,9 @@ top_level_options!(
// try to not rely on this too much. // try to not rely on this too much.
actually_rustdoc: bool [TRACKED], actually_rustdoc: bool [TRACKED],
// Control path trimming.
trimmed_def_paths: TrimmedDefPaths [TRACKED],
// Specifications of codegen units / ThinLTO which are forced as a // Specifications of codegen units / ThinLTO which are forced as a
// result of parsing command line options. These are not necessarily // result of parsing command line options. These are not necessarily
// what rustc was invoked with, but massaged a bit to agree with // what rustc was invoked with, but massaged a bit to agree with
@ -1084,6 +1087,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"for every macro invocation, print its name and arguments (default: no)"), "for every macro invocation, print its name and arguments (default: no)"),
treat_err_as_bug: Option<usize> = (None, parse_treat_err_as_bug, [TRACKED], treat_err_as_bug: Option<usize> = (None, parse_treat_err_as_bug, [TRACKED],
"treat error number `val` that occurs as bug"), "treat error number `val` that occurs as bug"),
trim_diagnostic_paths: bool = (true, parse_bool, [UNTRACKED],
"in diagnostics, use heuristics to shorten paths referring to items"),
ui_testing: bool = (false, parse_bool, [UNTRACKED], ui_testing: bool = (false, parse_bool, [UNTRACKED],
"emit compiler diagnostics in a form suitable for UI testing (default: no)"), "emit compiler diagnostics in a form suitable for UI testing (default: no)"),
unleash_the_miri_inside_of_you: bool = (false, parse_bool, [TRACKED], unleash_the_miri_inside_of_you: bool = (false, parse_bool, [TRACKED],

View file

@ -442,6 +442,24 @@ impl Session {
pub fn delay_span_bug<S: Into<MultiSpan>>(&self, sp: S, msg: &str) { pub fn delay_span_bug<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
self.diagnostic().delay_span_bug(sp, msg) self.diagnostic().delay_span_bug(sp, msg)
} }
/// Used for code paths of expensive computations that should only take place when
/// warnings or errors are emitted. If no messages are emitted ("good path"), then
/// it's likely a bug.
pub fn delay_good_path_bug(&self, msg: &str) {
if self.opts.debugging_opts.print_type_sizes
|| self.opts.debugging_opts.query_dep_graph
|| self.opts.debugging_opts.dump_mir.is_some()
|| self.opts.debugging_opts.unpretty.is_some()
|| self.opts.output_types.contains_key(&OutputType::Mir)
|| std::env::var_os("RUSTC_LOG").is_some()
{
return;
}
self.diagnostic().delay_good_path_bug(msg)
}
pub fn note_without_error(&self, msg: &str) { pub fn note_without_error(&self, msg: &str) {
self.diagnostic().note_without_error(msg) self.diagnostic().note_without_error(msg)
} }

View file

@ -1342,8 +1342,8 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
.normalize(candidate) .normalize(candidate)
.ok(); .ok();
match normalized { match normalized {
Some(normalized) => format!("\n {:?}", normalized.value), Some(normalized) => format!("\n {}", normalized.value),
None => format!("\n {:?}", candidate), None => format!("\n {}", candidate),
} }
}) })
}; };

View file

@ -32,6 +32,7 @@ use rustc_hir::def_id::DefId;
use rustc_middle::dep_graph::{DepKind, DepNodeIndex}; use rustc_middle::dep_graph::{DepKind, DepNodeIndex};
use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::mir::interpret::ErrorHandled;
use rustc_middle::ty::fast_reject; use rustc_middle::ty::fast_reject;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::relate::TypeRelation; use rustc_middle::ty::relate::TypeRelation;
use rustc_middle::ty::subst::{GenericArgKind, Subst, SubstsRef}; use rustc_middle::ty::subst::{GenericArgKind, Subst, SubstsRef};
use rustc_middle::ty::{ use rustc_middle::ty::{
@ -778,14 +779,16 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
if !candidate_set.ambiguous && candidate_set.vec.is_empty() { if !candidate_set.ambiguous && candidate_set.vec.is_empty() {
let trait_ref = stack.obligation.predicate.skip_binder().trait_ref; let trait_ref = stack.obligation.predicate.skip_binder().trait_ref;
let self_ty = trait_ref.self_ty(); let self_ty = trait_ref.self_ty();
let cause = IntercrateAmbiguityCause::DownstreamCrate { let cause =
trait_desc: trait_ref.print_only_trait_path().to_string(), with_no_trimmed_paths(|| IntercrateAmbiguityCause::DownstreamCrate {
self_desc: if self_ty.has_concrete_skeleton() { trait_desc: trait_ref.print_only_trait_path().to_string(),
Some(self_ty.to_string()) self_desc: if self_ty.has_concrete_skeleton() {
} else { Some(self_ty.to_string())
None } else {
}, None
}; },
});
debug!("evaluate_stack: pushing cause = {:?}", cause); debug!("evaluate_stack: pushing cause = {:?}", cause);
self.intercrate_ambiguity_causes.as_mut().unwrap().push(cause); self.intercrate_ambiguity_causes.as_mut().unwrap().push(cause);
} }
@ -1030,12 +1033,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
if !candidate_set.ambiguous && no_candidates_apply { if !candidate_set.ambiguous && no_candidates_apply {
let trait_ref = stack.obligation.predicate.skip_binder().trait_ref; let trait_ref = stack.obligation.predicate.skip_binder().trait_ref;
let self_ty = trait_ref.self_ty(); let self_ty = trait_ref.self_ty();
let trait_desc = trait_ref.print_only_trait_path().to_string(); let (trait_desc, self_desc) = with_no_trimmed_paths(|| {
let self_desc = if self_ty.has_concrete_skeleton() { let trait_desc = trait_ref.print_only_trait_path().to_string();
Some(self_ty.to_string()) let self_desc = if self_ty.has_concrete_skeleton() {
} else { Some(self_ty.to_string())
None } else {
}; None
};
(trait_desc, self_desc)
});
let cause = if let Conflict::Upstream = conflict { let cause = if let Conflict::Upstream = conflict {
IntercrateAmbiguityCause::UpstreamCrateUpdate { trait_desc, self_desc } IntercrateAmbiguityCause::UpstreamCrateUpdate { trait_desc, self_desc }
} else { } else {

View file

@ -3,6 +3,7 @@ use super::OverlapError;
use crate::traits; use crate::traits;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_middle::ty::fast_reject::{self, SimplifiedType}; use rustc_middle::ty::fast_reject::{self, SimplifiedType};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, TyCtxt, TypeFoldable}; use rustc_middle::ty::{self, TyCtxt, TypeFoldable};
pub use rustc_middle::traits::specialization_graph::*; pub use rustc_middle::traits::specialization_graph::*;
@ -102,7 +103,8 @@ impl ChildrenExt for Children {
let trait_ref = overlap.impl_header.trait_ref.unwrap(); let trait_ref = overlap.impl_header.trait_ref.unwrap();
let self_ty = trait_ref.self_ty(); let self_ty = trait_ref.self_ty();
OverlapError { // FIXME: should postpone string formatting until we decide to actually emit.
with_no_trimmed_paths(|| OverlapError {
with_impl: possible_sibling, with_impl: possible_sibling,
trait_desc: trait_ref.print_only_trait_path().to_string(), trait_desc: trait_ref.print_only_trait_path().to_string(),
// Only report the `Self` type if it has at least // Only report the `Self` type if it has at least
@ -115,7 +117,7 @@ impl ChildrenExt for Children {
}, },
intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes, intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes,
involves_placeholder: overlap.involves_placeholder, involves_placeholder: overlap.involves_placeholder,
} })
}; };
let report_overlap_error = |overlap: traits::coherence::OverlapResult<'_>, let report_overlap_error = |overlap: traits::coherence::OverlapResult<'_>,

View file

@ -2487,14 +2487,14 @@ fn fn_sig_suggestion<'tcx>(
_ => format!("self: {}", ty), _ => format!("self: {}", ty),
} }
} else { } else {
format!("_: {:?}", ty) format!("_: {}", ty)
} }
} }
_ => { _ => {
if assoc.fn_has_self_parameter && i == 0 { if assoc.fn_has_self_parameter && i == 0 {
format!("self: {:?}", ty) format!("self: {}", ty)
} else { } else {
format!("_: {:?}", ty) format!("_: {}", ty)
} }
} }
}) })
@ -2504,7 +2504,7 @@ fn fn_sig_suggestion<'tcx>(
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join(", "); .join(", ");
let output = sig.output(); let output = sig.output();
let output = if !output.is_unit() { format!(" -> {:?}", output) } else { String::new() }; let output = if !output.is_unit() { format!(" -> {}", output) } else { String::new() };
let unsafety = sig.unsafety.prefix_str(); let unsafety = sig.unsafety.prefix_str();
let (generics, where_clauses) = bounds_from_generic_predicates(tcx, predicates); let (generics, where_clauses) = bounds_from_generic_predicates(tcx, predicates);
@ -2542,7 +2542,7 @@ fn suggestion_signature(assoc: &ty::AssocItem, tcx: TyCtxt<'_>) -> String {
ty::AssocKind::Const => { ty::AssocKind::Const => {
let ty = tcx.type_of(assoc.def_id); let ty = tcx.type_of(assoc.def_id);
let val = expr::ty_kind_suggestion(ty).unwrap_or("value"); let val = expr::ty_kind_suggestion(ty).unwrap_or("value");
format!("const {}: {:?} = {};", assoc.ident, ty, val) format!("const {}: {} = {};", assoc.ident, ty, val)
} }
} }
} }

View file

@ -1177,7 +1177,7 @@ fn e0307(fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
fcx.tcx.sess.diagnostic(), fcx.tcx.sess.diagnostic(),
span, span,
E0307, E0307,
"invalid `self` parameter type: {:?}", "invalid `self` parameter type: {}",
receiver_ty, receiver_ty,
) )
.note("type of `self` must be `Self` or a type that dereferences to it") .note("type of `self` must be `Self` or a type that dereferences to it")

View file

@ -22,7 +22,7 @@ impl<T> Key<T> {
use std::thread::__FastLocalKeyInner as Key; use std::thread::__FastLocalKeyInner as Key;
static __KEY: Key<()> = Key::new(); static __KEY: Key<()> = Key::new();
//~^ ERROR `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads //~^ ERROR `UnsafeCell<Option<()>>` cannot be shared between threads
//~| ERROR cannot be shared between threads safely [E0277] //~| ERROR cannot be shared between threads safely [E0277]
fn main() {} fn main() {}

View file

@ -39,9 +39,9 @@ fn square_fn() -> impl Fn(u32) -> u32 {
} }
fn main() { fn main() {
iterator(); //~ ERROR unused implementer of `std::iter::Iterator` that must be used iterator(); //~ ERROR unused implementer of `Iterator` that must be used
future(); //~ ERROR unused implementer of `std::future::Future` that must be used future(); //~ ERROR unused implementer of `Future` that must be used
square_fn_once(); //~ ERROR unused implementer of `std::ops::FnOnce` that must be used square_fn_once(); //~ ERROR unused implementer of `FnOnce` that must be used
square_fn_mut(); //~ ERROR unused implementer of `std::ops::FnMut` that must be used square_fn_mut(); //~ ERROR unused implementer of `FnMut` that must be used
square_fn(); //~ ERROR unused implementer of `std::ops::Fn` that must be used square_fn(); //~ ERROR unused implementer of `Fn` that must be used
} }

View file

@ -27,7 +27,7 @@ mod y {
#[rustc_clean(label="typeck", cfg="cfail2")] #[rustc_clean(label="typeck", cfg="cfail2")]
pub fn y() { pub fn y() {
//[cfail2]~^ ERROR `typeck(y::y)` should be clean but is not //[cfail2]~^ ERROR `typeck(y)` should be clean but is not
x::x(); x::x();
} }
} }
@ -35,6 +35,6 @@ mod y {
mod z { mod z {
#[rustc_dirty(label="typeck", cfg="cfail2")] #[rustc_dirty(label="typeck", cfg="cfail2")]
pub fn z() { pub fn z() {
//[cfail2]~^ ERROR `typeck(z::z)` should be dirty but is not //[cfail2]~^ ERROR `typeck(z)` should be dirty but is not
} }
} }

View file

@ -35,7 +35,7 @@ fn main() -> () {
_2 = move _3; // scope 2 at $DIR/basic_assignment.rs:16:5: 16:24 _2 = move _3; // scope 2 at $DIR/basic_assignment.rs:16:5: 16:24
StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:16:23: 16:24 StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:16:23: 16:24
StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15 StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
_4 = std::option::Option::<std::boxed::Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:18:36: 18:40 _4 = Option::<Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:18:36: 18:40
FakeRead(ForLet, _4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15 FakeRead(ForLet, _4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:18:17: 18:33 AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:18:17: 18:33
StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15 StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15

View file

@ -38,7 +38,7 @@ fn main() -> () {
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12 StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11 StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11 _4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_3 = std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12 _3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// mir::Constant // mir::Constant
// + span: $DIR/box_expr.rs:8:5: 8:9 // + span: $DIR/box_expr.rs:8:5: 8:9
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }

View file

@ -8,7 +8,7 @@ fn main() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 _2 = const {alloc0: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const // ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])] // + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0)) // + val: Value(Scalar(alloc0))

View file

@ -8,7 +8,7 @@ fn main() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8 _2 = const {alloc0: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const // ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])] // + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0)) // + val: Value(Scalar(alloc0))

View file

@ -8,7 +8,7 @@ fn main() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 _2 = const {alloc0: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const // ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])] // + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0)) // + val: Value(Scalar(alloc0))

View file

@ -8,7 +8,7 @@ fn main() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 _2 = const {alloc0: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const // ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])] // + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0)) // + val: Value(Scalar(alloc0))

View file

@ -16,7 +16,7 @@
StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10 StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10
StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30 StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16 StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
_3 = const main::FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16 _3 = const FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
// ty::Const // ty::Const
// + ty: &i32 // + ty: &i32
// + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None) // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None)

View file

@ -22,7 +22,7 @@
bb2: { bb2: {
StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }

View file

@ -1,6 +1,6 @@
// MIR for `match_tuple` after SimplifyCfg-initial // MIR for `match_tuple` after SimplifyCfg-initial
fn match_tuple(_1: (u32, bool, std::option::Option<i32>, u32)) -> u32 { fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
debug x => _1; // in scope 0 at $DIR/exponential-or.rs:6:16: 6:17 debug x => _1; // in scope 0 at $DIR/exponential-or.rs:6:16: 6:17
let mut _0: u32; // return place in scope 0 at $DIR/exponential-or.rs:6:53: 6:56 let mut _0: u32; // return place in scope 0 at $DIR/exponential-or.rs:6:53: 6:56
let mut _2: isize; // in scope 0 at $DIR/exponential-or.rs:8:37: 8:48 let mut _2: isize; // in scope 0 at $DIR/exponential-or.rs:8:37: 8:48

View file

@ -1,6 +1,6 @@
// MIR for `std::ops::Fn::call` before AddMovesForPackedDrops // MIR for `std::ops::Fn::call` before AddMovesForPackedDrops
fn std::ops::Fn::call(_1: *const fn(), _2: Args) -> <Self as std::ops::FnOnce<Args>>::Output { fn std::ops::Fn::call(_1: *const fn(), _2: Args) -> <Self as FnOnce<Args>>::Output {
let mut _0: <Self as std::ops::FnOnce<Args>>::Output; // return place in scope 0 at $SRC_DIR/core/src/ops/function.rs:LL:COL let mut _0: <Self as std::ops::FnOnce<Args>>::Output; // return place in scope 0 at $SRC_DIR/core/src/ops/function.rs:LL:COL
bb0: { bb0: {

View file

@ -1,7 +1,7 @@
- // MIR for `float_to_exponential_common` before ConstProp - // MIR for `float_to_exponential_common` before ConstProp
+ // MIR for `float_to_exponential_common` after ConstProp + // MIR for `float_to_exponential_common` after ConstProp
fn float_to_exponential_common(_1: &mut std::fmt::Formatter, _2: &T, _3: bool) -> std::result::Result<(), std::fmt::Error> { fn float_to_exponential_common(_1: &mut Formatter, _2: &T, _3: bool) -> std::result::Result<(), std::fmt::Error> {
debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:11:35: 11:38 debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:11:35: 11:38
debug num => _2; // in scope 0 at $DIR/funky_arms.rs:11:60: 11:63 debug num => _2; // in scope 0 at $DIR/funky_arms.rs:11:60: 11:63
debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:11:69: 11:74 debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:11:69: 11:74
@ -38,7 +38,7 @@
StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:15:9: 15:19 StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:15:9: 15:19
StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:15:22: 15:25 StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:15:22: 15:25
_5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:15:22: 15:25 _5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:15:22: 15:25
_4 = std::fmt::Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:15:22: 15:37 _4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:15:22: 15:37
// mir::Constant // mir::Constant
// + span: $DIR/funky_arms.rs:15:26: 15:35 // + span: $DIR/funky_arms.rs:15:26: 15:35
// + literal: Const { ty: for<'r> fn(&'r std::fmt::Formatter) -> bool {std::fmt::Formatter::sign_plus}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r std::fmt::Formatter) -> bool {std::fmt::Formatter::sign_plus}, val: Value(Scalar(<ZST>)) }
@ -64,7 +64,7 @@
StorageLive(_7); // scope 2 at $DIR/funky_arms.rs:24:30: 24:45 StorageLive(_7); // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
StorageLive(_8); // scope 2 at $DIR/funky_arms.rs:24:30: 24:33 StorageLive(_8); // scope 2 at $DIR/funky_arms.rs:24:30: 24:33
_8 = &(*_1); // scope 2 at $DIR/funky_arms.rs:24:30: 24:33 _8 = &(*_1); // scope 2 at $DIR/funky_arms.rs:24:30: 24:33
_7 = std::fmt::Formatter::precision(move _8) -> bb5; // scope 2 at $DIR/funky_arms.rs:24:30: 24:45 _7 = Formatter::precision(move _8) -> bb5; // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
// mir::Constant // mir::Constant
// + span: $DIR/funky_arms.rs:24:34: 24:43 // + span: $DIR/funky_arms.rs:24:34: 24:43
// + literal: Const { ty: for<'r> fn(&'r std::fmt::Formatter) -> std::option::Option<usize> {std::fmt::Formatter::precision}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r std::fmt::Formatter) -> std::option::Option<usize> {std::fmt::Formatter::precision}, val: Value(Scalar(<ZST>)) }

View file

@ -14,7 +14,7 @@
}, },
} */ } */
fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6 {std::string::String, ()}]) -> () { fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6 {String, ()}]) -> () {
let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15 let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15

View file

@ -10,7 +10,7 @@
storage_conflicts: BitMatrix(0x0) {}, storage_conflicts: BitMatrix(0x0) {},
} */ } */
fn main::{{closure}}#0(_1: std::pin::Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6 {u8, HasDrop, ()}]>, _2: u8) -> std::ops::GeneratorState<(), ()> { fn main::{{closure}}#0(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6 {u8, HasDrop, ()}]>, _2: u8) -> GeneratorState<(), ()> {
debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19 debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19
let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6
let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15 let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15

View file

@ -17,9 +17,9 @@
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 - (*_2) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL + ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL
+ // ty::Const + // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32> + // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) + // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
@ -54,7 +54,7 @@
- } - }
- -
- bb4 (cleanup): { - bb4 (cleanup): {
- _3 = alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }

View file

@ -17,9 +17,9 @@
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 - (*_2) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL + ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL
+ // ty::Const + // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32> + // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) + // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
@ -54,7 +54,7 @@
- } - }
- -
- bb4 (cleanup): { - bb4 (cleanup): {
- _3 = alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }

View file

@ -12,7 +12,7 @@
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10 StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
- _1 = <std::vec::Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38 - _1 = <Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-specialization.rs:5:13: 5:36 - // + span: $DIR/inline-specialization.rs:5:13: 5:36
- // + literal: Const { ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}, val: Value(Scalar(<ZST>)) }

View file

@ -1,6 +1,6 @@
// MIR for `b` after Inline // MIR for `b` after Inline
fn b(_1: &mut std::boxed::Box<T>) -> &mut T { fn b(_1: &mut Box<T>) -> &mut T {
debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:13: 7:14 debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:13: 7:14
let mut _0: &mut T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:32: 7:38 let mut _0: &mut T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:32: 7:38
let mut _2: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 let mut _2: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15

View file

@ -1,6 +1,6 @@
// MIR for `d` after Inline // MIR for `d` after Inline
fn d(_1: &std::boxed::Box<T>) -> &T { fn d(_1: &Box<T>) -> &T {
debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:13: 17:14 debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:13: 17:14
let mut _0: &T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:28: 17:30 let mut _0: &T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:28: 17:30
let _2: &T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 let _2: &T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15

View file

@ -1,6 +1,6 @@
// MIR for `test` before ElaborateDrops // MIR for `test` before ElaborateDrops
fn test() -> std::option::Option<std::boxed::Box<u32>> { fn test() -> Option<Box<u32>> {
let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30 let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30
let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21 let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21 let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
@ -29,8 +29,8 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
_2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 _2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_4 = std::option::Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 _4 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_3 = <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 _3 = <Option<u32> as Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant // mir::Constant
// + span: $DIR/issue-62289.rs:9:15: 9:20 // + span: $DIR/issue-62289.rs:9:15: 9:20
// + literal: Const { ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) }
@ -69,7 +69,7 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
StorageLive(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 StorageLive(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_9 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 _9 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_8 = <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 _8 = <NoneError as From<NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
// mir::Constant // mir::Constant
// + span: $DIR/issue-62289.rs:9:19: 9:20 // + span: $DIR/issue-62289.rs:9:19: 9:20
// + literal: Const { ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}, val: Value(Scalar(<ZST>)) }
@ -81,7 +81,7 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
bb8: { bb8: {
StorageDead(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 StorageDead(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_0 = <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 _0 = <Option<Box<u32>> as Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
// mir::Constant // mir::Constant
// + span: $DIR/issue-62289.rs:9:15: 9:20 // + span: $DIR/issue-62289.rs:9:15: 9:20
// + literal: Const { ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) }
@ -106,7 +106,7 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
bb12: { bb12: {
StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
_0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22 _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
} }

View file

@ -21,7 +21,7 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10 StorageLive(_2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10
StorageLive(_3); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43 StorageLive(_3); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43
_3 = (); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43 _3 = (); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43
_2 = std::intrinsics::transmute::<(), Void>(move _3) -> [return: bb2, unwind: bb1]; // scope 2 at $DIR/issue-72181-1.rs:17:9: 17:44 _2 = transmute::<(), Void>(move _3) -> [return: bb2, unwind: bb1]; // scope 2 at $DIR/issue-72181-1.rs:17:9: 17:44
// mir::Constant // mir::Constant
// + span: $DIR/issue-72181-1.rs:17:9: 17:40 // + span: $DIR/issue-72181-1.rs:17:9: 17:40
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {std::intrinsics::transmute::<(), Void>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {std::intrinsics::transmute::<(), Void>}, val: Value(Scalar(<ZST>)) }

View file

@ -140,12 +140,12 @@
_22 = (_18.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _22 = (_18.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_23 = (_18.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = (_18.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_24); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_24); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
_25 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _25 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_28 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _25) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _28 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _25) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -153,7 +153,7 @@
bb3: { bb3: {
StorageLive(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_29 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _22) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _29 = transmute::<&&i32, &core::fmt::Opaque>(move _22) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -165,12 +165,12 @@
StorageDead(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageDead(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_26); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_26); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
_27 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _27 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_30); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_30); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_30 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _30 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -178,7 +178,7 @@
bb5: { bb5: {
StorageLive(_31); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_31); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_31 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _31 = transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -201,7 +201,7 @@
(_13.2: &[std::fmt::ArgumentV1]) = move _15; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_13.2: &[std::fmt::ArgumentV1]) = move _15; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageDead(_32); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_32); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }

View file

@ -140,12 +140,12 @@
_22 = (_18.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _22 = (_18.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_23 = (_18.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = (_18.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_24); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_24); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
_25 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _25 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_28 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _25) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _28 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _25) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -153,7 +153,7 @@
bb3: { bb3: {
StorageLive(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_29 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _22) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _29 = transmute::<&&i32, &core::fmt::Opaque>(move _22) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -165,12 +165,12 @@
StorageDead(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_29); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageDead(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_28); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_26); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_26); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
_27 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _27 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_30); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_30); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_30 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _30 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -178,7 +178,7 @@
bb5: { bb5: {
StorageLive(_31); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_31); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_31 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _31 = transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -201,7 +201,7 @@
(_13.2: &[std::fmt::ArgumentV1]) = move _15; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_13.2: &[std::fmt::ArgumentV1]) = move _15; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageDead(_32); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageDead(_32); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }

View file

@ -217,14 +217,14 @@
StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_40 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _40 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_46 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -235,7 +235,7 @@
StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_48 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -253,14 +253,14 @@
StorageLive(_42); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_42); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_42 = _37; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _42 = _37; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_43); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_43); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_43 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _43 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_50 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -271,7 +271,7 @@
StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_52 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -310,7 +310,7 @@
StorageDead(_23); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageDead(_23); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
_21 = &_22; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _21 = &_22; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
_20 = _21; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _20 = _21; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic_fmt(move _20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic_fmt(move _20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }

View file

@ -217,14 +217,14 @@
StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_40 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _40 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_46 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -235,7 +235,7 @@
StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_48 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -253,14 +253,14 @@
StorageLive(_42); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_42); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_42 = _37; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _42 = _37; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_43); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_43); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_43 = <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _43 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_50 = std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
@ -271,7 +271,7 @@
StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
_52 = std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
@ -310,7 +310,7 @@
StorageDead(_23); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageDead(_23); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
_21 = &_22; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _21 = &_22; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
_20 = _21; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL _20 = _21; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic_fmt(move _20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic_fmt(move _20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }

View file

@ -1,7 +1,7 @@
- // MIR for `complicated_match` after SimplifyCfg-initial - // MIR for `complicated_match` after SimplifyCfg-initial
+ // MIR for `complicated_match` after ElaborateDrops + // MIR for `complicated_match` after ElaborateDrops
fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 {
debug cond => _1; // in scope 0 at $DIR/match-arm-scopes.rs:13:22: 13:26 debug cond => _1; // in scope 0 at $DIR/match-arm-scopes.rs:13:22: 13:26
debug items => _2; // in scope 0 at $DIR/match-arm-scopes.rs:13:34: 13:39 debug items => _2; // in scope 0 at $DIR/match-arm-scopes.rs:13:34: 13:39
let mut _0: i32; // return place in scope 0 at $DIR/match-arm-scopes.rs:13:66: 13:69 let mut _0: i32; // return place in scope 0 at $DIR/match-arm-scopes.rs:13:66: 13:69

View file

@ -26,7 +26,7 @@ fn full_tested_match() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
_2 = std::option::Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16

View file

@ -25,7 +25,7 @@ fn full_tested_match2() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
_2 = std::option::Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16

View file

@ -36,7 +36,7 @@ fn main() -> () {
bb0: { bb0: {
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
_2 = std::option::Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
_4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
switchInt(move _4) -> [1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 switchInt(move _4) -> [1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17

View file

@ -1,7 +1,7 @@
- // MIR for `foo` before MatchBranchSimplification - // MIR for `foo` before MatchBranchSimplification
+ // MIR for `foo` after MatchBranchSimplification + // MIR for `foo` after MatchBranchSimplification
fn foo(_1: std::option::Option<()>) -> () { fn foo(_1: Option<()>) -> () {
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:5:8: 5:11 debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:5:8: 5:11
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:5:25: 5:25 let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:5:25: 5:25
let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL

View file

@ -1,7 +1,7 @@
- // MIR for `foo` before MatchBranchSimplification - // MIR for `foo` before MatchBranchSimplification
+ // MIR for `foo` after MatchBranchSimplification + // MIR for `foo` after MatchBranchSimplification
fn foo(_1: std::option::Option<()>) -> () { fn foo(_1: Option<()>) -> () {
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:5:8: 5:11 debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:5:8: 5:11
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:5:25: 5:25 let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:5:25: 5:25
let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL

View file

@ -1,6 +1,6 @@
// MIR for `unwrap` after SimplifyCfg-elaborate-drops // MIR for `unwrap` after SimplifyCfg-elaborate-drops
fn unwrap(_1: std::option::Option<T>) -> T { fn unwrap(_1: Option<T>) -> T {
debug opt => _1; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:14: 7:17 debug opt => _1; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:14: 7:17
let mut _0: T; // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:33: 7:34 let mut _0: T; // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:33: 7:34
let mut _2: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 let mut _2: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
@ -20,7 +20,7 @@ fn unwrap(_1: std::option::Option<T>) -> T {
bb1: { bb1: {
StorageLive(_4); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_4); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
std::rt::begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/std/src/macros.rs:LL:COL // + span: $SRC_DIR/std/src/macros.rs:LL:COL
// + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }

View file

@ -20,7 +20,7 @@ fn main() -> () {
// + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22 // + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) } // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) }
_3 = &(*_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22 _3 = &(*_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
_2 = <str as std::string::ToString>::to_string(move _3) -> bb2; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34 _2 = <str as ToString>::to_string(move _3) -> bb2; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
// mir::Constant // mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32 // + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32
// + literal: Const { ty: for<'r> fn(&'r str) -> std::string::String {<str as std::string::ToString>::to_string}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r str) -> std::string::String {<str as std::string::ToString>::to_string}, val: Value(Scalar(<ZST>)) }
@ -32,7 +32,7 @@ fn main() -> () {
bb2: { bb2: {
StorageDead(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34 StorageDead(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34
_1 = std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35 _1 = std::mem::drop::<String>(move _2) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
// mir::Constant // mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:5: 9:19 // + span: $DIR/no-spurious-drop-after-call.rs:9:5: 9:19
// + literal: Const { ty: fn(std::string::String) {std::mem::drop::<std::string::String>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: fn(std::string::String) {std::mem::drop::<std::string::String>}, val: Value(Scalar(<ZST>)) }

View file

@ -1,7 +1,7 @@
- // MIR for `match_guard` before CleanupNonCodegenStatements - // MIR for `match_guard` before CleanupNonCodegenStatements
+ // MIR for `match_guard` after CleanupNonCodegenStatements + // MIR for `match_guard` after CleanupNonCodegenStatements
fn match_guard(_1: std::option::Option<&&i32>, _2: bool) -> i32 { fn match_guard(_1: Option<&&i32>, _2: bool) -> i32 {
debug x => _1; // in scope 0 at $DIR/remove_fake_borrows.rs:6:16: 6:17 debug x => _1; // in scope 0 at $DIR/remove_fake_borrows.rs:6:16: 6:17
debug c => _2; // in scope 0 at $DIR/remove_fake_borrows.rs:6:34: 6:35 debug c => _2; // in scope 0 at $DIR/remove_fake_borrows.rs:6:34: 6:35
let mut _0: i32; // return place in scope 0 at $DIR/remove_fake_borrows.rs:6:46: 6:49 let mut _0: i32; // return place in scope 0 at $DIR/remove_fake_borrows.rs:6:46: 6:49

View file

@ -1,6 +1,6 @@
// MIR for `std::intrinsics::drop_in_place` after SimplifyCfg-make_shim // MIR for `drop_in_place` after SimplifyCfg-make_shim
fn std::intrinsics::drop_in_place(_1: *mut Test) -> () { fn drop_in_place(_1: *mut Test) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@ -8,7 +8,7 @@ fn std::intrinsics::drop_in_place(_1: *mut Test) -> () {
bb0: { bb0: {
Retag([raw] _1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL Retag([raw] _1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_3 = <Test as std::ops::Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _3 = <Test as Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut Test) {<Test as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r mut Test) {<Test as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) }

View file

@ -1,7 +1,7 @@
- // MIR for `id` before SimplifyArmIdentity - // MIR for `id` before SimplifyArmIdentity
+ // MIR for `id` after SimplifyArmIdentity + // MIR for `id` after SimplifyArmIdentity
fn id(_1: std::option::Option<u8>) -> std::option::Option<u8> { fn id(_1: Option<u8>) -> Option<u8> {
debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:9:7: 9:8 debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:9:7: 9:8
let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:9:25: 9:35 let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:9:25: 9:35
let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:11:9: 11:16

View file

@ -1,7 +1,7 @@
- // MIR for `id` before SimplifyBranchSame - // MIR for `id` before SimplifyBranchSame
+ // MIR for `id` after SimplifyBranchSame + // MIR for `id` after SimplifyBranchSame
fn id(_1: std::option::Option<u8>) -> std::option::Option<u8> { fn id(_1: Option<u8>) -> Option<u8> {
debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:9:7: 9:8 debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:9:7: 9:8
let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:9:25: 9:35 let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:9:25: 9:35
let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:11:9: 11:16

View file

@ -1,7 +1,7 @@
- // MIR for `map` before SimplifyLocals - // MIR for `map` before SimplifyLocals
+ // MIR for `map` after SimplifyLocals + // MIR for `map` after SimplifyLocals
fn map(_1: std::option::Option<std::boxed::Box<()>>) -> std::option::Option<std::boxed::Box<()>> { fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9 debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46 let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 - let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13

View file

@ -1,7 +1,7 @@
- // MIR for `map` before SimplifyLocals - // MIR for `map` before SimplifyLocals
+ // MIR for `map` after SimplifyLocals + // MIR for `map` after SimplifyLocals
fn map(_1: std::option::Option<std::boxed::Box<()>>) -> std::option::Option<std::boxed::Box<()>> { fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9 debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46 let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 - let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13

View file

@ -35,7 +35,7 @@
StorageLive(_5); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:60 StorageLive(_5); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:60
StorageLive(_6); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:53 StorageLive(_6); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:53
_6 = &mut ((*_2).0: std::option::Option<std::ptr::NonNull<Node>>); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:53 _6 = &mut ((*_2).0: std::option::Option<std::ptr::NonNull<Node>>); // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:53
_5 = std::option::Option::<std::ptr::NonNull<Node>>::take(move _6) -> bb4; // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:60 _5 = Option::<NonNull<Node>>::take(move _6) -> bb4; // scope 1 at $DIR/simplify_try_if_let.rs:26:43: 26:60
// mir::Constant // mir::Constant
// + span: $DIR/simplify_try_if_let.rs:26:54: 26:58 // + span: $DIR/simplify_try_if_let.rs:26:54: 26:58
// + literal: Const { ty: for<'r> fn(&'r mut std::option::Option<std::ptr::NonNull<Node>>) -> std::option::Option<std::ptr::NonNull<Node>> {std::option::Option::<std::ptr::NonNull<Node>>::take}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r mut std::option::Option<std::ptr::NonNull<Node>>) -> std::option::Option<std::ptr::NonNull<Node>> {std::option::Option::<std::ptr::NonNull<Node>>::take}, val: Value(Scalar(<ZST>)) }
@ -73,7 +73,7 @@
StorageLive(_11); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:38 StorageLive(_11); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:38
StorageLive(_12); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29 StorageLive(_12); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29
_12 = &mut _4; // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29 _12 = &mut _4; // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29
_11 = std::ptr::NonNull::<Node>::as_mut(move _12) -> bb7; // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:38 _11 = NonNull::<Node>::as_mut(move _12) -> bb7; // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:38
// mir::Constant // mir::Constant
// + span: $DIR/simplify_try_if_let.rs:28:30: 28:36 // + span: $DIR/simplify_try_if_let.rs:28:30: 28:36
// + literal: Const { ty: for<'r> unsafe fn(&'r mut std::ptr::NonNull<Node>) -> &'r mut Node {std::ptr::NonNull::<Node>::as_mut}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> unsafe fn(&'r mut std::ptr::NonNull<Node>) -> &'r mut Node {std::ptr::NonNull::<Node>::as_mut}, val: Value(Scalar(<ZST>)) }

View file

@ -1,7 +1,7 @@
// compile-flags: -Zmir-opt-level=0 // compile-flags: -Zmir-opt-level=0
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR core.ptr-drop_in_place.[std__string__String].AddMovesForPackedDrops.before.mir // EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
fn main() { fn main() {
let _fn = std::ptr::drop_in_place::<[String]> as unsafe fn(_); let _fn = std::ptr::drop_in_place::<[String]> as unsafe fn(_);
} }

View file

@ -1,6 +1,6 @@
// MIR for `std::intrinsics::drop_in_place` before AddMovesForPackedDrops // MIR for `drop_in_place` before AddMovesForPackedDrops
fn std::intrinsics::drop_in_place(_1: *mut [std::string::String]) -> () { fn drop_in_place(_1: *mut [String]) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View file

@ -1,6 +1,6 @@
// MIR for `std::intrinsics::drop_in_place` before AddMovesForPackedDrops // MIR for `drop_in_place` before AddMovesForPackedDrops
fn std::intrinsics::drop_in_place(_1: *mut [std::string::String]) -> () { fn drop_in_place(_1: *mut [String]) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View file

@ -45,7 +45,7 @@ fn main() -> () {
StorageLive(_4); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25 StorageLive(_4); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
StorageLive(_5); // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24 StorageLive(_5); // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
_5 = _1; // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24 _5 = _1; // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
_4 = std::option::Option::<i32>::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25 _4 = Option::<i32>::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
StorageDead(_5); // scope 1 at $DIR/storage_ranges.rs:6:24: 6:25 StorageDead(_5); // scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
_3 = &_4; // scope 1 at $DIR/storage_ranges.rs:6:17: 6:25 _3 = &_4; // scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
FakeRead(ForLet, _3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14 FakeRead(ForLet, _3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14

View file

@ -24,6 +24,6 @@ enum E {
fn main() { fn main() {
let f = Test::X as fn(usize) -> Test; let f = Test::X as fn(usize) -> Test;
// EMIT_MIR core.ptr-drop_in_place.std__vec__Vec_i32_.AddMovesForPackedDrops.before.mir // EMIT_MIR core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
let v = Vec::<i32>::new(); let v = Vec::<i32>::new();
} }

View file

@ -1,6 +1,6 @@
// MIR for `std::intrinsics::drop_in_place` before AddMovesForPackedDrops // MIR for `drop_in_place` before AddMovesForPackedDrops
fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () { fn drop_in_place(_1: *mut Vec<i32>) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@ -35,7 +35,7 @@ fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () {
bb7: { bb7: {
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_3 = <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) }

View file

@ -1,6 +1,6 @@
// MIR for `std::intrinsics::drop_in_place` before AddMovesForPackedDrops // MIR for `drop_in_place` before AddMovesForPackedDrops
fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () { fn drop_in_place(_1: *mut Vec<i32>) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@ -35,7 +35,7 @@ fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () {
bb7: { bb7: {
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_3 = <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant // mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) }

View file

@ -32,34 +32,34 @@ pub fn bar() ({
({ ({
let res = let res =
((::alloc::fmt::format as ((::alloc::fmt::format as
for<'r> fn(std::fmt::Arguments<'r>) -> std::string::String {std::fmt::format})(((::core::fmt::Arguments::new_v1 for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
as as
fn(&[&'static str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1})((&([("test" fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
as as
&str)] &str)]
as as
[&str; 1]) [&str; 1])
as as
&[&str; 1]), &[&str; 1]),
(&(match (() (&(match (()
as as
()) ())
{ {
() ()
=> =>
([] ([]
as as
[std::fmt::ArgumentV1; 0]), [ArgumentV1; 0]),
} }
as as
[std::fmt::ArgumentV1; 0]) [ArgumentV1; 0])
as as
&[std::fmt::ArgumentV1; 0])) &[ArgumentV1; 0]))
as as
std::fmt::Arguments)) Arguments))
as std::string::String); as String);
(res as std::string::String) (res as String)
} as std::string::String); } as String);
} as ()) } as ())
pub type Foo = [i32; (3 as usize)]; pub type Foo = [i32; (3 as usize)];
pub struct Bar { pub struct Bar {

View file

@ -11,9 +11,9 @@ all:
tr -d '\r\n' | $(CGREP) -e \ tr -d '\r\n' | $(CGREP) -e \
"mismatched types.*\ "mismatched types.*\
crateB::try_foo\(foo2\);.*\ crateB::try_foo\(foo2\);.*\
expected struct \`crateA::foo::Foo\`, found struct \`crateA::Foo\`.*\ expected struct \`crateA::foo::Foo\`, found struct \`Foo\`.*\
different versions of crate \`crateA\`.*\ different versions of crate \`crateA\`.*\
mismatched types.*\ mismatched types.*\
crateB::try_bar\(bar2\);.*\ crateB::try_bar\(bar2\);.*\
expected trait \`crateA::bar::Bar\`, found trait \`crateA::Bar\`.*\ expected trait \`crateA::bar::Bar\`, found trait \`Bar\`.*\
different versions of crate \`crateA\`" different versions of crate \`crateA\`"

View file

@ -7,7 +7,7 @@ LL | }
| - | -
| | | |
| `arena` dropped here while still borrowed | `arena` dropped here while still borrowed
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `rustc_arena::TypedArena` | borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `TypedArena`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | }
| - | -
| | | |
| `arena` dropped here while still borrowed | `arena` dropped here while still borrowed
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `rustc_arena::TypedArena` | borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `TypedArena`
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | match *s { S(v) => v }
| ^^ - | ^^ -
| | | | | |
| | data moved here | | data moved here
| | move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait | | move occurs because `v` has type `Vec<isize>`, which does not implement the `Copy` trait
| help: consider borrowing here: `&*s` | help: consider borrowing here: `&*s`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,35 +1,35 @@
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1 --> $DIR/not-an-allocator.rs:2:1
| |
LL | static A: usize = 0; LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
| |
= note: required by `std::alloc::GlobalAlloc::alloc` = note: required by `std::alloc::GlobalAlloc::alloc`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1 --> $DIR/not-an-allocator.rs:2:1
| |
LL | static A: usize = 0; LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
| |
= note: required by `std::alloc::GlobalAlloc::dealloc` = note: required by `std::alloc::GlobalAlloc::dealloc`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1 --> $DIR/not-an-allocator.rs:2:1
| |
LL | static A: usize = 0; LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
| |
= note: required by `std::alloc::GlobalAlloc::realloc` = note: required by `std::alloc::GlobalAlloc::realloc`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:2:1 --> $DIR/not-an-allocator.rs:2:1
| |
LL | static A: usize = 0; LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
| |
= note: required by `std::alloc::GlobalAlloc::alloc_zeroed` = note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -59,7 +59,7 @@ error[E0631]: type mismatch in closure arguments
LL | g1(|_: (), _: ()| {}); LL | g1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _` | ^^ -------------- found signature of `fn((), ()) -> _`
| | | |
| expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _` | expected signature of `for<'r> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>) -> _`
... ...
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {} LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
| ------------------------- required by this bound in `g1` | ------------------------- required by this bound in `g1`
@ -81,7 +81,7 @@ error[E0631]: type mismatch in closure arguments
LL | g3(|_: (), _: ()| {}); LL | g3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _` | ^^ -------------- found signature of `fn((), ()) -> _`
| | | |
| expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _` | expected signature of `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
... ...
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {} LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
| ------------------------------------ required by this bound in `g3` | ------------------------------------ required by this bound in `g3`
@ -103,7 +103,7 @@ error[E0631]: type mismatch in closure arguments
LL | h1(|_: (), _: (), _: (), _: ()| {}); LL | h1(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _` | ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| | | |
| expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _` | expected signature of `for<'r, 's> fn(&'r (), Box<(dyn for<'t0> Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
... ...
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {} LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
| -------------------------------------------- required by this bound in `h1` | -------------------------------------------- required by this bound in `h1`
@ -114,7 +114,7 @@ error[E0631]: type mismatch in closure arguments
LL | h2(|_: (), _: (), _: (), _: ()| {}); LL | h2(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _` | ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| | | |
| expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _` | expected signature of `for<'r, 't0> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
... ...
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {} LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
| --------------------------------------------------------- required by this bound in `h2` | --------------------------------------------------------- required by this bound in `h2`

View file

@ -1,7 +1,7 @@
fn main() { fn main() {
match "foo".to_string() { match "foo".to_string() {
['f', 'o', ..] => {} ['f', 'o', ..] => {}
//~^ ERROR expected an array or slice, found `std::string::String` //~^ ERROR expected an array or slice, found `String`
_ => { } _ => { }
}; };

View file

@ -4,11 +4,11 @@ error[E0425]: cannot find value `does_not_exist` in this scope
LL | match does_not_exist { LL | match does_not_exist {
| ^^^^^^^^^^^^^^ not found in this scope | ^^^^^^^^^^^^^^ not found in this scope
error[E0529]: expected an array or slice, found `std::string::String` error[E0529]: expected an array or slice, found `String`
--> $DIR/slice-pat-type-mismatches.rs:3:9 --> $DIR/slice-pat-type-mismatches.rs:3:9
| |
LL | ['f', 'o', ..] => {} LL | ['f', 'o', ..] => {}
| ^^^^^^^^^^^^^^ pattern cannot match with input type `std::string::String` | ^^^^^^^^^^^^^^ pattern cannot match with input type `String`
error[E0527]: pattern requires 1 element but array has 3 error[E0527]: pattern requires 1 element but array has 3
--> $DIR/slice-pat-type-mismatches.rs:18:9 --> $DIR/slice-pat-type-mismatches.rs:18:9

View file

@ -16,7 +16,7 @@ error[E0277]: the size for values of type `[u64]` cannot be known at compilation
LL | asm!("{}", in(reg) v[..]); LL | asm!("{}", in(reg) v[..]);
| ^^^^^ doesn't have a size known at compile-time | ^^^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `[u64]` = help: the trait `Sized` is not implemented for `[u64]`
= note: all inline asm arguments must have a statically known size = note: all inline asm arguments must have a statically known size
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
@ -25,7 +25,7 @@ error[E0277]: the size for values of type `[u64]` cannot be known at compilation
LL | asm!("{}", out(reg) v[..]); LL | asm!("{}", out(reg) v[..]);
| ^^^^^ doesn't have a size known at compile-time | ^^^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `[u64]` = help: the trait `Sized` is not implemented for `[u64]`
= note: all inline asm arguments must have a statically known size = note: all inline asm arguments must have a statically known size
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
@ -34,7 +34,7 @@ error[E0277]: the size for values of type `[u64]` cannot be known at compilation
LL | asm!("{}", inout(reg) v[..]); LL | asm!("{}", inout(reg) v[..]);
| ^^^^^ doesn't have a size known at compile-time | ^^^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `[u64]` = help: the trait `Sized` is not implemented for `[u64]`
= note: all inline asm arguments must have a statically known size = note: all inline asm arguments must have a statically known size
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -78,7 +78,7 @@ fn main() {
asm!("{}", in(reg) |x: i32| x); asm!("{}", in(reg) |x: i32| x);
//~^ ERROR cannot use value of type //~^ ERROR cannot use value of type
asm!("{}", in(reg) vec![0]); asm!("{}", in(reg) vec![0]);
//~^ ERROR cannot use value of type `std::vec::Vec<i32>` for inline assembly //~^ ERROR cannot use value of type `Vec<i32>` for inline assembly
asm!("{}", in(reg) (1, 2, 3)); asm!("{}", in(reg) (1, 2, 3));
//~^ ERROR cannot use value of type `(i32, i32, i32)` for inline assembly //~^ ERROR cannot use value of type `(i32, i32, i32)` for inline assembly
asm!("{}", in(reg) [1, 2, 3]); asm!("{}", in(reg) [1, 2, 3]);

View file

@ -26,7 +26,7 @@ LL | asm!("{}", in(reg) |x: i32| x);
| |
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
error: cannot use value of type `std::vec::Vec<i32>` for inline assembly error: cannot use value of type `Vec<i32>` for inline assembly
--> $DIR/type-check-2.rs:80:28 --> $DIR/type-check-2.rs:80:28
| |
LL | asm!("{}", in(reg) vec![0]); LL | asm!("{}", in(reg) vec![0]);

View file

@ -12,9 +12,9 @@ fn main() {
asm!("{}", in(reg) 0i128); asm!("{}", in(reg) 0i128);
//~^ ERROR type `i128` cannot be used with this register class //~^ ERROR type `i128` cannot be used with this register class
asm!("{}", in(reg) _mm_setzero_ps()); asm!("{}", in(reg) _mm_setzero_ps());
//~^ ERROR type `std::arch::x86_64::__m128` cannot be used with this register class //~^ ERROR type `__m128` cannot be used with this register class
asm!("{}", in(reg) _mm256_setzero_ps()); asm!("{}", in(reg) _mm256_setzero_ps());
//~^ ERROR type `std::arch::x86_64::__m256` cannot be used with this register class //~^ ERROR type `__m256` cannot be used with this register class
asm!("{}", in(xmm_reg) 0u8); asm!("{}", in(xmm_reg) 0u8);
//~^ ERROR type `u8` cannot be used with this register class //~^ ERROR type `u8` cannot be used with this register class
asm!("{:e}", in(reg) 0i32); asm!("{:e}", in(reg) 0i32);

View file

@ -6,7 +6,7 @@ LL | asm!("{}", in(reg) 0i128);
| |
= note: register class `reg` supports these types: i16, i32, i64, f32, f64 = note: register class `reg` supports these types: i16, i32, i64, f32, f64
error: type `std::arch::x86_64::__m128` cannot be used with this register class error: type `__m128` cannot be used with this register class
--> $DIR/type-check-3.rs:14:28 --> $DIR/type-check-3.rs:14:28
| |
LL | asm!("{}", in(reg) _mm_setzero_ps()); LL | asm!("{}", in(reg) _mm_setzero_ps());
@ -14,7 +14,7 @@ LL | asm!("{}", in(reg) _mm_setzero_ps());
| |
= note: register class `reg` supports these types: i16, i32, i64, f32, f64 = note: register class `reg` supports these types: i16, i32, i64, f32, f64
error: type `std::arch::x86_64::__m256` cannot be used with this register class error: type `__m256` cannot be used with this register class
--> $DIR/type-check-3.rs:16:28 --> $DIR/type-check-3.rs:16:28
| |
LL | asm!("{}", in(reg) _mm256_setzero_ps()); LL | asm!("{}", in(reg) _mm256_setzero_ps());

View file

@ -24,7 +24,7 @@ impl Bar for AssocNoCopy { type Assoc = String; }
impl Thing for AssocNoCopy { impl Thing for AssocNoCopy {
type Out = Box<dyn Bar<Assoc: Copy>>; type Out = Box<dyn Bar<Assoc: Copy>>;
//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied //~^ ERROR the trait bound `String: Copy` is not satisfied
fn func() -> Self::Out { fn func() -> Self::Out {
Box::new(AssocNoCopy) Box::new(AssocNoCopy)

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:26:28 --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:26:28
| |
LL | type Out = Box<dyn Bar<Assoc: Copy>>; LL | type Out = Box<dyn Bar<Assoc: Copy>>;
| ^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String` | ^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
| |
= note: the return type of a function must have a statically known size = note: the return type of a function must have a statically known size

View file

@ -1,5 +1,3 @@
// ignore-tidy-linelength
// NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`. // NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`.
// This should hopefully be fixed with Chalk. // This should hopefully be fixed with Chalk.
@ -29,15 +27,15 @@ trait Case1 {
pub struct S1; pub struct S1;
impl Case1 for S1 { impl Case1 for S1 {
//~^ ERROR `<L1 as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` [E0277] //~^ ERROR `<L1 as Lam<&'a u8>>::App` doesn't implement `Debug` [E0277]
type C = Once<Once<L1>>; type C = Once<Once<L1>>;
} }
fn assume_case1<T: Case1>() { fn assume_case1<T: Case1>() {
//~^ ERROR `<_ as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` [E0277] //~^ ERROR `<_ as Lam<&'a u8>>::App` doesn't implement `Debug` [E0277]
//~| ERROR `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator [E0277] //~| ERROR `<<T as Case1>::C as Iterator>::Item` is not an iterator [E0277]
//~| ERROR `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely [E0277] //~| ERROR `<<T as Case1>::C as Iterator>::Item` cannot be sent between threads safely [E0277]
//~| ERROR `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely [E0277] //~| ERROR `<<T as Case1>::C as Iterator>::Item` cannot be shared between threads safely [E0277]
fn assert_a<_0, A>() where A: Iterator<Item = _0>, _0: Debug {} fn assert_a<_0, A>() where A: Iterator<Item = _0>, _0: Debug {}
assert_a::<_, T::A>(); assert_a::<_, T::A>();

View file

@ -1,5 +1,5 @@
error[E0277]: `<L1 as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` error[E0277]: `<L1 as Lam<&'a u8>>::App` doesn't implement `Debug`
--> $DIR/bad-bounds-on-assoc-in-trait.rs:31:6 --> $DIR/bad-bounds-on-assoc-in-trait.rs:29:6
| |
LL | trait Case1 { LL | trait Case1 {
| ----- required by a bound in this | ----- required by a bound in this
@ -8,24 +8,24 @@ LL | Debug
| ----- required by this bound in `Case1` | ----- required by this bound in `Case1`
... ...
LL | impl Case1 for S1 { LL | impl Case1 for S1 {
| ^^^^^ `<L1 as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | ^^^^^ `<L1 as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `Debug`
| |
= help: the trait `for<'a> std::fmt::Debug` is not implemented for `<L1 as Lam<&'a u8>>::App` = help: the trait `for<'a> Debug` is not implemented for `<L1 as Lam<&'a u8>>::App`
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator error[E0277]: `<<T as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 --> $DIR/bad-bounds-on-assoc-in-trait.rs:34:20
| |
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^^^^^ `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator | ^^^^^ `<<T as Case1>::C as Iterator>::Item` is not an iterator
| |
= help: the trait `std::iter::Iterator` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `Iterator` is not implemented for `<<T as Case1>::C as Iterator>::Item`
help: consider further restricting the associated type help: consider further restricting the associated type
| |
LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as std::iter::Iterator>::Item: std::iter::Iterator { LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as Iterator>::Item: Iterator {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely error[E0277]: `<<T as Case1>::C as Iterator>::Item` cannot be sent between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 --> $DIR/bad-bounds-on-assoc-in-trait.rs:34:20
| |
LL | trait Case1 { LL | trait Case1 {
| ----- required by a bound in this | ----- required by a bound in this
@ -34,16 +34,16 @@ LL | Send + Iterator<Item:
| ---- required by this bound in `Case1` | ---- required by this bound in `Case1`
... ...
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^^^^^ `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely | ^^^^^ `<<T as Case1>::C as Iterator>::Item` cannot be sent between threads safely
| |
= help: the trait `std::marker::Send` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `Send` is not implemented for `<<T as Case1>::C as Iterator>::Item`
help: consider further restricting the associated type help: consider further restricting the associated type
| |
LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Send { LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as Iterator>::Item: Send {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely error[E0277]: `<<T as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 --> $DIR/bad-bounds-on-assoc-in-trait.rs:34:20
| |
LL | trait Case1 { LL | trait Case1 {
| ----- required by a bound in this | ----- required by a bound in this
@ -52,16 +52,16 @@ LL | > + Sync>;
| ---- required by this bound in `Case1` | ---- required by this bound in `Case1`
... ...
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^^^^^ `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely | ^^^^^ `<<T as Case1>::C as Iterator>::Item` cannot be shared between threads safely
| |
= help: the trait `std::marker::Sync` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `Sync` is not implemented for `<<T as Case1>::C as Iterator>::Item`
help: consider further restricting the associated type help: consider further restricting the associated type
| |
LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Sync { LL | fn assume_case1<T: Case1>() where <<T as Case1>::C as Iterator>::Item: Sync {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `<_ as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` error[E0277]: `<_ as Lam<&'a u8>>::App` doesn't implement `Debug`
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 --> $DIR/bad-bounds-on-assoc-in-trait.rs:34:20
| |
LL | trait Case1 { LL | trait Case1 {
| ----- required by a bound in this | ----- required by a bound in this
@ -70,9 +70,9 @@ LL | Debug
| ----- required by this bound in `Case1` | ----- required by this bound in `Case1`
... ...
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^^^^^ `<_ as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | ^^^^^ `<_ as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `Debug`
| |
= help: the trait `for<'a> std::fmt::Debug` is not implemented for `<_ as Lam<&'a u8>>::App` = help: the trait `for<'a> Debug` is not implemented for `<_ as Lam<&'a u8>>::App`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -8,172 +8,172 @@
use std::iter; use std::iter;
struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T } struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T } struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T } struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T } struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T } struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T } struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) } enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) } enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) } enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) } enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) } enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) } enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T } union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T } union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T } union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T } union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T } union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T } union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FI1<T: Iterator<Item: Copy, Item: Send>>() {} fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {} fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {} fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {} fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {} fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {} fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() } fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() } fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() } fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
const CIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); const CIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
const CIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); const CIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
const CIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); const CIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
static SIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); static SIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
static SIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); static SIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
static SIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); static SIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty();
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn lit1() { let _: impl Iterator<Item: Copy, Item: Send> = iter::empty(); } fn lit1() { let _: impl Iterator<Item: Copy, Item: Send> = iter::empty(); }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn lit2() { let _: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); } fn lit2() { let _: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn lit3() { let _: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); } fn lit3() { let _: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T; type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T; type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T; type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type ETAI4 = impl Iterator<Item: Copy, Item: Send>; type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRS1: Iterator<Item: Copy, Item: Send> {} trait TRS1: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRS2: Iterator<Item: Copy, Item: Copy> {} trait TRS2: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRS3: Iterator<Item: 'static, Item: 'static> {} trait TRS3: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {} trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {} trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {} trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; } trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; } trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; } trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses //~| ERROR could not find defining uses
//~| ERROR could not find defining uses //~| ERROR could not find defining uses

Some files were not shown because too many files have changed in this diff Show more