[[package]]
name = "compiler_builtins"
-version = "0.1.84"
+version = "0.1.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "989b2c1ca6e90ad06fdc69d1d1862fa28d27a977be6d92ae2fa762cf61fe0b10"
+checksum = "13e81c6cd7ab79f51a0c927d22858d61ad12bd0b3865f0b13ece02a4486aeabb"
dependencies = [
"cc",
"rustc-std-workspace-core",
[[package]]
name = "rustix"
-version = "0.36.3"
+version = "0.36.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e"
+checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
dependencies = [
"bitflags",
"errno",
#![cfg_attr(feature = "nightly", feature(step_trait, rustc_attrs, min_specialization))]
-use std::convert::{TryFrom, TryInto};
use std::fmt;
#[cfg(feature = "nightly")]
use std::iter::Step;
use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
use core::cmp::{self, Ordering};
-use core::convert::TryFrom;
use core::fmt::{self, Write};
use core::marker::PhantomData;
use core::mem;
use std::alloc::Layout;
use std::cell::{Cell, RefCell};
use std::cmp;
-use std::marker::{PhantomData, Send};
+use std::marker::PhantomData;
use std::mem::{self, MaybeUninit};
use std::ptr::{self, NonNull};
use std::slice;
use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{Span, DUMMY_SP};
-use std::convert::TryFrom;
use std::fmt;
use std::mem;
use thin_vec::{thin_vec, ThinVec};
//! Moreover, a switch to, e.g., `P<'a, T>` would be easy and mostly automated.
use std::fmt::{self, Debug, Display};
-use std::iter::FromIterator;
use std::ops::{Deref, DerefMut};
use std::{slice, vec};
}
}
-impl iter::FromIterator<TokenTree> for TokenStream {
+impl FromIterator<TokenTree> for TokenStream {
fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
}
}
// Drop AST to free memory
- std::mem::drop(ast_index);
- sess.time("drop_ast", || std::mem::drop(krate));
+ drop(ast_index);
+ sess.time("drop_ast", || drop(krate));
// Discard hygiene data, which isn't required after lowering to HIR.
if !sess.opts.unstable_opts.keep_hygiene_data {
self.check_activations(location);
match &terminator.kind {
- TerminatorKind::SwitchInt { discr, switch_ty: _, targets: _ } => {
+ TerminatorKind::SwitchInt { discr, targets: _ } => {
self.consume_operand(location, discr);
}
TerminatorKind::Drop { place: drop_place, target: _, unwind: _ } => {
self.check_activations(loc, span, flow_state);
match &term.kind {
- TerminatorKind::SwitchInt { discr, switch_ty: _, targets: _ } => {
+ TerminatorKind::SwitchInt { discr, targets: _ } => {
self.consume_operand(loc, (discr, span), flow_state);
}
TerminatorKind::Drop { place, target: _, unwind: _ } => {
);
}
}
- TerminatorKind::SwitchInt { discr, switch_ty, .. } => {
+ TerminatorKind::SwitchInt { discr, .. } => {
self.check_operand(discr, term_location);
- let discr_ty = discr.ty(body, tcx);
- if let Err(terr) = self.sub_types(
- discr_ty,
- *switch_ty,
- term_location.to_locations(),
- ConstraintCategory::Assignment,
- ) {
- span_mirbug!(
- self,
- term,
- "bad SwitchInt ({:?} on {:?}): {:?}",
- switch_ty,
- discr_ty,
- terr
- );
- }
+ let switch_ty = discr.ty(body, tcx);
if !switch_ty.is_integral() && !switch_ty.is_char() && !switch_ty.is_bool() {
span_mirbug!(self, term, "bad SwitchInt discr ty {:?}", switch_ty);
}
use rustc_session::errors::report_lit_error;
use rustc_span::symbol::Symbol;
-use std::string::String;
-
pub fn expand_concat(
cx: &mut base::ExtCtxt<'_>,
sp: rustc_span::Span,
tts: TokenStream,
) -> Box<dyn base::MacResult + 'static> {
- let Some(es) = base::get_exprs_from_tts(cx, sp, tts) else {
+ let Some(es) = base::get_exprs_from_tts(cx, tts) else {
return DummyResult::any(sp);
};
let mut accumulator = String::new();
sp: rustc_span::Span,
tts: TokenStream,
) -> Box<dyn base::MacResult + 'static> {
- let Some(es) = base::get_exprs_from_tts(cx, sp, tts) else {
+ let Some(es) = base::get_exprs_from_tts(cx, tts) else {
return DummyResult::any(sp);
};
let mut accumulator = Vec::new();
sp: Span,
tts: TokenStream,
) -> Box<dyn base::MacResult + 'cx> {
- let mut exprs = match get_exprs_from_tts(cx, sp, tts) {
+ let mut exprs = match get_exprs_from_tts(cx, tts) {
Some(exprs) if exprs.is_empty() => {
cx.span_err(sp, "env! takes 1 or 2 arguments");
return DummyResult::any(sp);
}
}
- TerminatorKind::SwitchInt { discr, switch_ty, targets } => {
- let discr = codegen_operand(fx, discr).load_scalar(fx);
+ TerminatorKind::SwitchInt { discr, targets } => {
+ let discr = codegen_operand(fx, discr);
+ let switch_ty = discr.layout().ty;
+ let discr = discr.load_scalar(fx);
let use_bool_opt = switch_ty.kind() == fx.tcx.types.bool.kind()
|| (targets.iter().count() == 1 && targets.iter().next().unwrap().0 == 0);
use rustc_target::abi::{Align, Size, VariantIdx};
use std::collections::BTreeSet;
-use std::convert::TryFrom;
use std::time::{Duration, Instant};
use itertools::Itertools;
helper: TerminatorCodegenHelper<'tcx>,
bx: &mut Bx,
discr: &mir::Operand<'tcx>,
- switch_ty: Ty<'tcx>,
targets: &SwitchTargets,
) {
let discr = self.codegen_operand(bx, &discr);
- // `switch_ty` is redundant, sanity-check that.
- assert_eq!(discr.layout.ty, switch_ty);
+ let switch_ty = discr.layout.ty;
let mut target_iter = targets.iter();
if target_iter.len() == 1 {
// If there are two targets (one conditional, one fallback), emit `br` instead of
helper.funclet_br(self, bx, target, mergeable_succ())
}
- mir::TerminatorKind::SwitchInt { ref discr, switch_ty, ref targets } => {
- self.codegen_switchint_terminator(helper, bx, discr, switch_ty, targets);
+ mir::TerminatorKind::SwitchInt { ref discr, ref targets } => {
+ self.codegen_switchint_terminator(helper, bx, discr, targets);
MergingSucc::False
}
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::mir;
use rustc_middle::ty;
+use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
use rustc_session::config::DebugInfo;
use rustc_span::symbol::{kw, Symbol};
use rustc_span::{BytePos, Span};
-use rustc_target::abi::Abi;
-use rustc_target::abi::Size;
+use rustc_target::abi::{Abi, Size, VariantIdx};
use super::operand::{OperandRef, OperandValue};
use super::place::PlaceRef;
}
}
+trait DebugInfoOffsetLocation<'tcx, Bx> {
+ fn deref(&self, bx: &mut Bx) -> Self;
+ fn layout(&self) -> TyAndLayout<'tcx>;
+ fn project_field(&self, bx: &mut Bx, field: mir::Field) -> Self;
+ fn downcast(&self, bx: &mut Bx, variant: VariantIdx) -> Self;
+}
+
+impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> DebugInfoOffsetLocation<'tcx, Bx>
+ for PlaceRef<'tcx, Bx::Value>
+{
+ fn deref(&self, bx: &mut Bx) -> Self {
+ bx.load_operand(*self).deref(bx.cx())
+ }
+
+ fn layout(&self) -> TyAndLayout<'tcx> {
+ self.layout
+ }
+
+ fn project_field(&self, bx: &mut Bx, field: mir::Field) -> Self {
+ PlaceRef::project_field(*self, bx, field.index())
+ }
+
+ fn downcast(&self, bx: &mut Bx, variant: VariantIdx) -> Self {
+ self.project_downcast(bx, variant)
+ }
+}
+
+impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> DebugInfoOffsetLocation<'tcx, Bx>
+ for TyAndLayout<'tcx>
+{
+ fn deref(&self, bx: &mut Bx) -> Self {
+ bx.cx().layout_of(
+ self.ty.builtin_deref(true).unwrap_or_else(|| bug!("cannot deref `{}`", self.ty)).ty,
+ )
+ }
+
+ fn layout(&self) -> TyAndLayout<'tcx> {
+ *self
+ }
+
+ fn project_field(&self, bx: &mut Bx, field: mir::Field) -> Self {
+ self.field(bx.cx(), field.index())
+ }
+
+ fn downcast(&self, bx: &mut Bx, variant: VariantIdx) -> Self {
+ self.for_variant(bx.cx(), variant)
+ }
+}
+
+struct DebugInfoOffset<T> {
+ /// Offset from the `base` used to calculate the debuginfo offset.
+ direct_offset: Size,
+ /// Each offset in this vector indicates one level of indirection from the base or previous
+ /// indirect offset plus a dereference.
+ indirect_offsets: Vec<Size>,
+ /// The final location debuginfo should point to.
+ result: T,
+}
+
+fn calculate_debuginfo_offset<
+ 'a,
+ 'tcx,
+ Bx: BuilderMethods<'a, 'tcx>,
+ L: DebugInfoOffsetLocation<'tcx, Bx>,
+>(
+ bx: &mut Bx,
+ local: mir::Local,
+ var: &PerLocalVarDebugInfo<'tcx, Bx::DIVariable>,
+ base: L,
+) -> DebugInfoOffset<L> {
+ let mut direct_offset = Size::ZERO;
+ // FIXME(eddyb) use smallvec here.
+ let mut indirect_offsets = vec![];
+ let mut place = base;
+
+ for elem in &var.projection[..] {
+ match *elem {
+ mir::ProjectionElem::Deref => {
+ indirect_offsets.push(Size::ZERO);
+ place = place.deref(bx);
+ }
+ mir::ProjectionElem::Field(field, _) => {
+ let offset = indirect_offsets.last_mut().unwrap_or(&mut direct_offset);
+ *offset += place.layout().fields.offset(field.index());
+ place = place.project_field(bx, field);
+ }
+ mir::ProjectionElem::Downcast(_, variant) => {
+ place = place.downcast(bx, variant);
+ }
+ _ => span_bug!(
+ var.source_info.span,
+ "unsupported var debuginfo place `{:?}`",
+ mir::Place { local, projection: var.projection },
+ ),
+ }
+ }
+
+ DebugInfoOffset { direct_offset, indirect_offsets, result: place }
+}
+
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn set_debug_loc(&self, bx: &mut Bx, source_info: mir::SourceInfo) {
bx.set_span(source_info.span);
let Some(dbg_var) = var.dbg_var else { continue };
let Some(dbg_loc) = self.dbg_loc(var.source_info) else { continue };
- let mut direct_offset = Size::ZERO;
- // FIXME(eddyb) use smallvec here.
- let mut indirect_offsets = vec![];
- let mut place = base;
-
- for elem in &var.projection[..] {
- match *elem {
- mir::ProjectionElem::Deref => {
- indirect_offsets.push(Size::ZERO);
- place = bx.load_operand(place).deref(bx.cx());
- }
- mir::ProjectionElem::Field(field, _) => {
- let i = field.index();
- let offset = indirect_offsets.last_mut().unwrap_or(&mut direct_offset);
- *offset += place.layout.fields.offset(i);
- place = place.project_field(bx, i);
- }
- mir::ProjectionElem::Downcast(_, variant) => {
- place = place.project_downcast(bx, variant);
- }
- _ => span_bug!(
- var.source_info.span,
- "unsupported var debuginfo place `{:?}`",
- mir::Place { local, projection: var.projection },
- ),
- }
- }
+ let DebugInfoOffset { direct_offset, indirect_offsets, result: _ } =
+ calculate_debuginfo_offset(bx, local, &var, base.layout);
// When targeting MSVC, create extra allocas for arguments instead of pointing multiple
// dbg_var_addr() calls into the same alloca with offsets. MSVC uses CodeView records
|| !matches!(&indirect_offsets[..], [Size::ZERO] | []));
if should_create_individual_allocas {
+ let DebugInfoOffset { direct_offset: _, indirect_offsets: _, result: place } =
+ calculate_debuginfo_offset(bx, local, &var, base);
+
// Create a variable which will be a pointer to the actual value
let ptr_ty = bx.tcx().mk_ty(ty::RawPtr(ty::TypeAndMut {
mutbl: mir::Mutability::Mut,
use std::borrow::Cow;
-use std::convert::TryInto;
use either::{Left, Right};
use std::assert_matches::assert_matches;
-use std::convert::TryFrom;
use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::{Float, FloatConvert};
//! looking at their MIR. Intrinsics/functions supported here are shared by CTFE
//! and miri.
-use std::convert::TryFrom;
-
use rustc_hir::def_id::DefId;
use rustc_middle::mir::{
self,
-use std::convert::TryFrom;
-
use rustc_ast::Mutability;
use rustc_hir::lang_items::LangItem;
use rustc_middle::mir::TerminatorKind;
-use std::convert::TryFrom;
-
use rustc_apfloat::Float;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{InterpResult, Scalar};
Goto { target } => self.go_to_block(target),
- SwitchInt { ref discr, ref targets, switch_ty } => {
+ SwitchInt { ref discr, ref targets } => {
let discr = self.read_immediate(&self.eval_operand(discr, None)?)?;
trace!("SwitchInt({:?})", *discr);
- assert_eq!(discr.layout.ty, switch_ty);
// Branch to the `otherwise` case by default, if no match is found.
let mut target_block = targets.otherwise();
use rustc_middle::mir::interpret::InterpResult;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor};
-use std::convert::TryInto;
use std::ops::ControlFlow;
/// Checks whether a type contains generic parameters which require substitution.
//! That's useful because it means other passes (e.g. promotion) can rely on `const`s
//! to be const-safe.
-use std::convert::TryFrom;
use std::fmt::{Display, Write};
use std::num::NonZeroUsize;
TerminatorKind::Goto { target } => {
self.check_edge(location, *target, EdgeKind::Normal);
}
- TerminatorKind::SwitchInt { targets, switch_ty, discr } => {
- let ty = discr.ty(&self.body.local_decls, self.tcx);
- if ty != *switch_ty {
- self.fail(
- location,
- format!(
- "encountered `SwitchInt` terminator with type mismatch: {:?} != {:?}",
- ty, switch_ty,
- ),
- );
- }
+ TerminatorKind::SwitchInt { targets, discr } => {
+ let switch_ty = discr.ty(&self.body.local_decls, self.tcx);
let target_width = self.tcx.sess.target.pointer_width;
use rustc_middle::ty::{Ty, TyCtxt};
use rustc_target::abi::VariantIdx;
-use std::convert::TryFrom;
use std::iter::TrustedLen;
/// Expand `lhs = Rvalue::Aggregate(kind, operands)` into assignments to the fields.
use crate::stable_hasher;
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
-use std::convert::TryInto;
use std::hash::{Hash, Hasher};
#[cfg(test)]
use crate::graph::vec_graph::VecGraph;
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
use rustc_index::vec::{Idx, IndexVec};
-use std::cmp::Ord;
use std::ops::Range;
#[cfg(test)]
-use std::cmp::Ord;
-
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
use rustc_index::vec::{Idx, IndexVec};
/////////////////////////////////////////////////////////////////////////////
use std::borrow::Borrow;
-use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
-use std::convert::From;
+use std::cmp::Ordering;
use std::fmt::{self, Debug};
use std::hash::{Hash, Hasher};
-use std::marker::{Send, Sync};
impl<O, T: ?Sized> Deref for OwningRef<O, T> {
type Target = T;
// std types integration and convenience type defs
/////////////////////////////////////////////////////////////////////////////
-use std::boxed::Box;
use std::cell::{Ref, RefCell, RefMut};
use std::rc::Rc;
use std::sync::Arc;
mod owning_ref {
use super::super::OwningRef;
use super::super::{BoxRef, Erased, ErasedBoxRef, RcRef};
- use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
+ use std::cmp::Ordering;
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
mod owning_ref_mut {
use super::super::BoxRef;
use super::super::{BoxRefMut, Erased, ErasedBoxRefMut, OwningRefMut};
- use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
+ use std::cmp::Ordering;
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::borrow::Borrow;
use std::collections::hash_map::Entry;
-use std::convert::Into;
use std::error::Error;
use std::fs;
use std::path::Path;
use crate::stable_hasher::{HashStable, StableHasher, StableOrd};
use std::borrow::Borrow;
use std::cmp::Ordering;
-use std::iter::FromIterator;
use std::mem;
use std::ops::{Bound, Index, IndexMut, RangeBounds};
//! A variant of `SortedMap` that preserves insertion order.
use std::hash::{Hash, Hasher};
-use std::iter::FromIterator;
use crate::stable_hasher::{HashStable, StableHasher};
use rustc_index::vec::{Idx, IndexVec};
use std::fmt;
-use std::iter::ExactSizeIterator;
use std::iter::FusedIterator;
-use std::iter::Iterator;
/// Iterator which may contain instance of
/// one of two specific implementations.
use arrayvec::ArrayVec;
use std::fmt;
use std::hash::Hash;
-use std::iter::FromIterator;
use std::ops::Index;
// For pointer-sized arguments arrays
use std::fmt;
use std::hash::Hash;
-use std::iter::FromIterator;
use super::map::SsoHashMap;
}
}
- pub use std::iter::Iterator as ParallelIterator;
+ pub use Iterator as ParallelIterator;
pub fn par_iter<T: IntoIterator>(t: T) -> T::IntoIter {
t.into_iter()
fn drop(&mut self) {
// No need to drop the tag, as it's Copy
unsafe {
- std::mem::drop(P::from_usize(self.raw.pointer_raw()));
+ drop(P::from_usize(self.raw.pointer_raw()));
}
}
}
use std::borrow::Borrow;
use std::fmt::Debug;
-use std::iter::FromIterator;
use std::slice::Iter;
use std::vec::IntoIter;
use std::borrow::Cow;
use std::cmp::max;
-use std::default::Default;
use std::env;
use std::ffi::OsString;
use std::fs;
```
use std::cell::Cell;
-use std::marker::Sync;
struct NotThreadSafe<T> {
value: Cell<T>,
variable '{$ident}' is still repeating at this depth
expand_meta_var_dif_seq_matchers = {$msg}
+
+expand_macro_const_stability =
+ macros cannot have const stability attributes
+ .label = invalid const stability attribute
+ .label2 = const stability attribute affects this macro
+
+expand_macro_body_stability =
+ macros cannot have body stability attributes
+ .label = invalid body stability attribute
+ .label2 = body stability attribute affects this macro
+
+expand_resolve_relative_path =
+ cannot resolve relative path in non-file source `{$path}`
+
+expand_attr_no_arguments =
+ attribute must have either one or two arguments
+
+expand_not_a_meta_item =
+ not a meta item
+
+expand_only_one_word =
+ must only be one word
+
+expand_cannot_be_name_of_macro =
+ `{$trait_ident}` cannot be a name of {$macro_type} macro
+
+expand_arg_not_attributes =
+ second argument must be `attributes`
+
+expand_attributes_wrong_form =
+ attribute must be of form: `attributes(foo, bar)`
+
+expand_attribute_meta_item =
+ attribute must be a meta item, not a literal
+
+expand_attribute_single_word =
+ attribute must only be a single word
+
+expand_helper_attribute_name_invalid =
+ `{$name}` cannot be a name of derive helper attribute
+
+expand_expected_comma_in_list =
+ expected token: `,`
+
+expand_only_one_argument =
+ {$name} takes 1 argument
+
+expand_takes_no_arguments =
+ {$name} takes no arguments
+
+expand_feature_included_in_edition =
+ the feature `{$feature}` is included in the Rust {$edition} edition
+
+expand_feature_removed =
+ feature has been removed
+ .label = feature has been removed
+ .reason = {$reason}
+
+expand_feature_not_allowed =
+ the feature `{$name}` is not in the list of allowed features
+
+expand_recursion_limit_reached =
+ recursion limit reached while expanding `{$descr}`
+ .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`)
+
+expand_malformed_feature_attribute =
+ malformed `feature` attribute input
+ .expected = expected just one word
+
+expand_remove_expr_not_supported =
+ removing an expression is not supported in this position
+
+expand_invalid_cfg_no_parens = `cfg` is not followed by parentheses
+expand_invalid_cfg_no_predicate = `cfg` predicate is not specified
+expand_invalid_cfg_multiple_predicates = multiple `cfg` predicates are specified
+expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal
+expand_invalid_cfg_expected_syntax = expected syntax is
+
+expand_wrong_fragment_kind =
+ non-{$kind} macro in {$kind} position: {$name}
+
+expand_unsupported_key_value =
+ key-value macro attributes are not supported
+
+expand_incomplete_parse =
+ macro expansion ignores token `{$token}` and any following
+ .label = caused by the macro expansion here
+ .note = the usage of `{$macro_path}!` is likely invalid in {$kind_name} context
+ .suggestion_add_semi = you might be missing a semicolon here
+
+expand_remove_node_not_supported =
+ removing {$descr} is not supported in this position
+
+expand_module_circular =
+ circular modules: {$modules}
+
+expand_module_in_block =
+ cannot declare a non-inline module inside a block unless it has a path attribute
+ .note = maybe `use` the module `{$name}` instead of redeclaring it
+
+expand_module_file_not_found =
+ file not found for module `{$name}`
+ .help = to create the module `{$name}`, create file "{$default_path}" or "{$secondary_path}"
+
+expand_module_multiple_candidates =
+ file for module `{$name}` found at both "{$default_path}" and "{$secondary_path}"
+ .help = delete or rename one of them to remove the ambiguity
i128,
u128,
std::io::Error,
- std::boxed::Box<dyn std::error::Error>,
+ Box<dyn std::error::Error>,
std::num::NonZeroU32,
hir::Target,
Edition,
}
}
+impl IntoDiagnosticArg for &ast::Path {
+ fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+ DiagnosticArgValue::Str(Cow::Owned(pprust::path_to_string(self)))
+ }
+}
+
impl IntoDiagnosticArg for ast::token::Token {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
DiagnosticArgValue::Str(pprust::token_to_string(&self))
+#![deny(rustc::untranslatable_diagnostic)]
+
+use crate::errors::{
+ ArgumentNotAttributes, AttrNoArguments, AttributeMetaItem, AttributeSingleWord,
+ AttributesWrongForm, CannotBeNameOfMacro, ExpectedCommaInList, HelperAttributeNameInvalid,
+ MacroBodyStability, MacroConstStability, NotAMetaItem, OnlyOneArgument, OnlyOneWord,
+ ResolveRelativePath, TakesNoArguments,
+};
use crate::expand::{self, AstFragment, Invocation};
use crate::module::DirOwnership;
use rustc_span::{BytePos, FileName, RealFileName, Span, DUMMY_SP};
use smallvec::{smallvec, SmallVec};
-use std::default::Default;
use std::iter;
use std::path::PathBuf;
use std::rc::Rc;
.unwrap_or_else(|| (None, helper_attrs));
let (stability, const_stability, body_stability) = attr::find_stability(&sess, attrs, span);
if let Some((_, sp)) = const_stability {
- sess.parse_sess
- .span_diagnostic
- .struct_span_err(sp, "macros cannot have const stability attributes")
- .span_label(sp, "invalid const stability attribute")
- .span_label(
- sess.source_map().guess_head_span(span),
- "const stability attribute affects this macro",
- )
- .emit();
+ sess.emit_err(MacroConstStability {
+ span: sp,
+ head_span: sess.source_map().guess_head_span(span),
+ });
}
if let Some((_, sp)) = body_stability {
- sess.parse_sess
- .span_diagnostic
- .struct_span_err(sp, "macros cannot have body stability attributes")
- .span_label(sp, "invalid body stability attribute")
- .span_label(
- sess.source_map().guess_head_span(span),
- "body stability attribute affects this macro",
- )
- .emit();
+ sess.emit_err(MacroBodyStability {
+ span: sp,
+ head_span: sess.source_map().guess_head_span(span),
+ });
}
SyntaxExtension {
.expect("attempting to resolve a file path in an external file"),
FileName::DocTest(path, _) => path,
other => {
- return Err(parse_sess.span_diagnostic.struct_span_err(
+ return Err(ResolveRelativePath {
span,
- &format!(
- "cannot resolve relative path in non-file source `{}`",
- parse_sess.source_map().filename_for_diagnostics(&other)
- ),
- ));
+ path: parse_sess.source_map().filename_for_diagnostics(&other).to_string(),
+ }
+ .into_diagnostic(&parse_sess.span_diagnostic));
}
};
result.pop();
/// The returned bool indicates whether an applicable suggestion has already been
/// added to the diagnostic to avoid emitting multiple suggestions. `Err(None)`
/// indicates that an ast error was encountered.
+// FIXME(Nilstrieb) Make this function setup translatable
+#[allow(rustc::untranslatable_diagnostic)]
pub fn expr_to_spanned_string<'a>(
cx: &'a mut ExtCtxt<'_>,
expr: P<ast::Expr>,
/// compilation should call
/// `cx.parse_sess.span_diagnostic.abort_if_errors()` (this should be
/// done as rarely as possible).
-pub fn check_zero_tts(cx: &ExtCtxt<'_>, sp: Span, tts: TokenStream, name: &str) {
+pub fn check_zero_tts(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream, name: &str) {
if !tts.is_empty() {
- cx.span_err(sp, &format!("{} takes no arguments", name));
+ cx.emit_err(TakesNoArguments { span, name });
}
}
/// expect exactly one string literal, or emit an error and return `None`.
pub fn get_single_str_from_tts(
cx: &mut ExtCtxt<'_>,
- sp: Span,
+ span: Span,
tts: TokenStream,
name: &str,
) -> Option<Symbol> {
let mut p = cx.new_parser_from_tts(tts);
if p.token == token::Eof {
- cx.span_err(sp, &format!("{} takes 1 argument", name));
+ cx.emit_err(OnlyOneArgument { span, name });
return None;
}
let ret = parse_expr(&mut p)?;
let _ = p.eat(&token::Comma);
if p.token != token::Eof {
- cx.span_err(sp, &format!("{} takes 1 argument", name));
+ cx.emit_err(OnlyOneArgument { span, name });
}
expr_to_string(cx, ret, "argument must be a string literal").map(|(s, _)| s)
}
/// Extracts comma-separated expressions from `tts`.
/// On error, emit it, and return `None`.
-pub fn get_exprs_from_tts(
- cx: &mut ExtCtxt<'_>,
- sp: Span,
- tts: TokenStream,
-) -> Option<Vec<P<ast::Expr>>> {
+pub fn get_exprs_from_tts(cx: &mut ExtCtxt<'_>, tts: TokenStream) -> Option<Vec<P<ast::Expr>>> {
let mut p = cx.new_parser_from_tts(tts);
let mut es = Vec::new();
while p.token != token::Eof {
continue;
}
if p.token != token::Eof {
- cx.span_err(sp, "expected token: `,`");
+ cx.emit_err(ExpectedCommaInList { span: p.token.span });
return None;
}
}
pub fn parse_macro_name_and_helper_attrs(
diag: &rustc_errors::Handler,
attr: &Attribute,
- descr: &str,
+ macro_type: &str,
) -> Option<(Symbol, Vec<Symbol>)> {
// Once we've located the `#[proc_macro_derive]` attribute, verify
// that it's of the form `#[proc_macro_derive(Foo)]` or
// `#[proc_macro_derive(Foo, attributes(A, ..))]`
let list = attr.meta_item_list()?;
if list.len() != 1 && list.len() != 2 {
- diag.span_err(attr.span, "attribute must have either one or two arguments");
+ diag.emit_err(AttrNoArguments { span: attr.span });
return None;
}
let Some(trait_attr) = list[0].meta_item() else {
- diag.span_err(list[0].span(), "not a meta item");
+ diag.emit_err(NotAMetaItem {span: list[0].span()});
return None;
};
let trait_ident = match trait_attr.ident() {
Some(trait_ident) if trait_attr.is_word() => trait_ident,
_ => {
- diag.span_err(trait_attr.span, "must only be one word");
+ diag.emit_err(OnlyOneWord { span: trait_attr.span });
return None;
}
};
if !trait_ident.name.can_be_raw() {
- diag.span_err(
- trait_attr.span,
- &format!("`{}` cannot be a name of {} macro", trait_ident, descr),
- );
+ diag.emit_err(CannotBeNameOfMacro { span: trait_attr.span, trait_ident, macro_type });
}
let attributes_attr = list.get(1);
let proc_attrs: Vec<_> = if let Some(attr) = attributes_attr {
if !attr.has_name(sym::attributes) {
- diag.span_err(attr.span(), "second argument must be `attributes`");
+ diag.emit_err(ArgumentNotAttributes { span: attr.span() });
}
attr.meta_item_list()
.unwrap_or_else(|| {
- diag.span_err(attr.span(), "attribute must be of form: `attributes(foo, bar)`");
+ diag.emit_err(AttributesWrongForm { span: attr.span() });
&[]
})
.iter()
.filter_map(|attr| {
let Some(attr) = attr.meta_item() else {
- diag.span_err(attr.span(), "not a meta item");
+ diag.emit_err(AttributeMetaItem { span: attr.span() });
return None;
};
let ident = match attr.ident() {
Some(ident) if attr.is_word() => ident,
_ => {
- diag.span_err(attr.span, "must only be one word");
+ diag.emit_err(AttributeSingleWord { span: attr.span });
return None;
}
};
if !ident.name.can_be_raw() {
- diag.span_err(
- attr.span,
- &format!("`{}` cannot be a name of derive helper attribute", ident),
- );
+ diag.emit_err(HelperAttributeNameInvalid { span: attr.span, name: ident });
}
Some(ident.name)
//! Conditional compilation stripping.
+use crate::errors::{
+ FeatureIncludedInEdition, FeatureNotAllowed, FeatureRemoved, FeatureRemovedReason, InvalidCfg,
+ MalformedFeatureAttribute, MalformedFeatureAttributeHelp, RemoveExprNotSupported,
+};
use rustc_ast::ptr::P;
use rustc_ast::token::{Delimiter, Token, TokenKind};
use rustc_ast::tokenstream::{AttrTokenStream, AttrTokenTree};
use rustc_attr as attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::map_in_place::MapInPlace;
-use rustc_errors::{error_code, struct_span_err, Applicability, Handler};
use rustc_feature::{Feature, Features, State as FeatureState};
use rustc_feature::{
ACCEPTED_FEATURES, ACTIVE_FEATURES, REMOVED_FEATURES, STABLE_REMOVED_FEATURES,
pub lint_node_id: NodeId,
}
-fn get_features(
- sess: &Session,
- span_handler: &Handler,
- krate_attrs: &[ast::Attribute],
-) -> Features {
- fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
- let mut err = struct_span_err!(span_handler, span, E0557, "feature has been removed");
- err.span_label(span, "feature has been removed");
- if let Some(reason) = reason {
- err.note(reason);
- }
- err.emit();
+fn get_features(sess: &Session, krate_attrs: &[ast::Attribute]) -> Features {
+ fn feature_removed(sess: &Session, span: Span, reason: Option<&str>) {
+ sess.emit_err(FeatureRemoved {
+ span,
+ reason: reason.map(|reason| FeatureRemovedReason { reason }),
+ });
}
fn active_features_up_to(edition: Edition) -> impl Iterator<Item = &'static Feature> {
continue;
};
- let bad_input = |span| {
- struct_span_err!(span_handler, span, E0556, "malformed `feature` attribute input")
- };
-
for mi in list {
let name = match mi.ident() {
Some(ident) if mi.is_word() => ident.name,
Some(ident) => {
- bad_input(mi.span())
- .span_suggestion(
- mi.span(),
- "expected just one word",
- ident.name,
- Applicability::MaybeIncorrect,
- )
- .emit();
+ sess.emit_err(MalformedFeatureAttribute {
+ span: mi.span(),
+ help: MalformedFeatureAttributeHelp::Suggestion {
+ span: mi.span(),
+ suggestion: ident.name,
+ },
+ });
continue;
}
None => {
- bad_input(mi.span()).span_label(mi.span(), "expected just one word").emit();
+ sess.emit_err(MalformedFeatureAttribute {
+ span: mi.span(),
+ help: MalformedFeatureAttributeHelp::Label { span: mi.span() },
+ });
continue;
}
};
- if let Some(edition) = edition_enabled_features.get(&name) {
- let msg =
- &format!("the feature `{}` is included in the Rust {} edition", name, edition);
- span_handler.struct_span_warn_with_code(mi.span(), msg, error_code!(E0705)).emit();
+ if let Some(&edition) = edition_enabled_features.get(&name) {
+ sess.emit_warning(FeatureIncludedInEdition {
+ span: mi.span(),
+ feature: name,
+ edition,
+ });
continue;
}
if let FeatureState::Removed { reason } | FeatureState::Stabilized { reason } =
state
{
- feature_removed(span_handler, mi.span(), *reason);
+ feature_removed(sess, mi.span(), *reason);
continue;
}
}
if let Some(allowed) = sess.opts.unstable_opts.allow_features.as_ref() {
if allowed.iter().all(|f| name.as_str() != f) {
- struct_span_err!(
- span_handler,
- mi.span(),
- E0725,
- "the feature `{}` is not in the list of allowed features",
- name
- )
- .emit();
+ sess.emit_err(FeatureNotAllowed { span: mi.span(), name });
continue;
}
}
}
Some(attrs) => {
krate.attrs = attrs;
- let features = get_features(sess, diag, &krate.attrs);
+ let features = get_features(sess, &krate.attrs);
if err_count == diag.err_count() {
// Avoid reconfiguring malformed `cfg_attr`s.
strip_unconfigured.features = Some(&features);
// N.B., this is intentionally not part of the visit_expr() function
// in order for filter_map_expr() to be able to avoid this check
if let Some(attr) = expr.attrs().iter().find(|a| is_cfg(*a)) {
- let msg = "removing an expression is not supported in this position";
- self.sess.parse_sess.span_diagnostic.span_err(attr.span, msg);
+ self.sess.emit_err(RemoveExprNotSupported { span: attr.span });
}
self.process_cfg_attrs(expr);
}
pub fn parse_cfg<'a>(meta_item: &'a MetaItem, sess: &Session) -> Option<&'a MetaItem> {
- let error = |span, msg, suggestion: &str| {
- let mut err = sess.parse_sess.span_diagnostic.struct_span_err(span, msg);
- if !suggestion.is_empty() {
- err.span_suggestion(
- span,
- "expected syntax is",
- suggestion,
- Applicability::HasPlaceholders,
- );
- }
- err.emit();
- None
- };
let span = meta_item.span;
match meta_item.meta_item_list() {
- None => error(span, "`cfg` is not followed by parentheses", "cfg(/* predicate */)"),
- Some([]) => error(span, "`cfg` predicate is not specified", ""),
- Some([_, .., l]) => error(l.span(), "multiple `cfg` predicates are specified", ""),
+ None => {
+ sess.emit_err(InvalidCfg::NotFollowedByParens { span });
+ None
+ }
+ Some([]) => {
+ sess.emit_err(InvalidCfg::NoPredicate { span });
+ None
+ }
+ Some([_, .., l]) => {
+ sess.emit_err(InvalidCfg::MultiplePredicates { span: l.span() });
+ None
+ }
Some([single]) => match single.meta_item() {
Some(meta_item) => Some(meta_item),
- None => error(single.span(), "`cfg` predicate key cannot be a literal", ""),
+ None => {
+ sess.emit_err(InvalidCfg::PredicateLiteral { span: single.span() });
+ None
+ }
},
}
}
+use rustc_ast::ast;
use rustc_macros::Diagnostic;
-use rustc_span::symbol::MacroRulesNormalizedIdent;
-use rustc_span::Span;
+use rustc_session::Limit;
+use rustc_span::edition::Edition;
+use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent};
+use rustc_span::{Span, Symbol};
+use std::borrow::Cow;
#[derive(Diagnostic)]
#[diag(expand_expr_repeat_no_syntax_vars)]
pub span: Span,
pub msg: String,
}
+
+#[derive(Diagnostic)]
+#[diag(expand_resolve_relative_path)]
+pub(crate) struct ResolveRelativePath {
+ #[primary_span]
+ pub span: Span,
+ pub path: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_macro_const_stability)]
+pub(crate) struct MacroConstStability {
+ #[primary_span]
+ #[label]
+ pub span: Span,
+ #[label(label2)]
+ pub head_span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_macro_body_stability)]
+pub(crate) struct MacroBodyStability {
+ #[primary_span]
+ #[label]
+ pub span: Span,
+ #[label(label2)]
+ pub head_span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_attr_no_arguments)]
+pub(crate) struct AttrNoArguments {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_not_a_meta_item)]
+pub(crate) struct NotAMetaItem {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_only_one_word)]
+pub(crate) struct OnlyOneWord {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_cannot_be_name_of_macro)]
+pub(crate) struct CannotBeNameOfMacro<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub trait_ident: Ident,
+ pub macro_type: &'a str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_arg_not_attributes)]
+pub(crate) struct ArgumentNotAttributes {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_attributes_wrong_form)]
+pub(crate) struct AttributesWrongForm {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_attribute_meta_item)]
+pub(crate) struct AttributeMetaItem {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_attribute_single_word)]
+pub(crate) struct AttributeSingleWord {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_helper_attribute_name_invalid)]
+pub(crate) struct HelperAttributeNameInvalid {
+ #[primary_span]
+ pub span: Span,
+ pub name: Ident,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_expected_comma_in_list)]
+pub(crate) struct ExpectedCommaInList {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_only_one_argument)]
+pub(crate) struct OnlyOneArgument<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub name: &'a str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_takes_no_arguments)]
+pub(crate) struct TakesNoArguments<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub name: &'a str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_feature_included_in_edition, code = "E0705")]
+pub(crate) struct FeatureIncludedInEdition {
+ #[primary_span]
+ pub span: Span,
+ pub feature: Symbol,
+ pub edition: Edition,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_feature_removed, code = "E0557")]
+pub(crate) struct FeatureRemoved<'a> {
+ #[primary_span]
+ #[label]
+ pub span: Span,
+ #[subdiagnostic]
+ pub reason: Option<FeatureRemovedReason<'a>>,
+}
+
+#[derive(Subdiagnostic)]
+#[note(reason)]
+pub(crate) struct FeatureRemovedReason<'a> {
+ pub reason: &'a str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_feature_not_allowed, code = "E0725")]
+pub(crate) struct FeatureNotAllowed {
+ #[primary_span]
+ pub span: Span,
+ pub name: Symbol,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_recursion_limit_reached)]
+#[help]
+pub(crate) struct RecursionLimitReached<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub descr: String,
+ pub suggested_limit: Limit,
+ pub crate_name: &'a str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_malformed_feature_attribute, code = "E0556")]
+pub(crate) struct MalformedFeatureAttribute {
+ #[primary_span]
+ pub span: Span,
+ #[subdiagnostic]
+ pub help: MalformedFeatureAttributeHelp,
+}
+
+#[derive(Subdiagnostic)]
+pub(crate) enum MalformedFeatureAttributeHelp {
+ #[label(expected)]
+ Label {
+ #[primary_span]
+ span: Span,
+ },
+ #[suggestion(expected, code = "{suggestion}", applicability = "maybe-incorrect")]
+ Suggestion {
+ #[primary_span]
+ span: Span,
+ suggestion: Symbol,
+ },
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_remove_expr_not_supported)]
+pub(crate) struct RemoveExprNotSupported {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+pub(crate) enum InvalidCfg {
+ #[diag(expand_invalid_cfg_no_parens)]
+ NotFollowedByParens {
+ #[primary_span]
+ #[suggestion(
+ expand_invalid_cfg_expected_syntax,
+ code = "cfg(/* predicate */)",
+ applicability = "has-placeholders"
+ )]
+ span: Span,
+ },
+ #[diag(expand_invalid_cfg_no_predicate)]
+ NoPredicate {
+ #[primary_span]
+ #[suggestion(
+ expand_invalid_cfg_expected_syntax,
+ code = "cfg(/* predicate */)",
+ applicability = "has-placeholders"
+ )]
+ span: Span,
+ },
+ #[diag(expand_invalid_cfg_multiple_predicates)]
+ MultiplePredicates {
+ #[primary_span]
+ span: Span,
+ },
+ #[diag(expand_invalid_cfg_predicate_literal)]
+ PredicateLiteral {
+ #[primary_span]
+ span: Span,
+ },
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_wrong_fragment_kind)]
+pub(crate) struct WrongFragmentKind<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub kind: &'a str,
+ pub name: &'a ast::Path,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_unsupported_key_value)]
+pub(crate) struct UnsupportedKeyValue {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_incomplete_parse)]
+#[note]
+pub(crate) struct IncompleteParse<'a> {
+ #[primary_span]
+ pub span: Span,
+ pub token: Cow<'a, str>,
+ #[label]
+ pub label_span: Span,
+ pub macro_path: &'a ast::Path,
+ pub kind_name: &'a str,
+
+ #[suggestion(
+ suggestion_add_semi,
+ style = "verbose",
+ code = ";",
+ applicability = "maybe-incorrect"
+ )]
+ pub add_semicolon: Option<Span>,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_remove_node_not_supported)]
+pub(crate) struct RemoveNodeNotSupported {
+ #[primary_span]
+ pub span: Span,
+ pub descr: &'static str,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_module_circular)]
+pub(crate) struct ModuleCircular {
+ #[primary_span]
+ pub span: Span,
+ pub modules: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_module_in_block)]
+pub(crate) struct ModuleInBlock {
+ #[primary_span]
+ pub span: Span,
+ #[subdiagnostic]
+ pub name: Option<ModuleInBlockName>,
+}
+
+#[derive(Subdiagnostic)]
+#[note(note)]
+pub(crate) struct ModuleInBlockName {
+ #[primary_span]
+ pub span: Span,
+ pub name: Ident,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_module_file_not_found, code = "E0583")]
+#[help]
+pub(crate) struct ModuleFileNotFound {
+ #[primary_span]
+ pub span: Span,
+ pub name: Ident,
+ pub default_path: String,
+ pub secondary_path: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(expand_module_multiple_candidates, code = "E0761")]
+#[help]
+pub(crate) struct ModuleMultipleCandidates {
+ #[primary_span]
+ pub span: Span,
+ pub name: Ident,
+ pub default_path: String,
+ pub secondary_path: String,
+}
use crate::base::*;
use crate::config::StripUnconfigured;
+use crate::errors::{
+ IncompleteParse, RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported,
+ UnsupportedKeyValue, WrongFragmentKind,
+};
use crate::hygiene::SyntaxContext;
use crate::mbe::diagnostics::annotate_err_with_kind;
use crate::module::{mod_dir_path, parse_external_mod, DirOwnership, ParsedExternalMod};
use rustc_ast_pretty::pprust;
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_data_structures::sync::Lrc;
-use rustc_errors::{Applicability, PResult};
+use rustc_errors::PResult;
use rustc_feature::Features;
use rustc_parse::parser::{
AttemptLocalParseRecovery, CommaRecoveryMode, ForceCollect, Parser, RecoverColon, RecoverComma,
Limit(0) => Limit(2),
limit => limit * 2,
};
- self.cx
- .struct_span_err(
- expn_data.call_site,
- &format!("recursion limit reached while expanding `{}`", expn_data.kind.descr()),
- )
- .help(&format!(
- "consider increasing the recursion limit by adding a \
- `#![recursion_limit = \"{}\"]` attribute to your crate (`{}`)",
- suggested_limit, self.cx.ecfg.crate_name,
- ))
- .emit();
+
+ self.cx.emit_err(RecursionLimitReached {
+ span: expn_data.call_site,
+ descr: expn_data.kind.descr(),
+ suggested_limit,
+ crate_name: &self.cx.ecfg.crate_name,
+ });
+
self.cx.trace_macros_diag();
}
/// A macro's expansion does not fit in this fragment kind.
/// For example, a non-type macro in a type position.
fn error_wrong_fragment_kind(&mut self, kind: AstFragmentKind, mac: &ast::MacCall, span: Span) {
- let msg = format!(
- "non-{kind} macro in {kind} position: {path}",
- kind = kind.name(),
- path = pprust::path_to_string(&mac.path),
- );
- self.cx.span_err(span, &msg);
+ self.cx.emit_err(WrongFragmentKind { span, kind: kind.name(), name: &mac.path });
+
self.cx.trace_macros_diag();
}
};
let attr_item = attr.unwrap_normal_item();
if let AttrArgs::Eq(..) = attr_item.args {
- self.cx.span_err(span, "key-value macro attributes are not supported");
+ self.cx.emit_err(UnsupportedKeyValue { span });
}
let inner_tokens = attr_item.args.inner_tokens();
let Ok(tok_result) = expander.expand(self.cx, span, inner_tokens, tokens) else {
}
};
if fragment_kind == AstFragmentKind::Expr && items.is_empty() {
- let msg =
- "removing an expression is not supported in this position";
- self.cx.span_err(span, msg);
+ self.cx.emit_err(RemoveExprNotSupported { span });
fragment_kind.dummy(span)
} else {
fragment_kind.expect_from_annotatables(items)
}
pub fn ensure_complete_parse<'a>(
- this: &mut Parser<'a>,
+ parser: &mut Parser<'a>,
macro_path: &ast::Path,
kind_name: &str,
span: Span,
) {
- if this.token != token::Eof {
- let token = pprust::token_to_string(&this.token);
- let msg = format!("macro expansion ignores token `{}` and any following", token);
+ if parser.token != token::Eof {
+ let token = pprust::token_to_string(&parser.token);
// Avoid emitting backtrace info twice.
- let def_site_span = this.token.span.with_ctxt(SyntaxContext::root());
- let mut err = this.struct_span_err(def_site_span, &msg);
- err.span_label(span, "caused by the macro expansion here");
- let msg = format!(
- "the usage of `{}!` is likely invalid in {} context",
- pprust::path_to_string(macro_path),
- kind_name,
- );
- err.note(&msg);
+ let def_site_span = parser.token.span.with_ctxt(SyntaxContext::root());
- let semi_span = this.sess.source_map().next_point(span);
- match this.sess.source_map().span_to_snippet(semi_span) {
+ let semi_span = parser.sess.source_map().next_point(span);
+ let add_semicolon = match parser.sess.source_map().span_to_snippet(semi_span) {
Ok(ref snippet) if &snippet[..] != ";" && kind_name == "expression" => {
- err.span_suggestion(
- span.shrink_to_hi(),
- "you might be missing a semicolon here",
- ";",
- Applicability::MaybeIncorrect,
- );
+ Some(span.shrink_to_hi())
}
- _ => {}
- }
- err.emit();
+ _ => None,
+ };
+
+ parser.sess.emit_err(IncompleteParse {
+ span: def_site_span,
+ token,
+ label_span: span,
+ macro_path,
+ kind_name,
+ add_semicolon,
+ });
}
}
if self.expand_cfg_true(node, attr, pos) {
continue;
}
- let msg =
- format!("removing {} is not supported in this position", Node::descr());
- self.cx.span_err(span, &msg);
+
+ self.cx.emit_err(RemoveNodeNotSupported { span, descr: Node::descr() });
continue;
}
sym::cfg_attr => {
#![feature(rustc_attrs)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
+#![deny(rustc::untranslatable_diagnostic)]
#[macro_use]
extern crate rustc_macros;
pub mod errors;
pub mod expand;
pub mod module;
+
+// FIXME(Nilstrieb) Translate proc_macro diagnostics
+#[allow(rustc::untranslatable_diagnostic)]
pub mod proc_macro;
+// FIXME(Nilstrieb) Translate macro_rules diagnostics
+#[allow(rustc::untranslatable_diagnostic)]
pub(crate) mod mbe;
// HACK(Centril, #64197): These shouldn't really be here.
use crate::base::ModuleData;
+use crate::errors::{
+ ModuleCircular, ModuleFileNotFound, ModuleInBlock, ModuleInBlockName, ModuleMultipleCandidates,
+};
use rustc_ast::ptr::P;
use rustc_ast::{token, AttrVec, Attribute, Inline, Item, ModSpans};
-use rustc_errors::{struct_span_err, DiagnosticBuilder, ErrorGuaranteed};
+use rustc_errors::{DiagnosticBuilder, ErrorGuaranteed};
use rustc_parse::new_parser_from_file;
use rustc_parse::validate_attr;
use rustc_session::parse::ParseSess;
use rustc_session::Session;
use rustc_span::symbol::{sym, Ident};
use rustc_span::Span;
+use std::iter::once;
use std::path::{self, Path, PathBuf};
impl ModError<'_> {
fn report(self, sess: &Session, span: Span) -> ErrorGuaranteed {
- let diag = &sess.parse_sess.span_diagnostic;
match self {
ModError::CircularInclusion(file_paths) => {
- let mut msg = String::from("circular modules: ");
- for file_path in &file_paths {
- msg.push_str(&file_path.display().to_string());
- msg.push_str(" -> ");
- }
- msg.push_str(&file_paths[0].display().to_string());
- diag.struct_span_err(span, &msg)
- }
- ModError::ModInBlock(ident) => {
- let msg = "cannot declare a non-inline module inside a block unless it has a path attribute";
- let mut err = diag.struct_span_err(span, msg);
- if let Some(ident) = ident {
- let note =
- format!("maybe `use` the module `{}` instead of redeclaring it", ident);
- err.span_note(span, ¬e);
- }
- err
+ let path_to_string = |path: &PathBuf| path.display().to_string();
+
+ let paths = file_paths
+ .iter()
+ .map(path_to_string)
+ .chain(once(path_to_string(&file_paths[0])))
+ .collect::<Vec<_>>();
+
+ let modules = paths.join(" -> ");
+
+ sess.emit_err(ModuleCircular { span, modules })
}
- ModError::FileNotFound(ident, default_path, secondary_path) => {
- let mut err = struct_span_err!(
- diag,
+ ModError::ModInBlock(ident) => sess.emit_err(ModuleInBlock {
+ span,
+ name: ident.map(|name| ModuleInBlockName { span, name }),
+ }),
+ ModError::FileNotFound(name, default_path, secondary_path) => {
+ sess.emit_err(ModuleFileNotFound {
span,
- E0583,
- "file not found for module `{}`",
- ident,
- );
- err.help(&format!(
- "to create the module `{}`, create file \"{}\" or \"{}\"",
- ident,
- default_path.display(),
- secondary_path.display(),
- ));
- err
+ name,
+ default_path: default_path.display().to_string(),
+ secondary_path: secondary_path.display().to_string(),
+ })
}
- ModError::MultipleCandidates(ident, default_path, secondary_path) => {
- let mut err = struct_span_err!(
- diag,
+ ModError::MultipleCandidates(name, default_path, secondary_path) => {
+ sess.emit_err(ModuleMultipleCandidates {
span,
- E0761,
- "file for module `{}` found at both \"{}\" and \"{}\"",
- ident,
- default_path.display(),
- secondary_path.display(),
- );
- err.help("delete or rename one of them to remove the ambiguity");
- err
+ name,
+ default_path: default_path.display().to_string(),
+ secondary_path: secondary_path.display().to_string(),
+ })
}
- ModError::ParserError(err) => err,
- }.emit()
+ ModError::ParserError(mut err) => err.emit(),
+ }
}
}
false,
);
let handler = Handler::with_emitter(true, None, Box::new(emitter));
+ #[allow(rustc::untranslatable_diagnostic)]
handler.span_err(msp, "foo");
assert!(
use rustc_span::symbol::Ident;
use rustc_span::Span;
-use std::iter::{Enumerate, ExactSizeIterator};
+use std::iter::Enumerate;
pub struct EnumerateAndAdjust<I> {
enumerate: Enumerate<I>,
};
use std::cell::LazyCell;
-use std::convert::TryInto;
use std::iter;
use std::ops::{ControlFlow, Deref};
let generics = tcx.generics_of(parent_def_id.to_def_id());
let param_def_idx = generics.param_def_id_to_index[¶m_id.to_def_id()];
// In the above example this would be .params[..N#0]
- let params = generics.params[..param_def_idx as usize].to_owned();
+ let params = generics.params_to(param_def_idx as usize, tcx).to_owned();
let param_def_id_to_index =
params.iter().map(|param| (param.def_id, param.index)).collect();
callee_expr,
call_expr,
callee_ty,
- pick,
+ &pick,
segment,
);
if pick.illegal_sized_bound.is_some() {
&self,
err: &mut Diagnostic,
expr: &hir::Expr<'_>,
- error: Option<TypeError<'_>>,
+ error: Option<TypeError<'tcx>>,
) {
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
match (self.tcx.hir().find(parent), error) {
err.downgrade_to_delayed_bug();
}
}
+ (
+ Some(hir::Node::Expr(hir::Expr {
+ kind: hir::ExprKind::Binary(_, lhs, rhs), ..
+ })),
+ Some(TypeError::Sorts(ExpectedFound { expected, .. })),
+ ) if rhs.hir_id == expr.hir_id
+ && self.typeck_results.borrow().expr_ty_adjusted_opt(lhs) == Some(expected) =>
+ {
+ err.span_label(lhs.span, &format!("expected because this is `{expected}`"));
+ }
_ => {}
}
}
self_expr: &'tcx hir::Expr<'tcx>,
call_expr: &'tcx hir::Expr<'tcx>,
unadjusted_self_ty: Ty<'tcx>,
- pick: probe::Pick<'tcx>,
+ pick: &probe::Pick<'tcx>,
segment: &hir::PathSegment<'_>,
) -> ConfirmResult<'tcx> {
debug!(
fn confirm(
&mut self,
unadjusted_self_ty: Ty<'tcx>,
- pick: probe::Pick<'tcx>,
+ pick: &probe::Pick<'tcx>,
segment: &hir::PathSegment<'_>,
) -> ConfirmResult<'tcx> {
// Adjust the self expression the user provided and obtain the adjusted type.
self.tcx.check_stability(pick.item.def_id, Some(call_expr.hir_id), span, None);
- let result =
- self.confirm_method(span, self_expr, call_expr, self_ty, pick.clone(), segment);
+ let result = self.confirm_method(span, self_expr, call_expr, self_ty, &pick, segment);
debug!("result = {:?}", result);
if let Some(span) = result.illegal_sized_bound {
use rustc_trait_selection::traits::query::CanonicalTyGoal;
use rustc_trait_selection::traits::NormalizeExt;
use rustc_trait_selection::traits::{self, ObligationCause};
+use std::cell::RefCell;
use std::cmp::max;
use std::iter;
-use std::mem;
use std::ops::Deref;
use smallvec::{smallvec, SmallVec};
/// This is the OriginalQueryValues for the steps queries
/// that are answered in steps.
- orig_steps_var_values: OriginalQueryValues<'tcx>,
+ orig_steps_var_values: &'a OriginalQueryValues<'tcx>,
steps: &'tcx [CandidateStep<'tcx>],
inherent_candidates: Vec<Candidate<'tcx>>,
extension_candidates: Vec<Candidate<'tcx>>,
impl_dups: FxHashSet<DefId>,
- /// Collects near misses when the candidate functions are missing a `self` keyword and is only
- /// used for error reporting
- static_candidates: Vec<CandidateSource>,
-
/// When probing for names, include names that are close to the
- /// requested name (by Levensthein distance)
+ /// requested name (by Levenshtein distance)
allow_similar_names: bool,
/// Some(candidate) if there is a private candidate
private_candidate: Option<(DefKind, DefId)>,
+ /// Collects near misses when the candidate functions are missing a `self` keyword and is only
+ /// used for error reporting
+ static_candidates: RefCell<Vec<CandidateSource>>,
+
/// Collects near misses when trait bounds for type parameters are unsatisfied and is only used
/// for error reporting
- unsatisfied_predicates:
+ unsatisfied_predicates: RefCell<
Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>, Option<ObligationCause<'tcx>>)>,
+ >,
scope_expr_id: hir::HirId,
}
op: OP,
) -> Result<R, MethodError<'tcx>>
where
- OP: FnOnce(ProbeContext<'a, 'tcx>) -> Result<R, MethodError<'tcx>>,
+ OP: FnOnce(ProbeContext<'_, 'tcx>) -> Result<R, MethodError<'tcx>>,
{
let mut orig_values = OriginalQueryValues::default();
let param_env_and_self_ty = self.canonicalize_query(
mode,
method_name,
return_type,
- orig_values,
+ &orig_values,
steps.steps,
scope_expr_id,
);
mode: Mode,
method_name: Option<Ident>,
return_type: Option<Ty<'tcx>>,
- orig_steps_var_values: OriginalQueryValues<'tcx>,
+ orig_steps_var_values: &'a OriginalQueryValues<'tcx>,
steps: &'tcx [CandidateStep<'tcx>],
scope_expr_id: hir::HirId,
) -> ProbeContext<'a, 'tcx> {
impl_dups: FxHashSet::default(),
orig_steps_var_values,
steps,
- static_candidates: Vec::new(),
allow_similar_names: false,
private_candidate: None,
- unsatisfied_predicates: Vec::new(),
+ static_candidates: RefCell::new(Vec::new()),
+ unsatisfied_predicates: RefCell::new(Vec::new()),
scope_expr_id,
}
}
self.inherent_candidates.clear();
self.extension_candidates.clear();
self.impl_dups.clear();
- self.static_candidates.clear();
self.private_candidate = None;
+ self.static_candidates.borrow_mut().clear();
+ self.unsatisfied_predicates.borrow_mut().clear();
}
///////////////////////////////////////////////////////////////////////////
debug!("pick: actual search failed, assemble diagnostics");
- let static_candidates = mem::take(&mut self.static_candidates);
+ let static_candidates = std::mem::take(self.static_candidates.get_mut());
let private_candidate = self.private_candidate.take();
- let unsatisfied_predicates = mem::take(&mut self.unsatisfied_predicates);
+ let unsatisfied_predicates = std::mem::take(self.unsatisfied_predicates.get_mut());
// things failed, so lets look at all traits, for diagnostic purposes now:
self.reset();
}))
}
- fn pick_core(&mut self) -> Option<PickResult<'tcx>> {
+ fn pick_core(&self) -> Option<PickResult<'tcx>> {
let pick = self.pick_all_method(Some(&mut vec![]));
// In this case unstable picking is done by `pick_method`.
}
fn pick_all_method(
- &mut self,
+ &self,
mut unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
) -> Option<PickResult<'tcx>> {
- let steps = self.steps.clone();
- steps
+ self.steps
.iter()
.filter(|step| {
debug!("pick_all_method: step={:?}", step);
/// to transparently pass `&mut` pointers, in particular, without consuming
/// them for their entire lifetime.
fn pick_by_value_method(
- &mut self,
+ &self,
step: &CandidateStep<'tcx>,
self_ty: Ty<'tcx>,
unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
}
fn pick_autorefd_method(
- &mut self,
+ &self,
step: &CandidateStep<'tcx>,
self_ty: Ty<'tcx>,
mutbl: hir::Mutability,
/// special case for this is because going from `*mut T` to `*const T` with autoderefs and
/// autorefs would require dereferencing the pointer, which is not safe.
fn pick_const_ptr_method(
- &mut self,
+ &self,
step: &CandidateStep<'tcx>,
self_ty: Ty<'tcx>,
unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
})
}
- fn pick_method_with_unstable(&mut self, self_ty: Ty<'tcx>) -> Option<PickResult<'tcx>> {
+ fn pick_method_with_unstable(&self, self_ty: Ty<'tcx>) -> Option<PickResult<'tcx>> {
debug!("pick_method_with_unstable(self_ty={})", self.ty_to_string(self_ty));
let mut possibly_unsatisfied_predicates = Vec::new();
debug!("searching {} candidates", kind);
let res = self.consider_candidates(
self_ty,
- candidates.iter(),
+ candidates,
&mut possibly_unsatisfied_predicates,
Some(&mut vec![]),
);
}
}
- debug!("searching unstable candidates");
- let res = self.consider_candidates(
- self_ty,
- self.inherent_candidates.iter().chain(&self.extension_candidates),
- &mut possibly_unsatisfied_predicates,
- None,
- );
- if res.is_none() {
- self.unsatisfied_predicates.extend(possibly_unsatisfied_predicates);
+ for (kind, candidates) in
+ &[("inherent", &self.inherent_candidates), ("extension", &self.extension_candidates)]
+ {
+ debug!("searching unstable {kind} candidates");
+ let res = self.consider_candidates(
+ self_ty,
+ candidates,
+ &mut possibly_unsatisfied_predicates,
+ None,
+ );
+ if res.is_some() {
+ return res;
+ }
}
- res
+
+ self.unsatisfied_predicates.borrow_mut().extend(possibly_unsatisfied_predicates);
+ None
}
fn pick_method(
- &mut self,
+ &self,
self_ty: Ty<'tcx>,
mut unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
) -> Option<PickResult<'tcx>> {
debug!("searching {} candidates", kind);
let res = self.consider_candidates(
self_ty,
- candidates.iter(),
+ candidates,
&mut possibly_unsatisfied_predicates,
unstable_candidates.as_deref_mut(),
);
// `pick_method` may be called twice for the same self_ty if no stable methods
// match. Only extend once.
if unstable_candidates.is_some() {
- self.unsatisfied_predicates.extend(possibly_unsatisfied_predicates);
+ self.unsatisfied_predicates.borrow_mut().extend(possibly_unsatisfied_predicates);
}
None
}
- fn consider_candidates<'b, ProbesIter>(
+ fn consider_candidates(
&self,
self_ty: Ty<'tcx>,
- probes: ProbesIter,
+ candidates: &[Candidate<'tcx>],
possibly_unsatisfied_predicates: &mut Vec<(
ty::Predicate<'tcx>,
Option<ty::Predicate<'tcx>>,
Option<ObligationCause<'tcx>>,
)>,
mut unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
- ) -> Option<PickResult<'tcx>>
- where
- ProbesIter: Iterator<Item = &'b Candidate<'tcx>> + Clone,
- 'tcx: 'b,
- {
- let mut applicable_candidates: Vec<_> = probes
- .clone()
+ ) -> Option<PickResult<'tcx>> {
+ let mut applicable_candidates: Vec<_> = candidates
+ .iter()
.map(|probe| {
(probe, self.consider_probe(self_ty, probe, possibly_unsatisfied_predicates))
})
}
if let Some(uc) = &mut unstable_candidates {
- applicable_candidates.retain(|&(p, _)| {
+ applicable_candidates.retain(|&(candidate, _)| {
if let stability::EvalResult::Deny { feature, .. } =
- self.tcx.eval_stability(p.item.def_id, None, self.span, None)
+ self.tcx.eval_stability(candidate.item.def_id, None, self.span, None)
{
- uc.push((p.clone(), feature));
+ uc.push((candidate.clone(), feature));
return false;
}
true
}
if applicable_candidates.len() > 1 {
- let sources = probes.map(|p| self.candidate_source(p, self_ty)).collect();
+ let sources = candidates.iter().map(|p| self.candidate_source(p, self_ty)).collect();
return Some(Err(MethodError::Ambiguity(sources)));
}
self.mode,
self.method_name,
self.return_type,
- self.orig_steps_var_values.clone(),
+ &self.orig_steps_var_values,
steps,
self.scope_expr_id,
);
// -- but this could be overcome.
}
- fn record_static_candidate(&mut self, source: CandidateSource) {
- self.static_candidates.push(source);
+ fn record_static_candidate(&self, source: CandidateSource) {
+ self.static_candidates.borrow_mut().push(source);
}
#[instrument(level = "debug", skip(self))]
use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
-use std::iter::FromIterator;
-use std::vec::Vec;
const LOADED_FROM_DISK: Symbol = sym::loaded_from_disk;
const EXCEPT: Symbol = sym::except;
use std::fs as std_fs;
use std::io::{self, ErrorKind};
-use std::mem;
use std::path::{Path, PathBuf};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
}
delete_session_dir_lock_file(sess, &lock_file_path);
- mem::drop(directory_lock);
+ drop(directory_lock);
}
}
}
// Let's make it explicit that the file lock is released at this point,
// or rather, that we held on to it until here
- mem::drop(lock);
+ drop(lock);
}
Err(_) => {
debug!(
// Let's make it explicit that the file lock is released at this point,
// or rather, that we held on to it until here
- mem::drop(lock);
+ drop(lock);
}
Ok(())
use std::fmt;
use std::fmt::Debug;
use std::hash::Hash;
-use std::iter::FromIterator;
use std::marker::PhantomData;
use std::ops::{Index, IndexMut, RangeBounds};
use std::slice;
use rustc_target::spec::{RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TlsModel};
use std::collections::{BTreeMap, BTreeSet};
-use std::iter::FromIterator;
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use self::LiteralKind::*;
use self::TokenKind::*;
use crate::cursor::EOF_CHAR;
-use std::convert::TryFrom;
/// Parsed token.
/// It doesn't contain information about data that has been parsed,
}
impl EarlyLintPass for WhileTrue {
+ #[inline]
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
if let ast::ExprKind::While(cond, _, label) = &e.kind
&& let cond = pierce_parens(cond)
}
}
+ #[inline]
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
if let ast::ExprKind::Block(ref blk, _) = e.kind {
// Don't warn about generated blocks; that'll just pollute the output.
}
impl<'tcx> LateLintPass<'tcx> for MissingDoc {
+ #[inline]
fn enter_lint_attrs(&mut self, _cx: &LateContext<'_>, attrs: &[ast::Attribute]) {
let doc_hidden = self.doc_hidden()
|| attrs.iter().any(|attr| {
}
impl<'a> EarlyContextAndPasses<'a> {
- fn check_id(&mut self, id: ast::NodeId) {
+ // This always-inlined function is for the hot call site.
+ #[inline(always)]
+ fn inlined_check_id(&mut self, id: ast::NodeId) {
for early_lint in self.context.buffered.take(id) {
let BufferedEarlyLint { span, msg, node_id: _, lint_id, diagnostic } = early_lint;
self.context.lookup_with_diagnostics(
}
}
+ // This non-inlined function is for the cold call sites.
+ fn check_id(&mut self, id: ast::NodeId) {
+ self.inlined_check_id(id)
+ }
+
/// Merge the lints specified by any lint attributes into the
/// current lint context, call the provided function, then reset the
/// lints in effect to their previous state.
debug!(?id);
let push = self.context.builder.push(attrs, is_crate_node, None);
- self.check_id(id);
+ self.inlined_check_id(id);
debug!("early context: enter_attrs({:?})", attrs);
run_early_passes!(self, enter_lint_attrs, attrs);
f(self);
}
}
+ #[inline]
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {
// byte strings are already handled well enough by `EscapeError::NonAsciiCharInByteString`
match &expr.kind {
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
}
+// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
early_lint_methods!(
declare_combined_early_lint_pass,
[
]
);
+// Declare `BuiltinCombinedEarlyLintPass`, a lint pass that combines multiple
+// lint passes into a single pass for maximum speed. Each `check_foo` method
+// within this pass simply calls `check_foo` once per listed lint.
early_lint_methods!(
declare_combined_early_lint_pass,
[
]
);
-// FIXME: Make a separate lint type which do not require typeck tables
+// FIXME: Make a separate lint type which does not require typeck tables.
+
+// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
late_lint_methods!(
declare_combined_late_lint_pass,
[
// Keeps a global list of foreign declarations.
ClashingExternDeclarations: ClashingExternDeclarations::new(),
]
- ],
- ['tcx]
+ ]
);
+// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
late_lint_methods!(
declare_combined_late_lint_pass,
[
NamedAsmLabels: NamedAsmLabels,
OpaqueHiddenInferredBound: OpaqueHiddenInferredBound,
]
- ],
- ['tcx]
+ ]
);
pub fn new_lint_store(internal_lints: bool) -> LintStore {
#[macro_export]
macro_rules! late_lint_methods {
- ($macro:path, $args:tt, [$hir:tt]) => (
- $macro!($args, [$hir], [
- fn check_body(a: &$hir hir::Body<$hir>);
- fn check_body_post(a: &$hir hir::Body<$hir>);
+ ($macro:path, $args:tt) => (
+ $macro!($args, [
+ fn check_body(a: &'tcx hir::Body<'tcx>);
+ fn check_body_post(a: &'tcx hir::Body<'tcx>);
fn check_crate();
fn check_crate_post();
- fn check_mod(a: &$hir hir::Mod<$hir>, b: hir::HirId);
- fn check_foreign_item(a: &$hir hir::ForeignItem<$hir>);
- fn check_item(a: &$hir hir::Item<$hir>);
- fn check_item_post(a: &$hir hir::Item<$hir>);
- fn check_local(a: &$hir hir::Local<$hir>);
- fn check_block(a: &$hir hir::Block<$hir>);
- fn check_block_post(a: &$hir hir::Block<$hir>);
- fn check_stmt(a: &$hir hir::Stmt<$hir>);
- fn check_arm(a: &$hir hir::Arm<$hir>);
- fn check_pat(a: &$hir hir::Pat<$hir>);
- fn check_expr(a: &$hir hir::Expr<$hir>);
- fn check_expr_post(a: &$hir hir::Expr<$hir>);
- fn check_ty(a: &$hir hir::Ty<$hir>);
- fn check_generic_param(a: &$hir hir::GenericParam<$hir>);
- fn check_generics(a: &$hir hir::Generics<$hir>);
- fn check_poly_trait_ref(a: &$hir hir::PolyTraitRef<$hir>);
+ fn check_mod(a: &'tcx hir::Mod<'tcx>, b: hir::HirId);
+ fn check_foreign_item(a: &'tcx hir::ForeignItem<'tcx>);
+ fn check_item(a: &'tcx hir::Item<'tcx>);
+ fn check_item_post(a: &'tcx hir::Item<'tcx>);
+ fn check_local(a: &'tcx hir::Local<'tcx>);
+ fn check_block(a: &'tcx hir::Block<'tcx>);
+ fn check_block_post(a: &'tcx hir::Block<'tcx>);
+ fn check_stmt(a: &'tcx hir::Stmt<'tcx>);
+ fn check_arm(a: &'tcx hir::Arm<'tcx>);
+ fn check_pat(a: &'tcx hir::Pat<'tcx>);
+ fn check_expr(a: &'tcx hir::Expr<'tcx>);
+ fn check_expr_post(a: &'tcx hir::Expr<'tcx>);
+ fn check_ty(a: &'tcx hir::Ty<'tcx>);
+ fn check_generic_param(a: &'tcx hir::GenericParam<'tcx>);
+ fn check_generics(a: &'tcx hir::Generics<'tcx>);
+ fn check_poly_trait_ref(a: &'tcx hir::PolyTraitRef<'tcx>);
fn check_fn(
- a: rustc_hir::intravisit::FnKind<$hir>,
- b: &$hir hir::FnDecl<$hir>,
- c: &$hir hir::Body<$hir>,
+ a: rustc_hir::intravisit::FnKind<'tcx>,
+ b: &'tcx hir::FnDecl<'tcx>,
+ c: &'tcx hir::Body<'tcx>,
d: Span,
e: hir::HirId);
- fn check_trait_item(a: &$hir hir::TraitItem<$hir>);
- fn check_impl_item(a: &$hir hir::ImplItem<$hir>);
- fn check_impl_item_post(a: &$hir hir::ImplItem<$hir>);
- fn check_struct_def(a: &$hir hir::VariantData<$hir>);
- fn check_field_def(a: &$hir hir::FieldDef<$hir>);
- fn check_variant(a: &$hir hir::Variant<$hir>);
- fn check_path(a: &hir::Path<$hir>, b: hir::HirId);
- fn check_attribute(a: &$hir ast::Attribute);
+ fn check_trait_item(a: &'tcx hir::TraitItem<'tcx>);
+ fn check_impl_item(a: &'tcx hir::ImplItem<'tcx>);
+ fn check_impl_item_post(a: &'tcx hir::ImplItem<'tcx>);
+ fn check_struct_def(a: &'tcx hir::VariantData<'tcx>);
+ fn check_field_def(a: &'tcx hir::FieldDef<'tcx>);
+ fn check_variant(a: &'tcx hir::Variant<'tcx>);
+ fn check_path(a: &hir::Path<'tcx>, b: hir::HirId);
+ fn check_attribute(a: &'tcx ast::Attribute);
/// Called when entering a syntax node that can have lint attributes such
/// as `#[allow(...)]`. Called with *all* the attributes of that node.
- fn enter_lint_attrs(a: &$hir [ast::Attribute]);
+ fn enter_lint_attrs(a: &'tcx [ast::Attribute]);
/// Counterpart to `enter_lint_attrs`.
- fn exit_lint_attrs(a: &$hir [ast::Attribute]);
+ fn exit_lint_attrs(a: &'tcx [ast::Attribute]);
]);
)
}
// contains a few lint-specific methods with no equivalent in `Visitor`.
macro_rules! declare_late_lint_pass {
- ([], [$hir:tt], [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => (
- pub trait LateLintPass<$hir>: LintPass {
- $(#[inline(always)] fn $name(&mut self, _: &LateContext<$hir>, $(_: $arg),*) {})*
+ ([], [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => (
+ pub trait LateLintPass<'tcx>: LintPass {
+ $(#[inline(always)] fn $name(&mut self, _: &LateContext<'tcx>, $(_: $arg),*) {})*
}
)
}
-late_lint_methods!(declare_late_lint_pass, [], ['tcx]);
+// Declare the `LateLintPass` trait, which contains empty default definitions
+// for all the `check_*` methods.
+late_lint_methods!(declare_late_lint_pass, []);
impl LateLintPass<'_> for HardwiredLints {}
#[macro_export]
macro_rules! expand_combined_late_lint_pass_method {
- ([$($passes:ident),*], $self: ident, $name: ident, $params:tt) => ({
- $($self.$passes.$name $params;)*
+ ([$($pass:ident),*], $self: ident, $name: ident, $params:tt) => ({
+ $($self.$pass.$name $params;)*
})
}
#[macro_export]
macro_rules! declare_combined_late_lint_pass {
- ([$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]], [$hir:tt], $methods:tt) => (
+ ([$v:vis $name:ident, [$($pass:ident: $constructor:expr,)*]], $methods:tt) => (
#[allow(non_snake_case)]
$v struct $name {
- $($passes: $passes,)*
+ $($pass: $pass,)*
}
impl $name {
$v fn new() -> Self {
Self {
- $($passes: $constructor,)*
+ $($pass: $constructor,)*
}
}
$v fn get_lints() -> LintArray {
let mut lints = Vec::new();
- $(lints.extend_from_slice(&$passes::get_lints());)*
+ $(lints.extend_from_slice(&$pass::get_lints());)*
lints
}
}
impl<'tcx> LateLintPass<'tcx> for $name {
- expand_combined_late_lint_pass_methods!([$($passes),*], $methods);
+ expand_combined_late_lint_pass_methods!([$($pass),*], $methods);
}
#[allow(rustc::lint_pass_impl_without_macro)]
)
}
+// Declare the `EarlyLintPass` trait, which contains empty default definitions
+// for all the `check_*` methods.
early_lint_methods!(declare_early_lint_pass, []);
#[macro_export]
macro_rules! expand_combined_early_lint_pass_method {
- ([$($passes:ident),*], $self: ident, $name: ident, $params:tt) => ({
- $($self.$passes.$name $params;)*
+ ([$($pass:ident),*], $self: ident, $name: ident, $params:tt) => ({
+ $($self.$pass.$name $params;)*
})
}
#[macro_export]
macro_rules! declare_combined_early_lint_pass {
- ([$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]], $methods:tt) => (
+ ([$v:vis $name:ident, [$($pass:ident: $constructor:expr,)*]], $methods:tt) => (
#[allow(non_snake_case)]
$v struct $name {
- $($passes: $passes,)*
+ $($pass: $pass,)*
}
impl $name {
$v fn new() -> Self {
Self {
- $($passes: $constructor,)*
+ $($pass: $constructor,)*
}
}
$v fn get_lints() -> LintArray {
let mut lints = Vec::new();
- $(lints.extend_from_slice(&$passes::get_lints());)*
+ $(lints.extend_from_slice(&$pass::get_lints());)*
lints
}
}
impl EarlyLintPass for $name {
- expand_combined_early_lint_pass_methods!([$($passes),*], $methods);
+ expand_combined_early_lint_pass_methods!([$($pass),*], $methods);
}
#[allow(rustc::lint_pass_impl_without_macro)]
use rustc_target::abi::{Integer, TagEncoding, Variants};
use rustc_target::spec::abi::Abi as SpecAbi;
-use std::cmp;
use std::iter;
use std::ops::ControlFlow;
_ => {}
};
- fn is_valid<T: cmp::PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
+ fn is_valid<T: PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
match binop.node {
hir::BinOpKind::Lt => v > min && v <= max,
hir::BinOpKind::Le => v >= min && v < max,
}
impl EarlyLintPass for UnusedParens {
+ #[inline]
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
match e.kind {
ExprKind::Let(ref pat, _, _) | ExprKind::ForLoop(ref pat, ..) => {
<Self as UnusedDelimLint>::check_stmt(self, cx, s)
}
+ #[inline]
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
<Self as UnusedDelimLint>::check_expr(self, cx, e);
use rustc_serialize::opaque::FileEncoder;
use rustc_serialize::Encoder as _;
use rustc_span::hygiene::MacroKind;
-use std::convert::TryInto;
use std::marker::PhantomData;
use std::num::NonZeroUsize;
use rustc_macros::HashStable;
use rustc_span::Symbol;
-use std::cmp::Ord;
use std::fmt::{self, Debug, Formatter};
rustc_index::newtype_index! {
mod queries;
mod value;
-use std::convert::TryFrom;
use std::fmt;
use std::io;
use std::io::{Read, Write};
use rustc_macros::HashStable;
use rustc_target::abi::{HasDataLayout, Size};
-use std::convert::{TryFrom, TryInto};
use std::fmt;
////////////////////////////////////////////////////////////////////////////////
-use std::convert::{TryFrom, TryInto};
use std::fmt;
use either::{Either, Left, Right};
use either::Either;
use std::borrow::Cow;
-use std::convert::TryInto;
use std::fmt::{self, Debug, Display, Formatter, Write};
use std::ops::{ControlFlow, Index, IndexMut};
use std::{iter, mem};
SwitchInt {
/// The discriminant value being tested.
discr: Operand<'tcx>,
-
- /// The type of value being tested.
- /// This is always the same as the type of `discr`.
- /// FIXME: remove this redundant information. Currently, it is relied on by pretty-printing.
- switch_ty: Ty<'tcx>,
-
targets: SwitchTargets,
},
-use crate::mir;
-use crate::mir::interpret::Scalar;
-use crate::ty::{self, Ty, TyCtxt};
use smallvec::{smallvec, SmallVec};
use super::{BasicBlock, InlineAsmOperand, Operand, SourceInfo, TerminatorKind};
}
impl<'tcx> TerminatorKind<'tcx> {
- pub fn if_(
- tcx: TyCtxt<'tcx>,
- cond: Operand<'tcx>,
- t: BasicBlock,
- f: BasicBlock,
- ) -> TerminatorKind<'tcx> {
- TerminatorKind::SwitchInt {
- discr: cond,
- switch_ty: tcx.types.bool,
- targets: SwitchTargets::static_if(0, f, t),
- }
+ pub fn if_(cond: Operand<'tcx>, t: BasicBlock, f: BasicBlock) -> TerminatorKind<'tcx> {
+ TerminatorKind::SwitchInt { discr: cond, targets: SwitchTargets::static_if(0, f, t) }
}
pub fn successors(&self) -> Successors<'_> {
}
}
- pub fn as_switch(&self) -> Option<(&Operand<'tcx>, Ty<'tcx>, &SwitchTargets)> {
+ pub fn as_switch(&self) -> Option<(&Operand<'tcx>, &SwitchTargets)> {
match self {
- TerminatorKind::SwitchInt { discr, switch_ty, targets } => {
- Some((discr, *switch_ty, targets))
- }
+ TerminatorKind::SwitchInt { discr, targets } => Some((discr, targets)),
_ => None,
}
}
match *self {
Return | Resume | Abort | Unreachable | GeneratorDrop => vec![],
Goto { .. } => vec!["".into()],
- SwitchInt { ref targets, switch_ty, .. } => ty::tls::with(|tcx| {
- let param_env = ty::ParamEnv::empty();
- let switch_ty = tcx.lift(switch_ty).unwrap();
- let size = tcx.layout_of(param_env.and(switch_ty)).unwrap().size;
- targets
- .values
- .iter()
- .map(|&u| {
- mir::ConstantKind::from_scalar(tcx, Scalar::from_uint(u, size), switch_ty)
- .to_string()
- .into()
- })
- .chain(iter::once("otherwise".into()))
- .collect()
- }),
+ SwitchInt { ref targets, .. } => targets
+ .values
+ .iter()
+ .map(|&u| Cow::Owned(u.to_string()))
+ .chain(iter::once("otherwise".into()))
+ .collect(),
Call { target: Some(_), cleanup: Some(_), .. } => {
vec!["return".into(), "unwind".into()]
}
TerminatorKind::SwitchInt {
discr,
- switch_ty,
targets: _
} => {
self.visit_operand(discr, location);
- self.visit_ty($(& $mutability)? *switch_ty, TyContext::Location(location));
}
TerminatorKind::Drop {
use crate::ty::{self, Ty, TyCtxt};
use rustc_hir::def_id::DefId;
use rustc_span::source_map::Span;
-use std::iter::FromIterator;
pub mod type_op {
use crate::ty::fold::TypeFoldable;
use rustc_apfloat::Float;
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use rustc_target::abi::Size;
-use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::num::NonZeroU8;
-use std::convert::TryInto;
-
use super::Const;
use crate::mir;
use crate::mir::interpret::{AllocId, ConstValue, Scalar};
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty::diagnostics::suggest_constraining_type_param;
-use crate::ty::print::{FmtPrinter, Printer};
+use crate::ty::print::{with_forced_trimmed_paths, FmtPrinter, Printer};
use crate::ty::{self, BoundRegionKind, Region, Ty, TyCtxt};
use hir::def::DefKind;
use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect};
),
RegionsPlaceholderMismatch => write!(f, "one type is more general than the other"),
ArgumentSorts(values, _) | Sorts(values) => ty::tls::with(|tcx| {
- report_maybe_different(
- f,
- &values.expected.sort_string(tcx),
- &values.found.sort_string(tcx),
- )
+ let (mut expected, mut found) = with_forced_trimmed_paths!((
+ values.expected.sort_string(tcx),
+ values.found.sort_string(tcx),
+ ));
+ if expected == found {
+ expected = values.expected.sort_string(tcx);
+ found = values.found.sort_string(tcx);
+ }
+ report_maybe_different(f, &expected, &found)
}),
Traits(values) => ty::tls::with(|tcx| {
+ let (mut expected, mut found) = with_forced_trimmed_paths!((
+ tcx.def_path_str(values.expected),
+ tcx.def_path_str(values.found),
+ ));
+ if expected == found {
+ expected = tcx.def_path_str(values.expected);
+ found = tcx.def_path_str(values.found);
+ }
report_maybe_different(
f,
- &format!("trait `{}`", tcx.def_path_str(values.expected)),
- &format!("trait `{}`", tcx.def_path_str(values.found)),
+ &format!("trait `{expected}`"),
+ &format!("trait `{found}`"),
)
}),
IntMismatch(ref values) => {
let mut short;
loop {
// Look for the longest properly trimmed path that still fits in lenght_limit.
- short = FmtPrinter::new_with_limit(
- self,
- hir::def::Namespace::TypeNS,
- rustc_session::Limit(type_limit),
- )
- .pretty_print_type(ty)
- .expect("could not write to `String`")
- .into_buffer();
+ short = with_forced_trimmed_paths!(
+ FmtPrinter::new_with_limit(
+ self,
+ hir::def::Namespace::TypeNS,
+ rustc_session::Limit(type_limit),
+ )
+ .pretty_print_type(ty)
+ .expect("could not write to `String`")
+ .into_buffer()
+ );
if short.len() <= length_limit || type_limit == 0 {
break;
}
}
}
+ pub fn params_to(&'tcx self, param_index: usize, tcx: TyCtxt<'tcx>) -> &'tcx [GenericParamDef] {
+ if let Some(index) = param_index.checked_sub(self.parent_count) {
+ &self.params[..index]
+ } else {
+ tcx.generics_of(self.parent.expect("parent_count > 0 but no parent?"))
+ .params_to(param_index, tcx)
+ }
+ }
+
/// Returns the `GenericParamDef` associated with this `EarlyBoundRegion`.
pub fn region_param(
&'tcx self,
use rustc_hir as hir;
use rustc_hir::def::{self, CtorKind, DefKind, Namespace};
use rustc_hir::def_id::{DefId, DefIdSet, CRATE_DEF_ID, LOCAL_CRATE};
-use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
+use rustc_hir::definitions::{DefKey, DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::LangItem;
use rustc_session::config::TrimmedDefPaths;
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
use std::cell::Cell;
use std::char;
use std::collections::BTreeMap;
-use std::convert::TryFrom;
use std::fmt::{self, Write as _};
use std::iter;
use std::ops::{ControlFlow, Deref, DerefMut};
static FORCE_IMPL_FILENAME_LINE: Cell<bool> = const { Cell::new(false) };
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = const { Cell::new(false) };
static NO_TRIMMED_PATH: Cell<bool> = const { Cell::new(false) };
+ static FORCE_TRIMMED_PATH: Cell<bool> = const { Cell::new(false) };
static NO_QUERIES: Cell<bool> = const { Cell::new(false) };
static NO_VISIBLE_PATH: Cell<bool> = const { Cell::new(false) };
}
/// of various rustc types, for example `std::vec::Vec` would be trimmed to `Vec`,
/// if no other `Vec` is found.
fn with_no_trimmed_paths(NoTrimmedGuard, NO_TRIMMED_PATH);
+ fn with_forced_trimmed_paths(ForceTrimmedGuard, FORCE_TRIMMED_PATH);
/// Prevent selection of visible paths. `Display` impl of DefId will prefer
/// visible (public) reexports of types as paths.
fn with_no_visible_paths(NoVisibleGuard, NO_VISIBLE_PATH);
self.try_print_visible_def_path_recur(def_id, &mut callers)
}
+ // Given a `DefId`, produce a short name. For types and traits, it prints *only* its name,
+ // For associated items on traits it prints out the trait's name and the associated item's name.
+ // For enum variants, if they have an unique name, then we only print the name, otherwise we
+ // print the enum name and the variant name. Otherwise, we do not print anything and let the
+ // caller use the `print_def_path` fallback.
+ fn force_print_trimmed_def_path(
+ mut self,
+ def_id: DefId,
+ ) -> Result<(Self::Path, bool), Self::Error> {
+ let key = self.tcx().def_key(def_id);
+ let visible_parent_map = self.tcx().visible_parent_map(());
+ let kind = self.tcx().def_kind(def_id);
+
+ let get_local_name = |this: &Self, name, def_id, key: DefKey| {
+ if let Some(visible_parent) = visible_parent_map.get(&def_id)
+ && let actual_parent = this.tcx().opt_parent(def_id)
+ && let DefPathData::TypeNs(_) = key.disambiguated_data.data
+ && Some(*visible_parent) != actual_parent
+ {
+ this
+ .tcx()
+ .module_children(visible_parent)
+ .iter()
+ .filter(|child| child.res.opt_def_id() == Some(def_id))
+ .find(|child| child.vis.is_public() && child.ident.name != kw::Underscore)
+ .map(|child| child.ident.name)
+ .unwrap_or(name)
+ } else {
+ name
+ }
+ };
+ if let DefKind::Variant = kind
+ && let Some(symbol) = self.tcx().trimmed_def_paths(()).get(&def_id)
+ {
+ // If `Assoc` is unique, we don't want to talk about `Trait::Assoc`.
+ self.write_str(get_local_name(&self, *symbol, def_id, key).as_str())?;
+ return Ok((self, true));
+ }
+ if let Some(symbol) = key.get_opt_name() {
+ if let DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy = kind
+ && let Some(parent) = self.tcx().opt_parent(def_id)
+ && let parent_key = self.tcx().def_key(parent)
+ && let Some(symbol) = parent_key.get_opt_name()
+ {
+ // Trait
+ self.write_str(get_local_name(&self, symbol, parent, parent_key).as_str())?;
+ self.write_str("::")?;
+ } else if let DefKind::Variant = kind
+ && let Some(parent) = self.tcx().opt_parent(def_id)
+ && let parent_key = self.tcx().def_key(parent)
+ && let Some(symbol) = parent_key.get_opt_name()
+ {
+ // Enum
+
+ // For associated items and variants, we want the "full" path, namely, include
+ // the parent type in the path. For example, `Iterator::Item`.
+ self.write_str(get_local_name(&self, symbol, parent, parent_key).as_str())?;
+ self.write_str("::")?;
+ } else if let DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::Trait
+ | DefKind::TyAlias | DefKind::Fn | DefKind::Const | DefKind::Static(_) = kind
+ {
+ } else {
+ // If not covered above, like for example items out of `impl` blocks, fallback.
+ return Ok((self, false));
+ }
+ self.write_str(get_local_name(&self, symbol, def_id, key).as_str())?;
+ return Ok((self, true));
+ }
+ Ok((self, false))
+ }
+
/// 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 FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
+ let (s, trimmed) = self.force_print_trimmed_def_path(def_id)?;
+ if trimmed {
+ return Ok((s, true));
+ }
+ self = s;
+ }
if !self.tcx().sess.opts.unstable_opts.trim_diagnostic_paths
|| matches!(self.tcx().sess.opts.trimmed_def_paths, TrimmedDefPaths::Never)
|| NO_TRIMMED_PATH.with(|flag| flag.get())
-use std::convert::TryFrom;
use std::fmt;
use crate::mir::interpret::{alloc_range, AllocId, Allocation, Pointer, Scalar};
LogicalOp::And => (else_block, shortcircuit_block),
LogicalOp::Or => (shortcircuit_block, else_block),
};
- let term = TerminatorKind::if_(this.tcx, lhs, blocks.0, blocks.1);
+ let term = TerminatorKind::if_(lhs, blocks.0, blocks.1);
this.cfg.terminate(block, source_info, term);
this.cfg.push_assign_constant(
mod util;
use std::borrow::Borrow;
-use std::convert::TryFrom;
use std::mem;
impl<'a, 'tcx> Builder<'a, 'tcx> {
let then_block = this.cfg.start_new_block();
let else_block = this.cfg.start_new_block();
- let term = TerminatorKind::if_(this.tcx, operand, then_block, else_block);
+ let term = TerminatorKind::if_(operand, then_block, else_block);
let source_info = this.source_info(expr_span);
this.cfg.terminate(block, source_info, term);
self.source_info(match_start_span),
TerminatorKind::SwitchInt {
discr: Operand::Move(discr),
- switch_ty: discr_ty,
targets: switch_targets,
},
);
0 => (second_bb, first_bb),
v => span_bug!(test.span, "expected boolean value but got {:?}", v),
};
- TerminatorKind::if_(self.tcx, Operand::Copy(place), true_bb, false_bb)
+ TerminatorKind::if_(Operand::Copy(place), true_bb, false_bb)
} else {
// The switch may be inexhaustive so we have a catch all block
debug_assert_eq!(options.len() + 1, target_blocks.len());
);
TerminatorKind::SwitchInt {
discr: Operand::Copy(place),
- switch_ty,
targets: switch_targets,
}
};
self.cfg.terminate(
block,
source_info,
- TerminatorKind::if_(self.tcx, Operand::Move(result), success_block, fail_block),
+ TerminatorKind::if_(Operand::Move(result), success_block, fail_block),
);
}
self.cfg.terminate(
eq_block,
source_info,
- TerminatorKind::if_(self.tcx, Operand::Move(eq_result), success_block, fail_block),
+ TerminatorKind::if_(Operand::Move(eq_result), success_block, fail_block),
);
}
use rustc_middle::ty;
use rustc_middle::ty::TypeVisitable;
use smallvec::SmallVec;
-use std::convert::TryInto;
impl<'a, 'tcx> Builder<'a, 'tcx> {
pub(crate) fn field_match_pairs<'pat>(
use std::cell::Cell;
use std::cmp::{self, max, min, Ordering};
use std::fmt;
-use std::iter::{once, IntoIterator};
+use std::iter::once;
use std::ops::RangeInclusive;
use smallvec::{smallvec, SmallVec};
source_info: self.source_info,
kind: TerminatorKind::SwitchInt {
discr: Operand::Move(discr),
- switch_ty: discr_ty,
targets: SwitchTargets::new(
values.iter().copied().zip(blocks.iter().copied()),
*blocks.last().unwrap(),
is_cleanup: unwind.is_cleanup(),
terminator: Some(Terminator {
source_info: self.source_info,
- kind: TerminatorKind::if_(tcx, move_(can_go), succ, drop_block),
+ kind: TerminatorKind::if_(move_(can_go), succ, drop_block),
}),
};
let loop_block = self.elaborator.patch().new_block(loop_block);
source_info: self.source_info,
kind: TerminatorKind::SwitchInt {
discr: move_(elem_size),
- switch_ty: tcx.types.usize,
targets: SwitchTargets::static_if(
0,
self.drop_loop_pair(ety, false, len),
DropStyle::Static => on_set,
DropStyle::Conditional | DropStyle::Open => {
let flag = self.elaborator.get_drop_flag(self.path).unwrap();
- let term = TerminatorKind::if_(self.tcx(), flag, on_set, on_unset);
+ let term = TerminatorKind::if_(flag, on_set, on_unset);
self.new_block(unwind, term)
}
}
propagate(pred, &tmp);
}
- mir::TerminatorKind::SwitchInt { targets: _, ref discr, switch_ty: _ } => {
+ mir::TerminatorKind::SwitchInt { targets: _, ref discr } => {
let mut applier = BackwardSwitchIntEdgeEffectsApplier {
body,
pred,
}
}
- SwitchInt { ref targets, ref discr, switch_ty: _ } => {
+ SwitchInt { ref targets, ref discr } => {
let mut applier = ForwardSwitchIntEdgeEffectsApplier {
exit_state,
targets,
//! ## `PartialOrd`
//!
//! Given that they represent partially ordered sets, you may be surprised that [`JoinSemiLattice`]
-//! and [`MeetSemiLattice`] do not have [`PartialOrd`][std::cmp::PartialOrd] as a supertrait. This
+//! and [`MeetSemiLattice`] do not have [`PartialOrd`] as a supertrait. This
//! is because most standard library types use lexicographic ordering instead of set inclusion for
//! their `PartialOrd` impl. Since we do not actually need to compare lattice elements to run a
//! dataflow analysis, there's no need for a newtype wrapper with a custom `PartialOrd` impl. The
}
let target_bb_terminator = target_bb.terminator();
- let (discr, switch_ty, targets) = target_bb_terminator.kind.as_switch()?;
+ let (discr, targets) = target_bb_terminator.kind.as_switch()?;
if discr.place() == Some(*place) {
+ let switch_ty = place.ty(self.body.local_decls(), self.tcx).ty;
// We now know that the Switch matches on the const place, and it is statementless
// Now find which value in the Switch matches the const value.
let const_value =
use rustc_index::vec::{Idx, IndexVec};
use rustc_middle::mir::coverage::CoverageKind;
use rustc_middle::mir::*;
-use rustc_middle::ty::{self, Ty, TyCtxt};
+use rustc_middle::ty;
use rustc_span::{self, BytePos, Pos, Span, DUMMY_SP};
// All `TEMP_BLOCK` targets should be replaced before calling `to_body() -> mir::Body`.
blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
dummy_place: Place<'tcx>,
next_local: usize,
- bool_ty: Ty<'tcx>,
}
impl<'tcx> MockBlocks<'tcx> {
blocks: IndexVec::new(),
dummy_place: Place { local: RETURN_PLACE, projection: ty::List::empty() },
next_local: 0,
- bool_ty: TyCtxt::BOOL_TY_FOR_UNIT_TESTING,
}
}
fn switchint(&mut self, some_from_block: Option<BasicBlock>) -> BasicBlock {
let switchint_kind = TerminatorKind::SwitchInt {
discr: Operand::Move(Place::from(self.new_temp())),
- switch_ty: self.bool_ty, // just a dummy value
targets: SwitchTargets::static_if(0, TEMP_BLOCK, TEMP_BLOCK),
};
self.add_block_from(some_from_block, switchint_kind)
let TerminatorKind::SwitchInt {
discr: parent_op,
- switch_ty: parent_ty,
targets: parent_targets
} = &bbs[parent].terminator().kind else {
unreachable!()
Operand::Copy(x) => Operand::Copy(*x),
Operand::Constant(x) => Operand::Constant(x.clone()),
};
+ let parent_ty = parent_op.ty(body.local_decls(), tcx);
let statements_before = bbs[parent].statements.len();
let parent_end = Location { block: parent, statement_index: statements_before };
// create temp to store inequality comparison between the two discriminants, `_t` in
// example above
let nequal = BinOp::Ne;
- let comp_res_type = nequal.ty(tcx, *parent_ty, opt_data.child_ty);
+ let comp_res_type = nequal.ty(tcx, parent_ty, opt_data.child_ty);
let comp_temp = patch.new_temp(comp_res_type, opt_data.child_source.span);
patch.add_statement(parent_end, StatementKind::StorageLive(comp_temp));
kind: TerminatorKind::SwitchInt {
// switch on the first discriminant, so we can mark the second one as dead
discr: parent_op,
- switch_ty: opt_data.child_ty,
targets: eq_targets,
},
}));
let false_case = eq_bb;
patch.patch_terminator(
parent,
- TerminatorKind::if_(
- tcx,
- Operand::Move(Place::from(comp_temp)),
- true_case,
- false_case,
- ),
+ TerminatorKind::if_(Operand::Move(Place::from(comp_temp)), true_case, false_case),
);
// generate StorageDead for the second_discriminant_temp not in use anymore
let bbs = &body.basic_blocks;
let TerminatorKind::SwitchInt {
targets,
- switch_ty: parent_ty,
- ..
+ discr: parent_discr,
} = &bbs[parent].terminator().kind else {
return None
};
+ let parent_ty = parent_discr.ty(body.local_decls(), tcx);
let parent_dest = {
let poss = targets.otherwise();
// If the fallthrough on the parent is trivially unreachable, we can let the
let (_, child) = targets.iter().next()?;
let child_terminator = &bbs[child].terminator();
let TerminatorKind::SwitchInt {
- switch_ty: child_ty,
targets: child_targets,
- ..
+ discr: child_discr,
} = &child_terminator.kind else {
return None
};
+ let child_ty = child_discr.ty(body.local_decls(), tcx);
if child_ty != parent_ty {
return None;
}
Some(OptimizationData {
destination,
child_place: *child_place,
- child_ty: *child_ty,
+ child_ty,
child_source: child_terminator.source_info,
})
}
let (assign, discr) = transform.get_discr(body);
let switch_targets =
SwitchTargets::new(cases.iter().map(|(i, bb)| ((*i) as u128, *bb)), default_block);
- let switch = TerminatorKind::SwitchInt {
- discr: Operand::Move(discr),
- switch_ty: transform.discr_ty,
- targets: switch_targets,
- };
+ let switch = TerminatorKind::SwitchInt { discr: Operand::Move(discr), targets: switch_targets };
let source_info = SourceInfo::outermost(body.span);
body.basic_blocks_mut().raw.insert(
continue;
}
- let (discr, val, switch_ty, first, second) = match bbs[bb_idx].terminator().kind {
+ let (discr, val, first, second) = match bbs[bb_idx].terminator().kind {
TerminatorKind::SwitchInt {
discr: ref discr @ (Operand::Copy(_) | Operand::Move(_)),
- switch_ty,
ref targets,
..
} if targets.iter().len() == 1 => {
if target == targets.otherwise() {
continue;
}
- (discr, value, switch_ty, target, targets.otherwise())
+ (discr, value, target, targets.otherwise())
}
// Only optimize switch int statements
_ => continue,
}
// Take ownership of items now that we know we can optimize.
let discr = discr.clone();
+ let discr_ty = discr.ty(&body.local_decls, tcx);
// Introduce a temporary for the discriminant value.
let source_info = bbs[bb_idx].terminator().source_info;
- let discr_local = body.local_decls.push(LocalDecl::new(switch_ty, source_info.span));
+ let discr_local = body.local_decls.push(LocalDecl::new(discr_ty, source_info.span));
// We already checked that first and second are different blocks,
// and bb_idx has a different terminator from both of them.
(*f).clone()
} else {
// Different value between blocks. Make value conditional on switch condition.
- let size = tcx.layout_of(param_env.and(switch_ty)).unwrap().size;
+ let size = tcx.layout_of(param_env.and(discr_ty)).unwrap().size;
let const_cmp = Operand::const_from_scalar(
tcx,
- switch_ty,
+ discr_ty,
rustc_const_eval::interpret::Scalar::from_uint(val, size),
rustc_span::DUMMY_SP,
);
statements.push(statement);
*kind = TerminatorKind::SwitchInt {
discr: Operand::Move(temp),
- switch_ty: discr_ty,
targets: SwitchTargets::new(cases.into_iter(), unreachable),
};
}
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;
use smallvec::SmallVec;
-use std::convert::TryInto;
pub struct SimplifyCfg {
label: String,
let terminator = block.terminator_mut();
terminator.kind = match terminator.kind {
TerminatorKind::SwitchInt {
- discr: Operand::Constant(ref c),
- switch_ty,
- ref targets,
- ..
+ discr: Operand::Constant(ref c), ref targets, ..
} => {
- let constant = c.literal.try_eval_bits(tcx, param_env, switch_ty);
+ let constant = c.literal.try_eval_bits(tcx, param_env, c.ty());
if let Some(constant) = constant {
let target = targets.target_for_value(constant);
TerminatorKind::Goto { target }
let targets = SwitchTargets::new(iter::once((new_value, bb_cond)), bb_otherwise);
let terminator = bb.terminator_mut();
- terminator.kind = TerminatorKind::SwitchInt {
- discr: Operand::Move(opt.to_switch_on),
- switch_ty: opt.branch_value_ty,
- targets,
- };
+ terminator.kind =
+ TerminatorKind::SwitchInt { discr: Operand::Move(opt.to_switch_on), targets };
}
for (idx, bb_idx) in storage_deads_to_remove {
let terminator = match terminator_kind {
// This will unconditionally run into an unreachable and is therefore unreachable as well.
TerminatorKind::Goto { target } if is_unreachable(*target) => TerminatorKind::Unreachable,
- TerminatorKind::SwitchInt { targets, discr, switch_ty } => {
+ TerminatorKind::SwitchInt { targets, discr } => {
let otherwise = targets.otherwise();
// If all targets are unreachable, we can be unreachable as well.
return None;
}
- TerminatorKind::SwitchInt {
- discr: discr.clone(),
- switch_ty: *switch_ty,
- targets: new_targets,
- }
+ TerminatorKind::SwitchInt { discr: discr.clone(), targets: new_targets }
} else {
// If the otherwise branch is reachable, we don't want to delete any unreachable branches.
return None;
Const, Ty, TyCtxt,
};
use rustc_span::symbol::sym;
-use std::convert::TryInto;
use std::ops::ControlFlow;
use crate::errors::UnusedGenericParams;
use rustc_ast::token::{self, Delimiter, Nonterminal};
use rustc_errors::{error_code, fluent, Diagnostic, IntoDiagnostic, PResult};
use rustc_span::{sym, BytePos, Span};
-use std::convert::TryInto;
// Public for rustfmt usage
#[derive(Debug)]
use rustc_session::parse::ParseSess;
use rustc_span::{sym, Span, DUMMY_SP};
-use std::convert::TryInto;
use std::ops::Range;
/// A wrapper type to ensure that the parser handles outer attributes correctly.
use rustc_span::source_map::{self, Span};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::DUMMY_SP;
-use std::convert::TryFrom;
use std::mem;
use thin_vec::ThinVec;
use tracing::debug;
pub const FOREVER_RED_NODE: DepNodeIndex = DepNodeIndex::from_u32(1);
}
-impl std::convert::From<DepNodeIndex> for QueryInvocationId {
+impl From<DepNodeIndex> for QueryInvocationId {
#[inline]
fn from(dep_node_index: DepNodeIndex) -> Self {
QueryInvocationId(dep_node_index.as_u32())
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder, IntEncodedWithFixedSize, MemDecoder};
use rustc_serialize::{Decodable, Decoder, Encodable};
use smallvec::SmallVec;
-use std::convert::TryInto;
// The maximum value of `SerializedDepNodeIndex` leaves the upper two bits
// unused so that we can store multiple index types in `CompressedHybridIndex`,
use rustc_data_structures::sync::Lock;
use rustc_data_structures::sync::WorkerLocal;
use rustc_index::vec::{Idx, IndexVec};
-use std::default::Default;
use std::fmt::Debug;
use std::hash::Hash;
use std::marker::PhantomData;
rustc_data_structures::{jobserver, OnDrop},
rustc_rayon_core as rayon_core,
rustc_span::DUMMY_SP,
- std::iter::{self, FromIterator},
- std::{mem, process},
+ std::iter,
+ std::process,
};
/// Represents a span and a query key.
jobserver::release_thread();
waiter.condvar.wait(&mut info);
// Release the lock before we potentially block in `acquire_thread`
- mem::drop(info);
+ drop(info);
jobserver::acquire_thread();
}
}
use rustc_span::*;
use std::cell::Cell;
-use std::default::Default;
use std::env;
use std::fs::File;
use std::io::BufWriter;
use crate::leb128::{self, largest_max_leb128_len};
use crate::serialize::{Decodable, Decoder, Encodable, Encoder};
-use std::convert::TryInto;
use std::fs::File;
use std::io::{self, Write};
use std::mem::MaybeUninit;
use std::collections::{BTreeMap, BTreeSet};
use std::fmt;
use std::hash::Hash;
-use std::iter::{self, FromIterator};
+use std::iter;
use std::path::{Path, PathBuf};
use std::str::{self, FromStr};
use smallvec::{smallvec, SmallVec};
use std::env;
use std::fs;
-use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use crate::search_paths::{PathKind, SearchPath};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_data_structures::sync::{AtomicU32, Lrc, MappedReadGuard, ReadGuard, RwLock};
+use std::cmp;
use std::hash::Hash;
use std::path::{Path, PathBuf};
use std::sync::atomic::Ordering;
-use std::{clone::Clone, cmp};
-use std::{convert::TryFrom, unreachable};
use std::fs;
use std::io;
use rustc_macros::HashStable_Generic;
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
-use std::cmp::{Ord, PartialEq, PartialOrd};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::str;
/// For example `sym::rustfmt` or `sym::u8`.
pub mod sym {
use super::Symbol;
- use std::convert::TryInto;
#[doc(inline)]
pub use super::sym_generated::*;
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
-use std::iter::FromIterator;
use std::path::{Path, PathBuf};
#[macro_use]
use serde_json::Value;
use std::borrow::Cow;
use std::collections::BTreeMap;
-use std::convert::TryFrom;
use std::hash::{Hash, Hasher};
-use std::iter::FromIterator;
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use super::InferCtxtPrivExt;
use crate::infer::InferCtxtExt as _;
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
-use rustc_middle::ty::print::with_no_trimmed_paths;
+use rustc_middle::ty::print::{with_forced_trimmed_paths, with_no_trimmed_paths};
#[derive(Debug)]
pub enum GeneratorInteriorOrUpvar {
ObligationCauseCode::BindingObligation(item_def_id, span)
| ObligationCauseCode::ExprBindingObligation(item_def_id, span, ..) => {
let item_name = tcx.def_path_str(item_def_id);
+ let short_item_name = with_forced_trimmed_paths!(tcx.def_path_str(item_def_id));
let mut multispan = MultiSpan::from(span);
let sm = tcx.sess.source_map();
if let Some(ident) = tcx.opt_item_ident(item_def_id) {
multispan.push_span_label(ident.span, "required by a bound in this");
}
}
- let descr = format!("required by a bound in `{}`", item_name);
+ let descr = format!("required by a bound in `{item_name}`");
if span.is_visible(sm) {
- let msg = format!("required by this bound in `{}`", item_name);
+ let msg = format!("required by this bound in `{short_item_name}`");
multispan.push_span_label(span, msg);
err.span_note(multispan, &descr);
} else {
#![allow(rustc::usage_of_ty_tykind)]
-use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
+use std::cmp::Ordering;
use std::{fmt, hash};
use crate::DebruijnIndex;
panic_abort = { path = "../panic_abort" }
core = { path = "../core" }
libc = { version = "0.2.138", default-features = false, features = ['rustc-dep-of-std'] }
-compiler_builtins = { version = "0.1.82" }
+compiler_builtins = { version = "0.1.85" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
hashbrown = { version = "0.12", default-features = false, features = ['rustc-dep-of-std'] }
use crate::ptr;
use crate::sync::atomic::{AtomicPtr, Ordering::Relaxed};
use crate::sys::locks::{pthread_mutex, Mutex};
+use crate::sys::time::TIMESPEC_MAX;
use crate::sys_common::lazy_box::{LazyBox, LazyInit};
use crate::time::Duration;
mutex: AtomicPtr<libc::pthread_mutex_t>,
}
-const TIMESPEC_MAX: libc::timespec =
- libc::timespec { tv_sec: <libc::time_t>::MAX, tv_nsec: 1_000_000_000 - 1 };
-
-fn saturating_cast_to_time_t(value: u64) -> libc::time_t {
- if value > <libc::time_t>::MAX as u64 { <libc::time_t>::MAX } else { value as libc::time_t }
-}
-
#[inline]
fn raw(c: &Condvar) -> *mut libc::pthread_cond_t {
c.inner.0.get()
target_os = "horizon"
)))]
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
- use crate::mem;
+ use crate::sys::time::Timespec;
let mutex = pthread_mutex::raw(mutex);
self.verify(mutex);
- let mut now: libc::timespec = mem::zeroed();
- let r = libc::clock_gettime(libc::CLOCK_MONOTONIC, &mut now);
- assert_eq!(r, 0);
-
- // Nanosecond calculations can't overflow because both values are below 1e9.
- let nsec = dur.subsec_nanos() + now.tv_nsec as u32;
-
- let sec = saturating_cast_to_time_t(dur.as_secs())
- .checked_add((nsec / 1_000_000_000) as libc::time_t)
- .and_then(|s| s.checked_add(now.tv_sec));
- let nsec = nsec % 1_000_000_000;
-
- let timeout =
- sec.map(|s| libc::timespec { tv_sec: s, tv_nsec: nsec as _ }).unwrap_or(TIMESPEC_MAX);
-
+ let timeout = Timespec::now(libc::CLOCK_MONOTONIC)
+ .checked_add_duration(&dur)
+ .and_then(|t| t.to_timespec())
+ .unwrap_or(TIMESPEC_MAX);
let r = libc::pthread_cond_timedwait(raw(self), mutex, &timeout);
assert!(r == libc::ETIMEDOUT || r == 0);
r == 0
target_os = "espidf",
target_os = "horizon"
))]
- pub unsafe fn wait_timeout(&self, mutex: &Mutex, mut dur: Duration) -> bool {
+ pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
+ use crate::sys::time::SystemTime;
use crate::time::Instant;
let mutex = pthread_mutex::raw(mutex);
self.verify(mutex);
- // 1000 years
- let max_dur = Duration::from_secs(1000 * 365 * 86400);
-
- if dur > max_dur {
- // OSX implementation of `pthread_cond_timedwait` is buggy
- // with super long durations. When duration is greater than
- // 0x100_0000_0000_0000 seconds, `pthread_cond_timedwait`
- // in macOS Sierra return error 316.
- //
- // This program demonstrates the issue:
- // https://gist.github.com/stepancheg/198db4623a20aad2ad7cddb8fda4a63c
- //
- // To work around this issue, and possible bugs of other OSes, timeout
- // is clamped to 1000 years, which is allowable per the API of `wait_timeout`
- // because of spurious wakeups.
-
- dur = max_dur;
- }
-
- // First, figure out what time it currently is, in both system and
- // stable time. pthread_cond_timedwait uses system time, but we want to
- // report timeout based on stable time.
- let mut sys_now = libc::timeval { tv_sec: 0, tv_usec: 0 };
- let stable_now = Instant::now();
- let r = libc::gettimeofday(&mut sys_now, ptr::null_mut());
- assert_eq!(r, 0, "unexpected error: {:?}", crate::io::Error::last_os_error());
-
- let nsec = dur.subsec_nanos() as libc::c_long + (sys_now.tv_usec * 1000) as libc::c_long;
- let extra = (nsec / 1_000_000_000) as libc::time_t;
- let nsec = nsec % 1_000_000_000;
- let seconds = saturating_cast_to_time_t(dur.as_secs());
-
- let timeout = sys_now
- .tv_sec
- .checked_add(extra)
- .and_then(|s| s.checked_add(seconds))
- .map(|s| libc::timespec { tv_sec: s, tv_nsec: nsec })
+ // OSX implementation of `pthread_cond_timedwait` is buggy
+ // with super long durations. When duration is greater than
+ // 0x100_0000_0000_0000 seconds, `pthread_cond_timedwait`
+ // in macOS Sierra returns error 316.
+ //
+ // This program demonstrates the issue:
+ // https://gist.github.com/stepancheg/198db4623a20aad2ad7cddb8fda4a63c
+ //
+ // To work around this issue, and possible bugs of other OSes, timeout
+ // is clamped to 1000 years, which is allowable per the API of `wait_timeout`
+ // because of spurious wakeups.
+ let dur = Duration::min(dur, Duration::from_secs(1000 * 365 * 86400));
+
+ // pthread_cond_timedwait uses system time, but we want to report timeout
+ // based on stable time.
+ let now = Instant::now();
+
+ let timeout = SystemTime::now()
+ .t
+ .checked_add_duration(&dur)
+ .and_then(|t| t.to_timespec())
.unwrap_or(TIMESPEC_MAX);
- // And wait!
let r = libc::pthread_cond_timedwait(raw(self), mutex, &timeout);
debug_assert!(r == libc::ETIMEDOUT || r == 0);
// ETIMEDOUT is not a totally reliable method of determining timeout due
// to clock shifts, so do the check ourselves
- stable_now.elapsed() < dur
+ now.elapsed() < dur
}
}
unsafe {
// Available since glibc 2.12, musl 1.1.16, and uClibc 1.0.20.
- let name = truncate_cstr(name, TASK_COMM_LEN);
+ let name = truncate_cstr::<{ TASK_COMM_LEN }>(name);
let res = libc::pthread_setname_np(libc::pthread_self(), name.as_ptr());
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
debug_assert_eq!(res, 0);
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))]
pub fn set_name(name: &CStr) {
unsafe {
- let name = truncate_cstr(name, libc::MAXTHREADNAMESIZE);
+ let name = truncate_cstr::<{ libc::MAXTHREADNAMESIZE }>(name);
let res = libc::pthread_setname_np(name.as_ptr());
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
debug_assert_eq!(res, 0);
}
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "ios", target_os = "watchos"))]
-fn truncate_cstr(cstr: &CStr, max_with_nul: usize) -> crate::borrow::Cow<'_, CStr> {
- use crate::{borrow::Cow, ffi::CString};
-
- if cstr.to_bytes_with_nul().len() > max_with_nul {
- let bytes = cstr.to_bytes()[..max_with_nul - 1].to_vec();
- // SAFETY: the non-nul bytes came straight from a CStr.
- // (CString will add the terminating nul.)
- Cow::Owned(unsafe { CString::from_vec_unchecked(bytes) })
- } else {
- Cow::Borrowed(cstr)
+fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
+ let mut result = [0; MAX_WITH_NUL];
+ for (src, dst) in cstr.to_bytes().iter().zip(&mut result[..MAX_WITH_NUL - 1]) {
+ *dst = *src as libc::c_char;
}
+ result
}
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
use crate::ptr::addr_of_mut;
use crate::sync::atomic::AtomicUsize;
use crate::sync::atomic::Ordering::SeqCst;
+use crate::sys::time::TIMESPEC_MAX;
use crate::time::Duration;
const EMPTY: usize = 0;
debug_assert_eq!(r, 0);
}
-const TIMESPEC_MAX: libc::timespec =
- libc::timespec { tv_sec: <libc::time_t>::MAX, tv_nsec: 1_000_000_000 - 1 };
-
unsafe fn wait_timeout(
cond: *mut libc::pthread_cond_t,
lock: *mut libc::pthread_mutex_t,
const NSEC_PER_SEC: u64 = 1_000_000_000;
pub const UNIX_EPOCH: SystemTime = SystemTime { t: Timespec::zero() };
+#[allow(dead_code)] // Used for pthread condvar timeouts
+pub const TIMESPEC_MAX: libc::timespec =
+ libc::timespec { tv_sec: <libc::time_t>::MAX, tv_nsec: 1_000_000_000 - 1 };
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
- let builder = run.builder;
-
// Allow building `rust-analyzer-proc-macro-srv` both as part of the `rust-analyzer` and as a stand-alone tool.
run.path("src/tools/rust-analyzer")
.path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
- .default_condition(
- builder.config.extended
- && builder.config.tools.as_ref().map_or(true, |tools| {
- tools.iter().any(|tool| {
- tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
- })
- }),
- )
}
fn make_run(run: RunConfig<'_>) {
pathname syntax. For example `--remap-path-prefix foo=bar` will match
`foo/lib.rs` but not `./foo/lib.rs`.
+When multiple remappings are given and several of them match, the **last**
+matching one is applied.
+
<a id="option-json"></a>
## `--json`: configure json messages printed by the compiler
use super::format::{self, Buffer};
/// This type is needed in case we want to render links on items to allow to go to their definition.
-pub(crate) struct HrefContext<'a, 'b, 'c> {
- pub(crate) context: &'a Context<'b>,
+pub(crate) struct HrefContext<'a, 'tcx> {
+ pub(crate) context: &'a Context<'tcx>,
/// This span contains the current file we're going through.
pub(crate) file_span: Span,
/// This field is used to know "how far" from the top of the directory we are to link to either
/// documentation pages or other source pages.
- pub(crate) root_path: &'c str,
+ pub(crate) root_path: &'a str,
/// This field is used to calculate precise local URLs.
- pub(crate) current_href: &'c str,
+ pub(crate) current_href: String,
}
/// Decorations are represented as a map from CSS class to vector of character ranges.
src: &str,
out: &mut Buffer,
line_numbers: Buffer,
- href_context: HrefContext<'_, '_, '_>,
+ href_context: HrefContext<'_, '_>,
decoration_info: DecorationInfo,
extra: Option<&str>,
) {
/// This type is used as a conveniency to prevent having to pass all its fields as arguments into
/// the various functions (which became its methods).
-struct TokenHandler<'a, 'b, 'c, 'd, 'e> {
+struct TokenHandler<'a, 'tcx> {
out: &'a mut Buffer,
/// It contains the closing tag and the associated `Class`.
closing_tags: Vec<(&'static str, Class)>,
current_class: Option<Class>,
/// We need to keep the `Class` for each element because it could contain a `Span` which is
/// used to generate links.
- pending_elems: Vec<(&'b str, Option<Class>)>,
- href_context: Option<HrefContext<'c, 'd, 'e>>,
+ pending_elems: Vec<(&'a str, Option<Class>)>,
+ href_context: Option<HrefContext<'a, 'tcx>>,
}
-impl<'a, 'b, 'c, 'd, 'e> TokenHandler<'a, 'b, 'c, 'd, 'e> {
+impl<'a, 'tcx> TokenHandler<'a, 'tcx> {
fn handle_exit_span(&mut self) {
// We can't get the last `closing_tags` element using `pop()` because `closing_tags` is
// being used in `write_pending_elems`.
}
}
-impl<'a, 'b, 'c, 'd, 'e> Drop for TokenHandler<'a, 'b, 'c, 'd, 'e> {
+impl<'a, 'tcx> Drop for TokenHandler<'a, 'tcx> {
/// When leaving, we need to flush all pending data to not have missing content.
fn drop(&mut self) {
if self.pending_exit_span.is_some() {
fn write_code(
out: &mut Buffer,
src: &str,
- href_context: Option<HrefContext<'_, '_, '_>>,
+ href_context: Option<HrefContext<'_, '_>>,
decoration_info: Option<DecorationInfo>,
) {
// This replace allows to fix how the code source with DOS backline characters is displayed.
/// Processes program tokens, classifying strings of text by highlighting
/// category (`Class`).
-struct Classifier<'a> {
- tokens: PeekIter<'a>,
+struct Classifier<'src> {
+ tokens: PeekIter<'src>,
in_attribute: bool,
in_macro: bool,
in_macro_nonterminal: bool,
byte_pos: u32,
file_span: Span,
- src: &'a str,
+ src: &'src str,
decorations: Option<Decorations>,
}
-impl<'a> Classifier<'a> {
+impl<'src> Classifier<'src> {
/// Takes as argument the source code to HTML-ify, the rust edition to use and the source code
/// file span which will be used later on by the `span_correspondance_map`.
fn new(src: &str, file_span: Span, decoration_info: Option<DecorationInfo>) -> Classifier<'_> {
///
/// It returns the token's kind, the token as a string and its byte position in the source
/// string.
- fn next(&mut self) -> Option<(TokenKind, &'a str, u32)> {
+ fn next(&mut self) -> Option<(TokenKind, &'src str, u32)> {
if let Some((kind, text)) = self.tokens.next() {
let before = self.byte_pos;
self.byte_pos += text.len() as u32;
/// The general structure for this method is to iterate over each token,
/// possibly giving it an HTML span with a class specifying what flavor of
/// token is used.
- fn highlight(mut self, sink: &mut dyn FnMut(Highlight<'a>)) {
+ fn highlight(mut self, sink: &mut dyn FnMut(Highlight<'src>)) {
loop {
if let Some(decs) = self.decorations.as_mut() {
let byte_pos = self.byte_pos;
fn advance(
&mut self,
token: TokenKind,
- text: &'a str,
- sink: &mut dyn FnMut(Highlight<'a>),
+ text: &'src str,
+ sink: &mut dyn FnMut(Highlight<'src>),
before: u32,
) {
let lookahead = self.peek();
fn enter_span(
out: &mut Buffer,
klass: Class,
- href_context: &Option<HrefContext<'_, '_, '_>>,
+ href_context: &Option<HrefContext<'_, '_>>,
) -> &'static str {
string_without_closing_tag(out, "", Some(klass), href_context, true).expect(
"internal error: enter_span was called with Some(klass) but did not return a \
out: &mut Buffer,
text: T,
klass: Option<Class>,
- href_context: &Option<HrefContext<'_, '_, '_>>,
+ href_context: &Option<HrefContext<'_, '_>>,
open_tag: bool,
) {
if let Some(closing_tag) = string_without_closing_tag(out, text, klass, href_context, open_tag)
out: &mut Buffer,
text: T,
klass: Option<Class>,
- href_context: &Option<HrefContext<'_, '_, '_>>,
+ href_context: &Option<HrefContext<'_, '_>>,
open_tag: bool,
) -> Option<&'static str> {
let Some(klass) = klass
// https://github.com/rust-lang/rust/blob/60f1a2fc4b535ead9c85ce085fdce49b1b097531/src/librustdoc/html/render/context.rs#L315-L338
match href {
LinkFromSrc::Local(span) => {
- context.href_from_span_relative(*span, href_context.current_href)
+ context.href_from_span_relative(*span, &href_context.current_href)
}
LinkFromSrc::External(def_id) => {
format::href_with_root_path(*def_id, context, Some(href_context.root_path))
let mut line_numbers = Buffer::empty_from(buf);
let extra;
line_numbers.write_str("<pre class=\"src-line-numbers\">");
- let current_href = &context
+ let current_href = context
.href_from_span(clean::Span::new(file_span), false)
.expect("only local crates should have sources emitted");
match source_context {
--- /dev/null
+// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes
+// min-llvm-version: 15.0 # this test uses opaque pointer notation
+#![feature(stmt_expr_attributes)]
+
+pub struct S([usize; 8]);
+
+#[no_mangle]
+pub fn outer_function(x: S, y: S) -> usize {
+ (#[inline(always)]|| {
+ let _z = x;
+ y.0[0]
+ })()
+}
+
+// Check that we do not attempt to load from the spilled arg before it is assigned to
+// when generating debuginfo.
+// CHECK-LABEL: @outer_function
+// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
+// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
+// CHECK-NOT: [[load:%.*]] = load ptr, ptr
+// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
+// CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[spill]], ptr {{align .*}} %x
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/76803_regression.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/76803_regression.rs:+1:5: +1:12
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/76803_regression.rs:+1:5: +1:12
}
bb1: {
- _2 = Ne(move _3, const true); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
}
bb1: {
- _2 = Ne(const true, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
}
bb1: {
- _2 = Eq(move _3, const false); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
}
bb1: {
- _2 = Eq(const false, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
}
bb1: {
StorageLive(_5); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
FakeRead(ForMatchedPlace(None), _1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
_6 = discriminant(_1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
- switchInt(move _6) -> [1_isize: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
+ switchInt(move _6) -> [1: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
}
bb1: {
StorageLive(_3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
_3 = const true; // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
FakeRead(ForMatchedPlace(None), _3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23
+ switchInt(_3) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23
}
bb3: {
_2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
}
bb1: {
}
bb6: {
- switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
}
bb7: {
_2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
}
bb1: {
}
bb6: {
- switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
}
bb7: {
_2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
_4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ switchInt(move _4) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
}
bb1: {
bb4: {
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _3) -> [1_isize: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ switchInt(move _3) -> [1: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
}
bb5: {
}
bb9: {
- switchInt(move _8) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ switchInt(move _8) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
}
bb10: {
}
bb15: {
- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
}
bb16: {
bb0: {
FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple_match.rs:+1:11: +1:12
- switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12
+ switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12
}
bb1: {
bb0: {
- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20
-- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- switchInt(move _3) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20
-+ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ switchInt(move _2) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
- }
-
- bb3: {
-- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb4: {
StorageLive(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:11: +6:6
StorageLive(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16
_2 = const A; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16
- switchInt(_2) -> [1_i32: bb2, 2_i32: bb2, 3_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:9: +2:16
+ switchInt(_2) -> [1: bb2, 2: bb2, 3: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:9: +2:16
}
bb1: {
bb2: {
_1 = const B; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27
- goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27
-+ switchInt(_1) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
++ switchInt(_1) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
}
bb3: {
-- switchInt(_1) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
+- switchInt(_1) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
- }
-
- bb4: {
- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
- StorageLive(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
- _6 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
+- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
+ StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
+ _2 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
++ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
}
bb1: {
-
- bb3: {
- StorageDead(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:51: +2:52
-- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
+- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
- }
-
- bb4: {
-
- bb6: {
- StorageDead(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:75: +2:76
-- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
+- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
- }
-
- bb7: {
- }
-
- bb9: {
-- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
+- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
- }
-
- bb10: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
_1 = const _; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
-- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
-+ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
+- switchInt(move _1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
++ switchInt(const false) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
}
bb1: {
((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
}
bb1: {
- switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
}
bb2: {
((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
}
bb1: {
- switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
}
bb2: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-- switchInt(_1) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
-+ switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
+- switchInt(_1) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
++ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
}
bb1: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-- switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
+- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
+ goto -> bb2; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
}
bcb1__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb1</td></tr><tr><td align="left" balign="left">Expression(bcb0 + bcb3) at 10:5-11:17<br align="left"/> 11:12-11:17: @2.Call: _2 = bar() -> [return: bb3, unwind: bb6]</td></tr><tr><td align="left" balign="left">bb1: FalseUnwind<br align="left"/>bb2: Call</td></tr><tr><td align="left" balign="left">bb3: SwitchInt</td></tr></table>>];
bcb0__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb0</td></tr><tr><td align="left" balign="left"></td></tr><tr><td align="left" balign="left">Counter(bcb0) at 9:1-9:11<br align="left"/> </td></tr><tr><td align="left" balign="left">bb0: Goto</td></tr></table>>];
bcb3__Cov_0_3 -> bcb1__Cov_0_3 [label=<>];
- bcb1__Cov_0_3 -> bcb3__Cov_0_3 [label=<false>];
+ bcb1__Cov_0_3 -> bcb3__Cov_0_3 [label=<0>];
bcb1__Cov_0_3 -> bcb2__Cov_0_3 [label=<otherwise>];
bcb0__Cov_0_3 -> bcb1__Cov_0_3 [label=<>];
}
discriminant(_1) = 0; // scope 0 at $DIR/enum.rs:+1:13: +1:21
StorageLive(_2); // scope 1 at $DIR/enum.rs:+2:9: +2:10
_3 = discriminant(_1); // scope 1 at $DIR/enum.rs:+2:19: +2:20
- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
+ switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
}
bb1: {
+ _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:17
+ _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:22
StorageDead(_4); // scope 1 at $DIR/if.rs:+2:21: +2:22
-- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
-+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
+- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
}
bb1: {
+ _9 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:17
+ _8 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:22
StorageDead(_9); // scope 3 at $DIR/if.rs:+5:21: +5:22
-- switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
-+ switchInt(const true) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
+- switchInt(move _8) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
++ switchInt(const true) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
}
bb4: {
StorageLive(_1); // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
StorageLive(_2); // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
_2 = const true; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
}
bb1: {
}
bb2: {
-- switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
-+ switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
+- switchInt(move _5) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
++ switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
}
bb3: {
bb0: {
StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9
_3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9
- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9
+ switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9
}
bb1: {
_7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
_8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
_9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- switchInt(move _9) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ switchInt(move _9) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
}
bb2: {
- switchInt((*_2)[0 of 4]) -> [47_u8: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[0 of 4]) -> [47: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb3: {
- switchInt((*_2)[1 of 4]) -> [47_u8: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[1 of 4]) -> [47: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb4: {
- switchInt((*_2)[2 of 4]) -> [47_u8: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[2 of 4]) -> [47: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb5: {
-- switchInt((*_2)[3 of 4]) -> [47_u8: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+- switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
++ switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb6: {
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
_5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
_6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- switchInt(move _6) -> [false: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ switchInt(move _6) -> [0: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
}
bb7: {
- switchInt((*_2)[0 of 3]) -> [47_u8: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb8: {
- switchInt((*_2)[1 of 3]) -> [47_u8: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb9: {
-- switchInt((*_2)[2 of 3]) -> [47_u8: bb12, 33_u8: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
++ switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb10: {
_7 = const false; // scope 0 at $DIR/string.rs:+1:11: +1:12
_7 = const true; // scope 0 at $DIR/string.rs:+1:11: +1:12
_5 = discriminant(_1); // scope 0 at $DIR/string.rs:+1:11: +1:12
- switchInt(move _5) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/string.rs:+1:5: +1:12
+ switchInt(move _5) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/string.rs:+1:5: +1:12
}
bb1: {
}
bb4: {
- switchInt(move _4) -> [false: bb1, otherwise: bb5]; // scope 0 at $DIR/string.rs:+2:14: +2:17
+ switchInt(move _4) -> [0: bb1, otherwise: bb5]; // scope 0 at $DIR/string.rs:+2:14: +2:17
}
bb5: {
}
bb9: {
- switchInt(_7) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/string.rs:+5:1: +5:2
+ switchInt(_7) -> [0: bb7, otherwise: bb8]; // scope 0 at $DIR/string.rs:+5:1: +5:2
}
}
bb3: {
StorageDead(_8); // scope 1 at $DIR/derefer_complex_case.rs:+1:25: +1:26
_10 = discriminant(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
}
bb4: {
_6 = &_7; // scope 2 at $DIR/derefer_terminator_test.rs:+3:18: +3:21
_5 = &_6; // scope 2 at $DIR/derefer_terminator_test.rs:+3:17: +3:21
_4 = &_5; // scope 2 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
-- switchInt((*(*(*(*_4))))) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _10 = deref_copy (*_4); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _11 = deref_copy (*_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _12 = deref_copy (*_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ switchInt((*_12)) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
++ switchInt((*_12)) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
}
bb3: {
}
bb2: {
- switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
+ switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
}
bb3: {
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
_7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _10 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _11) -> [false: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
bb1: {
bb2: {
- _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
- }
-
- bb3: {
+
+ bb4: {
+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
}
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
_8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _8) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _8) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _11 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _12 = Ne(_8, move _11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _12) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(move _12) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
bb1: {
- _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [0_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _6) -> [0: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
- }
-
- bb2: {
- bb3: {
- _7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1_isize: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _7) -> [1: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
- }
-
- bb4: {
+
+ bb5: {
+ StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_8) -> [0_isize: bb3, 1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(_8) -> [0: bb3, 1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
}
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
_7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _10 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _11) -> [false: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
bb1: {
bb2: {
- _6 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
- }
-
- bb3: {
+
+ bb4: {
+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
}
}
StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20
_10 = discriminant((_4.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+- switchInt(move _10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ StorageLive(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ _14 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ StorageLive(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ _15 = Ne(_10, move _14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ StorageDead(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(move _15) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
++ switchInt(move _15) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
}
bb1: {
bb2: {
- _9 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _9) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+- switchInt(move _9) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
- }
-
- bb3: {
_8 = discriminant((_4.2: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _8) -> [1_isize: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(move _8) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+- switchInt(move _8) -> [1: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
++ switchInt(move _8) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
}
- bb4: {
+
+ bb5: {
+ StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(_10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
++ switchInt(_10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
}
}
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
_34 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_11 = discriminant((*_34)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _11) -> [0_isize: bb1, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ switchInt(move _11) -> [0: bb1, 1: bb3, 2: bb4, 3: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb1: {
_35 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_7 = discriminant((*_35)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ switchInt(move _7) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb2: {
bb3: {
_36 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_8 = discriminant((*_36)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ switchInt(move _8) -> [1: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb4: {
_37 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_9 = discriminant((*_37)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ switchInt(move _9) -> [2: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb5: {
_38 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_10 = discriminant((*_38)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ switchInt(move _10) -> [3: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb6: {
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17
_8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _8) -> [0_isize: bb1, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ switchInt(move _8) -> [0: bb1, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
}
bb1: {
_6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _6) -> [0_isize: bb2, 1_isize: bb7, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ switchInt(move _6) -> [0: bb2, 1: bb7, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
}
bb2: {
bb4: {
_7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _7) -> [0_isize: bb6, 1_isize: bb5, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ switchInt(move _7) -> [0: bb6, 1: bb5, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
}
bb5: {
bb0: {
_3 = discriminant(_1); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:11: +1:12
- switchInt(move _3) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:12
+ switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:12
}
bb1: {
bb2: {
_4 = discriminant((*_2)); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:26: +3:28
- switchInt(move _4) -> [1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:20: +3:28
+ switchInt(move _4) -> [1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:20: +3:28
}
bb3: {
bb0: {
_3 = discriminant((*_1)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- switchInt(move _3) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
+ switchInt(move _3) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
}
bb1: {
_4 = deref_copy (((*_1) as Some).0: &E<'_>); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
_2 = discriminant((*_4)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
+ switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
}
bb2: {
- _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
+ _2 = move _3; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
StorageDead(_3); // scope 0 at $DIR/equal_true.rs:+1:16: +1:17
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
}
bb1: {
bb0: {
FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/exponential_or.rs:+1:11: +1:12
- switchInt((_1.0: u32)) -> [1_u32: bb2, 4_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:15: +2:20
+ switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:15: +2:20
}
bb1: {
bb2: {
_2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
- switchInt(move _2) -> [0_isize: bb4, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
+ switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
}
bb3: {
- switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1_i32: bb4, 8_i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
+ switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
}
bb4: {
_5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
+ switchInt(move _5) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
}
bb5: {
_6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
+ switchInt(move _6) -> [0: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
}
bb6: {
_3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
+ switchInt(move _3) -> [0: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
}
bb7: {
_4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
+ switchInt(move _4) -> [0: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
}
bb8: {
bb1: {
StorageDead(_5); // scope 0 at $DIR/funky_arms.rs:+4:36: +4:37
StorageLive(_6); // scope 1 at $DIR/funky_arms.rs:+8:9: +8:13
- switchInt(_4) -> [false: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32
+ switchInt(_4) -> [0: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32
}
bb2: {
bb5: {
StorageDead(_8); // scope 3 at $DIR/funky_arms.rs:+13:44: +13:45
_9 = discriminant(_7); // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
- switchInt(move _9) -> [1_isize: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
+ switchInt(move _9) -> [1: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
}
bb6: {
bb0: {
_8 = discriminant((*_1)); // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
+ switchInt(move _8) -> [0: bb7, 3: bb10, otherwise: bb11]; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
}
bb1: {
bb0: {
_11 = discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
+ switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
}
bb1: {
bb0: {
StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
_2 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
_2 = Eq(move _3, const -42f32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:17: +1:18
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
- _2 = Eq(move _3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
-- switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+ _2 = Eq(_3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
-+ switchInt(move _3) -> [17_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
++ switchInt(move _3) -> [17: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-+ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
++ switchInt(move _3) -> [120: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
}
bb1: {
_5 = _1; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
- _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
- StorageDead(_5); // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
-- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
+- switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
+ nop; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
+ nop; // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
-+ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
++ switchInt(move _5) -> [21: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
}
bb3: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-+ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
++ switchInt(move _3) -> [4294967254: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
}
bb1: {
_3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
}
bb1: {
_3 = _1; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:9
_2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
StorageDead(_3); // scope 0 at $DIR/inline_diverging.rs:+1:12: +1:13
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
}
bb1: {
+ _7 = const false; // scope 0 at $DIR/inline_generator.rs:+1:14: +1:46
+ _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
+ _9 = discriminant((*_10)); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ switchInt(move _9) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
++ switchInt(move _9) -> [0: bb3, 1: bb8, 3: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
}
- bb3: {
+
+ bb3: {
+ StorageLive(_8); // scope 6 at $DIR/inline_generator.rs:15:17: 15:39
-+ switchInt(move _7) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21
++ switchInt(move _7) -> [0: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21
+ }
+
+ bb4: {
+ StorageLive(_6); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
+ StorageLive(_7); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
+ _6 = discriminant((*_5)); // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-+ switchInt(move _6) -> [0_isize: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
++ switchInt(move _6) -> [0: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb2: {
}
bb3: {
- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
+ switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
}
bb4: {
StorageLive(_3); // scope 1 at $DIR/issue_38669.rs:+3:9: +5:10
StorageLive(_4); // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
_4 = _1; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
+ switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
}
bb3: {
}
bb8 (cleanup): {
- switchInt(_5) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
+ switchInt(_5) -> [0: bb6, otherwise: bb7]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
}
}
}
bb14 (cleanup): {
- switchInt(_6) -> [false: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+ switchInt(_6) -> [0: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
}
}
}
bb1: {
- switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
+ switchInt(move _2) -> [0: bb7, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
}
bb2: {
bb4: {
StorageDead(_3); // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
_5 = discriminant(_1); // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24
- switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24
+ switchInt(move _5) -> [0: bb5, otherwise: bb6]; // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24
}
bb5: {
bb19: {
_10 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- switchInt(move _10) -> [0_isize: bb15, otherwise: bb17]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ switchInt(move _10) -> [0: bb15, otherwise: bb17]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
}
bb20: {
- switchInt(_7) -> [false: bb15, otherwise: bb19]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ switchInt(_7) -> [0: bb15, otherwise: bb19]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
}
bb21 (cleanup): {
_11 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- switchInt(move _11) -> [0_isize: bb16, otherwise: bb18]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ switchInt(move _11) -> [0: bb16, otherwise: bb18]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
}
bb22 (cleanup): {
- switchInt(_7) -> [false: bb12, otherwise: bb21]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ switchInt(_7) -> [0: bb12, otherwise: bb21]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
}
}
bb2: {
StorageDead(_7); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
_8 = discriminant(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
- switchInt(move _8) -> [0_isize: bb3, 1_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
}
bb3: {
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _15) -> [false: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _15) -> [0: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb4: {
StorageDead(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_10 = Not(move _11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _10) -> [false: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _10) -> [0: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb3: {
StorageDead(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_31 = Not(move _32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _31) -> [false: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _31) -> [0: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb12: {
bb2: {
_7 = discriminant(_2); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _7) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
+ switchInt(move _7) -> [0: bb6, 1: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
}
bb3: {
StorageDead(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_5); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_3); // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23
- switchInt(move _9) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23
+ switchInt(move _9) -> [1: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23
}
bb6: {
bb1: {
StorageDead(_3); // scope 2 at $DIR/issue_75439.rs:+2:52: +2:53
- switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[0 of 4]) -> [0: bb2, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
bb2: {
- switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[1 of 4]) -> [0: bb3, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
bb3: {
- switchInt(_2[2 of 4]) -> [0_u32: bb5, 4294901760_u32: bb6, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[2 of 4]) -> [0: bb5, 4294901760: bb6, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
bb4: {
StorageLive(_1); // scope 0 at $DIR/loop_test.rs:+4:5: +6:6
StorageLive(_2); // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
_2 = const true; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
}
bb1: {
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
+ switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
}
bb2: {
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
+ switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
}
bb2: {
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ switchInt(move _3) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
}
bb1: {
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ switchInt(move _3) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
}
bb1: {
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
StorageDead(_5); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27
StorageDead(_4); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
+ switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
}
bb2: {
bb0: {
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
-- switchInt((_2.0: bool)) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
-+ switchInt((_2.0: bool)) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
+- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
++ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
}
bb1: {
- falseEdge -> [real: bb8, imaginary: bb3]; // scope 0 at $DIR/match_arm_scopes.rs:+2:9: +2:22
-+ switchInt((_2.1: bool)) -> [false: bb10, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
++ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
}
bb2: {
-- switchInt((_2.1: bool)) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
-+ switchInt((_2.0: bool)) -> [false: bb3, otherwise: bb17]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
+- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
++ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
}
bb3: {
- }
-
- bb4: {
-- switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
+- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
- }
-
- bb5: {
StorageLive(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
StorageLive(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
_10 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-+ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
+- switchInt(move _10) -> [0: bb10, otherwise: bb9]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
++ switchInt(move _10) -> [0: bb7, otherwise: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
}
- bb9: {
- bb10: {
+ bb7: {
_9 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71
-- switchInt(move _9) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
+- switchInt(move _9) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
++ switchInt(move _9) -> [0: bb9, otherwise: bb8]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
}
- bb11: {
StorageLive(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
StorageLive(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
_13 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-+ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
+- switchInt(move _13) -> [0: bb15, otherwise: bb14]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
++ switchInt(move _13) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
}
- bb14: {
- bb15: {
+ bb12: {
_12 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71
-- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
+- switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
++ switchInt(move _12) -> [0: bb14, otherwise: bb13]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
}
- bb16: {
StorageLive(_3); // scope 2 at $DIR/match_test.rs:+6:5: +11:6
FakeRead(ForMatchedPlace(None), _1); // scope 2 at $DIR/match_test.rs:+6:11: +6:12
_6 = Le(const 0_i32, _1); // scope 2 at $DIR/match_test.rs:+7:9: +7:14
- switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
+ switchInt(move _6) -> [0: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
}
bb1: {
_7 = Lt(_1, const 10_i32); // scope 2 at $DIR/match_test.rs:+7:9: +7:14
- switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
+ switchInt(move _7) -> [0: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
}
bb2: {
bb4: {
_4 = Le(const 10_i32, _1); // scope 2 at $DIR/match_test.rs:+8:9: +8:16
- switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
+ switchInt(move _4) -> [0: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
}
bb5: {
_5 = Le(_1, const 20_i32); // scope 2 at $DIR/match_test.rs:+8:9: +8:16
- switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
+ switchInt(move _5) -> [0: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
}
bb6: {
}
bb7: {
- switchInt(_1) -> [-1_i32: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:+6:5: +6:12
+ switchInt(_1) -> [4294967295: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:+6:5: +6:12
}
bb8: {
_8 = &shallow _1; // scope 2 at $DIR/match_test.rs:+6:11: +6:12
StorageLive(_9); // scope 2 at $DIR/match_test.rs:+7:18: +7:19
_9 = _2; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- switchInt(move _9) -> [false: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
+ switchInt(move _9) -> [0: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
}
bb10: {
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
-- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
+- switchInt(_1) -> [7: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
- }
-
- bb1: {
bb0: {
StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
-- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _4 = move _3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
- }
-
- bb3: {
-- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb4: {
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- }
-
- bb1: {
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- }
-
- bb4: {
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:75: +2:76
-- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- }
-
- bb7: {
- }
-
- bb9: {
-- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- }
-
- bb10: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
_7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- switchInt(move _7) -> [ConstValue(Scalar(0x00): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
+ switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
}
bb2: {
FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
_7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- switchInt(move _7) -> [ConstValue(Scalar(0x00): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
+ switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
}
bb2: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14
- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14
+ switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14
}
bb1: {
- _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
+ _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:+1:17: +1:18
- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
}
bb1: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
_3 = discriminant(_1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- switchInt(move _3) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
+ switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
}
bb1: {
}
bb2: {
- switchInt((*(*((_1 as Some).0: &&i32)))) -> [0_i32: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
+ switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
}
bb3: {
+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
StorageLive(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
_8 = _2; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- switchInt(move _8) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
+ switchInt(move _8) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
}
bb5: {
bb3: {
- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
_10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
}
bb4: {
StorageDead(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_22 = Not(move _23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _22) -> [0: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb3: {
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-- switchInt(move _10) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+- switchInt(move _10) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb1: {
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+- switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- }
-
- bb2: {
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
++ switchInt(move _5) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
- bb6: {
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
++ switchInt(move _5) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
- bb8: {
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
_3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
+ switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
}
bb1: {
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
- goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
+ _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-+ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
++ switchInt(move _8) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
bb2: {
-
- bb4: {
_8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-- switchInt(move _8) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
-+ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+- switchInt(move _8) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
++ switchInt(move _8) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
- bb5: {
}
- bb3: {
-- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+ bb2: {
-+ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
++ switchInt(move _2) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
}
- bb4: {
}
bb3: {
- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+ switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
}
bb4: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
_1 = const false; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
-- switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+- switchInt(const false) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+ goto -> bb3; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
}
StorageDead(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69
StorageDead(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69
_5 = discriminant((_1.0: std::option::Option<u8>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- switchInt(move _5) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
+ switchInt(move _5) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
}
bb1: {
_4 = discriminant((_1.1: std::option::Option<T>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- switchInt(move _4) -> [0_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
+ switchInt(move _4) -> [0: bb2, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
}
bb2: {
- _5 = const false; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
- _5 = const true; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
_2 = discriminant(_1); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:5: +1:12
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:5: +1:12
}
bb1: {
- _1 = _2; // scope 1 at $DIR/simplify_match.rs:+1:28: +1:29
+ _1 = const false; // scope 1 at $DIR/simplify_match.rs:+1:28: +1:29
StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:+1:30: +1:31
-- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
-+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
+- switchInt(_1) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
++ switchInt(const false) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
}
bb1: {
bb4 (cleanup): {
_6 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ switchInt(move _6) -> [0: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb5: {
bb6: {
_8 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ switchInt(move _8) -> [0: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb7: {
bb10 (cleanup): {
_12 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ switchInt(move _12) -> [0: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb11: {
bb12: {
_14 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ switchInt(move _14) -> [0: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb13: {
bb15: {
_2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_3 = Len((*_1)); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _2) -> [0_usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ switchInt(move _2) -> [0: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
}
discriminant(_2) = 1; // scope 1 at $DIR/sroa.rs:+1:22: +1:29
StorageDead(_3); // scope 1 at $DIR/sroa.rs:+1:28: +1:29
_4 = discriminant(_2); // scope 1 at $DIR/sroa.rs:+1:12: +1:19
- switchInt(move _4) -> [1_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/sroa.rs:+1:12: +1:19
+ switchInt(move _4) -> [1: bb1, otherwise: bb2]; // scope 1 at $DIR/sroa.rs:+1:12: +1:19
}
bb1: {
bb0: {
StorageLive(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
_3 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
- switchInt(move _3) -> [0_isize: bb2, 1_isize: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
+ switchInt(move _3) -> [0: bb2, 1: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
}
bb1: {
((_2 as Break).0: E) = move _5; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
discriminant(_2) = 1; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
_6 = discriminant(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
- switchInt(move _6) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
+ switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
}
bb2: {
((_2 as Continue).0: T) = move _4; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
discriminant(_2) = 0; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
_6 = discriminant(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
- switchInt(move _6) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
+ switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
}
bb3: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +2:16
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +2:16
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +2:16
}
bb1: {
Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
_3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+ switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
}
bb1: {
Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
discriminant(_7) = 0; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
_8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- switchInt(move _8) -> [4_isize: bb5, 5_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4: bb5, 5: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
bb2: {
Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
_3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
-- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
-+ switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
++ switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
}
bb1: {
Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
discriminant(_7) = 0; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
_8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- switchInt(move _8) -> [4_isize: bb8, 5_isize: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4: bb8, 5: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
bb6: {
StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- switchInt(move _5) -> [2_isize: bb3, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+ switchInt(move _5) -> [2: bb3, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
}
bb1: {
StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
_10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
- switchInt(move _10) -> [2_isize: bb7, 3_isize: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+ switchInt(move _10) -> [2: bb7, 3: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
}
bb5: {
StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
-- switchInt(move _5) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
-+ switchInt(move _5) -> [2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
++ switchInt(move _5) -> [2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
}
bb1: {
StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
_10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
-- switchInt(move _10) -> [0_isize: bb9, 1_isize: bb10, 2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
-+ switchInt(move _10) -> [2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+- switchInt(move _10) -> [0: bb9, 1: bb10, 2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
++ switchInt(move _10) -> [2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
}
bb7: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12
-- switchInt(move _2) -> [1_isize: bb3, 2_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
-+ switchInt(move _2) -> [1_isize: bb3, 2_isize: bb2, otherwise: bb5]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
+- switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
++ switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb5]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
}
bb1: {
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12
-- switchInt(move _2) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
-+ switchInt(move _2) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
+- switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
++ switchInt(move _2) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
}
bb1: {
bb1: {
_2 = discriminant(_1); // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
-- switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
-+ switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
+- switchInt(move _2) -> [1: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
++ switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
}
bb2: {
- StorageLive(_5); // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
- _6 = const true; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
-- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
+- switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
+ unreachable; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
}
bb1: {
_3 = discriminant(_2); // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
- switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
+ switchInt(move _3) -> [1: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
}
bb2: {
StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
_6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
+ switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
}
bb3: {
Deinit(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
discriminant(_3) = 0; // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
- _4 = discriminant(_3); // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ _4 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-+ switchInt(const 0_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
++ switchInt(const 0_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
}
bb1: {
- switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ switchInt(((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
}
bb2: {
bb2: {
StorageDead(_3); // scope 0 at $DIR/while_storage.rs:+1:21: +1:22
- switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22
+ switchInt(move _2) -> [0: bb7, otherwise: bb3]; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22
}
bb3: {
bb4: {
StorageDead(_5); // scope 0 at $DIR/while_storage.rs:+2:22: +2:23
- switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23
+ switchInt(move _4) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23
}
bb5: {
--> $DIR/doc-cfg.rs:3:7
|
LL | #[doc(cfg(), cfg(foo, bar))]
- | ^^^^^
+ | ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
error: multiple `cfg` predicates are specified
--> $DIR/doc-cfg.rs:3:23
--> $DIR/doc-cfg.rs:7:7
|
LL | #[doc(cfg())]
- | ^^^^^
+ | ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
error: multiple `cfg` predicates are specified
--> $DIR/doc-cfg.rs:8:16
--> $DIR/closure-return-type-must-be-sized.rs:14:19
|
LL | pub fn bar<F: FnOnce() -> R, R: ?Sized>() {}
- | ^^^^^^^^^^^^^ required by this bound in `a::bar`
+ | ^^^^^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:56:5
--> $DIR/closure-return-type-must-be-sized.rs:28:19
|
LL | pub fn bar<F: Fn() -> R, R: ?Sized>() {}
- | ^^^^^^^^^ required by this bound in `b::bar`
+ | ^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:63:5
--> $DIR/closure-return-type-must-be-sized.rs:42:19
|
LL | pub fn bar<F: FnMut() -> R, R: ?Sized>() {}
- | ^^^^^^^^^^^^ required by this bound in `c::bar`
+ | ^^^^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:70:5
--> $DIR/cfg-attr-syntax-validation.rs:7:1
|
LL | #[cfg()]
- | ^^^^^^^^
+ | ^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)`
error: multiple `cfg` predicates are specified
--> $DIR/cfg-attr-syntax-validation.rs:10:10
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:17:5
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:20:19
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:20:5
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:23:5
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:25:5
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:35:19
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:35:5
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:38:19
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:38:5
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:41:5
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:43:5
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
- | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+ | ^^^^^ required by this bound in `assert_impl`
error: aborting due to 12 previous errors
--- /dev/null
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Trait<T> {
+ fn fnc<const N: usize = "">(&self) {} //~ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ fn foo<const N: usize = { std::mem::size_of::<T>() }>(&self) {} //~ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+}
+
+fn main() {}
--- /dev/null
+error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/issue-105257.rs:5:12
+ |
+LL | fn fnc<const N: usize = "">(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/issue-105257.rs:6:12
+ |
+LL | fn foo<const N: usize = { std::mem::size_of::<T>() }>(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
--> $DIR/issue-79518-default_trait_method_normalization.rs:16:32
|
LL | Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]`
+ | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]`
+ | |
+ | expected because this is `<Self as Foo>::Assoc`
|
= note: expected associated type `<Self as Foo>::Assoc`
found array `[(); _]`
--- /dev/null
+// run-pass
+// compile-flags: --edition 2021 -Copt-level=3 -Cdebuginfo=2 -Zmir-opt-level=3
+
+fn main() {
+ TranslatorI.visit_pre();
+}
+
+impl TranslatorI {
+ fn visit_pre(self) {
+ Some(())
+ .map(|_| self.flags())
+ .unwrap_or_else(|| self.flags());
+ }
+}
+
+struct TranslatorI;
+
+impl TranslatorI {
+ fn flags(&self) {}
+}
// compile-flags: --diagnostic-width=60
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
-struct Atype<T, K>(T, K);
-struct Btype<T, K>(T, K);
-struct Ctype<T, K>(T, K);
+mod a {
+ // Force the "short path for unique types" machinery to trip up
+ pub struct Atype;
+ pub struct Btype;
+ pub struct Ctype;
+}
+
+mod b {
+ pub struct Atype<T, K>(T, K);
+ pub struct Btype<T, K>(T, K);
+ pub struct Ctype<T, K>(T, K);
+}
+
+use b::*;
fn main() {
let x: Atype<
error[E0308]: mismatched types
- --> $DIR/long-E0308.rs:33:9
+ --> $DIR/long-E0308.rs:44:9
|
LL | let x: Atype<
| _____________-
the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
error[E0308]: mismatched types
- --> $DIR/long-E0308.rs:46:26
+ --> $DIR/long-E0308.rs:57:26
|
LL | ))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
| __________________________^
the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
error[E0308]: mismatched types
- --> $DIR/long-E0308.rs:77:9
+ --> $DIR/long-E0308.rs:88:9
|
LL | let x: Atype<
| ____________-
found unit type `()`
error[E0308]: mismatched types
- --> $DIR/long-E0308.rs:80:17
+ --> $DIR/long-E0308.rs:91:17
|
LL | let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
| ____________--___^
--> $DIR/disambiguate-identical-names.rs:13:10
|
LL | test(&v);
- | ---- ^^ expected struct `std::vec::Vec`, found struct `HashMap`
+ | ---- ^^ expected struct `Vec`, found struct `HashMap`
| |
| arguments to this function are incorrect
|
--> $DIR/no-implicit-dyn-star.rs:6:48
|
LL | dyn_star_foreign::require_dyn_star_display(1usize);
- | ------------------------------------------ ^^^^^^ expected trait object `dyn std::fmt::Display`, found `usize`
+ | ------------------------------------------ ^^^^^^ expected trait object `dyn Display`, found `usize`
| |
| arguments to this function are incorrect
|
--> $DIR/auxiliary/foo_defn.rs:4:15
|
LL | type Bar: AsRef<()>;
- | ^^^^^^^^^ required by this bound in `foo_defn::Foo::Bar`
+ | ^^^^^^^^^ required by this bound in `Foo::Bar`
error: aborting due to previous error
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [_, 99.., _] => {},
- | ^^ expected struct `std::ops::Range`, found integer
+ | ^^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [_, 99..] => {},
- | ^^ expected struct `std::ops::Range`, found integer
+ | ^^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [..9, 99..100, _] => {},
- | ^ expected struct `std::ops::Range`, found integer
+ | ^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
LL | [..9, 99..100, _] => {},
| ^^ --- this is of type `{integer}`
| |
- | expected struct `std::ops::Range`, found integer
+ | expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [..9, 99..100, _] => {},
- | -- ^^^ expected struct `std::ops::Range`, found integer
+ | -- ^^^ expected struct `Range`, found integer
| |
| this is of type `{integer}`
|
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
| ^^^^^^^^^^^
| |
- | expected struct `a::Bar`, found opaque type
+ | expected struct `Bar`, found opaque type
| help: change the parameter type to match the trait: `&(a::Bar, i32)`
|
= note: expected fn pointer `fn(&a::Bar, &(a::Bar, i32)) -> _`
LL | fn eq(&self, _other: &(Bar, i32)) -> bool {
| ^^^^^^^^^^^
| |
- | expected opaque type, found struct `b::Bar`
+ | expected opaque type, found struct `Bar`
| help: change the parameter type to match the trait: `&(b::Foo, i32)`
|
= note: expected fn pointer `fn(&b::Bar, &(b::Foo, i32)) -> _`
--> $DIR/deref-suggestion.rs:37:5
|
LL | assert_eq!(3i32, &3i32);
- | ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | expected `i32`, found `&i32`
+ | expected because this is `i32`
|
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(B, Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `fold`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::fold`
error: aborting due to previous error
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | Self: Sized + Iterator<Item = &'a T>,
- | ^^^^^^^^^^^^ required by this bound in `cloned`
+ | ^^^^^^^^^^^^ required by this bound in `Iterator::cloned`
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>`, but its trait bounds were not satisfied
--> $DIR/issue-31173.rs:13:10
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | Self: Sized + Iterator<Item = &'a T>,
- | ^^^^^^^^^^^^ required by this bound in `cloned`
+ | ^^^^^^^^^^^^ required by this bound in `Iterator::cloned`
error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:6:14
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors
--> $DIR/issue-47486.rs:2:10
|
LL | () < std::mem::size_of::<_>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
+ | -- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
+ | |
+ | expected because this is `()`
error[E0282]: type annotations needed
--> $DIR/issue-47486.rs:3:11
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
--> $DIR/issue-66923-show-error-for-correct-call.rs:12:14
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to previous error
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^ required by this bound in `collect`
+ | ^ required by this bound in `Iterator::collect`
error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size
--> $DIR/collect-into-slice.rs:6:30
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 3 previous errors
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to previous error
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_`
--> $DIR/recursion4.rs:19:9
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors
LL | let Bar(z) = x;
| ^^^^^^ - this expression has type `&mut irrefutable::Foo`
| |
- | expected struct `irrefutable::Foo`, found struct `irrefutable::Bar`
+ | expected struct `Foo`, found struct `Bar`
error: aborting due to 2 previous errors
| ^^^^^^^^^
...
LL | foo!()
- | ------- help: you might be missing a semicolon here: `;`
- | |
- | caused by the macro expansion here
+ | ------ caused by the macro expansion here
|
= note: the usage of `foo!` is likely invalid in expression context
+help: you might be missing a semicolon here
+ |
+LL | foo!();
+ | +
warning: trailing semicolon in macro used in expression position
--> $DIR/macro-in-expression-context.rs:5:29
--> $DIR/issue-90315.rs:28:8
|
LL | if 1..(end + 1).is_empty() {
- | ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
--> $DIR/issue-90315.rs:34:8
|
LL | if 1..(end + 1).is_sorted() {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
--> $DIR/issue-90315.rs:40:21
|
LL | let _res: i32 = 3..6.take(2).sum();
- | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
+ | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Range`
| |
| expected due to this
|
--> $DIR/issue-90315.rs:45:21
|
LL | let _sum: i32 = 3..6.sum();
- | --- ^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
+ | --- ^^^^^^^^^^ expected `i32`, found struct `Range`
| |
| expected due to this
|
--> $DIR/issue-90315.rs:62:8
|
LL | if 1..end.error_method() {
- | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:27:57
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:29:57
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
--> $DIR/closure-arg-count.rs:32:45
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:35:10
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:4:14
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:5:14
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
- | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error: aborting due to 3 previous errors
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | P: FnMut(&Self::Item) -> bool,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::filter`
error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
--> $DIR/issue-36053-2.rs:7:55
--> $DIR/wrap-suggestion-privacy.rs:22:17
|
LL | needs_ready(Some(0));
- | ----------- ^^^^^^^ expected struct `std::future::Ready`, found enum `Option`
+ | ----------- ^^^^^^^ expected struct `Ready`, found enum `Option`
| |
| arguments to this function are incorrect
|
--> $DIR/numeric-cast-binop.rs:23:16
|
LL | x_u8 > x_u16;
- | ^^^^^ expected `u8`, found `u16`
+ | ---- ^^^^^ expected `u8`, found `u16`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `u16`, matching the type of `x_u16`
|
--> $DIR/numeric-cast-binop.rs:25:16
|
LL | x_u8 > x_u32;
- | ^^^^^ expected `u8`, found `u32`
+ | ---- ^^^^^ expected `u8`, found `u32`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `u32`, matching the type of `x_u32`
|
--> $DIR/numeric-cast-binop.rs:27:16
|
LL | x_u8 > x_u64;
- | ^^^^^ expected `u8`, found `u64`
+ | ---- ^^^^^ expected `u8`, found `u64`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `u64`, matching the type of `x_u64`
|
--> $DIR/numeric-cast-binop.rs:29:16
|
LL | x_u8 > x_u128;
- | ^^^^^^ expected `u8`, found `u128`
+ | ---- ^^^^^^ expected `u8`, found `u128`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `u128`, matching the type of `x_u128`
|
--> $DIR/numeric-cast-binop.rs:31:16
|
LL | x_u8 > x_usize;
- | ^^^^^^^ expected `u8`, found `usize`
+ | ---- ^^^^^^^ expected `u8`, found `usize`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `usize`, matching the type of `x_usize`
|
--> $DIR/numeric-cast-binop.rs:34:17
|
LL | x_u16 > x_u8;
- | ^^^^ expected `u16`, found `u8`
+ | ----- ^^^^ expected `u16`, found `u8`
+ | |
+ | expected because this is `u16`
|
help: you can convert a `u8` to a `u16`
|
--> $DIR/numeric-cast-binop.rs:36:17
|
LL | x_u16 > x_u32;
- | ^^^^^ expected `u16`, found `u32`
+ | ----- ^^^^^ expected `u16`, found `u32`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `u32`, matching the type of `x_u32`
|
--> $DIR/numeric-cast-binop.rs:38:17
|
LL | x_u16 > x_u64;
- | ^^^^^ expected `u16`, found `u64`
+ | ----- ^^^^^ expected `u16`, found `u64`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `u64`, matching the type of `x_u64`
|
--> $DIR/numeric-cast-binop.rs:40:17
|
LL | x_u16 > x_u128;
- | ^^^^^^ expected `u16`, found `u128`
+ | ----- ^^^^^^ expected `u16`, found `u128`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `u128`, matching the type of `x_u128`
|
--> $DIR/numeric-cast-binop.rs:42:17
|
LL | x_u16 > x_usize;
- | ^^^^^^^ expected `u16`, found `usize`
+ | ----- ^^^^^^^ expected `u16`, found `usize`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `usize`, matching the type of `x_usize`
|
--> $DIR/numeric-cast-binop.rs:45:17
|
LL | x_u32 > x_u8;
- | ^^^^ expected `u32`, found `u8`
+ | ----- ^^^^ expected `u32`, found `u8`
+ | |
+ | expected because this is `u32`
|
help: you can convert a `u8` to a `u32`
|
--> $DIR/numeric-cast-binop.rs:47:17
|
LL | x_u32 > x_u16;
- | ^^^^^ expected `u32`, found `u16`
+ | ----- ^^^^^ expected `u32`, found `u16`
+ | |
+ | expected because this is `u32`
|
help: you can convert a `u16` to a `u32`
|
--> $DIR/numeric-cast-binop.rs:49:17
|
LL | x_u32 > x_u64;
- | ^^^^^ expected `u32`, found `u64`
+ | ----- ^^^^^ expected `u32`, found `u64`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `u64`, matching the type of `x_u64`
|
--> $DIR/numeric-cast-binop.rs:51:17
|
LL | x_u32 > x_u128;
- | ^^^^^^ expected `u32`, found `u128`
+ | ----- ^^^^^^ expected `u32`, found `u128`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `u128`, matching the type of `x_u128`
|
--> $DIR/numeric-cast-binop.rs:53:17
|
LL | x_u32 > x_usize;
- | ^^^^^^^ expected `u32`, found `usize`
+ | ----- ^^^^^^^ expected `u32`, found `usize`
+ | |
+ | expected because this is `u32`
|
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:56:17
|
LL | x_u64 > x_u8;
- | ^^^^ expected `u64`, found `u8`
+ | ----- ^^^^ expected `u64`, found `u8`
+ | |
+ | expected because this is `u64`
|
help: you can convert a `u8` to a `u64`
|
--> $DIR/numeric-cast-binop.rs:58:17
|
LL | x_u64 > x_u16;
- | ^^^^^ expected `u64`, found `u16`
+ | ----- ^^^^^ expected `u64`, found `u16`
+ | |
+ | expected because this is `u64`
|
help: you can convert a `u16` to a `u64`
|
--> $DIR/numeric-cast-binop.rs:60:17
|
LL | x_u64 > x_u32;
- | ^^^^^ expected `u64`, found `u32`
+ | ----- ^^^^^ expected `u64`, found `u32`
+ | |
+ | expected because this is `u64`
|
help: you can convert a `u32` to a `u64`
|
--> $DIR/numeric-cast-binop.rs:62:17
|
LL | x_u64 > x_u128;
- | ^^^^^^ expected `u64`, found `u128`
+ | ----- ^^^^^^ expected `u64`, found `u128`
+ | |
+ | expected because this is `u64`
|
help: you can convert `x_u64` from `u64` to `u128`, matching the type of `x_u128`
|
--> $DIR/numeric-cast-binop.rs:64:17
|
LL | x_u64 > x_usize;
- | ^^^^^^^ expected `u64`, found `usize`
+ | ----- ^^^^^^^ expected `u64`, found `usize`
+ | |
+ | expected because this is `u64`
|
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:67:18
|
LL | x_u128 > x_u8;
- | ^^^^ expected `u128`, found `u8`
+ | ------ ^^^^ expected `u128`, found `u8`
+ | |
+ | expected because this is `u128`
|
help: you can convert a `u8` to a `u128`
|
--> $DIR/numeric-cast-binop.rs:69:18
|
LL | x_u128 > x_u16;
- | ^^^^^ expected `u128`, found `u16`
+ | ------ ^^^^^ expected `u128`, found `u16`
+ | |
+ | expected because this is `u128`
|
help: you can convert a `u16` to a `u128`
|
--> $DIR/numeric-cast-binop.rs:71:18
|
LL | x_u128 > x_u32;
- | ^^^^^ expected `u128`, found `u32`
+ | ------ ^^^^^ expected `u128`, found `u32`
+ | |
+ | expected because this is `u128`
|
help: you can convert a `u32` to a `u128`
|
--> $DIR/numeric-cast-binop.rs:73:18
|
LL | x_u128 > x_u64;
- | ^^^^^ expected `u128`, found `u64`
+ | ------ ^^^^^ expected `u128`, found `u64`
+ | |
+ | expected because this is `u128`
|
help: you can convert a `u64` to a `u128`
|
--> $DIR/numeric-cast-binop.rs:75:18
|
LL | x_u128 > x_usize;
- | ^^^^^^^ expected `u128`, found `usize`
+ | ------ ^^^^^^^ expected `u128`, found `usize`
+ | |
+ | expected because this is `u128`
|
help: you can convert a `usize` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:78:19
|
LL | x_usize > x_u8;
- | ^^^^ expected `usize`, found `u8`
+ | ------- ^^^^ expected `usize`, found `u8`
+ | |
+ | expected because this is `usize`
|
help: you can convert a `u8` to a `usize`
|
--> $DIR/numeric-cast-binop.rs:80:19
|
LL | x_usize > x_u16;
- | ^^^^^ expected `usize`, found `u16`
+ | ------- ^^^^^ expected `usize`, found `u16`
+ | |
+ | expected because this is `usize`
|
help: you can convert a `u16` to a `usize`
|
--> $DIR/numeric-cast-binop.rs:82:19
|
LL | x_usize > x_u32;
- | ^^^^^ expected `usize`, found `u32`
+ | ------- ^^^^^ expected `usize`, found `u32`
+ | |
+ | expected because this is `usize`
|
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:84:19
|
LL | x_usize > x_u64;
- | ^^^^^ expected `usize`, found `u64`
+ | ------- ^^^^^ expected `usize`, found `u64`
+ | |
+ | expected because this is `usize`
|
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:86:19
|
LL | x_usize > x_u128;
- | ^^^^^^ expected `usize`, found `u128`
+ | ------- ^^^^^^ expected `usize`, found `u128`
+ | |
+ | expected because this is `usize`
|
help: you can convert a `u128` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:92:16
|
LL | x_i8 > x_i16;
- | ^^^^^ expected `i8`, found `i16`
+ | ---- ^^^^^ expected `i8`, found `i16`
+ | |
+ | expected because this is `i8`
|
help: you can convert `x_i8` from `i8` to `i16`, matching the type of `x_i16`
|
--> $DIR/numeric-cast-binop.rs:94:16
|
LL | x_i8 > x_i32;
- | ^^^^^ expected `i8`, found `i32`
+ | ---- ^^^^^ expected `i8`, found `i32`
+ | |
+ | expected because this is `i8`
|
help: you can convert `x_i8` from `i8` to `i32`, matching the type of `x_i32`
|
--> $DIR/numeric-cast-binop.rs:96:16
|
LL | x_i8 > x_i64;
- | ^^^^^ expected `i8`, found `i64`
+ | ---- ^^^^^ expected `i8`, found `i64`
+ | |
+ | expected because this is `i8`
|
help: you can convert `x_i8` from `i8` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:98:16
|
LL | x_i8 > x_i128;
- | ^^^^^^ expected `i8`, found `i128`
+ | ---- ^^^^^^ expected `i8`, found `i128`
+ | |
+ | expected because this is `i8`
|
help: you can convert `x_i8` from `i8` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:100:16
|
LL | x_i8 > x_isize;
- | ^^^^^^^ expected `i8`, found `isize`
+ | ---- ^^^^^^^ expected `i8`, found `isize`
+ | |
+ | expected because this is `i8`
|
help: you can convert `x_i8` from `i8` to `isize`, matching the type of `x_isize`
|
--> $DIR/numeric-cast-binop.rs:103:17
|
LL | x_i16 > x_i8;
- | ^^^^ expected `i16`, found `i8`
+ | ----- ^^^^ expected `i16`, found `i8`
+ | |
+ | expected because this is `i16`
|
help: you can convert an `i8` to an `i16`
|
--> $DIR/numeric-cast-binop.rs:105:17
|
LL | x_i16 > x_i32;
- | ^^^^^ expected `i16`, found `i32`
+ | ----- ^^^^^ expected `i16`, found `i32`
+ | |
+ | expected because this is `i16`
|
help: you can convert `x_i16` from `i16` to `i32`, matching the type of `x_i32`
|
--> $DIR/numeric-cast-binop.rs:107:17
|
LL | x_i16 > x_i64;
- | ^^^^^ expected `i16`, found `i64`
+ | ----- ^^^^^ expected `i16`, found `i64`
+ | |
+ | expected because this is `i16`
|
help: you can convert `x_i16` from `i16` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:109:17
|
LL | x_i16 > x_i128;
- | ^^^^^^ expected `i16`, found `i128`
+ | ----- ^^^^^^ expected `i16`, found `i128`
+ | |
+ | expected because this is `i16`
|
help: you can convert `x_i16` from `i16` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:111:17
|
LL | x_i16 > x_isize;
- | ^^^^^^^ expected `i16`, found `isize`
+ | ----- ^^^^^^^ expected `i16`, found `isize`
+ | |
+ | expected because this is `i16`
|
help: you can convert `x_i16` from `i16` to `isize`, matching the type of `x_isize`
|
--> $DIR/numeric-cast-binop.rs:114:17
|
LL | x_i32 > x_i8;
- | ^^^^ expected `i32`, found `i8`
+ | ----- ^^^^ expected `i32`, found `i8`
+ | |
+ | expected because this is `i32`
|
help: you can convert an `i8` to an `i32`
|
--> $DIR/numeric-cast-binop.rs:116:17
|
LL | x_i32 > x_i16;
- | ^^^^^ expected `i32`, found `i16`
+ | ----- ^^^^^ expected `i32`, found `i16`
+ | |
+ | expected because this is `i32`
|
help: you can convert an `i16` to an `i32`
|
--> $DIR/numeric-cast-binop.rs:118:17
|
LL | x_i32 > x_i64;
- | ^^^^^ expected `i32`, found `i64`
+ | ----- ^^^^^ expected `i32`, found `i64`
+ | |
+ | expected because this is `i32`
|
help: you can convert `x_i32` from `i32` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:120:17
|
LL | x_i32 > x_i128;
- | ^^^^^^ expected `i32`, found `i128`
+ | ----- ^^^^^^ expected `i32`, found `i128`
+ | |
+ | expected because this is `i32`
|
help: you can convert `x_i32` from `i32` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:122:17
|
LL | x_i32 > x_isize;
- | ^^^^^^^ expected `i32`, found `isize`
+ | ----- ^^^^^^^ expected `i32`, found `isize`
+ | |
+ | expected because this is `i32`
|
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:125:17
|
LL | x_i64 > x_i8;
- | ^^^^ expected `i64`, found `i8`
+ | ----- ^^^^ expected `i64`, found `i8`
+ | |
+ | expected because this is `i64`
|
help: you can convert an `i8` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:127:17
|
LL | x_i64 > x_i16;
- | ^^^^^ expected `i64`, found `i16`
+ | ----- ^^^^^ expected `i64`, found `i16`
+ | |
+ | expected because this is `i64`
|
help: you can convert an `i16` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:129:17
|
LL | x_i64 > x_i32;
- | ^^^^^ expected `i64`, found `i32`
+ | ----- ^^^^^ expected `i64`, found `i32`
+ | |
+ | expected because this is `i64`
|
help: you can convert an `i32` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:131:17
|
LL | x_i64 > x_i128;
- | ^^^^^^ expected `i64`, found `i128`
+ | ----- ^^^^^^ expected `i64`, found `i128`
+ | |
+ | expected because this is `i64`
|
help: you can convert `x_i64` from `i64` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:133:17
|
LL | x_i64 > x_isize;
- | ^^^^^^^ expected `i64`, found `isize`
+ | ----- ^^^^^^^ expected `i64`, found `isize`
+ | |
+ | expected because this is `i64`
|
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:136:18
|
LL | x_i128 > x_i8;
- | ^^^^ expected `i128`, found `i8`
+ | ------ ^^^^ expected `i128`, found `i8`
+ | |
+ | expected because this is `i128`
|
help: you can convert an `i8` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:138:18
|
LL | x_i128 > x_i16;
- | ^^^^^ expected `i128`, found `i16`
+ | ------ ^^^^^ expected `i128`, found `i16`
+ | |
+ | expected because this is `i128`
|
help: you can convert an `i16` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:140:18
|
LL | x_i128 > x_i32;
- | ^^^^^ expected `i128`, found `i32`
+ | ------ ^^^^^ expected `i128`, found `i32`
+ | |
+ | expected because this is `i128`
|
help: you can convert an `i32` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:142:18
|
LL | x_i128 > x_i64;
- | ^^^^^ expected `i128`, found `i64`
+ | ------ ^^^^^ expected `i128`, found `i64`
+ | |
+ | expected because this is `i128`
|
help: you can convert an `i64` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:144:18
|
LL | x_i128 > x_isize;
- | ^^^^^^^ expected `i128`, found `isize`
+ | ------ ^^^^^^^ expected `i128`, found `isize`
+ | |
+ | expected because this is `i128`
|
help: you can convert an `isize` to an `i128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:147:19
|
LL | x_isize > x_i8;
- | ^^^^ expected `isize`, found `i8`
+ | ------- ^^^^ expected `isize`, found `i8`
+ | |
+ | expected because this is `isize`
|
help: you can convert an `i8` to an `isize`
|
--> $DIR/numeric-cast-binop.rs:149:19
|
LL | x_isize > x_i16;
- | ^^^^^ expected `isize`, found `i16`
+ | ------- ^^^^^ expected `isize`, found `i16`
+ | |
+ | expected because this is `isize`
|
help: you can convert an `i16` to an `isize`
|
--> $DIR/numeric-cast-binop.rs:151:19
|
LL | x_isize > x_i32;
- | ^^^^^ expected `isize`, found `i32`
+ | ------- ^^^^^ expected `isize`, found `i32`
+ | |
+ | expected because this is `isize`
|
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:153:19
|
LL | x_isize > x_i64;
- | ^^^^^ expected `isize`, found `i64`
+ | ------- ^^^^^ expected `isize`, found `i64`
+ | |
+ | expected because this is `isize`
|
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:155:19
|
LL | x_isize > x_i128;
- | ^^^^^^ expected `isize`, found `i128`
+ | ------- ^^^^^^ expected `isize`, found `i128`
+ | |
+ | expected because this is `isize`
|
help: you can convert an `i128` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:161:16
|
LL | x_u8 > x_i8;
- | ^^^^ expected `u8`, found `i8`
+ | ---- ^^^^ expected `u8`, found `i8`
+ | |
+ | expected because this is `u8`
|
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:163:16
|
LL | x_u8 > x_i16;
- | ^^^^^ expected `u8`, found `i16`
+ | ---- ^^^^^ expected `u8`, found `i16`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `x_i16`
|
--> $DIR/numeric-cast-binop.rs:165:16
|
LL | x_u8 > x_i32;
- | ^^^^^ expected `u8`, found `i32`
+ | ---- ^^^^^ expected `u8`, found `i32`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `x_i32`
|
--> $DIR/numeric-cast-binop.rs:167:16
|
LL | x_u8 > x_i64;
- | ^^^^^ expected `u8`, found `i64`
+ | ---- ^^^^^ expected `u8`, found `i64`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:169:16
|
LL | x_u8 > x_i128;
- | ^^^^^^ expected `u8`, found `i128`
+ | ---- ^^^^^^ expected `u8`, found `i128`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:171:16
|
LL | x_u8 > x_isize;
- | ^^^^^^^ expected `u8`, found `isize`
+ | ---- ^^^^^^^ expected `u8`, found `isize`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `x_isize`
|
--> $DIR/numeric-cast-binop.rs:174:17
|
LL | x_u16 > x_i8;
- | ^^^^ expected `u16`, found `i8`
+ | ----- ^^^^ expected `u16`, found `i8`
+ | |
+ | expected because this is `u16`
|
help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:176:17
|
LL | x_u16 > x_i16;
- | ^^^^^ expected `u16`, found `i16`
+ | ----- ^^^^^ expected `u16`, found `i16`
+ | |
+ | expected because this is `u16`
|
help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:178:17
|
LL | x_u16 > x_i32;
- | ^^^^^ expected `u16`, found `i32`
+ | ----- ^^^^^ expected `u16`, found `i32`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `x_i32`
|
--> $DIR/numeric-cast-binop.rs:180:17
|
LL | x_u16 > x_i64;
- | ^^^^^ expected `u16`, found `i64`
+ | ----- ^^^^^ expected `u16`, found `i64`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:182:17
|
LL | x_u16 > x_i128;
- | ^^^^^^ expected `u16`, found `i128`
+ | ----- ^^^^^^ expected `u16`, found `i128`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:184:17
|
LL | x_u16 > x_isize;
- | ^^^^^^^ expected `u16`, found `isize`
+ | ----- ^^^^^^^ expected `u16`, found `isize`
+ | |
+ | expected because this is `u16`
|
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:187:17
|
LL | x_u32 > x_i8;
- | ^^^^ expected `u32`, found `i8`
+ | ----- ^^^^ expected `u32`, found `i8`
+ | |
+ | expected because this is `u32`
|
help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:189:17
|
LL | x_u32 > x_i16;
- | ^^^^^ expected `u32`, found `i16`
+ | ----- ^^^^^ expected `u32`, found `i16`
+ | |
+ | expected because this is `u32`
|
help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:191:17
|
LL | x_u32 > x_i32;
- | ^^^^^ expected `u32`, found `i32`
+ | ----- ^^^^^ expected `u32`, found `i32`
+ | |
+ | expected because this is `u32`
|
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:193:17
|
LL | x_u32 > x_i64;
- | ^^^^^ expected `u32`, found `i64`
+ | ----- ^^^^^ expected `u32`, found `i64`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `x_i64`
|
--> $DIR/numeric-cast-binop.rs:195:17
|
LL | x_u32 > x_i128;
- | ^^^^^^ expected `u32`, found `i128`
+ | ----- ^^^^^^ expected `u32`, found `i128`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:197:17
|
LL | x_u32 > x_isize;
- | ^^^^^^^ expected `u32`, found `isize`
+ | ----- ^^^^^^^ expected `u32`, found `isize`
+ | |
+ | expected because this is `u32`
|
help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:200:17
|
LL | x_u64 > x_i8;
- | ^^^^ expected `u64`, found `i8`
+ | ----- ^^^^ expected `u64`, found `i8`
+ | |
+ | expected because this is `u64`
|
help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:202:17
|
LL | x_u64 > x_i16;
- | ^^^^^ expected `u64`, found `i16`
+ | ----- ^^^^^ expected `u64`, found `i16`
+ | |
+ | expected because this is `u64`
|
help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:204:17
|
LL | x_u64 > x_i32;
- | ^^^^^ expected `u64`, found `i32`
+ | ----- ^^^^^ expected `u64`, found `i32`
+ | |
+ | expected because this is `u64`
|
help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:206:17
|
LL | x_u64 > x_i64;
- | ^^^^^ expected `u64`, found `i64`
+ | ----- ^^^^^ expected `u64`, found `i64`
+ | |
+ | expected because this is `u64`
|
help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:208:17
|
LL | x_u64 > x_i128;
- | ^^^^^^ expected `u64`, found `i128`
+ | ----- ^^^^^^ expected `u64`, found `i128`
+ | |
+ | expected because this is `u64`
|
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `x_i128`
|
--> $DIR/numeric-cast-binop.rs:210:17
|
LL | x_u64 > x_isize;
- | ^^^^^^^ expected `u64`, found `isize`
+ | ----- ^^^^^^^ expected `u64`, found `isize`
+ | |
+ | expected because this is `u64`
|
help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:213:18
|
LL | x_u128 > x_i8;
- | ^^^^ expected `u128`, found `i8`
+ | ------ ^^^^ expected `u128`, found `i8`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `i8` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:215:18
|
LL | x_u128 > x_i16;
- | ^^^^^ expected `u128`, found `i16`
+ | ------ ^^^^^ expected `u128`, found `i16`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `i16` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:217:18
|
LL | x_u128 > x_i32;
- | ^^^^^ expected `u128`, found `i32`
+ | ------ ^^^^^ expected `u128`, found `i32`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `i32` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:219:18
|
LL | x_u128 > x_i64;
- | ^^^^^ expected `u128`, found `i64`
+ | ------ ^^^^^ expected `u128`, found `i64`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `i64` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:221:18
|
LL | x_u128 > x_i128;
- | ^^^^^^ expected `u128`, found `i128`
+ | ------ ^^^^^^ expected `u128`, found `i128`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `i128` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:223:18
|
LL | x_u128 > x_isize;
- | ^^^^^^^ expected `u128`, found `isize`
+ | ------ ^^^^^^^ expected `u128`, found `isize`
+ | |
+ | expected because this is `u128`
|
help: you can convert an `isize` to a `u128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:226:19
|
LL | x_usize > x_i8;
- | ^^^^ expected `usize`, found `i8`
+ | ------- ^^^^ expected `usize`, found `i8`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:228:19
|
LL | x_usize > x_i16;
- | ^^^^^ expected `usize`, found `i16`
+ | ------- ^^^^^ expected `usize`, found `i16`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:230:19
|
LL | x_usize > x_i32;
- | ^^^^^ expected `usize`, found `i32`
+ | ------- ^^^^^ expected `usize`, found `i32`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:232:19
|
LL | x_usize > x_i64;
- | ^^^^^ expected `usize`, found `i64`
+ | ------- ^^^^^ expected `usize`, found `i64`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:234:19
|
LL | x_usize > x_i128;
- | ^^^^^^ expected `usize`, found `i128`
+ | ------- ^^^^^^ expected `usize`, found `i128`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `i128` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:236:19
|
LL | x_usize > x_isize;
- | ^^^^^^^ expected `usize`, found `isize`
+ | ------- ^^^^^^^ expected `usize`, found `isize`
+ | |
+ | expected because this is `usize`
|
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:242:16
|
LL | x_i8 > x_u8;
- | ^^^^ expected `i8`, found `u8`
+ | ---- ^^^^ expected `i8`, found `u8`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:244:16
|
LL | x_i8 > x_u16;
- | ^^^^^ expected `i8`, found `u16`
+ | ---- ^^^^^ expected `i8`, found `u16`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:246:16
|
LL | x_i8 > x_u32;
- | ^^^^^ expected `i8`, found `u32`
+ | ---- ^^^^^ expected `i8`, found `u32`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:248:16
|
LL | x_i8 > x_u64;
- | ^^^^^ expected `i8`, found `u64`
+ | ---- ^^^^^ expected `i8`, found `u64`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:250:16
|
LL | x_i8 > x_u128;
- | ^^^^^^ expected `i8`, found `u128`
+ | ---- ^^^^^^ expected `i8`, found `u128`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `u128` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:252:16
|
LL | x_i8 > x_usize;
- | ^^^^^^^ expected `i8`, found `usize`
+ | ---- ^^^^^^^ expected `i8`, found `usize`
+ | |
+ | expected because this is `i8`
|
help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:255:17
|
LL | x_i16 > x_u8;
- | ^^^^ expected `i16`, found `u8`
+ | ----- ^^^^ expected `i16`, found `u8`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `u8` to an `i16`
|
--> $DIR/numeric-cast-binop.rs:257:17
|
LL | x_i16 > x_u16;
- | ^^^^^ expected `i16`, found `u16`
+ | ----- ^^^^^ expected `i16`, found `u16`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:259:17
|
LL | x_i16 > x_u32;
- | ^^^^^ expected `i16`, found `u32`
+ | ----- ^^^^^ expected `i16`, found `u32`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:261:17
|
LL | x_i16 > x_u64;
- | ^^^^^ expected `i16`, found `u64`
+ | ----- ^^^^^ expected `i16`, found `u64`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:263:17
|
LL | x_i16 > x_u128;
- | ^^^^^^ expected `i16`, found `u128`
+ | ----- ^^^^^^ expected `i16`, found `u128`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `u128` to an `i16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:265:17
|
LL | x_i16 > x_usize;
- | ^^^^^^^ expected `i16`, found `usize`
+ | ----- ^^^^^^^ expected `i16`, found `usize`
+ | |
+ | expected because this is `i16`
|
help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:268:17
|
LL | x_i32 > x_u8;
- | ^^^^ expected `i32`, found `u8`
+ | ----- ^^^^ expected `i32`, found `u8`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `u8` to an `i32`
|
--> $DIR/numeric-cast-binop.rs:270:17
|
LL | x_i32 > x_u16;
- | ^^^^^ expected `i32`, found `u16`
+ | ----- ^^^^^ expected `i32`, found `u16`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `u16` to an `i32`
|
--> $DIR/numeric-cast-binop.rs:272:17
|
LL | x_i32 > x_u32;
- | ^^^^^ expected `i32`, found `u32`
+ | ----- ^^^^^ expected `i32`, found `u32`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:274:17
|
LL | x_i32 > x_u64;
- | ^^^^^ expected `i32`, found `u64`
+ | ----- ^^^^^ expected `i32`, found `u64`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:276:17
|
LL | x_i32 > x_u128;
- | ^^^^^^ expected `i32`, found `u128`
+ | ----- ^^^^^^ expected `i32`, found `u128`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `u128` to an `i32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:278:17
|
LL | x_i32 > x_usize;
- | ^^^^^^^ expected `i32`, found `usize`
+ | ----- ^^^^^^^ expected `i32`, found `usize`
+ | |
+ | expected because this is `i32`
|
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:281:17
|
LL | x_i64 > x_u8;
- | ^^^^ expected `i64`, found `u8`
+ | ----- ^^^^ expected `i64`, found `u8`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `u8` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:283:17
|
LL | x_i64 > x_u16;
- | ^^^^^ expected `i64`, found `u16`
+ | ----- ^^^^^ expected `i64`, found `u16`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `u16` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:285:17
|
LL | x_i64 > x_u32;
- | ^^^^^ expected `i64`, found `u32`
+ | ----- ^^^^^ expected `i64`, found `u32`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `u32` to an `i64`
|
--> $DIR/numeric-cast-binop.rs:287:17
|
LL | x_i64 > x_u64;
- | ^^^^^ expected `i64`, found `u64`
+ | ----- ^^^^^ expected `i64`, found `u64`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:289:17
|
LL | x_i64 > x_u128;
- | ^^^^^^ expected `i64`, found `u128`
+ | ----- ^^^^^^ expected `i64`, found `u128`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `u128` to an `i64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:291:17
|
LL | x_i64 > x_usize;
- | ^^^^^^^ expected `i64`, found `usize`
+ | ----- ^^^^^^^ expected `i64`, found `usize`
+ | |
+ | expected because this is `i64`
|
help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:294:18
|
LL | x_i128 > x_u8;
- | ^^^^ expected `i128`, found `u8`
+ | ------ ^^^^ expected `i128`, found `u8`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `u8` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:296:18
|
LL | x_i128 > x_u16;
- | ^^^^^ expected `i128`, found `u16`
+ | ------ ^^^^^ expected `i128`, found `u16`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `u16` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:298:18
|
LL | x_i128 > x_u32;
- | ^^^^^ expected `i128`, found `u32`
+ | ------ ^^^^^ expected `i128`, found `u32`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `u32` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:300:18
|
LL | x_i128 > x_u64;
- | ^^^^^ expected `i128`, found `u64`
+ | ------ ^^^^^ expected `i128`, found `u64`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `u64` to an `i128`
|
--> $DIR/numeric-cast-binop.rs:302:18
|
LL | x_i128 > x_u128;
- | ^^^^^^ expected `i128`, found `u128`
+ | ------ ^^^^^^ expected `i128`, found `u128`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `u128` to an `i128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:304:18
|
LL | x_i128 > x_usize;
- | ^^^^^^^ expected `i128`, found `usize`
+ | ------ ^^^^^^^ expected `i128`, found `usize`
+ | |
+ | expected because this is `i128`
|
help: you can convert a `usize` to an `i128` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:307:19
|
LL | x_isize > x_u8;
- | ^^^^ expected `isize`, found `u8`
+ | ------- ^^^^ expected `isize`, found `u8`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `u8` to an `isize`
|
--> $DIR/numeric-cast-binop.rs:309:19
|
LL | x_isize > x_u16;
- | ^^^^^ expected `isize`, found `u16`
+ | ------- ^^^^^ expected `isize`, found `u16`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:311:19
|
LL | x_isize > x_u32;
- | ^^^^^ expected `isize`, found `u32`
+ | ------- ^^^^^ expected `isize`, found `u32`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:313:19
|
LL | x_isize > x_u64;
- | ^^^^^ expected `isize`, found `u64`
+ | ------- ^^^^^ expected `isize`, found `u64`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:315:19
|
LL | x_isize > x_u128;
- | ^^^^^^ expected `isize`, found `u128`
+ | ------- ^^^^^^ expected `isize`, found `u128`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `u128` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-binop.rs:317:19
|
LL | x_isize > x_usize;
- | ^^^^^^^ expected `isize`, found `usize`
+ | ------- ^^^^^^^ expected `isize`, found `usize`
+ | |
+ | expected because this is `isize`
|
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
--> $DIR/numeric-cast-no-fix.rs:10:15
|
LL | x_usize > -1_isize;
- | ^^^^^^^^ expected `usize`, found `isize`
+ | ------- ^^^^^^^^ expected `usize`, found `isize`
+ | |
+ | expected because this is `usize`
|
= note: `-1_isize` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:12:14
|
LL | x_u128 > -1_isize;
- | ^^^^^^^^ expected `u128`, found `isize`
+ | ------ ^^^^^^^^ expected `u128`, found `isize`
+ | |
+ | expected because this is `u128`
|
= note: `-1_isize` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:14:13
|
LL | x_u64 > -1_isize;
- | ^^^^^^^^ expected `u64`, found `isize`
+ | ----- ^^^^^^^^ expected `u64`, found `isize`
+ | |
+ | expected because this is `u64`
|
= note: `-1_isize` cannot fit into type `u64`
--> $DIR/numeric-cast-no-fix.rs:16:13
|
LL | x_u32 > -1_isize;
- | ^^^^^^^^ expected `u32`, found `isize`
+ | ----- ^^^^^^^^ expected `u32`, found `isize`
+ | |
+ | expected because this is `u32`
|
= note: `-1_isize` cannot fit into type `u32`
--> $DIR/numeric-cast-no-fix.rs:18:13
|
LL | x_u16 > -1_isize;
- | ^^^^^^^^ expected `u16`, found `isize`
+ | ----- ^^^^^^^^ expected `u16`, found `isize`
+ | |
+ | expected because this is `u16`
|
= note: `-1_isize` cannot fit into type `u16`
--> $DIR/numeric-cast-no-fix.rs:20:12
|
LL | x_u8 > -1_isize;
- | ^^^^^^^^ expected `u8`, found `isize`
+ | ---- ^^^^^^^^ expected `u8`, found `isize`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `-1_isize`
|
--> $DIR/numeric-cast-no-fix.rs:23:15
|
LL | x_usize > -1_i128;
- | ^^^^^^^ expected `usize`, found `i128`
+ | ------- ^^^^^^^ expected `usize`, found `i128`
+ | |
+ | expected because this is `usize`
|
= note: `-1_i128` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:25:14
|
LL | x_u128 > -1_i128;
- | ^^^^^^^ expected `u128`, found `i128`
+ | ------ ^^^^^^^ expected `u128`, found `i128`
+ | |
+ | expected because this is `u128`
|
= note: `-1_i128` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:27:13
|
LL | x_u64 > -1_i128;
- | ^^^^^^^ expected `u64`, found `i128`
+ | ----- ^^^^^^^ expected `u64`, found `i128`
+ | |
+ | expected because this is `u64`
|
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `-1_i128`
|
--> $DIR/numeric-cast-no-fix.rs:29:13
|
LL | x_u32 > -1_i128;
- | ^^^^^^^ expected `u32`, found `i128`
+ | ----- ^^^^^^^ expected `u32`, found `i128`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `-1_i128`
|
--> $DIR/numeric-cast-no-fix.rs:31:13
|
LL | x_u16 > -1_i128;
- | ^^^^^^^ expected `u16`, found `i128`
+ | ----- ^^^^^^^ expected `u16`, found `i128`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `-1_i128`
|
--> $DIR/numeric-cast-no-fix.rs:33:12
|
LL | x_u8 > -1_i128;
- | ^^^^^^^ expected `u8`, found `i128`
+ | ---- ^^^^^^^ expected `u8`, found `i128`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `-1_i128`
|
--> $DIR/numeric-cast-no-fix.rs:36:15
|
LL | x_usize > -1_i64;
- | ^^^^^^ expected `usize`, found `i64`
+ | ------- ^^^^^^ expected `usize`, found `i64`
+ | |
+ | expected because this is `usize`
|
= note: `-1_i64` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:38:14
|
LL | x_u128 > -1_i64;
- | ^^^^^^ expected `u128`, found `i64`
+ | ------ ^^^^^^ expected `u128`, found `i64`
+ | |
+ | expected because this is `u128`
|
= note: `-1_i64` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:40:13
|
LL | x_u64 > -1_i64;
- | ^^^^^^ expected `u64`, found `i64`
+ | ----- ^^^^^^ expected `u64`, found `i64`
+ | |
+ | expected because this is `u64`
|
= note: `-1_i64` cannot fit into type `u64`
--> $DIR/numeric-cast-no-fix.rs:42:13
|
LL | x_u32 > -1_i64;
- | ^^^^^^ expected `u32`, found `i64`
+ | ----- ^^^^^^ expected `u32`, found `i64`
+ | |
+ | expected because this is `u32`
|
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `-1_i64`
|
--> $DIR/numeric-cast-no-fix.rs:44:13
|
LL | x_u16 > -1_i64;
- | ^^^^^^ expected `u16`, found `i64`
+ | ----- ^^^^^^ expected `u16`, found `i64`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `-1_i64`
|
--> $DIR/numeric-cast-no-fix.rs:46:12
|
LL | x_u8 > -1_i64;
- | ^^^^^^ expected `u8`, found `i64`
+ | ---- ^^^^^^ expected `u8`, found `i64`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `-1_i64`
|
--> $DIR/numeric-cast-no-fix.rs:49:15
|
LL | x_usize > -1_i32;
- | ^^^^^^ expected `usize`, found `i32`
+ | ------- ^^^^^^ expected `usize`, found `i32`
+ | |
+ | expected because this is `usize`
|
= note: `-1_i32` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:51:14
|
LL | x_u128 > -1_i32;
- | ^^^^^^ expected `u128`, found `i32`
+ | ------ ^^^^^^ expected `u128`, found `i32`
+ | |
+ | expected because this is `u128`
|
= note: `-1_i32` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:53:13
|
LL | x_u64 > -1_i32;
- | ^^^^^^ expected `u64`, found `i32`
+ | ----- ^^^^^^ expected `u64`, found `i32`
+ | |
+ | expected because this is `u64`
|
= note: `-1_i32` cannot fit into type `u64`
--> $DIR/numeric-cast-no-fix.rs:55:13
|
LL | x_u32 > -1_i32;
- | ^^^^^^ expected `u32`, found `i32`
+ | ----- ^^^^^^ expected `u32`, found `i32`
+ | |
+ | expected because this is `u32`
|
= note: `-1_i32` cannot fit into type `u32`
--> $DIR/numeric-cast-no-fix.rs:57:13
|
LL | x_u16 > -1_i32;
- | ^^^^^^ expected `u16`, found `i32`
+ | ----- ^^^^^^ expected `u16`, found `i32`
+ | |
+ | expected because this is `u16`
|
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `-1_i32`
|
--> $DIR/numeric-cast-no-fix.rs:59:12
|
LL | x_u8 > -1_i32;
- | ^^^^^^ expected `u8`, found `i32`
+ | ---- ^^^^^^ expected `u8`, found `i32`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `-1_i32`
|
--> $DIR/numeric-cast-no-fix.rs:62:15
|
LL | x_usize > -1_i16;
- | ^^^^^^ expected `usize`, found `i16`
+ | ------- ^^^^^^ expected `usize`, found `i16`
+ | |
+ | expected because this is `usize`
|
= note: `-1_i16` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:64:14
|
LL | x_u128 > -1_i16;
- | ^^^^^^ expected `u128`, found `i16`
+ | ------ ^^^^^^ expected `u128`, found `i16`
+ | |
+ | expected because this is `u128`
|
= note: `-1_i16` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:66:13
|
LL | x_u64 > -1_i16;
- | ^^^^^^ expected `u64`, found `i16`
+ | ----- ^^^^^^ expected `u64`, found `i16`
+ | |
+ | expected because this is `u64`
|
= note: `-1_i16` cannot fit into type `u64`
--> $DIR/numeric-cast-no-fix.rs:68:13
|
LL | x_u32 > -1_i16;
- | ^^^^^^ expected `u32`, found `i16`
+ | ----- ^^^^^^ expected `u32`, found `i16`
+ | |
+ | expected because this is `u32`
|
= note: `-1_i16` cannot fit into type `u32`
--> $DIR/numeric-cast-no-fix.rs:70:13
|
LL | x_u16 > -1_i16;
- | ^^^^^^ expected `u16`, found `i16`
+ | ----- ^^^^^^ expected `u16`, found `i16`
+ | |
+ | expected because this is `u16`
|
= note: `-1_i16` cannot fit into type `u16`
--> $DIR/numeric-cast-no-fix.rs:72:12
|
LL | x_u8 > -1_i16;
- | ^^^^^^ expected `u8`, found `i16`
+ | ---- ^^^^^^ expected `u8`, found `i16`
+ | |
+ | expected because this is `u8`
|
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `-1_i16`
|
--> $DIR/numeric-cast-no-fix.rs:75:15
|
LL | x_usize > -1_i8;
- | ^^^^^ expected `usize`, found `i8`
+ | ------- ^^^^^ expected `usize`, found `i8`
+ | |
+ | expected because this is `usize`
|
= note: `-1_i8` cannot fit into type `usize`
--> $DIR/numeric-cast-no-fix.rs:77:14
|
LL | x_u128 > -1_i8;
- | ^^^^^ expected `u128`, found `i8`
+ | ------ ^^^^^ expected `u128`, found `i8`
+ | |
+ | expected because this is `u128`
|
= note: `-1_i8` cannot fit into type `u128`
--> $DIR/numeric-cast-no-fix.rs:79:13
|
LL | x_u64 > -1_i8;
- | ^^^^^ expected `u64`, found `i8`
+ | ----- ^^^^^ expected `u64`, found `i8`
+ | |
+ | expected because this is `u64`
|
= note: `-1_i8` cannot fit into type `u64`
--> $DIR/numeric-cast-no-fix.rs:81:13
|
LL | x_u32 > -1_i8;
- | ^^^^^ expected `u32`, found `i8`
+ | ----- ^^^^^ expected `u32`, found `i8`
+ | |
+ | expected because this is `u32`
|
= note: `-1_i8` cannot fit into type `u32`
--> $DIR/numeric-cast-no-fix.rs:83:13
|
LL | x_u16 > -1_i8;
- | ^^^^^ expected `u16`, found `i8`
+ | ----- ^^^^^ expected `u16`, found `i8`
+ | |
+ | expected because this is `u16`
|
= note: `-1_i8` cannot fit into type `u16`
--> $DIR/numeric-cast-no-fix.rs:85:12
|
LL | x_u8 > -1_i8;
- | ^^^^^ expected `u8`, found `i8`
+ | ---- ^^^^^ expected `u8`, found `i8`
+ | |
+ | expected because this is `u8`
|
= note: `-1_i8` cannot fit into type `u8`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | S: Sum<Self::Item>,
- | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
+ | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum`
error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator
--> $DIR/sum.rs:7:5
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | P: Product<Self::Item>,
- | ^^^^^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::product`
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::product`
error: aborting due to 2 previous errors
--> $DIR/bare-struct-body.rs:11:14
|
LL | x.val == 42;
- | ^^ expected `()`, found integer
+ | ----- ^^ expected `()`, found integer
+ | |
+ | expected because this is `()`
error: aborting due to 3 previous errors
--> $DIR/chained-comparison-suggestion.rs:4:14
|
LL | 1 < 2 <= 3;
- | ^ expected `bool`, found integer
+ | ----- ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:13:14
|
LL | 1 <= 2 < 3;
- | ^ expected `bool`, found integer
+ | ------ ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:18:15
|
LL | 1 <= 2 <= 3;
- | ^ expected `bool`, found integer
+ | ------ ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:23:14
|
LL | 1 > 2 >= 3;
- | ^ expected `bool`, found integer
+ | ----- ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:36:15
|
LL | 1 >= 2 >= 3;
- | ^ expected `bool`, found integer
+ | ------ ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:49:15
|
LL | 1 == 2 == 3;
- | ^ expected `bool`, found integer
+ | ------ ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
error: aborting due to 17 previous errors
--> $DIR/pptypedef.rs:4:37
|
LL | let_in(3u32, |i| { assert!(i == 3i32); });
- | ^^^^ expected `u32`, found `i32`
+ | - ^^^^ expected `u32`, found `i32`
+ | |
+ | expected because this is `u32`
|
help: change the type of the numeric literal from `i32` to `u32`
|
--> $DIR/pptypedef.rs:8:37
|
LL | let_in(3i32, |i| { assert!(i == 3u32); });
- | ^^^^ expected `i32`, found `u32`
+ | - ^^^^ expected `i32`, found `u32`
+ | |
+ | expected because this is `i32`
|
help: change the type of the numeric literal from `u32` to `i32`
|
--> $DIR/attr-invalid-exprs.rs:15:13
|
LL | let _ = #[duplicate] "Hello, world!";
- | ^^^^^^^^^^^^- help: you might be missing a semicolon here: `;`
- | |
- | caused by the macro expansion here
+ | ^^^^^^^^^^^^ caused by the macro expansion here
|
= note: the usage of `duplicate!` is likely invalid in expression context
+help: you might be missing a semicolon here
+ |
+LL | let _ = #[duplicate]; "Hello, world!";
+ | +
error: macro expansion ignores token `,` and any following
--> $DIR/attr-invalid-exprs.rs:24:9
|
LL | #[duplicate]
- | ^^^^^^^^^^^^- help: you might be missing a semicolon here: `;`
- | |
- | caused by the macro expansion here
+ | ^^^^^^^^^^^^ caused by the macro expansion here
|
= note: the usage of `duplicate!` is likely invalid in expression context
+help: you might be missing a semicolon here
+ |
+LL | #[duplicate];
+ | +
error: aborting due to 3 previous errors
pub fn foo12(input: TokenStream) -> TokenStream { input }
#[proc_macro_derive(d13, attributes("a"))]
-//~^ ERROR: not a meta item
+//~^ ERROR: attribute must be a meta item, not a literal
pub fn foo13(input: TokenStream) -> TokenStream { input }
#[proc_macro_derive(d14, attributes(a = ""))]
-//~^ ERROR: must only be one word
+//~^ ERROR: attribute must only be a single word
pub fn foo14(input: TokenStream) -> TokenStream { input }
#[proc_macro_derive(d15, attributes(m::a))]
-//~^ ERROR: must only be one word
+//~^ ERROR: attribute must only be a single word
pub fn foo15(input: TokenStream) -> TokenStream { input }
#[proc_macro_derive(d16, attributes(a(b)))]
-//~^ ERROR: must only be one word
+//~^ ERROR: attribute must only be a single word
pub fn foo16(input: TokenStream) -> TokenStream { input }
#[proc_macro_derive(d17, attributes(self))]
LL | #[proc_macro_derive(d12, attributes)]
| ^^^^^^^^^^
-error: not a meta item
+error: attribute must be a meta item, not a literal
--> $DIR/attribute.rs:55:37
|
LL | #[proc_macro_derive(d13, attributes("a"))]
| ^^^
-error: must only be one word
+error: attribute must only be a single word
--> $DIR/attribute.rs:59:37
|
LL | #[proc_macro_derive(d14, attributes(a = ""))]
| ^^^^^^
-error: must only be one word
+error: attribute must only be a single word
--> $DIR/attribute.rs:63:37
|
LL | #[proc_macro_derive(d15, attributes(m::a))]
| ^^^^
-error: must only be one word
+error: attribute must only be a single word
--> $DIR/attribute.rs:67:37
|
LL | #[proc_macro_derive(d16, attributes(a(b)))]
--> $DIR/expand-expr.rs:115:47
|
LL | expand_expr_is!("string", echo_tts!("string"; hello));
- | --------------------^^^^^-- help: you might be missing a semicolon here: `;`
- | |
- | caused by the macro expansion here
+ | --------------------^^^^^- caused by the macro expansion here
|
= note: the usage of `echo_tts!` is likely invalid in expression context
+help: you might be missing a semicolon here
+ |
+LL | expand_expr_is!("string", echo_tts!("string"; hello););
+ | +
error: macro expansion ignores token `;` and any following
--> $DIR/expand-expr.rs:116:44
|
LL | expand_expr_is!("string", echo_pm!("string"; hello));
- | -----------------^-------- help: you might be missing a semicolon here: `;`
- | |
- | caused by the macro expansion here
+ | -----------------^------- caused by the macro expansion here
|
= note: the usage of `echo_pm!` is likely invalid in expression context
+help: you might be missing a semicolon here
+ |
+LL | expand_expr_is!("string", echo_pm!("string"; hello););
+ | +
error: recursion limit reached while expanding `recursive_expand!`
--> $DIR/expand-expr.rs:124:16
LL | take_range(std::ops::Range { start: 0, end: 1 });
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
- | | expected reference, found struct `std::ops::Range`
+ | | expected reference, found struct `Range`
| | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
| arguments to this function are incorrect
|
LL | take_range(::std::ops::Range { start: 0, end: 1 });
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
- | | expected reference, found struct `std::ops::Range`
+ | | expected reference, found struct `Range`
| | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
| arguments to this function are incorrect
|
LL | take_range(0..1);
| ---------- ^^^^
| | |
- | | expected reference, found struct `std::ops::Range`
+ | | expected reference, found struct `Range`
| | help: consider borrowing here: `&(0..1)`
| arguments to this function are incorrect
|
LL | demo(tell(1)..tell(10));
| ---- ^^^^^^^^^^^^^^^^^
| | |
- | | expected reference, found struct `std::ops::Range`
+ | | expected `&Range<usize>`, found struct `Range`
| | help: consider borrowing here: `&(tell(1)..tell(10))`
| arguments to this function are incorrect
|
LL | demo(1..10);
| ---- ^^^^^
| | |
- | | expected reference, found struct `std::ops::Range`
+ | | expected `&Range<usize>`, found struct `Range`
| | help: consider borrowing here: `&(1..10)`
| arguments to this function are incorrect
|
--> $DIR/disallowed-positions.rs:157:8
|
LL | if true..(let 0 = 0) {}
- | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:171:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:175:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
- | expected fn pointer, found struct `std::ops::Range`
+ | expected fn pointer, found struct `Range`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:182:8
|
LL | if let Range { start: F, end } = F..|| true {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:190:8
|
LL | if let Range { start: true, end } = t..&&false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
--> $DIR/disallowed-positions.rs:249:11
|
LL | while true..(let 0 = 0) {}
- | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:263:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:267:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
- | expected fn pointer, found struct `std::ops::Range`
+ | expected fn pointer, found struct `Range`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:274:11
|
LL | while let Range { start: F, end } = F..|| true {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/disallowed-positions.rs:282:11
|
LL | while let Range { start: true, end } = t..&&false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
- | expected `bool`, found struct `std::ops::Range`
+ | expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
--> $DIR/struct-record-suggestion.rs:23:20
|
LL | let q = B { b: 1..Default::default() };
- | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `Range`
|
= note: expected type `u32`
found struct `std::ops::Range<{integer}>`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Foo<T>: Sized {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Bar: std::fmt::Display + Sized {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Baz: Sized where Self: std::fmt::Display {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Bat<T>: std::fmt::Display + Sized {
--> $DIR/dont-suggest-try_into-in-macros.rs:2:5
|
LL | assert_eq!(10u64, 10usize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | expected `u64`, found `usize`
+ | expected because this is `u64`
|
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $DIR/option-to-bool.rs:4:16
|
LL | if true && x {}
- | ^ expected `bool`, found enum `Option`
+ | ---- ^ expected `bool`, found enum `Option`
+ | |
+ | expected because this is `bool`
|
= note: expected type `bool`
found enum `Option<i32>`
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18
|
LL | let _: f64 = 0..10;
- | --- ^^^^^ expected `f64`, found struct `std::ops::Range`
+ | --- ^^^^^ expected `f64`, found struct `Range`
| |
| expected due to this
|
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18
|
LL | let _: f64 = std::ops::Range { start: 0, end: 1 };
- | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `std::ops::Range`
+ | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `Range`
| |
| expected due to this
|
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:31:20
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | ^ required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `size_of`
error: aborting due to 7 previous errors
--> $DIR/type-ascription-precedence.rs:53:5
|
LL | (S .. S): S;
- | ^^^^^^^^ expected struct `S`, found struct `std::ops::Range`
+ | ^^^^^^^^ expected struct `S`, found struct `Range`
|
= note: expected struct `S`
found struct `std::ops::Range<S>`
--> $DIR/assignment-in-if.rs:44:18
|
LL | if x == x && x = x && x == x {
- | ^ expected `bool`, found `usize`
+ | ------ ^ expected `bool`, found `usize`
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:44:22
--> $DIR/assignment-in-if.rs:51:28
|
LL | if x == x && x == x && x = x {
- | ^ expected `bool`, found `usize`
+ | ---------------- ^ expected `bool`, found `usize`
+ | |
+ | expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:51:8
LL | fn broken_add<T>(&self, rhs: T) -> Self {
| - found type parameter
LL | *self + rhs
- | ^^^ expected type parameter `Self`, found type parameter `T`
+ | ----- ^^^ expected type parameter `Self`, found type parameter `T`
+ | |
+ | expected because this is `Self`
|
= note: expected type parameter `Self`
found type parameter `T`
| - this type parameter - expected `I` because of return type
...
LL | self.iter()
- | ^^^^^^^^^^^ expected type parameter `I`, found struct `std::slice::Iter`
+ | ^^^^^^^^^^^ expected type parameter `I`, found struct `Iter`
|
= note: expected type parameter `I`
found struct `std::slice::Iter<'_, N>`
--> $DIR/wrong-mul-method-signature.rs:63:45
|
LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
- | ^^^ expected struct `Vec2`, found floating-point number
+ | ----------------------- ^^^ expected struct `Vec2`, found floating-point number
+ | |
+ | expected because this is `Vec2`
error[E0308]: mismatched types
--> $DIR/wrong-mul-method-signature.rs:63:19
TerminatorKind::SwitchInt {
discr,
- switch_ty: _,
targets: _,
} => check_operand(tcx, discr, span, body),
"@jackh726",
"@fee1-dead",
"@TaKO8Ki",
+ "@Nilstrieb",
]
compiler = [
"compiler-team",