[[package]]
name = "backtrace-sys"
-version = "0.1.35"
+version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7de8aba10a69c8e8d7622c5710229485ec32e9d55fdad160ea559c086fdcd118"
+checksum = "78848718ee1255a2485d1309ad9cdecfc2e7d0362dd11c6829364c6b35ae1bc7"
dependencies = [
"cc",
"compiler_builtins",
[[package]]
name = "cargo"
-version = "0.45.0"
+version = "0.46.0"
dependencies = [
"anyhow",
"atty",
[[package]]
name = "git2"
-version = "0.13.2"
+version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cfb93ca10f2934069c3aaafb753fbe0663f08ee009a01b6d62e062391447b15"
+checksum = "e1e02a51cd90229028c9bd8be0a0364f85b6b3199cccaa0ef39005ddbd5ac165"
dependencies = [
"bitflags",
"libc",
[[package]]
name = "libgit2-sys"
-version = "0.12.3+1.0.0"
+version = "0.12.5+1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7637dc15e7f05a16011723e0448655081fc01a374bcd368e2c9b9c7f5c5ab3ea"
+checksum = "3eadeec65514971355bf7134967a543f71372f35b53ac6c7143e7bd157f07535"
dependencies = [
"cc",
"libc",
let mut cmd = Command::new(real_llvm_config);
cmd.args(env::args().skip(1)).stderr(Stdio::piped());
let output = cmd.output().expect("failed to spawn llvm-config");
- let stdout = String::from_utf8_lossy(&output.stdout);
+ let mut stdout = String::from_utf8_lossy(&output.stdout);
+
+ if let Ok(to_replace) = env::var("LLVM_CONFIG_SHIM_REPLACE") {
+ if let Ok(replace_with) = env::var("LLVM_CONFIG_SHIM_REPLACE_WITH") {
+ stdout = stdout.replace(&to_replace, &replace_with).into();
+ }
+ }
+
print!("{}", stdout.replace("\\", "/"));
io::stdout().flush().unwrap();
process::exit(output.status.code().unwrap_or(1));
let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper");
cfg.out_dir(&out_dir)
.profile("Release")
- .env("LLVM_CONFIG_REAL", llvm_config)
+ .env("LLVM_CONFIG_REAL", &llvm_config)
.define("LLVM_CONFIG_PATH", llvm_config_shim)
.define("LLVM_INCLUDE_TESTS", "OFF");
+ // While we're using this horrible workaround to shim the execution of
+ // llvm-config, let's just pile on more. I can't seem to figure out how
+ // to build LLD as a standalone project and also cross-compile it at the
+ // same time. It wants a natively executable `llvm-config` to learn
+ // about LLVM, but then it learns about all the host configuration of
+ // LLVM and tries to link to host LLVM libraries.
+ //
+ // To work around that we tell our shim to replace anything with the
+ // build target with the actual target instead. This'll break parts of
+ // LLD though which try to execute host tools, such as llvm-tblgen, so
+ // we specifically tell it where to find those. This is likely super
+ // brittle and will break over time. If anyone knows better how to
+ // cross-compile LLD it would be much appreciated to fix this!
+ if target != builder.config.build {
+ cfg.env("LLVM_CONFIG_SHIM_REPLACE", &builder.config.build)
+ .env("LLVM_CONFIG_SHIM_REPLACE_WITH", &target)
+ .define("LLVM_TABLEGEN_EXE", llvm_config.with_file_name("llvm-tblgen"));
+ }
+
cfg.build();
t!(File::create(&done_stamp));
ENV HOSTS=aarch64-unknown-linux-gnu
ENV RUST_CONFIGURE_ARGS \
- --enable-extended \
+ --enable-full-tools \
--enable-profiler \
--disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
ENV HOSTS=arm-unknown-linux-gnueabi
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
ENV HOSTS=arm-unknown-linux-gnueabihf
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
ENV HOSTS=armv7-unknown-linux-gnueabihf
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
-Subproject commit f5db319e0b19c22964398d56bc63103d669e1bba
+Subproject commit e37c0e84e2ef73d3a4ebffda8011db6814a3b02d
-Subproject commit 668fb07b6160b9c468f598e839c1e044db65de30
+Subproject commit 40beccdf1bb8eb9184a2e3b42db8b8c6e394247f
-Subproject commit 6eb24d6e9c0773d4aee68ed5fca121ce3cdf676a
+Subproject commit 4d2d275997746d35eabfc4d992dfbdcce2f626ed
-Subproject commit 3ce94caed4cf967106c51ae86be5e098f7875f11
+Subproject commit ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e
-Subproject commit c106d1683c3a2b0960f0f0fb01728cbb19807332
+Subproject commit ffc99581689fe2455908aaef5f5cf50dd03bb8f5
## relocation-model
-This option lets you choose which
-[relocation](https://en.wikipedia.org/wiki/Relocation_\(computing\)) model to
-use.
+This option controls generation of
+[position-independent code (PIC)](https://en.wikipedia.org/wiki/Position-independent_code).
-To find the valid options for this flag, run `rustc --print relocation-models`.
+Supported values for this option are:
+
+#### Primary relocation models
+
+- `static` - non-relocatable code, machine instructions may use absolute addressing modes.
+
+- `pic` - fully relocatable position independent code,
+machine instructions need to use relative addressing modes.
+Equivalent to the "uppercase" `-fPIC` or `-fPIE` options in other compilers,
+depending on the produced crate types.
+This is the default model for majority of supported targets.
+
+#### Special relocation models
+
+- `dynamic-no-pic` - relocatable external references, non-relocatable code.
+Only makes sense on Darwin and is rarely used.
+If StackOverflow tells you to use this as an opt-out of PIC or PIE, don't believe it,
+use `-C relocation-model=static` instead.
+- `ropi`, `rwpi` and `ropi-rwpi` - relocatable code and read-only data, relocatable read-write data,
+and combination of both, respectively.
+Only makes sense for certain embedded ARM targets.
+- `default` - relocation model default to the current target.
+Only makes sense as an override for some other explicitly specified relocation model
+previously set on the command line.
+
+Supported values can also be discovered by running `rustc --print relocation-models`.
+
+#### Linking effects
+
+In addition to codegen effects, `relocation-model` has effects during linking.
+
+If the relocation model is `pic` and the current target supports position-independent executables
+(PIE), the linker will be instructed (`-pie`) to produce one.
+If the target doesn't support both position-independent and statically linked executables,
+then `-C target-feature=+crt-static` "wins" over `-C relocation-model=pic`,
+and the linker is instructed (`-static`) to produce a statically linked
+but not position-independent executable.
## remark
--- /dev/null
+# `tls_model`
+
+The tracking issue for this feature is: None.
+
+------------------------
+
+Option `-Z tls-model` controls [TLS model](https://www.akkadia.org/drepper/tls.pdf) used to
+generate code for accessing `#[thread_local]` `static` items.
+
+Supported values for this option are:
+
+- `global-dynamic` - General Dynamic TLS Model (alternatively called Global Dynamic) is the most
+general option usable in all circumstances, even if the TLS data is defined in a shared library
+loaded at runtime and is accessed from code outside of that library.
+This is the default for most targets.
+- `local-dynamic` - model usable if the TLS data is only accessed from the shared library or
+executable it is defined in. The TLS data may be in a library loaded after startup (via `dlopen`).
+- `initial-exec` - model usable if the TLS data is defined in the executable or in a shared library
+loaded at program startup.
+The TLS data must not be in a library loaded after startup (via `dlopen`).
+- `local-exec` - model usable only if the TLS data is defined directly in the executable,
+but not in a shared library, and is accessed only from that executable.
+
+`rustc` and LLVM may use a more optimized model than specified if they know that we are producing
+and executable rather than a library, or that the `static` item is private enough.
## Examples
-``` rust
+```rust
#![feature(cfg_sanitize)]
#[cfg(sanitize = "thread")]
fn a() {
- // ...
+ // ...
}
#[cfg(not(sanitize = "thread"))]
fn a() {
- // ...
+ // ...
}
fn b() {
- if cfg!(sanitize = "leak") {
- // ...
- } else {
- // ...
- }
+ if cfg!(sanitize = "leak") {
+ // ...
+ } else {
+ // ...
+ }
}
-
```
-
pub fn pin(x: T) -> Pin<Box<T>> {
(box x).into()
}
+
+ /// Converts a `Box<T>` into a `Box<[T]>`
+ ///
+ /// This conversion does not allocate on the heap and happens in place.
+ ///
+ #[unstable(feature = "box_into_boxed_slice", issue = "71582")]
+ pub fn into_boxed_slice(boxed: Box<T>) -> Box<[T]> {
+ // *mut T and *mut [T; 1] have the same size and alignment
+ unsafe { Box::from_raw(Box::into_raw(boxed) as *mut [T; 1] as *mut [T]) }
+ }
}
impl<T> Box<[T]> {
impl<'r, 'a, T: Ord> Drop for DropGuard<'r, 'a, T> {
fn drop(&mut self) {
- while let Some(_) = self.0.inner.pop() {}
+ while self.0.inner.pop().is_some() {}
}
}
/// assert_eq!(map.remove_entry(&1), Some((1, "a")));
/// assert_eq!(map.remove_entry(&1), None);
/// ```
- #[stable(feature = "btreemap_remove_entry", since = "1.44.0")]
+ #[stable(feature = "btreemap_remove_entry", since = "1.45.0")]
pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)>
where
K: Borrow<Q>,
}
unsafe fn from_ptr(ptr: NonNull<LeafNode<K, V>>) -> Self {
- BoxedNode { ptr: Unique::from(ptr) }
+ BoxedNode { ptr: Unique::new_unchecked(ptr.as_ptr()) }
}
fn as_ptr(&self) -> NonNull<LeafNode<K, V>> {
fn drop(&mut self) {
// Continue the same loop we do below. This only runs when a destructor has
// panicked. If another one panics this will abort.
- while let Some(_) = self.0.pop_front_node() {}
+ while self.0.pop_front_node().is_some() {}
}
}
let memory = alloc.alloc(layout, init).unwrap_or_else(|_| handle_alloc_error(layout));
Self {
- ptr: memory.ptr.cast().into(),
+ ptr: unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) },
cap: Self::capacity_from_bytes(memory.size),
alloc,
}
}
fn set_memory(&mut self, memory: MemoryBlock) {
- self.ptr = memory.ptr.cast().into();
+ self.ptr = unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) };
self.cap = Self::capacity_from_bytes(memory.size);
}
///
/// Read the [unstable book] for the usage.
///
- /// [unstable book]: ../unstable-book/library-features/asm.html
+ /// [unstable book]: ../unstable-book/library-features/llvm-asm.html
#[unstable(
feature = "llvm_asm",
issue = "70173",
}
}
- #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+ #[stable(feature = "nonzero_bitor", since = "1.45.0")]
impl BitOr for $Ty {
type Output = Self;
#[inline]
}
}
- #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+ #[stable(feature = "nonzero_bitor", since = "1.45.0")]
impl BitOr<$Int> for $Ty {
type Output = Self;
#[inline]
}
}
- #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+ #[stable(feature = "nonzero_bitor", since = "1.45.0")]
impl BitOr<$Ty> for $Int {
type Output = $Ty;
#[inline]
}
}
- #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+ #[stable(feature = "nonzero_bitor", since = "1.45.0")]
impl BitOrAssign for $Ty {
#[inline]
fn bitor_assign(&mut self, rhs: Self) {
}
}
- #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+ #[stable(feature = "nonzero_bitor", since = "1.45.0")]
impl BitOrAssign<$Int> for $Ty {
#[inline]
fn bitor_assign(&mut self, rhs: $Int) {
//! [`write_volatile`]: ./fn.write_volatile.html
//! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling
-// ignore-tidy-undocumented-unsafe
-
#![stable(feature = "rust1", since = "1.0.0")]
use crate::cmp::Ordering;
///
/// // create a slice pointer when starting out with a pointer to the first element
/// let x = [5, 6, 7];
-/// let ptr = x.as_ptr();
-/// let slice = ptr::slice_from_raw_parts(ptr, 3);
+/// let raw_pointer = x.as_ptr();
+/// let slice = ptr::slice_from_raw_parts(raw_pointer, 3);
/// assert_eq!(unsafe { &*slice }[2], 7);
/// ```
#[inline]
#[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
#[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
+ // SAFETY: Accessing the value from the `Repr` union is safe since *const [T]
+ // and FatPtr have the same memory layouts. Only std can make this
+ // guarantee.
unsafe { Repr { raw: FatPtr { data, len } }.rust }
}
///
/// [`slice_from_raw_parts`]: fn.slice_from_raw_parts.html
/// [`from_raw_parts_mut`]: ../../std/slice/fn.from_raw_parts_mut.html
+///
+/// # Examples
+///
+/// ```rust
+/// use std::ptr;
+///
+/// let x = &mut [5, 6, 7];
+/// let raw_pointer = x.as_mut_ptr();
+/// let slice = ptr::slice_from_raw_parts_mut(raw_pointer, 3);
+///
+/// unsafe {
+/// (*slice)[2] = 99; // assign a value at an index in the slice
+/// };
+///
+/// assert_eq!(unsafe { &*slice }[2], 99);
+/// ```
#[inline]
#[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
#[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
+ // SAFETY: Accessing the value from the `Repr` union is safe since *mut [T]
+ // and FatPtr have the same memory layouts
unsafe { Repr { raw: FatPtr { data, len } }.rust_mut }
}
use crate::ops::{CoerceUnsized, DispatchFromDyn};
use crate::ptr::Unique;
-// ignore-tidy-undocumented-unsafe
-
/// `*mut T` but non-zero and covariant.
///
/// This is often the correct thing to use when building data structures using
#[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0")]
#[inline]
pub const fn dangling() -> Self {
+ // SAFETY: mem::align_of() returns a non-zero usize which is then casted
+ // to a *mut T. Therefore, `ptr` is not null and the conditions for
+ // calling new_unchecked() are respected.
unsafe {
let ptr = mem::align_of::<T>() as *mut T;
NonNull::new_unchecked(ptr)
#[stable(feature = "nonnull", since = "1.25.0")]
#[inline]
pub fn new(ptr: *mut T) -> Option<Self> {
- if !ptr.is_null() { Some(unsafe { Self::new_unchecked(ptr) }) } else { None }
+ if !ptr.is_null() {
+ // SAFETY: The pointer is already checked and is not null
+ Some(unsafe { Self::new_unchecked(ptr) })
+ } else {
+ None
+ }
}
/// Acquires the underlying `*mut` pointer.
#[rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0")]
#[inline]
pub const fn cast<U>(self) -> NonNull<U> {
+ // SAFETY: `self` is a `NonNull` pointer which is necessarily non-null
unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) }
}
}
impl<T: ?Sized> From<Unique<T>> for NonNull<T> {
#[inline]
fn from(unique: Unique<T>) -> Self {
+ // SAFETY: A Unique pointer cannot be null, so the conditions for
+ // new_unchecked() are respected.
unsafe { NonNull::new_unchecked(unique.as_ptr()) }
}
}
impl<T: ?Sized> From<&mut T> for NonNull<T> {
#[inline]
fn from(reference: &mut T) -> Self {
+ // SAFETY: A mutable reference cannot be null.
unsafe { NonNull { pointer: reference as *mut T } }
}
}
impl<T: ?Sized> From<&T> for NonNull<T> {
#[inline]
fn from(reference: &T) -> Self {
+ // SAFETY: A reference cannot be null, so the conditions for
+ // new_unchecked() are respected.
unsafe { NonNull { pointer: reference as *const T } }
}
}
use crate::marker::{PhantomData, Unsize};
use crate::mem;
use crate::ops::{CoerceUnsized, DispatchFromDyn};
-use crate::ptr::NonNull;
// ignore-tidy-undocumented-unsafe
// FIXME: rename to dangling() to match NonNull?
#[inline]
pub const fn empty() -> Self {
+ // SAFETY: mem::align_of() returns a valid, non-null pointer. The
+ // conditions to call new_unchecked() are thus respected.
unsafe { Unique::new_unchecked(mem::align_of::<T>() as *mut T) }
}
}
#[inline]
pub fn new(ptr: *mut T) -> Option<Self> {
if !ptr.is_null() {
+ // SAFETY: The pointer has already been checked and is not null.
Some(unsafe { Unique { pointer: ptr as _, _marker: PhantomData } })
} else {
None
/// Casts to a pointer of another type.
#[inline]
pub const fn cast<U>(self) -> Unique<U> {
+ // SAFETY: Unique::new_unchecked() creates a new unique and needs
+ // the given pointer to not be null.
+ // Since we are passing self as a pointer, it cannot be null.
unsafe { Unique::new_unchecked(self.as_ptr() as *mut U) }
}
}
impl<T: ?Sized> From<&mut T> for Unique<T> {
#[inline]
fn from(reference: &mut T) -> Self {
+ // SAFETY: A mutable reference cannot be null
unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } }
}
}
-
-#[unstable(feature = "ptr_internals", issue = "none")]
-impl<T: ?Sized> From<&T> for Unique<T> {
- #[inline]
- fn from(reference: &T) -> Self {
- unsafe { Unique { pointer: reference as *const T, _marker: PhantomData } }
- }
-}
-
-#[unstable(feature = "ptr_internals", issue = "none")]
-impl<T: ?Sized> From<NonNull<T>> for Unique<T> {
- #[inline]
- fn from(p: NonNull<T>) -> Self {
- unsafe { Unique::new_unchecked(p.as_ptr()) }
- }
-}
/// definition site (local variables, labels, `$crate`) and sometimes at the macro
/// call site (everything else).
/// The span location is taken from the call-site.
- #[unstable(feature = "proc_macro_mixed_site", issue = "65049")]
+ #[stable(feature = "proc_macro_mixed_site", since = "1.45.0")]
pub fn mixed_site() -> Span {
Span(bridge::client::Span::mixed_site())
}
/// Creates a new span with the same line/column information as `self` but
/// that resolves symbols as though it were at `other`.
- #[stable(feature = "proc_macro_span_resolved_at", since = "1.43.0")]
+ #[stable(feature = "proc_macro_span_resolved_at", since = "1.45.0")]
pub fn resolved_at(&self, other: Span) -> Span {
Span(self.0.resolved_at(other.0))
}
/// Creates a new span with the same name resolution behavior as `self` but
/// with the line/column information of `other`.
- #[stable(feature = "proc_macro_span_located_at", since = "1.43.0")]
+ #[stable(feature = "proc_macro_span_located_at", since = "1.45.0")]
pub fn located_at(&self, other: Span) -> Span {
other.resolved_at(*self)
}
use crate::base;
use crate::common;
use crate::consts;
-use crate::context::{get_reloc_model, is_pie_binary};
+use crate::context::all_outputs_are_pic_executables;
use crate::llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
use crate::llvm_util;
use crate::type_::Type;
use rustc_middle::ty::TyCtxt;
use rustc_session::config::{self, Lto, OutputType, Passes, Sanitizer, SwitchWithOptPath};
use rustc_session::Session;
+use rustc_target::spec::RelocModel;
use libc::{c_char, c_int, c_uint, c_void, size_t};
use std::ffi::CString;
use std::str;
use std::sync::Arc;
-pub const RELOC_MODEL_ARGS: [(&str, llvm::RelocMode); 7] = [
- ("pic", llvm::RelocMode::PIC),
- ("static", llvm::RelocMode::Static),
- ("default", llvm::RelocMode::Default),
- ("dynamic-no-pic", llvm::RelocMode::DynamicNoPic),
- ("ropi", llvm::RelocMode::ROPI),
- ("rwpi", llvm::RelocMode::RWPI),
- ("ropi-rwpi", llvm::RelocMode::ROPI_RWPI),
-];
-
pub const CODE_GEN_MODEL_ARGS: &[(&str, llvm::CodeModel)] = &[
("small", llvm::CodeModel::Small),
("kernel", llvm::CodeModel::Kernel),
("large", llvm::CodeModel::Large),
];
-pub const TLS_MODEL_ARGS: [(&str, llvm::ThreadLocalMode); 4] = [
- ("global-dynamic", llvm::ThreadLocalMode::GeneralDynamic),
- ("local-dynamic", llvm::ThreadLocalMode::LocalDynamic),
- ("initial-exec", llvm::ThreadLocalMode::InitialExec),
- ("local-exec", llvm::ThreadLocalMode::LocalExec),
-];
-
pub fn llvm_err(handler: &rustc_errors::Handler, msg: &str) -> FatalError {
match llvm::last_error() {
Some(err) => handler.fatal(&format!("{}: {}", msg, err)),
}
}
-pub fn create_informational_target_machine(
- sess: &Session,
- find_features: bool,
-) -> &'static mut llvm::TargetMachine {
- target_machine_factory(sess, config::OptLevel::No, find_features)()
+pub fn create_informational_target_machine(sess: &Session) -> &'static mut llvm::TargetMachine {
+ target_machine_factory(sess, config::OptLevel::No)()
.unwrap_or_else(|err| llvm_err(sess.diagnostic(), &err).raise())
}
-pub fn create_target_machine(
- tcx: TyCtxt<'_>,
- find_features: bool,
-) -> &'static mut llvm::TargetMachine {
- target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE), find_features)()
+pub fn create_target_machine(tcx: TyCtxt<'_>) -> &'static mut llvm::TargetMachine {
+ target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE))()
.unwrap_or_else(|err| llvm_err(tcx.sess.diagnostic(), &err).raise())
}
}
}
-// If find_features is true this won't access `sess.crate_types` by assuming
-// that `is_pie_binary` is false. When we discover LLVM target features
-// `sess.crate_types` is uninitialized so we cannot access it.
+fn to_llvm_relocation_model(relocation_model: RelocModel) -> llvm::RelocModel {
+ match relocation_model {
+ RelocModel::Static => llvm::RelocModel::Static,
+ RelocModel::Pic => llvm::RelocModel::PIC,
+ RelocModel::DynamicNoPic => llvm::RelocModel::DynamicNoPic,
+ RelocModel::Ropi => llvm::RelocModel::ROPI,
+ RelocModel::Rwpi => llvm::RelocModel::RWPI,
+ RelocModel::RopiRwpi => llvm::RelocModel::ROPI_RWPI,
+ }
+}
+
pub fn target_machine_factory(
sess: &Session,
optlvl: config::OptLevel,
- find_features: bool,
) -> Arc<dyn Fn() -> Result<&'static mut llvm::TargetMachine, String> + Send + Sync> {
- let reloc_model = get_reloc_model(sess);
+ let reloc_model = to_llvm_relocation_model(sess.relocation_model());
let (opt_level, _) = to_llvm_opt_settings(optlvl);
let use_softfp = sess.opts.cg.soft_float;
let features = features.join(",");
let features = CString::new(features).unwrap();
let abi = SmallCStr::new(&sess.target.target.options.llvm_abiname);
- let is_pie_binary = !find_features && is_pie_binary(sess);
+ let pic_is_pie = all_outputs_are_pic_executables(sess);
let trap_unreachable = sess.target.target.options.trap_unreachable;
let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
reloc_model,
opt_level,
use_softfp,
- is_pie_binary,
+ pic_is_pie,
ffunction_sections,
fdata_sections,
trap_unreachable,
use rustc_span::source_map::{Span, DUMMY_SP};
use rustc_span::symbol::Symbol;
use rustc_target::abi::{HasDataLayout, LayoutOf, PointeeInfo, Size, TargetDataLayout, VariantIdx};
-use rustc_target::spec::{HasTargetSpec, Target};
+use rustc_target::spec::{HasTargetSpec, RelocModel, Target, TlsModel};
use std::cell::{Cell, RefCell};
use std::ffi::CStr;
local_gen_sym_counter: Cell<usize>,
}
-pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
- let reloc_model_arg = match sess.opts.cg.relocation_model {
- Some(ref s) => &s[..],
- None => &sess.target.target.options.relocation_model[..],
- };
-
- match crate::back::write::RELOC_MODEL_ARGS.iter().find(|&&arg| arg.0 == reloc_model_arg) {
- Some(x) => x.1,
- _ => {
- sess.err(&format!("{:?} is not a valid relocation mode", reloc_model_arg));
- sess.abort_if_errors();
- bug!();
- }
- }
-}
-
-fn get_tls_model(sess: &Session) -> llvm::ThreadLocalMode {
- let tls_model_arg = match sess.opts.debugging_opts.tls_model {
- Some(ref s) => &s[..],
- None => &sess.target.target.options.tls_model[..],
- };
-
- match crate::back::write::TLS_MODEL_ARGS.iter().find(|&&arg| arg.0 == tls_model_arg) {
- Some(x) => x.1,
- _ => {
- sess.err(&format!("{:?} is not a valid TLS model", tls_model_arg));
- sess.abort_if_errors();
- bug!();
- }
+fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
+ match tls_model {
+ TlsModel::GeneralDynamic => llvm::ThreadLocalMode::GeneralDynamic,
+ TlsModel::LocalDynamic => llvm::ThreadLocalMode::LocalDynamic,
+ TlsModel::InitialExec => llvm::ThreadLocalMode::InitialExec,
+ TlsModel::LocalExec => llvm::ThreadLocalMode::LocalExec,
}
}
-fn is_any_library(sess: &Session) -> bool {
- sess.crate_types.borrow().iter().any(|ty| *ty != config::CrateType::Executable)
-}
-
-pub fn is_pie_binary(sess: &Session) -> bool {
- !is_any_library(sess) && get_reloc_model(sess) == llvm::RelocMode::PIC
+/// PIE is potentially more effective than PIC, but can only be used in executables.
+/// If all our outputs are executables, then we can relax PIC to PIE when producing object code.
+/// If the list of crate types is not yet known we conservatively return `false`.
+pub fn all_outputs_are_pic_executables(sess: &Session) -> bool {
+ sess.relocation_model() == RelocModel::Pic
+ && sess.crate_types.try_get().map_or(false, |crate_types| {
+ crate_types.iter().all(|ty| *ty == config::CrateType::Executable)
+ })
}
fn strip_function_ptr_alignment(data_layout: String) -> String {
// Ensure the data-layout values hardcoded remain the defaults.
if sess.target.target.options.is_builtin {
- let tm = crate::back::write::create_informational_target_machine(&tcx.sess, false);
+ let tm = crate::back::write::create_informational_target_machine(tcx.sess);
llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm);
llvm::LLVMRustDisposeTargetMachine(tm);
let llvm_target = SmallCStr::new(&sess.target.target.llvm_target);
llvm::LLVMRustSetNormalizedTarget(llmod, llvm_target.as_ptr());
- if get_reloc_model(sess) == llvm::RelocMode::PIC {
+ if sess.relocation_model() == RelocModel::Pic {
llvm::LLVMRustSetModulePICLevel(llmod);
}
- if is_pie_binary(sess) {
+ if all_outputs_are_pic_executables(sess) {
llvm::LLVMRustSetModulePIELevel(llmod);
}
let check_overflow = tcx.sess.overflow_checks();
- let tls_model = get_tls_model(&tcx.sess);
+ let tls_model = to_llvm_tls_model(tcx.sess.tls_model());
let (llcx, llmod) = (&*llvm_module.llcx, llvm_module.llmod());
spflags |= DISPFlags::SPFlagOptimized;
}
if let Some((id, _)) = self.tcx.entry_fn(LOCAL_CRATE) {
- if id == def_id {
+ if id.to_def_id() == def_id {
spflags |= DISPFlags::SPFlagMainSubprogram;
}
}
&self,
sess: &Session,
optlvl: OptLevel,
- find_features: bool,
) -> Arc<dyn Fn() -> Result<&'static mut llvm::TargetMachine, String> + Send + Sync> {
- back::write::target_machine_factory(sess, optlvl, find_features)
+ back::write::target_machine_factory(sess, optlvl)
}
fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str {
llvm_util::target_cpu(sess)
match req {
PrintRequest::RelocationModels => {
println!("Available relocation models:");
- for &(name, _) in back::write::RELOC_MODEL_ARGS.iter() {
+ for name in
+ &["static", "pic", "dynamic-no-pic", "ropi", "rwpi", "ropi-rwpi", "default"]
+ {
println!(" {}", name);
}
println!();
}
PrintRequest::TlsModels => {
println!("Available TLS models:");
- for &(name, _) in back::write::TLS_MODEL_ARGS.iter() {
+ for name in &["global-dynamic", "local-dynamic", "initial-exec", "local-exec"] {
println!(" {}", name);
}
println!();
unsafe {
let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
- ModuleLlvm { llmod_raw, llcx, tm: create_target_machine(tcx, false) }
+ ModuleLlvm { llmod_raw, llcx, tm: create_target_machine(tcx) }
}
}
unsafe {
let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
- ModuleLlvm {
- llmod_raw,
- llcx,
- tm: create_informational_target_machine(&tcx.sess, false),
- }
+ ModuleLlvm { llmod_raw, llcx, tm: create_informational_target_machine(tcx.sess) }
}
}
/// LLVMRelocMode
#[derive(Copy, Clone, PartialEq)]
#[repr(C)]
-pub enum RelocMode {
- Default,
+pub enum RelocModel {
Static,
PIC,
DynamicNoPic,
Features: *const c_char,
Abi: *const c_char,
Model: CodeModel,
- Reloc: RelocMode,
+ Reloc: RelocModel,
Level: CodeGenOptLevel,
UseSoftFP: bool,
PositionIndependentExecutable: bool,
}
pub fn target_features(sess: &Session) -> Vec<Symbol> {
- let target_machine = create_informational_target_machine(sess, true);
+ let target_machine = create_informational_target_machine(sess);
target_feature_whitelist(sess)
.iter()
.filter_map(|&(feature, gate)| {
pub(crate) fn print(req: PrintRequest, sess: &Session) {
require_inited();
- let tm = create_informational_target_machine(sess, true);
+ let tm = create_informational_target_machine(sess);
unsafe {
match req {
PrintRequest::TargetCPUs => llvm::LLVMRustPrintTargetCPUs(tm),
/// need out of the shared crate context before we get rid of it.
use rustc_session::{filesearch, Session};
use rustc_span::symbol::Symbol;
-use rustc_target::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel};
use super::archive::ArchiveBuilder;
use super::command::Command;
if sess.target.target.options.position_independent_executables {
let attr_link_args = &*codegen_results.crate_info.link_args;
let mut user_defined_link_args = sess.opts.cg.link_args.iter().chain(attr_link_args);
- if is_pic(sess)
+ if sess.relocation_model() == RelocModel::Pic
&& !sess.crt_static(Some(crate_type))
&& !user_defined_link_args.any(|x| x == "-static")
{
config::Lto::No | config::Lto::ThinLocal => false,
}
}
-
-fn is_pic(sess: &Session) -> bool {
- let reloc_model_arg = match sess.opts.cg.relocation_model {
- Some(ref s) => &s[..],
- None => &sess.target.target.options.relocation_model[..],
- };
-
- reloc_model_arg == "pic"
-}
regular_module_config: regular_config,
metadata_module_config: metadata_config,
allocator_module_config: allocator_config,
- tm_factory: TargetMachineFactory(backend.target_machine_factory(tcx.sess, ol, false)),
+ tm_factory: TargetMachineFactory(backend.target_machine_factory(tcx.sess, ol)),
total_cgus,
msvc_imps_needed: msvc_imps_needed(tcx),
target_pointer_width: tcx.sess.target.target.target_pointer_width.clone(),
use rustc_data_structures::profiling::print_time_passes_entry;
use rustc_data_structures::sync::{par_iter, Lock, ParallelIterator};
use rustc_hir as hir;
-use rustc_hir::def_id::{DefId, LOCAL_CRATE};
+use rustc_hir::def_id::{LocalDefId, LOCAL_CRATE};
use rustc_hir::lang_items::StartFnLangItem;
use rustc_index::vec::Idx;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
None => return None,
};
- let instance = Instance::mono(cx.tcx(), main_def_id);
+ let instance = Instance::mono(cx.tcx(), main_def_id.to_def_id());
if !cx.codegen_unit().contains_item(&MonoItem::Fn(instance)) {
// We want to create the wrapper in the same codegen unit as Rust's main
cx: &'a Bx::CodegenCx,
sp: Span,
rust_main: Bx::Value,
- rust_main_def_id: DefId,
+ rust_main_def_id: LocalDefId,
use_start_lang_item: bool,
) -> Bx::Function {
// The entry function is either `int main(void)` or `int main(int argc, char **argv)`,
tcx: TyCtxt<'_>,
cgu_name: Symbol,
) -> (ModuleCodegen<Self::Module>, u64);
- // If find_features is true this won't access `sess.crate_types` by assuming
- // that `is_pie_binary` is false. When we discover LLVM target features
- // `sess.crate_types` is uninitialized so we cannot access it.
fn target_machine_factory(
&self,
sess: &Session,
opt_level: config::OptLevel,
- find_features: bool,
) -> Arc<dyn Fn() -> Result<Self::TargetMachine, String> + Send + Sync>;
fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str;
}
) -> Compilation {
let r = matches.opt_strs("Z");
if r.iter().any(|s| *s == "ls") {
- match input {
- &Input::File(ref ifile) => {
+ match *input {
+ Input::File(ref ifile) => {
let path = &(*ifile);
let mut v = Vec::new();
locator::list_file_metadata(&sess.target.target, path, metadata_loader, &mut v)
.unwrap();
println!("{}", String::from_utf8(v).unwrap());
}
- &Input::Str { .. } => {
+ Input::Str { .. } => {
early_error(ErrorOutputType::default(), "cannot list metadata for stdin");
}
}
}
fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) {
- if self.treat_err_as_bug() {
+ // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before
+ // incrementing `err_count` by one, so we need to +1 the comparing.
+ // FIXME: Would be nice to increment err_count in a more coherent way.
+ if self.flags.treat_err_as_bug.map(|c| self.err_count() + 1 >= c).unwrap_or(false) {
// FIXME: don't abort here if report_delayed_bugs is off
self.span_bug(sp, msg);
}
///
/// To resolve the path to a `DefId`, call [`qpath_res`].
///
-/// [`qpath_res`]: ../ty/struct.TypeckTables.html#method.qpath_res
+/// [`qpath_res`]: ../rustc_middle/ty/struct.TypeckTables.html#method.qpath_res
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
pub enum QPath<'hir> {
/// Path to a definition, optionally "fully-qualified" with a `Self`
None
};
printer.name_resolver = Some(Box::new(&getter));
- let _ = ty.print(printer);
+ let _ = if let ty::FnDef(..) = ty.kind {
+ // We don't want the regular output for `fn`s because it includes its path in
+ // invalid pseduo-syntax, we want the `fn`-pointer output instead.
+ ty.fn_sig(self.tcx).print(printer)
+ } else {
+ ty.print(printer)
+ };
s
};
// like `T` and `T::Item`. It may not work as well for things
// like `<T as Foo<'a>>::Item`.
let c_b = self.param_env.caller_bounds;
- let param_bounds = self.collect_outlives_from_predicate_list(&compare_ty, c_b);
+ let param_bounds = self.collect_outlives_from_predicate_list(&compare_ty, c_b.into_iter());
// Next, collect regions we scraped from the well-formedness
// constraints in the fn signature. To do that, we walk the list
let tcx = self.tcx;
let assoc_item = tcx.associated_item(assoc_item_def_id);
let trait_def_id = assoc_item.container.assert_trait();
- let trait_predicates =
- tcx.predicates_of(trait_def_id).predicates.iter().map(|(p, _)| *p).collect();
+ let trait_predicates = tcx.predicates_of(trait_def_id).predicates.iter().map(|(p, _)| *p);
let identity_substs = InternalSubsts::identity_for_item(tcx, assoc_item_def_id);
let identity_proj = tcx.mk_projection(assoc_item_def_id, identity_substs);
self.collect_outlives_from_predicate_list(
move |ty| ty == identity_proj,
- traits::elaborate_predicates(tcx, trait_predicates)
- .map(|o| o.predicate)
- .collect::<Vec<_>>(),
+ traits::elaborate_predicates(tcx, trait_predicates).map(|o| o.predicate),
)
.map(|b| b.1)
}
fn collect_outlives_from_predicate_list(
&self,
compare_ty: impl Fn(Ty<'tcx>) -> bool,
- predicates: impl IntoIterator<Item = impl AsRef<ty::Predicate<'tcx>>>,
+ predicates: impl Iterator<Item = impl AsRef<ty::Predicate<'tcx>>>,
) -> impl Iterator<Item = ty::OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>>> {
predicates
- .into_iter()
.filter_map(|p| p.as_ref().to_opt_type_outlives())
.filter_map(|p| p.no_bound_vars())
.filter(move |p| compare_ty(p.0))
tcx: TyCtxt<'tcx>,
trait_ref: ty::PolyTraitRef<'tcx>,
) -> Elaborator<'tcx> {
- elaborate_predicates(tcx, vec![trait_ref.without_const().to_predicate()])
+ elaborate_predicates(tcx, std::iter::once(trait_ref.without_const().to_predicate()))
}
pub fn elaborate_trait_refs<'tcx>(
tcx: TyCtxt<'tcx>,
trait_refs: impl Iterator<Item = ty::PolyTraitRef<'tcx>>,
) -> Elaborator<'tcx> {
- let predicates = trait_refs.map(|trait_ref| trait_ref.without_const().to_predicate()).collect();
+ let predicates = trait_refs.map(|trait_ref| trait_ref.without_const().to_predicate());
elaborate_predicates(tcx, predicates)
}
pub fn elaborate_predicates<'tcx>(
tcx: TyCtxt<'tcx>,
- mut predicates: Vec<ty::Predicate<'tcx>>,
+ predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
) -> Elaborator<'tcx> {
- let mut visited = PredicateSet::new(tcx);
- predicates.retain(|pred| visited.insert(pred));
- let obligations: Vec<_> =
+ let obligations =
predicates.into_iter().map(|predicate| predicate_obligation(predicate, None)).collect();
elaborate_obligations(tcx, obligations)
}
// Get predicates declared on the trait.
let predicates = tcx.super_predicates_of(data.def_id());
- let obligations = predicates.predicates.iter().map(|(pred, span)| {
+ let obligations = predicates.predicates.into_iter().map(|(pred, span)| {
predicate_obligation(
pred.subst_supertrait(tcx, &data.to_poly_trait_ref()),
Some(*span),
)
});
- debug!("super_predicates: data={:?} predicates={:?}", data, &obligations);
+ debug!("super_predicates: data={:?}", data);
// Only keep those bounds that we haven't already seen.
// This is necessary to prevent infinite recursion in some
// cases. One common case is when people define
// `trait Sized: Sized { }` rather than `trait Sized { }`.
let visited = &mut self.visited;
- let obligations =
- obligations.filter(|obligation| visited.insert(&obligation.predicate));
+ let obligations = obligations.filter(|o| visited.insert(&o.predicate));
self.stack.extend(obligations);
}
});
sess.time("MIR_borrow_checking", || {
- tcx.par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id.to_def_id()));
+ tcx.par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id));
});
sess.time("dumping_chalk_like_clauses", || {
_ => return,
};
- let attrs = &*tcx.get_attrs(def_id);
+ let attrs = &*tcx.get_attrs(def_id.to_def_id());
let attrs = attrs.iter().filter(|attr| attr.check_name(sym::rustc_error));
for attr in attrs {
match attr.meta_item_list() {
use rustc_span::edition::{Edition, DEFAULT_EDITION};
use rustc_span::symbol::sym;
use rustc_span::SourceFileHashAlgorithm;
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy};
+use rustc_target::spec::{RelocModel, RelroLevel, TlsModel};
use std::collections::{BTreeMap, BTreeSet};
use std::iter::FromIterator;
use std::path::PathBuf;
tracked!(prefer_dynamic, true);
tracked!(profile_generate, SwitchWithOptPath::Enabled(None));
tracked!(profile_use, Some(PathBuf::from("abc")));
- tracked!(relocation_model, Some(String::from("relocation model")));
+ tracked!(relocation_model, Some(RelocModel::Pic));
tracked!(soft_float, true);
tracked!(target_cpu, Some(String::from("abc")));
tracked!(target_feature, String::from("all the features, all of them"));
tracked!(symbol_mangling_version, SymbolManglingVersion::V0);
tracked!(teach, true);
tracked!(thinlto, Some(true));
- tracked!(tls_model, Some(String::from("tls model")));
+ tracked!(tls_model, Some(TlsModel::GeneralDynamic));
tracked!(treat_err_as_bug, Some(1));
tracked!(unleash_the_miri_inside_of_you, true);
tracked!(verify_llvm_ir, true);
}
fn load_backend_from_dylib(path: &Path) -> fn() -> Box<dyn CodegenBackend> {
- let lib = DynamicLibrary::open(Some(path)).unwrap_or_else(|err| {
+ let lib = DynamicLibrary::open(path).unwrap_or_else(|err| {
let err = format!("couldn't load codegen backend {:?}: {:?}", path, err);
early_error(ErrorOutputType::default(), &err);
});
| ast::TyKind::Rptr(_, ast::MutTy { ty: ref subty, .. })
| ast::TyKind::Paren(ref subty) => involves_impl_trait(subty),
ast::TyKind::Tup(ref tys) => any_involves_impl_trait(tys.iter()),
- ast::TyKind::Path(_, ref path) => path.segments.iter().any(|seg| {
- match seg.args.as_ref().map(|generic_arg| &**generic_arg) {
+ ast::TyKind::Path(_, ref path) => {
+ path.segments.iter().any(|seg| match seg.args.as_deref() {
None => false,
Some(&ast::GenericArgs::AngleBracketed(ref data)) => {
data.args.iter().any(|arg| match arg {
any_involves_impl_trait(data.inputs.iter())
|| ReplaceBodyWithLoop::should_ignore_fn(&data.output)
}
- }
- }),
+ })
+ }
_ => false,
}
}
/// (e.g. "#![deny(missing_docs)]").
pub fn strip_shebang(input: &str) -> Option<usize> {
debug_assert!(!input.is_empty());
- let s: &str = &remove_whitespace(input);
- if !s.starts_with("#!") || s.starts_with("#![") {
+ if !input.starts_with("#!") || input.starts_with("#![") {
return None;
}
Some(input.find('\n').unwrap_or(input.len()))
}
-fn remove_whitespace(s: &str) -> String {
- s.chars().filter(|c| !c.is_whitespace()).collect()
-}
-
/// Parses the first token from the provided input string.
pub fn first_token(input: &str) -> Token {
debug_assert!(!input.is_empty());
}),
);
}
-
- #[test]
- fn test_valid_shebang() {
- // https://github.com/rust-lang/rust/issues/70528
- let input = "#!/usr/bin/rustrun";
- let actual = strip_shebang(input);
- let expected: Option<usize> = Some(18);
- assert_eq!(expected, actual);
- }
-
- #[test]
- fn test_invalid_shebang_valid_rust_syntax() {
- // https://github.com/rust-lang/rust/issues/70528
- let input = "#! [bad_attribute]";
- let actual = strip_shebang(input);
- let expected: Option<usize> = None;
- assert_eq!(expected, actual);
- }
}
use rustc_ast::ast;
use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt;
use rustc_session::lint::builtin::{
*providers = Providers { lint_mod, ..*providers };
}
-fn lint_mod(tcx: TyCtxt<'_>, module_def_id: DefId) {
- late::late_lint_mod(
- tcx,
- module_def_id.expect_local(),
- BuiltinCombinedModuleLateLintPass::new(),
- );
+fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
+ late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
}
macro_rules! pre_expansion_lint_passes {
// Make sure the path contains a / or the linker will search for it.
let path = env::current_dir().unwrap().join(path);
- let lib = match DynamicLibrary::open(Some(&path)) {
+ let lib = match DynamicLibrary::open(&path) {
Ok(lib) => lib,
Err(err) => self.sess.span_fatal(span, &err),
};
}
impl DynamicLibrary {
- /// Lazily open a dynamic library. When passed None it gives a
- /// handle to the calling process
- pub fn open(filename: Option<&Path>) -> Result<DynamicLibrary, String> {
- let maybe_library = dl::open(filename.map(|path| path.as_os_str()));
+ /// Lazily open a dynamic library.
+ pub fn open(filename: &Path) -> Result<DynamicLibrary, String> {
+ let maybe_library = dl::open(filename.as_os_str());
// The dynamic library must not be constructed if there is
// an error opening the library so the destructor does not
use std::ptr;
use std::str;
- pub(super) fn open(filename: Option<&OsStr>) -> Result<*mut u8, String> {
+ pub(super) fn open(filename: &OsStr) -> Result<*mut u8, String> {
check_for_errors_in(|| unsafe {
- match filename {
- Some(filename) => open_external(filename),
- None => open_internal(),
- }
+ let s = CString::new(filename.as_bytes()).unwrap();
+ libc::dlopen(s.as_ptr(), libc::RTLD_LAZY) as *mut u8
})
}
- unsafe fn open_external(filename: &OsStr) -> *mut u8 {
- let s = CString::new(filename.as_bytes()).unwrap();
- libc::dlopen(s.as_ptr(), libc::RTLD_LAZY) as *mut u8
- }
-
- unsafe fn open_internal() -> *mut u8 {
- libc::dlopen(ptr::null(), libc::RTLD_LAZY) as *mut u8
- }
-
fn check_for_errors_in<T, F>(f: F) -> Result<T, String>
where
F: FnOnce() -> T,
use winapi::shared::minwindef::HMODULE;
use winapi::um::errhandlingapi::SetThreadErrorMode;
- use winapi::um::libloaderapi::{FreeLibrary, GetModuleHandleExW, GetProcAddress, LoadLibraryW};
+ use winapi::um::libloaderapi::{FreeLibrary, GetProcAddress, LoadLibraryW};
use winapi::um::winbase::SEM_FAILCRITICALERRORS;
- pub(super) fn open(filename: Option<&OsStr>) -> Result<*mut u8, String> {
+ pub(super) fn open(filename: &OsStr) -> Result<*mut u8, String> {
// disable "dll load failed" error dialog.
let prev_error_mode = unsafe {
let new_error_mode = SEM_FAILCRITICALERRORS;
prev_error_mode
};
- let result = match filename {
- Some(filename) => {
- let filename_str: Vec<_> = filename.encode_wide().chain(Some(0)).collect();
- let result = unsafe { LoadLibraryW(filename_str.as_ptr()) } as *mut u8;
- ptr_result(result)
- }
- None => {
- let mut handle = ptr::null_mut();
- let succeeded = unsafe { GetModuleHandleExW(0, ptr::null(), &mut handle) };
- if succeeded == 0 {
- Err(io::Error::last_os_error().to_string())
- } else {
- Ok(handle as *mut u8)
- }
- }
- };
+ let filename_str: Vec<_> = filename.encode_wide().chain(Some(0)).collect();
+ let result = unsafe { LoadLibraryW(filename_str.as_ptr()) } as *mut u8;
+ let result = ptr_result(result);
unsafe {
SetThreadErrorMode(prev_error_mode, ptr::null_mut());
use super::*;
-use std::mem;
-
-#[test]
-fn test_loading_atoi() {
- if cfg!(windows) {
- return;
- }
-
- // The C library does not need to be loaded since it is already linked in
- let lib = match DynamicLibrary::open(None) {
- Err(error) => panic!("Could not load self as module: {}", error),
- Ok(lib) => lib,
- };
-
- let atoi: extern "C" fn(*const libc::c_char) -> libc::c_int = unsafe {
- match lib.symbol("atoi") {
- Err(error) => panic!("Could not load function atoi: {}", error),
- Ok(atoi) => mem::transmute::<*mut u8, _>(atoi),
- }
- };
-
- let argument = CString::new("1383428980").unwrap();
- let expected_result = 0x52757374;
- let result = atoi(argument.as_ptr());
- if result != expected_result {
- panic!("atoi({:?}) != {} but equaled {} instead", argument, expected_result, result)
- }
-}
#[test]
fn test_errors_do_not_crash() {
// Open /dev/null as a library to get an error, and make sure
// that only causes an error, and not a crash.
let path = Path::new("/dev/null");
- match DynamicLibrary::open(Some(&path)) {
+ match DynamicLibrary::open(&path) {
Err(_) => {}
Ok(_) => panic!("Successfully opened the empty library."),
}
ident,
id: ast::DUMMY_NODE_ID,
span,
- attrs: attrs.iter().cloned().collect(),
+ attrs: attrs.to_vec(),
kind: ast::ItemKind::MacroDef(data.get_macro(id.index, sess)),
vis: source_map::respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited),
tokens: None,
use rustc_ast::ast::{self, Ident};
use rustc_ast::attr;
use rustc_data_structures::fingerprint::Fingerprint;
-use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_data_structures::sync::{join, Lrc};
use rustc_hir as hir;
use rustc_hir::def::CtorKind;
-use rustc_hir::def_id::DefIdSet;
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::definitions::DefPathTable;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
self.encode_generics(def_id);
self.encode_explicit_predicates(def_id);
self.encode_inferred_outlives(def_id);
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
fn encode_enum_variant_ctor(&mut self, def: &ty::AdtDef, index: VariantIdx) {
self.encode_generics(def_id);
self.encode_explicit_predicates(def_id);
self.encode_inferred_outlives(def_id);
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
fn encode_info_for_mod(
self.encode_generics(def_id);
self.encode_explicit_predicates(def_id);
self.encode_inferred_outlives(def_id);
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
fn encode_generics(&mut self, def_id: DefId) {
self.encode_inferred_outlives(def_id);
// This should be kept in sync with `PrefetchVisitor.visit_trait_item`.
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
fn metadata_output_only(&self) -> bool {
hir::ImplItemKind::OpaqueTy(..) | hir::ImplItemKind::TyAlias(..) => false,
};
if mir {
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
}
self.lazy(param_names.iter().map(|ident| ident.name))
}
- fn encode_optimized_mir(&mut self, def_id: DefId) {
+ fn encode_optimized_mir(&mut self, def_id: LocalDefId) {
debug!("EntryBuilder::encode_mir({:?})", def_id);
if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) {
- record!(self.tables.mir[def_id] <- self.tcx.optimized_mir(def_id));
+ record!(self.tables.mir[def_id.to_def_id()] <- self.tcx.optimized_mir(def_id));
}
}
- fn encode_promoted_mir(&mut self, def_id: DefId) {
+ fn encode_promoted_mir(&mut self, def_id: LocalDefId) {
debug!("EncodeContext::encode_promoted_mir({:?})", def_id);
if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) {
- record!(self.tables.promoted_mir[def_id] <- self.tcx.promoted_mir(def_id));
+ record!(self.tables.promoted_mir[def_id.to_def_id()] <- self.tcx.promoted_mir(def_id));
}
}
_ => false,
};
if mir {
- self.encode_optimized_mir(def_id);
- self.encode_promoted_mir(def_id);
+ self.encode_optimized_mir(def_id.expect_local());
+ self.encode_promoted_mir(def_id.expect_local());
}
}
let hir_id = self.tcx.hir().as_local_hir_id(def_id);
let ty = self.tcx.typeck_tables_of(def_id).node_type(hir_id);
- let def_id = def_id.to_def_id();
- record!(self.tables.kind[def_id] <- match ty.kind {
+ record!(self.tables.kind[def_id.to_def_id()] <- match ty.kind {
ty::Generator(..) => {
let data = self.tcx.generator_kind(def_id).unwrap();
EntryKind::Generator(data)
_ => bug!("closure that is neither generator nor closure"),
});
- record!(self.tables.visibility[def_id] <- ty::Visibility::Public);
- record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
- record!(self.tables.attributes[def_id] <- &self.tcx.get_attrs(def_id)[..]);
- self.encode_item_type(def_id);
+ record!(self.tables.visibility[def_id.to_def_id()] <- ty::Visibility::Public);
+ record!(self.tables.span[def_id.to_def_id()] <- self.tcx.def_span(def_id));
+ record!(self.tables.attributes[def_id.to_def_id()] <- &self.tcx.get_attrs(def_id.to_def_id())[..]);
+ self.encode_item_type(def_id.to_def_id());
if let ty::Closure(def_id, substs) = ty.kind {
record!(self.tables.fn_sig[def_id] <- substs.as_closure().sig());
}
- self.encode_generics(def_id);
+ self.encode_generics(def_id.to_def_id());
self.encode_optimized_mir(def_id);
self.encode_promoted_mir(def_id);
}
let id = self.tcx.hir().as_local_hir_id(def_id);
let body_id = self.tcx.hir().body_owned_by(id);
let const_data = self.encode_rendered_const_for_body(body_id);
- let def_id = def_id.to_def_id();
let qualifs = self.tcx.mir_const_qualif(def_id);
- record!(self.tables.kind[def_id] <- EntryKind::Const(qualifs, const_data));
- record!(self.tables.visibility[def_id] <- ty::Visibility::Public);
- record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
- self.encode_item_type(def_id);
- self.encode_generics(def_id);
- self.encode_explicit_predicates(def_id);
- self.encode_inferred_outlives(def_id);
+ record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::Const(qualifs, const_data));
+ record!(self.tables.visibility[def_id.to_def_id()] <- ty::Visibility::Public);
+ record!(self.tables.span[def_id.to_def_id()] <- self.tcx.def_span(def_id));
+ self.encode_item_type(def_id.to_def_id());
+ self.encode_generics(def_id.to_def_id());
+ self.encode_explicit_predicates(def_id.to_def_id());
+ self.encode_inferred_outlives(def_id.to_def_id());
self.encode_optimized_mir(def_id);
self.encode_promoted_mir(def_id);
}
/// Only a subset of the queries are actually prefetched to keep this code smaller.
struct PrefetchVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
- mir_keys: &'tcx DefIdSet,
+ mir_keys: &'tcx FxHashSet<LocalDefId>,
}
impl<'tcx> PrefetchVisitor<'tcx> {
fn prefetch_mir(&self, def_id: LocalDefId) {
- let def_id = def_id.to_def_id();
if self.mir_keys.contains(&def_id) {
self.tcx.optimized_mir(def_id);
self.tcx.promoted_mir(def_id);
rustc_hir::def_id::DefId,
rustc_middle::ty::subst::SubstsRef<$tcx>
)>,
- [few, decode] mir_keys: rustc_hir::def_id::DefIdSet,
+ [few, decode] collect_and_partition_mono_items: rustc_hir::def_id::DefIdSet,
+ [few, decode] mir_keys: rustc_data_structures::fx::FxHashSet<rustc_hir::def_id::LocalDefId>,
[decode] specialization_graph: rustc_middle::traits::specialization_graph::Graph,
[] region_scope_tree: rustc_middle::middle::region::ScopeTree,
[] item_local_set: rustc_hir::ItemLocalSet,
InvalidUndefBytes(Option<Pointer>),
/// Working with a local that is not currently live.
DeadLocal,
+ /// Data size is not equal to target size.
+ ScalarSizeMismatch {
+ target_size: u64,
+ data_size: u64,
+ },
}
impl fmt::Debug for UndefinedBehaviorInfo {
"using uninitialized data, but this operation requires initialized memory"
),
DeadLocal => write!(f, "accessing a dead local variable"),
+ ScalarSizeMismatch { target_size, data_size } => write!(
+ f,
+ "scalar size mismatch: expected {} bytes but got {} bytes instead",
+ target_size, data_size
+ ),
}
}
}
assert_ne!(target_size.bytes(), 0, "you should never look at the bits of a ZST");
match self {
Scalar::Raw { data, size } => {
- assert_eq!(target_size.bytes(), u64::from(size));
+ if target_size.bytes() != u64::from(size) {
+ throw_ub!(ScalarSizeMismatch {
+ target_size: target_size.bytes(),
+ data_size: u64::from(size),
+ });
+ }
Scalar::check_data(data, size);
Ok(data)
}
/// Examples include `{ ...; tail };` and `let _ = { ...; tail };`
/// but not e.g., `let _x = { ...; tail };`
pub tail_result_is_ignored: bool,
+
+ /// `Span` of the tail expression.
+ pub span: Span,
}
/// A MIR local.
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
-use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use rustc_hir::HirId;
use rustc_session::config::OptLevel;
use rustc_span::source_map::Span;
// linkage, then we'll be creating a globally shared version.
if self.explicit_linkage(tcx).is_some()
|| !instance.def.generates_cgu_internal_copy(tcx)
- || Some(instance.def_id()) == entry_def_id
+ || Some(instance.def_id()) == entry_def_id.map(LocalDefId::to_def_id)
{
return InstantiationMode::GloballyShared { may_conflict: false };
}
pub struct ConstQualifs {
pub has_mut_interior: bool,
pub needs_drop: bool,
+ pub custom_eq: bool,
}
/// After we borrow check a closure, we are left with various
/// Set of all the `DefId`s in this crate that have MIR associated with
/// them. This includes all the body owners, but also things like struct
/// constructors.
- query mir_keys(_: CrateNum) -> &'tcx DefIdSet {
+ query mir_keys(_: CrateNum) -> &'tcx FxHashSet<LocalDefId> {
desc { "getting a list of all mir_keys" }
}
/// Fetch the MIR for a given `DefId` right after it's built - this includes
/// unreachable code.
- query mir_built(_: DefId) -> &'tcx Steal<mir::Body<'tcx>> {
+ query mir_built(_: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
desc { "building MIR for" }
}
no_hash
}
- query mir_validated(_: DefId) ->
+ query mir_validated(key: LocalDefId) ->
(
&'tcx Steal<mir::Body<'tcx>>,
&'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
) {
no_hash
+ desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
}
/// MIR after our optimization passes have run. This is MIR that is ready
/// To avoid cycles within the predicates of a single item we compute
/// per-type-parameter predicates for resolving `T::AssocTy`.
- query type_param_predicates(key: (DefId, DefId)) -> ty::GenericPredicates<'tcx> {
+ query type_param_predicates(key: (DefId, LocalDefId)) -> ty::GenericPredicates<'tcx> {
desc { |tcx| "computing the bounds for type parameter `{}`", {
- let id = tcx.hir().as_local_hir_id(key.1.expect_local());
+ let id = tcx.hir().as_local_hir_id(key.1);
tcx.hir().ty_param_name(id)
}}
}
TypeChecking {
/// The result of unsafety-checking this `DefId`.
- query unsafety_check_result(key: DefId) -> mir::UnsafetyCheckResult {
- desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
- cache_on_disk_if { key.is_local() }
+ query unsafety_check_result(key: LocalDefId) -> mir::UnsafetyCheckResult {
+ desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+ cache_on_disk_if { true }
}
/// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error
}
Other {
- query lint_mod(key: DefId) -> () {
- desc { |tcx| "linting {}", describe_as_module(key, tcx) }
+ query lint_mod(key: LocalDefId) -> () {
+ desc { |tcx| "linting {}", describe_as_module(key.to_def_id(), tcx) }
}
/// Checks the attributes in the module.
desc { |tcx| "checking item types in {}", describe_as_module(key, tcx) }
}
- query check_mod_privacy(key: DefId) -> () {
- desc { |tcx| "checking privacy in {}", describe_as_module(key, tcx) }
+ query check_mod_privacy(key: LocalDefId) -> () {
+ desc { |tcx| "checking privacy in {}", describe_as_module(key.to_def_id(), tcx) }
}
query check_mod_intrinsics(key: DefId) -> () {
desc { "type-checking all item bodies" }
}
- query typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> {
- desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
- cache_on_disk_if { key.is_local() }
+ query typeck_tables_of(key: LocalDefId) -> &'tcx ty::TypeckTables<'tcx> {
+ desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+ cache_on_disk_if { true }
}
- query diagnostic_only_typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> {
- cache_on_disk_if { key.is_local() }
+ query diagnostic_only_typeck_tables_of(key: LocalDefId) -> &'tcx ty::TypeckTables<'tcx> {
+ desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+ cache_on_disk_if { true }
load_cached(tcx, id) {
let typeck_tables: Option<ty::TypeckTables<'tcx>> = tcx
.queries.on_disk_cache
}
Other {
- query used_trait_imports(key: DefId) -> &'tcx DefIdSet {
- cache_on_disk_if { key.is_local() }
+ query used_trait_imports(key: LocalDefId) -> &'tcx DefIdSet {
+ desc { |tcx| "used_trait_imports `{}`", tcx.def_path_str(key.to_def_id()) }
+ cache_on_disk_if { true }
}
}
BorrowChecking {
/// Borrow-checks the function body. If this is a closure, returns
/// additional requirements that the closure's creator must verify.
- query mir_borrowck(key: DefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
- desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key) }
+ query mir_borrowck(key: LocalDefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
+ desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key.to_def_id()) }
cache_on_disk_if(tcx, opt_result) {
- key.is_local()
- && (tcx.is_closure(key)
- || opt_result.map_or(false, |r| !r.concrete_opaque_types.is_empty()))
+ tcx.is_closure(key.to_def_id())
+ || opt_result.map_or(false, |r| !r.concrete_opaque_types.is_empty())
}
}
}
TypeChecking {
query impl_defaultness(_: DefId) -> hir::Defaultness {}
- query check_item_well_formed(_: DefId) -> () {}
- query check_trait_item_well_formed(_: DefId) -> () {}
- query check_impl_item_well_formed(_: DefId) -> () {}
+ query check_item_well_formed(key: LocalDefId) -> () {
+ desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+ }
+ query check_trait_item_well_formed(key: LocalDefId) -> () {
+ desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+ }
+ query check_impl_item_well_formed(key: LocalDefId) -> () {
+ desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+ }
}
Linking {
/// Identifies the entry-point (e.g., the `main` function) for a given
/// crate, returning `None` if there is no entry point (such as for library crates).
- query entry_fn(_: CrateNum) -> Option<(DefId, EntryFnType)> {
+ query entry_fn(_: CrateNum) -> Option<(LocalDefId, EntryFnType)> {
desc { "looking up the entry function of a crate" }
}
query plugin_registrar_fn(_: CrateNum) -> Option<DefId> {
query upvars(_: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
eval_always
}
- query maybe_unused_trait_import(_: DefId) -> bool {
+ query maybe_unused_trait_import(def_id: LocalDefId) -> bool {
eval_always
+ desc { |tcx| "maybe_unused_trait_import for `{}`", tcx.def_path_str(def_id.to_def_id()) }
}
query maybe_unused_extern_crates(_: CrateNum)
-> &'tcx [(DefId, Span)] {
eval_always
desc { "looking up all possibly unused extern crates" }
}
- query names_imported_by_glob_use(_: DefId)
+ query names_imported_by_glob_use(def_id: LocalDefId)
-> &'tcx FxHashSet<ast::Name> {
eval_always
+ desc { |tcx| "names_imported_by_glob_use for `{}`", tcx.def_path_str(def_id.to_def_id()) }
}
query stability_index(_: CrateNum) -> &'tcx stability::Index<'tcx> {
pub queries: query::Queries<'tcx>,
- maybe_unused_trait_imports: FxHashSet<DefId>,
+ maybe_unused_trait_imports: FxHashSet<LocalDefId>,
maybe_unused_extern_crates: Vec<(DefId, Span)>,
/// A map of glob use to a set of names it actually imports. Currently only
/// used in save-analysis.
- glob_map: FxHashMap<DefId, FxHashSet<ast::Name>>,
+ glob_map: FxHashMap<LocalDefId, FxHashSet<ast::Name>>,
/// Extern prelude entries. The value is `true` if the entry was introduced
/// via `extern crate` item and not `--extern` option or compiler built-in.
pub extern_prelude: FxHashMap<ast::Name, bool>,
maybe_unused_trait_imports: resolutions
.maybe_unused_trait_imports
.into_iter()
- .map(|id| definitions.local_def_id(id).to_def_id())
+ .map(|id| definitions.local_def_id(id))
.collect(),
maybe_unused_extern_crates: resolutions
.maybe_unused_extern_crates
glob_map: resolutions
.glob_map
.into_iter()
- .map(|(id, names)| (definitions.local_def_id(id).to_def_id(), names))
+ .map(|(id, names)| (definitions.local_def_id(id), names))
.collect(),
extern_prelude: resolutions.extern_prelude,
untracked_crate: krate,
assert_eq!(cnum, LOCAL_CRATE);
&tcx.maybe_unused_extern_crates[..]
};
- providers.names_imported_by_glob_use = |tcx, id| {
- assert_eq!(id.krate, LOCAL_CRATE);
- tcx.arena.alloc(tcx.glob_map.get(&id).cloned().unwrap_or_default())
- };
+ providers.names_imported_by_glob_use =
+ |tcx, id| tcx.arena.alloc(tcx.glob_map.get(&id).cloned().unwrap_or_default());
providers.lookup_stability = |tcx, id| {
let id = tcx.hir().local_def_id_to_hir_id(id.expect_local());
impl<'tcx> TyCtxt<'tcx> {
pub fn body_tables(self, body: hir::BodyId) -> &'tcx TypeckTables<'tcx> {
- self.typeck_tables_of(self.hir().body_owner_def_id(body).to_def_id())
+ self.typeck_tables_of(self.hir().body_owner_def_id(body))
}
/// Returns an iterator of the `DefId`s for all body-owners in this
}
}
+impl Key for (DefId, LocalDefId) {
+ type CacheSelector = DefaultCacheSelector;
+
+ fn query_crate(&self) -> CrateNum {
+ self.0.krate
+ }
+ fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
+ self.1.default_span(tcx)
+ }
+}
+
impl Key for (CrateNum, DefId) {
type CacheSelector = DefaultCacheSelector;
}
/// Returns a vector containing all impls
- pub fn all_impls(self, def_id: DefId) -> Vec<DefId> {
- let impls = self.trait_impls_of(def_id);
+ pub fn all_impls(self, def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
+ let TraitImpls { blanket_impls, non_blanket_impls } = self.trait_impls_of(def_id);
- impls
- .blanket_impls
- .iter()
- .chain(impls.non_blanket_impls.values().flatten())
+ blanket_impls
+ .into_iter()
+ .chain(non_blanket_impls.into_iter().map(|(_, v)| v).flatten())
.cloned()
- .collect()
}
}
.ty;
let needs_note = match ty.kind {
ty::Closure(id, _) => {
- let tables = self.infcx.tcx.typeck_tables_of(id);
+ let tables = self.infcx.tcx.typeck_tables_of(id.expect_local());
let hir_id = self.infcx.tcx.hir().as_local_hir_id(id.expect_local());
tables.closure_kind_origins().get(hir_id).is_none()
match &self
.infcx
.tcx
- .typeck_tables_of(self.mir_def_id)
+ .typeck_tables_of(def_id)
.node_type(fn_hir_id)
.kind
{
err.span_label(body.source_info(drop_loc).span, message);
if let Some(info) = &local_decl.is_block_tail {
- // FIXME: use span_suggestion instead, highlighting the
- // whole block tail expression.
- let msg = if info.tail_result_is_ignored {
- "The temporary is part of an expression at the end of a block. \
- Consider adding semicolon after the expression so its temporaries \
- are dropped sooner, before the local variables declared by the \
- block are dropped."
+ if info.tail_result_is_ignored {
+ err.span_suggestion_verbose(
+ info.span.shrink_to_hi(),
+ "consider adding semicolon after the expression so its \
+ temporaries are dropped sooner, before the local variables \
+ declared by the block are dropped",
+ ";".to_string(),
+ Applicability::MaybeIncorrect,
+ );
} else {
- "The temporary is part of an expression at the end of a block. \
- Consider forcing this temporary to be dropped sooner, before \
- the block's local variables are dropped. \
- For example, you could save the expression's value in a new \
- local variable `x` and then make `x` be the expression \
- at the end of the block."
+ err.note(
+ "the temporary is part of an expression at the end of a \
+ block;\nconsider forcing this temporary to be dropped sooner, \
+ before the block's local variables are dropped",
+ );
+ err.multipart_suggestion(
+ "for example, you could save the expression's value in a new \
+ local variable `x` and then make `x` be the expression at the \
+ end of the block",
+ vec![
+ (info.span.shrink_to_lo(), "let x = ".to_string()),
+ (info.span.shrink_to_hi(), "; x".to_string()),
+ ],
+ Applicability::MaybeIncorrect,
+ );
};
-
- err.note(msg);
}
}
}
debug!("add_moved_or_invoked_closure_note: closure={:?}", closure);
if let ty::Closure(did, _) = self.body.local_decls[closure].ty.kind {
- let hir_id = self.infcx.tcx.hir().as_local_hir_id(did.expect_local());
+ let did = did.expect_local();
+ let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
if let Some((span, name)) =
self.infcx.tcx.typeck_tables_of(did).closure_kind_origins().get(hir_id)
// Check if we are just moving a closure after it has been invoked.
if let Some(target) = target {
if let ty::Closure(did, _) = self.body.local_decls[target].ty.kind {
- let hir_id = self.infcx.tcx.hir().as_local_hir_id(did.expect_local());
+ let did = did.expect_local();
+ let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
if let Some((span, name)) =
self.infcx.tcx.typeck_tables_of(did).closure_kind_origins().get(hir_id)
*providers = Providers { mir_borrowck, ..*providers };
}
-fn mir_borrowck(tcx: TyCtxt<'_>, def_id: DefId) -> &BorrowCheckResult<'_> {
+fn mir_borrowck(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &BorrowCheckResult<'_> {
let (input_body, promoted) = tcx.mir_validated(def_id);
- debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id));
+ debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id.to_def_id()));
let opt_closure_req = tcx.infer_ctxt().enter(|infcx| {
let input_body: &Body<'_> = &input_body.borrow();
let promoted: &IndexVec<_, _> = &promoted.borrow();
- do_mir_borrowck(&infcx, input_body, promoted, def_id.expect_local())
+ do_mir_borrowck(&infcx, input_body, promoted, def_id)
});
debug!("mir_borrowck done");
match **aggregate_kind {
AggregateKind::Closure(def_id, _) | AggregateKind::Generator(def_id, _, _) => {
let BorrowCheckResult { used_mut_upvars, .. } =
- self.infcx.tcx.mir_borrowck(def_id);
+ self.infcx.tcx.mir_borrowck(def_id.expect_local());
debug!("{:?} used_mut_upvars={:?}", def_id, used_mut_upvars);
for field in used_mut_upvars {
self.propagate_closure_used_mut_upvar(&operands[field.index()]);
if !self.tcx().is_closure(self.mir_def_id) {
user_provided_sig = None;
} else {
- let typeck_tables = self.tcx().typeck_tables_of(self.mir_def_id);
+ let typeck_tables = self.tcx().typeck_tables_of(self.mir_def_id.expect_local());
user_provided_sig = match typeck_tables.user_provided_sigs.get(&self.mir_def_id) {
None => None,
Some(user_provided_poly_sig) => {
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::struct_span_err;
use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_index::vec::{Idx, IndexVec};
use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::infer::outlives::env::RegionBoundPairs;
let fty = self.sanitize_type(place, fty);
match self.field_ty(place, base, field, location) {
Ok(ty) => {
+ let ty = self.cx.normalize(ty, location);
if let Err(terr) = self.cx.eq_types(
ty,
fty,
let tcx = infcx.tcx;
let param_env = self.param_env;
let body = self.body;
- let concrete_opaque_types = &tcx.typeck_tables_of(anon_owner_def_id).concrete_opaque_types;
+ let concrete_opaque_types =
+ &tcx.typeck_tables_of(anon_owner_def_id.expect_local()).concrete_opaque_types;
let mut opaque_type_values = Vec::new();
debug!("eq_opaque_type_and_type: mir_def_id={:?}", self.mir_def_id);
// clauses on the struct.
AggregateKind::Closure(def_id, substs)
| AggregateKind::Generator(def_id, substs, _) => {
- self.prove_closure_bounds(tcx, *def_id, substs, location)
+ self.prove_closure_bounds(tcx, def_id.expect_local(), substs, location)
}
AggregateKind::Array(_) | AggregateKind::Tuple => ty::InstantiatedPredicates::empty(),
fn prove_closure_bounds(
&mut self,
tcx: TyCtxt<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
substs: SubstsRef<'tcx>,
location: Location,
) -> ty::InstantiatedPredicates<'tcx> {
if let Some(ref closure_region_requirements) = tcx.mir_borrowck(def_id).closure_requirements
{
let closure_constraints = QueryRegionConstraints {
- outlives: closure_region_requirements.apply_requirements(tcx, def_id, substs),
+ outlives: closure_region_requirements.apply_requirements(
+ tcx,
+ def_id.to_def_id(),
+ substs,
+ ),
// Presently, closures never propagate member
// constraints to their parents -- they are enforced
let defining_ty = if self.mir_def_id == closure_base_def_id {
tcx.type_of(closure_base_def_id)
} else {
- let tables = tcx.typeck_tables_of(self.mir_def_id);
+ let tables = tcx.typeck_tables_of(self.mir_def_id.expect_local());
tables.node_type(self.mir_hir_id)
};
let cid = key.value;
let def_id = cid.instance.def.def_id();
- if def_id.is_local() && tcx.has_typeck_tables(def_id) {
- if let Some(error_reported) = tcx.typeck_tables_of(def_id).tainted_by_errors {
- return Err(ErrorHandled::Reported(error_reported));
+ if let Some(def_id) = def_id.as_local() {
+ if tcx.has_typeck_tables(def_id) {
+ if let Some(error_reported) = tcx.typeck_tables_of(def_id).tainted_by_errors {
+ return Err(ErrorHandled::Reported(error_reported));
+ }
}
}
use rustc_middle::mir;
use rustc_middle::ty::layout::HasTyCtxt;
use rustc_middle::ty::{self, Ty};
-use std::borrow::{Borrow, Cow};
+use std::borrow::Borrow;
use std::collections::hash_map::Entry;
use std::hash::Hash;
use rustc_span::symbol::Symbol;
use crate::interpret::{
- self, AllocId, Allocation, Frame, GlobalId, ImmTy, InterpCx, InterpResult, Memory, MemoryKind,
- OpTy, PlaceTy, Pointer, Scalar,
+ self, compile_time_machine, AllocId, Allocation, Frame, GlobalId, ImmTy, InterpCx,
+ InterpResult, Memory, OpTy, PlaceTy, Pointer, Scalar,
};
use super::error::*;
}
impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, 'tcx> {
- type MemoryKind = !;
- type PointerTag = ();
- type ExtraFnVal = !;
+ compile_time_machine!(<'mir, 'tcx>);
- type FrameExtra = ();
type MemoryExtra = MemoryExtra;
- type AllocExtra = ();
-
- type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
-
- const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
-
- #[inline(always)]
- fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
- // We do not check for alignment to avoid having to carry an `Align`
- // in `ConstValue::ByRef`.
- false
- }
-
- #[inline(always)]
- fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
- false // for now, we don't enforce validity
- }
fn find_mir_or_eval_fn(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
}))
}
- fn call_extra_fn(
- _ecx: &mut InterpCx<'mir, 'tcx, Self>,
- fn_val: !,
- _args: &[OpTy<'tcx>],
- _ret: Option<(PlaceTy<'tcx>, mir::BasicBlock)>,
- _unwind: Option<mir::BasicBlock>,
- ) -> InterpResult<'tcx> {
- match fn_val {}
- }
-
fn call_intrinsic(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
Err(ConstEvalErrKind::NeedsRfc("pointer arithmetic or comparison".to_string()).into())
}
- #[inline(always)]
- fn init_allocation_extra<'b>(
- _memory_extra: &MemoryExtra,
- _id: AllocId,
- alloc: Cow<'b, Allocation>,
- _kind: Option<MemoryKind<!>>,
- ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
- // We do not use a tag so we can just cheaply forward the allocation
- (alloc, ())
- }
-
- #[inline(always)]
- fn tag_global_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {}
-
fn box_alloc(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
_dest: PlaceTy<'tcx>,
Ok(())
}
- #[inline(always)]
- fn init_frame_extra(
- _ecx: &mut InterpCx<'mir, 'tcx, Self>,
- frame: Frame<'mir, 'tcx>,
- ) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
- Ok(frame)
- }
-
#[inline(always)]
fn stack(
ecx: &'a InterpCx<'mir, 'tcx, Self>,
) -> InterpResult<'tcx, &'tcx mir::Body<'tcx>> {
// do not continue if typeck errors occurred (can only occur in local crate)
let did = instance.def_id();
- if did.is_local() && self.tcx.has_typeck_tables(did) {
- if let Some(error_reported) = self.tcx.typeck_tables_of(did).tainted_by_errors {
- throw_inval!(TypeckError(error_reported))
+ if let Some(did) = did.as_local() {
+ if self.tcx.has_typeck_tables(did) {
+ if let Some(error_reported) = self.tcx.typeck_tables_of(did).tainted_by_errors {
+ throw_inval!(TypeckError(error_reported))
+ }
}
}
trace!("load mir(instance={:?}, promoted={:?})", instance, promoted);
_ptr: Pointer<Self::PointerTag>,
) -> InterpResult<'tcx, u64>;
}
+
+// A lot of the flexibility above is just needed for `Miri`, but all "compile-time" machines
+// (CTFE and ConstProp) use the same instance. Here, we share that code.
+pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
+ type PointerTag = ();
+ type ExtraFnVal = !;
+
+ type MemoryKind = !;
+ type MemoryMap = rustc_data_structures::fx::FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
+ const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
+
+ type AllocExtra = ();
+ type FrameExtra = ();
+
+ #[inline(always)]
+ fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
+ // We do not check for alignment to avoid having to carry an `Align`
+ // in `ConstValue::ByRef`.
+ false
+ }
+
+ #[inline(always)]
+ fn enforce_validity(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
+ false // for now, we don't enforce validity
+ }
+
+ #[inline(always)]
+ fn call_extra_fn(
+ _ecx: &mut InterpCx<$mir, $tcx, Self>,
+ fn_val: !,
+ _args: &[OpTy<$tcx>],
+ _ret: Option<(PlaceTy<$tcx>, mir::BasicBlock)>,
+ _unwind: Option<mir::BasicBlock>,
+ ) -> InterpResult<$tcx> {
+ match fn_val {}
+ }
+
+ #[inline(always)]
+ fn init_allocation_extra<'b>(
+ _memory_extra: &Self::MemoryExtra,
+ _id: AllocId,
+ alloc: Cow<'b, Allocation>,
+ _kind: Option<MemoryKind<!>>,
+ ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
+ // We do not use a tag so we can just cheaply forward the allocation
+ (alloc, ())
+ }
+
+ #[inline(always)]
+ fn tag_global_base_pointer(
+ _memory_extra: &Self::MemoryExtra,
+ _id: AllocId,
+ ) -> Self::PointerTag {
+ ()
+ }
+
+ #[inline(always)]
+ fn init_frame_extra(
+ _ecx: &mut InterpCx<$mir, $tcx, Self>,
+ frame: Frame<$mir, $tcx>,
+ ) -> InterpResult<$tcx, Frame<$mir, $tcx>> {
+ Ok(frame)
+ }
+}
pub use self::eval_context::{Frame, InterpCx, LocalState, LocalValue, StackPopCleanup};
pub use self::intern::{intern_const_alloc_recursive, InternKind};
-pub use self::machine::{AllocMap, Machine, MayLeak, StackPopJump};
+pub use self::machine::{compile_time_machine, AllocMap, Machine, MayLeak, StackPopJump};
pub use self::memory::{AllocCheck, FnVal, Memory, MemoryKind};
pub use self::operand::{ImmTy, Immediate, OpTy, Operand};
pub use self::place::{MPlaceTy, MemPlace, MemPlaceMeta, Place, PlaceTy};
// generators and closures.
ty::Closure(def_id, _) | ty::Generator(def_id, _, _) => {
let mut name = None;
- if def_id.is_local() {
+ if let Some(def_id) = def_id.as_local() {
let tables = self.ecx.tcx.typeck_tables_of(def_id);
- if let Some(upvars) = tables.upvar_list.get(&def_id) {
+ if let Some(upvars) = tables.upvar_list.get(&def_id.to_def_id()) {
// Sometimes the index is beyond the number of upvars (seen
// for a generator).
if let Some((&var_hir_id, _)) = upvars.get_index(field) {
#![feature(const_fn)]
#![feature(const_panic)]
#![feature(crate_visibility_modifier)]
+#![feature(decl_macro)]
#![feature(drain_filter)]
#![feature(exhaustive_patterns)]
#![feature(iter_order_by)]
tcx: TyCtxt<'tcx>,
mode: MonoItemCollectionMode,
output: &'a mut Vec<MonoItem<'tcx>>,
- entry_fn: Option<(DefId, EntryFnType)>,
+ entry_fn: Option<(LocalDefId, EntryFnType)>,
}
impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
&& match self.mode {
MonoItemCollectionMode::Eager => true,
MonoItemCollectionMode::Lazy => {
- self.entry_fn.map(|(id, _)| id) == Some(def_id.to_def_id())
+ self.entry_fn.map(|(id, _)| id) == Some(def_id)
|| self.tcx.is_reachable_non_generic(def_id)
|| self
.tcx
instance,
None,
MirPhase::Const,
- &[
+ &[&[
&add_moves_for_packed_drops::AddMovesForPackedDrops,
&no_landing_pads::NoLandingPads::new(tcx),
&remove_noop_landing_pads::RemoveNoopLandingPads,
&simplify::SimplifyCfg::new("make_shim"),
&add_call_guards::CriticalCallEdges,
- ],
+ ]],
);
debug!("make_shim({:?}) = {:?}", instance, result);
//!
//! See the `Qualif` trait for more info.
+use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::mir::*;
-use rustc_middle::ty::{self, AdtDef, Ty};
+use rustc_middle::ty::{self, subst::SubstsRef, AdtDef, Ty};
use rustc_span::DUMMY_SP;
+use rustc_trait_selection::traits;
use super::ConstCx;
ConstQualifs {
has_mut_interior: HasMutInterior::in_any_value_of_ty(cx, ty),
needs_drop: NeedsDrop::in_any_value_of_ty(cx, ty),
+ custom_eq: CustomEq::in_any_value_of_ty(cx, ty),
}
}
/// with a custom `Drop` impl is inherently `NeedsDrop`.
///
/// Returning `true` for `in_adt_inherently` but `false` for `in_any_value_of_ty` is unsound.
- fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool;
+ fn in_adt_inherently(
+ cx: &ConstCx<'_, 'tcx>,
+ adt: &'tcx AdtDef,
+ substs: SubstsRef<'tcx>,
+ ) -> bool;
}
/// Constant containing interior mutability (`UnsafeCell<T>`).
!ty.is_freeze(cx.tcx, cx.param_env, DUMMY_SP)
}
- fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool {
+ fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &'tcx AdtDef, _: SubstsRef<'tcx>) -> bool {
// Exactly one type, `UnsafeCell`, has the `HasMutInterior` qualif inherently.
// It arises structurally for all other types.
Some(adt.did) == cx.tcx.lang_items().unsafe_cell_type()
ty.needs_drop(cx.tcx, cx.param_env)
}
- fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool {
+ fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &'tcx AdtDef, _: SubstsRef<'tcx>) -> bool {
adt.has_dtor(cx.tcx)
}
}
+/// A constant that cannot be used as part of a pattern in a `match` expression.
+pub struct CustomEq;
+
+impl Qualif for CustomEq {
+ const ANALYSIS_NAME: &'static str = "flow_custom_eq";
+
+ fn in_qualifs(qualifs: &ConstQualifs) -> bool {
+ qualifs.custom_eq
+ }
+
+ fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
+ // If *any* component of a composite data type does not implement `Structural{Partial,}Eq`,
+ // we know that at least some values of that type are not structural-match. I say "some"
+ // because that component may be part of an enum variant (e.g.,
+ // `Option::<NonStructuralMatchTy>::Some`), in which case some values of this type may be
+ // structural-match (`Option::None`).
+ let id = cx.tcx.hir().local_def_id_to_hir_id(cx.def_id.as_local().unwrap());
+ traits::search_for_structural_match_violation(id, cx.body.span, cx.tcx, ty).is_some()
+ }
+
+ fn in_adt_inherently(
+ cx: &ConstCx<'_, 'tcx>,
+ adt: &'tcx AdtDef,
+ substs: SubstsRef<'tcx>,
+ ) -> bool {
+ let ty = cx.tcx.mk_ty(ty::Adt(adt, substs));
+ let id = cx.tcx.hir().local_def_id_to_hir_id(cx.def_id.as_local().unwrap());
+ cx.tcx
+ .infer_ctxt()
+ .enter(|infcx| !traits::type_marked_structural(id, cx.body.span, &infcx, ty))
+ }
+}
+
// FIXME: Use `mir::visit::Visitor` for the `in_*` functions if/when it supports early return.
/// Returns `true` if this `Rvalue` contains qualif `Q`.
Rvalue::Aggregate(kind, operands) => {
// Return early if we know that the struct or enum being constructed is always
// qualified.
- if let AggregateKind::Adt(def, ..) = **kind {
- if Q::in_adt_inherently(cx, def) {
+ if let AggregateKind::Adt(def, _, substs, ..) = **kind {
+ if Q::in_adt_inherently(cx, def, substs) {
return true;
}
}
use std::ops::Deref;
use super::ops::{self, NonConstOp};
-use super::qualifs::{self, HasMutInterior, NeedsDrop};
+use super::qualifs::{self, CustomEq, HasMutInterior, NeedsDrop};
use super::resolver::FlowSensitiveAnalysis;
use super::{is_lang_panic_fn, ConstCx, ConstKind, Qualif};
use crate::const_eval::{is_const_fn, is_unstable_const_fn};
let return_loc = ccx.body.terminator_loc(return_block);
+ let custom_eq = match ccx.const_kind() {
+ // We don't care whether a `const fn` returns a value that is not structurally
+ // matchable. Functions calls are opaque and always use type-based qualification, so
+ // this value should never be used.
+ ConstKind::ConstFn => true,
+
+ // If we know that all values of the return type are structurally matchable, there's no
+ // need to run dataflow.
+ ConstKind::Const | ConstKind::Static | ConstKind::StaticMut
+ if !CustomEq::in_any_value_of_ty(ccx, ccx.body.return_ty()) =>
+ {
+ false
+ }
+
+ ConstKind::Const | ConstKind::Static | ConstKind::StaticMut => {
+ let mut cursor = FlowSensitiveAnalysis::new(CustomEq, ccx)
+ .into_engine(ccx.tcx, &ccx.body, ccx.def_id)
+ .iterate_to_fixpoint()
+ .into_results_cursor(&ccx.body);
+
+ cursor.seek_after(return_loc);
+ cursor.contains(RETURN_PLACE)
+ }
+ };
+
ConstQualifs {
needs_drop: self.needs_drop(ccx, RETURN_PLACE, return_loc),
has_mut_interior: self.has_mut_interior(ccx, RETURN_PLACE, return_loc),
+ custom_eq,
}
}
}
}
&AggregateKind::Closure(def_id, _) | &AggregateKind::Generator(def_id, _, _) => {
let UnsafetyCheckResult { violations, unsafe_blocks } =
- self.tcx.unsafety_check_result(def_id);
+ self.tcx.unsafety_check_result(def_id.expect_local());
self.register_violations(&violations, &unsafe_blocks);
}
},
intravisit::Visitor::visit_body(&mut visitor, body);
}
-fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: DefId) -> UnsafetyCheckResult {
+fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: LocalDefId) -> UnsafetyCheckResult {
debug!("unsafety_violations({:?})", def_id);
// N.B., this borrow is valid because all the consumers of
let param_env = tcx.param_env(def_id);
- let id = tcx.hir().as_local_hir_id(def_id.expect_local());
+ let id = tcx.hir().as_local_hir_id(def_id);
let (const_context, min_const_fn) = match tcx.hir().body_owner_kind(id) {
hir::BodyOwnerKind::Closure => (false, false),
- hir::BodyOwnerKind::Fn => (is_const_fn(tcx, def_id), is_min_const_fn(tcx, def_id)),
+ hir::BodyOwnerKind::Fn => {
+ (is_const_fn(tcx, def_id.to_def_id()), is_min_const_fn(tcx, def_id.to_def_id()))
+ }
hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(_) => (true, false),
};
let mut checker = UnsafetyChecker::new(const_context, min_const_fn, body, tcx, param_env);
checker.visit_body(&body);
- check_unused_unsafe(
- tcx,
- def_id.expect_local(),
- &checker.used_unsafe,
- &mut checker.inherited_blocks,
- );
+ check_unused_unsafe(tcx, def_id, &checker.used_unsafe, &mut checker.inherited_blocks);
UnsafetyCheckResult {
violations: checker.violations.into(),
unsafe_blocks: checker.inherited_blocks.into(),
return;
}
- let UnsafetyCheckResult { violations, unsafe_blocks } = tcx.unsafety_check_result(def_id);
+ let UnsafetyCheckResult { violations, unsafe_blocks } =
+ tcx.unsafety_check_result(def_id.expect_local());
for &UnsafetyViolation { source_info, description, details, kind } in violations.iter() {
// Report an error.
//! Propagates constants for early reporting of statically known
//! assertion failures
-use std::borrow::Cow;
use std::cell::Cell;
use rustc_ast::ast::Mutability;
-use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def::DefKind;
use rustc_hir::HirId;
use rustc_index::bit_set::BitSet;
use crate::const_eval::error_to_const_error;
use crate::interpret::{
- self, intern_const_alloc_recursive, AllocId, Allocation, Frame, ImmTy, Immediate, InternKind,
- InterpCx, LocalState, LocalValue, Memory, MemoryKind, OpTy, Operand as InterpOperand, PlaceTy,
- Pointer, ScalarMaybeUndef, StackPopCleanup,
+ self, compile_time_machine, intern_const_alloc_recursive, AllocId, Allocation, Frame, ImmTy,
+ Immediate, InternKind, InterpCx, LocalState, LocalValue, Memory, MemoryKind, OpTy,
+ Operand as InterpOperand, PlaceTy, Pointer, ScalarMaybeUndef, StackPopCleanup,
};
use crate::transform::{MirPass, MirSource};
.predicates_of(source.def_id())
.predicates
.iter()
- .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
- .collect();
+ .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
if !traits::normalize_and_test_predicates(
tcx,
traits::elaborate_predicates(tcx, predicates).map(|o| o.predicate).collect(),
}
impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx> {
- type MemoryKind = !;
- type PointerTag = ();
- type ExtraFnVal = !;
+ compile_time_machine!(<'mir, 'tcx>);
- type FrameExtra = ();
type MemoryExtra = ();
- type AllocExtra = ();
-
- type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
-
- const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
-
- #[inline(always)]
- fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
- false
- }
-
- #[inline(always)]
- fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
- false
- }
fn find_mir_or_eval_fn(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
Ok(None)
}
- fn call_extra_fn(
- _ecx: &mut InterpCx<'mir, 'tcx, Self>,
- fn_val: !,
- _args: &[OpTy<'tcx>],
- _ret: Option<(PlaceTy<'tcx>, BasicBlock)>,
- _unwind: Option<BasicBlock>,
- ) -> InterpResult<'tcx> {
- match fn_val {}
- }
-
fn call_intrinsic(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
_instance: ty::Instance<'tcx>,
throw_machine_stop_str!("pointer arithmetic or comparisons aren't supported in ConstProp")
}
- #[inline(always)]
- fn init_allocation_extra<'b>(
- _memory_extra: &(),
- _id: AllocId,
- alloc: Cow<'b, Allocation>,
- _kind: Option<MemoryKind<!>>,
- ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
- // We do not use a tag so we can just cheaply forward the allocation
- (alloc, ())
- }
-
- #[inline(always)]
- fn tag_global_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {}
-
fn box_alloc(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
_dest: PlaceTy<'tcx>,
Ok(())
}
- #[inline(always)]
- fn init_frame_extra(
- _ecx: &mut InterpCx<'mir, 'tcx, Self>,
- frame: Frame<'mir, 'tcx>,
- ) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
- Ok(frame)
- }
-
#[inline(always)]
fn stack(
ecx: &'a InterpCx<'mir, 'tcx, Self>,
// Because we have `MutVisitor` we can't obtain the `SourceInfo` from a `Location`. So we store
// the last known `SourceInfo` here and just keep revisiting it.
source_info: Option<SourceInfo>,
+ // Locals we need to forget at the end of the current block
+ locals_of_current_block: BitSet<Local>,
}
impl<'mir, 'tcx> LayoutOf for ConstPropagator<'mir, 'tcx> {
//FIXME(wesleywiser) we can't steal this because `Visitor::super_visit_body()` needs it
local_decls: body.local_decls.clone(),
source_info: None,
+ locals_of_current_block: BitSet::new_empty(body.local_decls.len()),
}
}
}
}
- fn remove_const(&mut self, local: Local) {
- self.ecx.frame_mut().locals[local] =
+ /// Remove `local` from the pool of `Locals`. Allows writing to them,
+ /// but not reading from them anymore.
+ fn remove_const(ecx: &mut InterpCx<'mir, 'tcx, ConstPropMachine<'mir, 'tcx>>, local: Local) {
+ ecx.frame_mut().locals[local] =
LocalState { value: LocalValue::Uninitialized, layout: Cell::new(None) };
}
}
}
+ /// Returns the value, if any, of evaluating `c`.
fn eval_constant(&mut self, c: &Constant<'tcx>, source_info: SourceInfo) -> Option<OpTy<'tcx>> {
// FIXME we need to revisit this for #67176
if c.needs_subst() {
}
}
+ /// Returns the value, if any, of evaluating `place`.
fn eval_place(&mut self, place: Place<'tcx>) -> Option<OpTy<'tcx>> {
trace!("eval_place(place={:?})", place);
self.use_ecx(|this| this.ecx.eval_place_to_op(place, None))
}
+ /// Returns the value, if any, of evaluating `op`. Calls upon `eval_constant`
+ /// or `eval_place`, depending on the variant of `Operand` used.
fn eval_operand(&mut self, op: &Operand<'tcx>, source_info: SourceInfo) -> Option<OpTy<'tcx>> {
match *op {
Operand::Constant(ref c) => self.eval_constant(c, source_info),
})
}
+ /// Creates a new `Operand::Constant` from a `Scalar` value
fn operand_from_scalar(&self, scalar: Scalar, ty: Ty<'tcx>, span: Span) -> Operand<'tcx> {
Operand::Constant(Box::new(Constant {
span,
// Found a value represented as a pair. For now only do cont-prop if type of
// Rvalue is also a pair with two scalars. The more general case is more
// complicated to implement so we'll do it later.
+ // FIXME: implement the general case stated above ^.
let ty = &value.layout.ty.kind;
// Only do it for tuples
if let ty::Tuple(substs) = ty {
}
}
+ /// Returns `true` if and only if this `op` should be const-propagated into.
fn should_const_prop(&mut self, op: OpTy<'tcx>) -> bool {
let mir_opt_level = self.tcx.sess.opts.debugging_opts.mir_opt_level;
enum ConstPropMode {
/// The `Local` can be propagated into and reads of this `Local` can also be propagated.
FullConstProp,
+ /// The `Local` can only be propagated into and from its own block.
+ OnlyInsideOwnBlock,
/// The `Local` can be propagated into but reads cannot be propagated.
OnlyPropagateInto,
/// No propagation is allowed at all.
struct CanConstProp {
can_const_prop: IndexVec<Local, ConstPropMode>,
- // false at the beginning, once set, there are not allowed to be any more assignments
+ // False at the beginning. Once set, no more assignments are allowed to that local.
found_assignment: BitSet<Local>,
+ // Cache of locals' information
+ local_kinds: IndexVec<Local, LocalKind>,
}
impl CanConstProp {
- /// returns true if `local` can be propagated
+ /// Returns true if `local` can be propagated
fn check(body: &Body<'_>) -> IndexVec<Local, ConstPropMode> {
let mut cpv = CanConstProp {
can_const_prop: IndexVec::from_elem(ConstPropMode::FullConstProp, &body.local_decls),
found_assignment: BitSet::new_empty(body.local_decls.len()),
+ local_kinds: IndexVec::from_fn_n(
+ |local| body.local_kind(local),
+ body.local_decls.len(),
+ ),
};
for (local, val) in cpv.can_const_prop.iter_enumerated_mut() {
- // cannot use args at all
- // cannot use locals because if x < y { y - x } else { x - y } would
+ // Cannot use args at all
+ // Cannot use locals because if x < y { y - x } else { x - y } would
// lint for x != y
// FIXME(oli-obk): lint variables until they are used in a condition
// FIXME(oli-obk): lint if return value is constant
- let local_kind = body.local_kind(local);
-
- if local_kind == LocalKind::Arg || local_kind == LocalKind::Var {
+ if cpv.local_kinds[local] == LocalKind::Arg {
*val = ConstPropMode::OnlyPropagateInto;
- trace!("local {:?} can't be const propagated because it's not a temporary", local);
+ trace!(
+ "local {:?} can't be const propagated because it's a function argument",
+ local
+ );
+ } else if cpv.local_kinds[local] == LocalKind::Var {
+ *val = ConstPropMode::OnlyInsideOwnBlock;
+ trace!(
+ "local {:?} will only be propagated inside its block, because it's a user variable",
+ local
+ );
}
}
cpv.visit_body(&body);
| NonMutatingUse(NonMutatingUseContext::Move)
| NonMutatingUse(NonMutatingUseContext::Inspect)
| NonMutatingUse(NonMutatingUseContext::Projection)
- | MutatingUse(MutatingUseContext::Projection)
| NonUse(_) => {}
+ MutatingUse(MutatingUseContext::Projection) => {
+ if self.local_kinds[local] != LocalKind::Temp {
+ self.can_const_prop[local] = ConstPropMode::NoPropagation;
+ }
+ }
_ => {
trace!("local {:?} can't be propagaged because it's used: {:?}", local, context);
self.can_const_prop[local] = ConstPropMode::NoPropagation;
if let Some(local) = place.as_local() {
let can_const_prop = self.can_const_prop[local];
if let Some(()) = self.const_prop(rval, place_layout, source_info, place) {
- if can_const_prop == ConstPropMode::FullConstProp
- || can_const_prop == ConstPropMode::OnlyPropagateInto
- {
+ if can_const_prop != ConstPropMode::NoPropagation {
+ // This will return None for Locals that are from other blocks,
+ // so it should be okay to propagate from here on down.
if let Some(value) = self.get_const(local) {
if self.should_const_prop(value) {
trace!("replacing {:?} with {:?}", rval, value);
self.replace_with_const(rval, value, statement.source_info);
-
- if can_const_prop == ConstPropMode::FullConstProp {
+ if can_const_prop == ConstPropMode::FullConstProp
+ || can_const_prop == ConstPropMode::OnlyInsideOwnBlock
+ {
trace!("propagated into {:?}", local);
}
}
+ if can_const_prop == ConstPropMode::OnlyInsideOwnBlock {
+ trace!(
+ "found local restricted to its block. Will remove it from const-prop after block is finished. Local: {:?}",
+ local
+ );
+ self.locals_of_current_block.insert(local);
+ }
}
}
}
- if self.can_const_prop[local] != ConstPropMode::FullConstProp {
+ if self.can_const_prop[local] == ConstPropMode::OnlyPropagateInto
+ || self.can_const_prop[local] == ConstPropMode::NoPropagation
+ {
trace!("can't propagate into {:?}", local);
if local != RETURN_PLACE {
- self.remove_const(local);
+ Self::remove_const(&mut self.ecx, local);
}
}
}
let expected = ScalarMaybeUndef::from(Scalar::from_bool(*expected));
let value_const = self.ecx.read_scalar(value).unwrap();
if expected != value_const {
- // poison all places this operand references so that further code
+ // Poison all places this operand references so that further code
// doesn't use the invalid value
match cond {
Operand::Move(ref place) | Operand::Copy(ref place) => {
- self.remove_const(place.local);
+ Self::remove_const(&mut self.ecx, place.local);
}
Operand::Constant(_) => {}
}
}
}
}
- //none of these have Operands to const-propagate
+ // None of these have Operands to const-propagate
TerminatorKind::Goto { .. }
| TerminatorKind::Resume
| TerminatorKind::Abort
//FIXME(wesleywiser) Call does have Operands that could be const-propagated
TerminatorKind::Call { .. } => {}
}
+ // We remove all Locals which are restricted in propagation to their containing blocks.
+ // We wouldn't need to clone, but the borrow checker can't see that we're not aliasing
+ // the locals_of_current_block field, so we need to clone it first.
+ // let ecx = &mut self.ecx;
+ for local in self.locals_of_current_block.iter() {
+ Self::remove_const(&mut self.ecx, local);
+ }
+ self.locals_of_current_block.clear();
}
}
}
fn constant(src_constant: &Constant<'tcx>) -> Option<Action<'tcx>> {
- Some(Action::PropagateConstant((*src_constant).clone()))
+ Some(Action::PropagateConstant(*src_constant))
}
fn perform(
_ => return,
}
- *operand = Operand::Constant(box self.constant.clone());
+ *operand = Operand::Constant(box self.constant);
self.uses_replaced += 1
}
}
remap: FxHashMap<Local, (Ty<'tcx>, VariantIdx, usize)>,
// A map from a suspension point in a block to the locals which have live storage at that point
- // FIXME(eddyb) This should use `IndexVec<BasicBlock, Option<_>>`.
- storage_liveness: FxHashMap<BasicBlock, liveness::LiveVarSet>,
+ storage_liveness: IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
// A list of suspension points, generated during the transform
suspension_points: Vec<SuspensionPoint<'tcx>>,
resume,
resume_arg,
drop,
- storage_liveness: self.storage_liveness.get(&block).unwrap().clone(),
+ storage_liveness: self.storage_liveness[block].clone().unwrap(),
});
VariantIdx::new(state)
is_block_tail: None,
local_info: LocalInfo::Other,
};
- let new_local = Local::new(body.local_decls.len());
- body.local_decls.push(new_decl);
+ let new_local = body.local_decls.push(new_decl);
body.local_decls.swap(local, new_local);
RenameLocalVisitor { from: local, to: new_local, tcx }.visit_body(body);
/// For every suspending block, the locals which are storage-live across
/// that suspension point.
- storage_liveness: FxHashMap<BasicBlock, liveness::LiveVarSet>,
+ storage_liveness: IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
}
fn locals_live_across_suspend_points(
let mut liveness = liveness::liveness_of_locals(body);
liveness::dump_mir(tcx, "generator_liveness", source, body_ref, &liveness);
- let mut storage_liveness_map = FxHashMap::default();
+ let mut storage_liveness_map = IndexVec::from_elem(None, body.basic_blocks());
let mut live_locals_at_suspension_points = Vec::new();
for (block, data) in body.basic_blocks().iter_enumerated() {
// Store the storage liveness for later use so we can restore the state
// after a suspension point
- storage_liveness_map.insert(block, storage_liveness);
+ storage_liveness_map[block] = Some(storage_liveness);
requires_storage_cursor.seek_before(loc);
let storage_required = requires_storage_cursor.get().clone();
) -> (
FxHashMap<Local, (Ty<'tcx>, VariantIdx, usize)>,
GeneratorLayout<'tcx>,
- FxHashMap<BasicBlock, liveness::LiveVarSet>,
+ IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
) {
// Use a liveness analysis to compute locals which are live across a suspension point
let LivenessInfo {
}
fn insert_term_block<'tcx>(body: &mut Body<'tcx>, kind: TerminatorKind<'tcx>) -> BasicBlock {
- let term_block = BasicBlock::new(body.basic_blocks().len());
let source_info = source_info(body);
body.basic_blocks_mut().push(BasicBlockData {
statements: Vec::new(),
terminator: Some(Terminator { source_info, kind }),
is_cleanup: false,
- });
- term_block
+ })
}
fn insert_panic_block<'tcx>(
// Poison the generator when it unwinds
if can_unwind {
- let poison_block = BasicBlock::new(body.basic_blocks().len());
let source_info = source_info(body);
- body.basic_blocks_mut().push(BasicBlockData {
+ let poison_block = body.basic_blocks_mut().push(BasicBlockData {
statements: vec![transform.set_discr(VariantIdx::new(POISONED), source_info)],
terminator: Some(Terminator { source_info, kind: TerminatorKind::Resume }),
is_cleanup: true,
fn insert_clean_drop(body: &mut Body<'_>) -> BasicBlock {
let return_block = insert_term_block(body, TerminatorKind::Return);
- // Create a block to destroy an unresumed generators. This can only destroy upvars.
- let drop_clean = BasicBlock::new(body.basic_blocks().len());
let term = TerminatorKind::Drop {
location: Place::from(SELF_ARG),
target: return_block,
unwind: None,
};
let source_info = source_info(body);
+
+ // Create a block to destroy an unresumed generators. This can only destroy upvars.
body.basic_blocks_mut().push(BasicBlockData {
statements: Vec::new(),
terminator: Some(Terminator { source_info, kind: term }),
is_cleanup: false,
- });
-
- drop_clean
+ })
}
/// An operation that can be performed on a generator.
.filter_map(|point| {
// Find the target for this suspension point, if applicable
operation.target_block(point).map(|target| {
- let block = BasicBlock::new(body.basic_blocks().len());
let mut statements = Vec::new();
// Create StorageLive instructions for locals with live storage
}
// Then jump to the real target
- body.basic_blocks_mut().push(BasicBlockData {
+ let block = body.basic_blocks_mut().push(BasicBlockData {
statements,
terminator: Some(Terminator {
source_info,
impl<'tcx> MirPass<'tcx> for InstCombine {
fn run_pass(&self, tcx: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) {
- // We only run when optimizing MIR (at any level).
- if tcx.sess.opts.debugging_opts.mir_opt_level == 0 {
- return;
- }
-
// First, find optimization opportunities. This is done in a pre-pass to keep the MIR
// read-only so that we can do global analyses on the MIR in the process (e.g.
// `Place::ty()`).
use crate::{shim, util};
use required_consts::RequiredConstsVisitor;
use rustc_ast::ast;
+use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
-use rustc_hir::def_id::{CrateNum, DefId, DefIdSet, LocalDefId, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_index::vec::IndexVec;
use rustc_middle::mir::visit::Visitor as _;
}
fn is_mir_available(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
- tcx.mir_keys(def_id.krate).contains(&def_id)
+ tcx.mir_keys(def_id.krate).contains(&def_id.expect_local())
}
/// Finds the full set of `DefId`s within the current crate that have
/// MIR associated with them.
-fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &DefIdSet {
+fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &FxHashSet<LocalDefId> {
assert_eq!(krate, LOCAL_CRATE);
- let mut set = DefIdSet::default();
+ let mut set = FxHashSet::default();
// All body-owners have MIR associated with them.
- set.extend(tcx.body_owners().map(LocalDefId::to_def_id));
+ set.extend(tcx.body_owners());
// Additionally, tuple struct/variant constructors have MIR, but
// they don't have a BodyId, so we need to build them separately.
struct GatherCtors<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
- set: &'a mut DefIdSet,
+ set: &'a mut FxHashSet<LocalDefId>,
}
impl<'a, 'tcx> Visitor<'tcx> for GatherCtors<'a, 'tcx> {
fn visit_variant_data(
_: Span,
) {
if let hir::VariantData::Tuple(_, hir_id) = *v {
- self.set.insert(self.tcx.hir().local_def_id(hir_id).to_def_id());
+ self.set.insert(self.tcx.hir().local_def_id(hir_id));
}
intravisit::walk_struct_def(self, v)
}
instance: InstanceDef<'tcx>,
promoted: Option<Promoted>,
mir_phase: MirPhase,
- passes: &[&dyn MirPass<'tcx>],
+ passes: &[&[&dyn MirPass<'tcx>]],
) {
let phase_index = mir_phase.phase_index();
index += 1;
};
- for pass in passes {
- run_pass(*pass);
+ for pass_group in passes {
+ for pass in *pass_group {
+ run_pass(*pass);
+ }
}
body.phase = mir_phase;
}
fn mir_const(tcx: TyCtxt<'_>, def_id: DefId) -> &Steal<Body<'_>> {
+ let def_id = def_id.expect_local();
+
// Unsafety check uses the raw mir, so make sure it is run
let _ = tcx.unsafety_check_result(def_id);
let mut body = tcx.mir_built(def_id).steal();
- util::dump_mir(tcx, None, "mir_map", &0, MirSource::item(def_id), &body, |_, _| Ok(()));
+ util::dump_mir(tcx, None, "mir_map", &0, MirSource::item(def_id.to_def_id()), &body, |_, _| {
+ Ok(())
+ });
run_passes(
tcx,
&mut body,
- InstanceDef::Item(def_id),
+ InstanceDef::Item(def_id.to_def_id()),
None,
MirPhase::Const,
- &[
+ &[&[
// What we need to do constant evaluation.
&simplify::SimplifyCfg::new("initial"),
&rustc_peek::SanityCheck,
- ],
+ ]],
);
tcx.alloc_steal_mir(body)
}
fn mir_validated(
tcx: TyCtxt<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
// Ensure that we compute the `mir_const_qualif` for constants at
// this point, before we steal the mir-const result.
- let _ = tcx.mir_const_qualif(def_id);
+ let _ = tcx.mir_const_qualif(def_id.to_def_id());
- let mut body = tcx.mir_const(def_id).steal();
+ let mut body = tcx.mir_const(def_id.to_def_id()).steal();
let mut required_consts = Vec::new();
let mut required_consts_visitor = RequiredConstsVisitor::new(&mut required_consts);
run_passes(
tcx,
&mut body,
- InstanceDef::Item(def_id),
+ InstanceDef::Item(def_id.to_def_id()),
None,
MirPhase::Validated,
- &[
+ &[&[
// What we need to run borrowck etc.
&promote_pass,
&simplify::SimplifyCfg::new("qualify-consts"),
- ],
+ ]],
);
let promoted = promote_pass.promoted_fragments.into_inner();
fn run_optimization_passes<'tcx>(
tcx: TyCtxt<'tcx>,
body: &mut Body<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
promoted: Option<Promoted>,
) {
+ let post_borrowck_cleanup: &[&dyn MirPass<'tcx>] = &[
+ // Remove all things only needed by analysis
+ &no_landing_pads::NoLandingPads::new(tcx),
+ &simplify_branches::SimplifyBranches::new("initial"),
+ &remove_noop_landing_pads::RemoveNoopLandingPads,
+ &cleanup_post_borrowck::CleanupNonCodegenStatements,
+ &simplify::SimplifyCfg::new("early-opt"),
+ // These next passes must be executed together
+ &add_call_guards::CriticalCallEdges,
+ &elaborate_drops::ElaborateDrops,
+ &no_landing_pads::NoLandingPads::new(tcx),
+ // AddMovesForPackedDrops needs to run after drop
+ // elaboration.
+ &add_moves_for_packed_drops::AddMovesForPackedDrops,
+ // `AddRetag` needs to run after `ElaborateDrops`. Otherwise it should run fairly late,
+ // but before optimizations begin.
+ &add_retag::AddRetag,
+ &simplify::SimplifyCfg::new("elaborate-drops"),
+ // No lifetime analysis based on borrowing can be done from here on out.
+ ];
+
+ let optimizations: &[&dyn MirPass<'tcx>] = &[
+ &unreachable_prop::UnreachablePropagation,
+ &uninhabited_enum_branching::UninhabitedEnumBranching,
+ &simplify::SimplifyCfg::new("after-uninhabited-enum-branching"),
+ &inline::Inline,
+ // Lowering generator control-flow and variables has to happen before we do anything else
+ // to them. We do this inside the "optimizations" block so that it can benefit from
+ // optimizations that run before, that might be harder to do on the state machine than MIR
+ // with async primitives.
+ &generator::StateTransform,
+ &instcombine::InstCombine,
+ &const_prop::ConstProp,
+ &simplify_branches::SimplifyBranches::new("after-const-prop"),
+ // Run deaggregation here because:
+ // 1. Some codegen backends require it
+ // 2. It creates additional possibilities for some MIR optimizations to trigger
+ // FIXME(#70073): Why is this done here and not in `post_borrowck_cleanup`?
+ &deaggregator::Deaggregator,
+ ©_prop::CopyPropagation,
+ &simplify_branches::SimplifyBranches::new("after-copy-prop"),
+ &remove_noop_landing_pads::RemoveNoopLandingPads,
+ &simplify::SimplifyCfg::new("after-remove-noop-landing-pads"),
+ &simplify_try::SimplifyArmIdentity,
+ &simplify_try::SimplifyBranchSame,
+ &simplify::SimplifyCfg::new("final"),
+ &simplify::SimplifyLocals,
+ ];
+
+ let no_optimizations: &[&dyn MirPass<'tcx>] = &[
+ // Even if we don't do optimizations, we still have to lower generators for codegen.
+ &generator::StateTransform,
+ // FIXME(#70073): This pass is responsible for both optimization as well as some lints.
+ &const_prop::ConstProp,
+ // Even if we don't do optimizations, still run deaggregation because some backends assume
+ // that deaggregation always occurs.
+ &deaggregator::Deaggregator,
+ ];
+
+ let pre_codegen_cleanup: &[&dyn MirPass<'tcx>] = &[
+ &add_call_guards::CriticalCallEdges,
+ // Dump the end result for testing and debugging purposes.
+ &dump_mir::Marker("PreCodegen"),
+ ];
+
+ let mir_opt_level = tcx.sess.opts.debugging_opts.mir_opt_level;
+
run_passes(
tcx,
body,
- InstanceDef::Item(def_id),
+ InstanceDef::Item(def_id.to_def_id()),
promoted,
MirPhase::Optimized,
&[
- // Remove all things only needed by analysis
- &no_landing_pads::NoLandingPads::new(tcx),
- &simplify_branches::SimplifyBranches::new("initial"),
- &remove_noop_landing_pads::RemoveNoopLandingPads,
- &cleanup_post_borrowck::CleanupNonCodegenStatements,
- &simplify::SimplifyCfg::new("early-opt"),
- // These next passes must be executed together
- &add_call_guards::CriticalCallEdges,
- &elaborate_drops::ElaborateDrops,
- &no_landing_pads::NoLandingPads::new(tcx),
- // AddMovesForPackedDrops needs to run after drop
- // elaboration.
- &add_moves_for_packed_drops::AddMovesForPackedDrops,
- // `AddRetag` needs to run after `ElaborateDrops`. Otherwise it should run fairly late,
- // but before optimizations begin.
- &add_retag::AddRetag,
- &simplify::SimplifyCfg::new("elaborate-drops"),
- // No lifetime analysis based on borrowing can be done from here on out.
-
- // Optimizations begin.
- &unreachable_prop::UnreachablePropagation,
- &uninhabited_enum_branching::UninhabitedEnumBranching,
- &simplify::SimplifyCfg::new("after-uninhabited-enum-branching"),
- &inline::Inline,
- // Lowering generator control-flow and variables
- // has to happen before we do anything else to them.
- &generator::StateTransform,
- &instcombine::InstCombine,
- &const_prop::ConstProp,
- &simplify_branches::SimplifyBranches::new("after-const-prop"),
- &deaggregator::Deaggregator,
- ©_prop::CopyPropagation,
- &simplify_branches::SimplifyBranches::new("after-copy-prop"),
- &remove_noop_landing_pads::RemoveNoopLandingPads,
- &simplify::SimplifyCfg::new("after-remove-noop-landing-pads"),
- &simplify_try::SimplifyArmIdentity,
- &simplify_try::SimplifyBranchSame,
- &simplify::SimplifyCfg::new("final"),
- &simplify::SimplifyLocals,
- &add_call_guards::CriticalCallEdges,
- &dump_mir::Marker("PreCodegen"),
+ post_borrowck_cleanup,
+ if mir_opt_level > 0 { optimizations } else { no_optimizations },
+ pre_codegen_cleanup,
],
);
}
return shim::build_adt_ctor(tcx, def_id);
}
+ let def_id = def_id.expect_local();
+
// (Mir-)Borrowck uses `mir_validated`, so we have to force it to
// execute before we can steal.
tcx.ensure().mir_borrowck(def_id);
return tcx.intern_promoted(IndexVec::new());
}
+ let def_id = def_id.expect_local();
+
tcx.ensure().mir_borrowck(def_id);
let (_, promoted) = tcx.mir_validated(def_id);
let mut promoted = promoted.steal();
}
}
- /// Returns a basic block that drop a place using the context
- /// and path in `c`. If `mode` is something, also clear `c`
- /// according to it.
- ///
- /// if FLAG(self.path)
- /// if let Some(mode) = mode: FLAG(self.path)[mode] = false
- /// drop(self.place)
fn complete_drop(
&mut self,
drop_mode: Option<DropFlagMode>,
let indented_body = format!("{0}{0}{1:?};", INDENT, statement);
writeln!(
w,
- "{:A$} // {:?}: {}",
+ "{:A$} // {}{}",
indented_body,
- current_location,
+ if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
comment(tcx, statement.source_info),
A = ALIGN,
)?;
let indented_terminator = format!("{0}{0}{1:?};", INDENT, data.terminator().kind);
writeln!(
w,
- "{:A$} // {:?}: {}",
+ "{:A$} // {}{}",
indented_terminator,
- current_location,
+ if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
comment(tcx, data.terminator().source_info),
A = ALIGN,
)?;
)?;
}
- // Local variable types (including the user's name in a comment).
+ // Local variable types.
for (local, local_decl) in body.local_decls.iter_enumerated() {
if (1..body.arg_count + 1).contains(&local.index()) {
// Skip over argument locals, they're printed in the signature.
}
pub fn dump_mir_def_ids(tcx: TyCtxt<'_>, single: Option<DefId>) -> Vec<DefId> {
- if let Some(i) = single { vec![i] } else { tcx.mir_keys(LOCAL_CRATE).iter().cloned().collect() }
+ if let Some(i) = single {
+ vec![i]
+ } else {
+ tcx.mir_keys(LOCAL_CRATE).iter().map(|def_id| def_id.to_def_id()).collect()
+ }
}
if let Some(expr) = expr {
let tail_result_is_ignored =
destination_ty.is_unit() || this.block_context.currently_ignores_tail_results();
- this.block_context.push(BlockFrame::TailExpr { tail_result_is_ignored });
+ let span = match expr {
+ ExprRef::Hair(expr) => expr.span,
+ ExprRef::Mirror(ref expr) => expr.span,
+ };
+ this.block_context.push(BlockFrame::TailExpr { tail_result_is_ignored, span });
unpack!(block = this.into(destination, block, expr));
let popped = this.block_context.pop();
let of_fld = Field::new(1);
let tcx = self.hir.tcx();
- let val = tcx.mk_place_field(result_value.clone(), val_fld, ty);
+ let val = tcx.mk_place_field(result_value, val_fld, ty);
let of = tcx.mk_place_field(result_value, of_fld, bool_ty);
let err = AssertKind::Overflow(op);
}
}
this.block_context
- .push(BlockFrame::TailExpr { tail_result_is_ignored: true });
+ .push(BlockFrame::TailExpr { tail_result_is_ignored: true, span: expr.span });
return Some(expr.span);
}
}
use super::lints;
-crate fn mir_built(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::steal::Steal<Body<'_>> {
- tcx.alloc_steal_mir(mir_build(tcx, def_id.expect_local()))
+crate fn mir_built(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &ty::steal::Steal<Body<'_>> {
+ tcx.alloc_steal_mir(mir_build(tcx, def_id))
}
/// Construct the MIR for a given `DefId`.
build::construct_const(cx, body_id, return_ty, return_ty_span)
};
- lints::check(tcx, &body, def_id.to_def_id());
+ lints::check(tcx, &body, def_id);
// The borrow checker will replace all the regions here with its own
// inference variables. There's no point having non-erased regions here.
///
/// Example: `let _ = { STMT_1; EXPR };`
tail_result_is_ignored: bool,
+
+ /// `Span` of the tail expression.
+ span: Span,
},
/// Generic mark meaning that the block occurred as a subexpression
match bf {
BlockFrame::SubExpr => continue,
BlockFrame::Statement { .. } => break,
- &BlockFrame::TailExpr { tail_result_is_ignored } => {
- return Some(BlockTailInfo { tail_result_is_ignored });
+ &BlockFrame::TailExpr { tail_result_is_ignored, span } => {
+ return Some(BlockTailInfo { tail_result_is_ignored, span });
}
}
}
// otherwise: use accumulated is_ignored state.
Some(
- BlockFrame::TailExpr { tail_result_is_ignored: ignored }
+ BlockFrame::TailExpr { tail_result_is_ignored: ignored, .. }
| BlockFrame::Statement { ignores_expr_result: ignored },
) => *ignored,
}
cv: &'tcx ty::Const<'tcx>,
id: hir::HirId,
span: Span,
+ mir_structural_match_violation: bool,
) -> Pat<'tcx> {
debug!("const_to_pat: cv={:#?} id={:?}", cv, id);
debug!("const_to_pat: cv.ty={:?} span={:?}", cv.ty, span);
self.tcx.infer_ctxt().enter(|infcx| {
let mut convert = ConstToPat::new(self, id, span, infcx);
- convert.to_pat(cv)
+ convert.to_pat(cv, mir_structural_match_violation)
})
}
}
traits::type_marked_structural(self.id, self.span, &self.infcx, ty)
}
- fn to_pat(&mut self, cv: &'tcx ty::Const<'tcx>) -> Pat<'tcx> {
+ fn to_pat(
+ &mut self,
+ cv: &'tcx ty::Const<'tcx>,
+ mir_structural_match_violation: bool,
+ ) -> Pat<'tcx> {
// This method is just a wrapper handling a validity check; the heavy lifting is
// performed by the recursive `recur` method, which is not meant to be
// invoked except by this method.
"search_for_structural_match_violation cv.ty: {:?} returned: {:?}",
cv.ty, structural
);
+
+ if structural.is_none() && mir_structural_match_violation {
+ bug!("MIR const-checker found novel structural match violation");
+ }
+
if let Some(non_sm_ty) = structural {
let adt_def = match non_sm_ty {
traits::NonStructuralMatchTy::Adt(adt_def) => adt_def,
if !ty_is_partial_eq {
// span_fatal avoids ICE from resolution of non-existent method (rare case).
self.tcx().sess.span_fatal(self.span, &make_msg());
- } else {
+ } else if mir_structural_match_violation {
self.tcx().struct_span_lint_hir(
lint::builtin::INDIRECT_STRUCTURAL_MATCH,
self.id,
self.span,
|lint| lint.build(&make_msg()).emit(),
);
+ } else {
+ debug!(
+ "`search_for_structural_match_violation` found one, but `CustomEq` was \
+ not in the qualifs for that `const`"
+ );
}
}
}
use rustc_hir::pat_util::EnumerateAndAdjustIterator;
use rustc_hir::RangeEnd;
use rustc_index::vec::Idx;
-use rustc_middle::mir::interpret::{get_slice_bytes, sign_extend, ConstValue, ErrorHandled};
+use rustc_middle::mir::interpret::{get_slice_bytes, sign_extend, ConstValue};
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
use rustc_middle::mir::UserTypeProjection;
use rustc_middle::mir::{BorrowKind, Field, Mutability};
fn lower_path(&mut self, qpath: &hir::QPath<'_>, id: hir::HirId, span: Span) -> Pat<'tcx> {
let ty = self.tables.node_type(id);
let res = self.tables.qpath_res(qpath, id);
- let is_associated_const = match res {
- Res::Def(DefKind::AssocConst, _) => true,
- _ => false,
+
+ let pat_from_kind = |kind| Pat { span, ty, kind: Box::new(kind) };
+
+ let (def_id, is_associated_const) = match res {
+ Res::Def(DefKind::Const, def_id) => (def_id, false),
+ Res::Def(DefKind::AssocConst, def_id) => (def_id, true),
+
+ _ => return pat_from_kind(self.lower_variant_or_leaf(res, id, span, ty, vec![])),
};
- let kind = match res {
- Res::Def(DefKind::Const | DefKind::AssocConst, def_id) => {
- let substs = self.tables.node_substs(id);
- // Use `Reveal::All` here because patterns are always monomorphic even if their function isn't.
- match self.tcx.const_eval_resolve(
- self.param_env.with_reveal_all(),
- def_id,
- substs,
- None,
- Some(span),
- ) {
- Ok(value) => {
- let const_ =
- ty::Const::from_value(self.tcx, value, self.tables.node_type(id));
-
- let pattern = self.const_to_pat(&const_, id, span);
- if !is_associated_const {
- return pattern;
- }
- let user_provided_types = self.tables().user_provided_types();
- return if let Some(u_ty) = user_provided_types.get(id) {
- let user_ty = PatTyProj::from_user_type(*u_ty);
- Pat {
- span,
- kind: Box::new(PatKind::AscribeUserType {
- subpattern: pattern,
- ascription: Ascription {
- /// Note that use `Contravariant` here. See the
- /// `variance` field documentation for details.
- variance: ty::Variance::Contravariant,
- user_ty,
- user_ty_span: span,
- },
- }),
- ty: const_.ty,
- }
- } else {
- pattern
- };
- }
- Err(ErrorHandled::TooGeneric) => {
- self.errors.push(if is_associated_const {
- PatternError::AssocConstInPattern(span)
- } else {
- PatternError::StaticInPattern(span)
- });
- PatKind::Wild
- }
- Err(_) => {
- self.tcx.sess.span_err(span, "could not evaluate constant pattern");
- PatKind::Wild
- }
- }
+ // Use `Reveal::All` here because patterns are always monomorphic even if their function
+ // isn't.
+ let param_env_reveal_all = self.param_env.with_reveal_all();
+ let substs = self.tables.node_substs(id);
+ let instance = match ty::Instance::resolve(self.tcx, param_env_reveal_all, def_id, substs) {
+ Ok(Some(i)) => i,
+ Ok(None) => {
+ self.errors.push(if is_associated_const {
+ PatternError::AssocConstInPattern(span)
+ } else {
+ PatternError::StaticInPattern(span)
+ });
+
+ return pat_from_kind(PatKind::Wild);
+ }
+
+ Err(_) => {
+ self.tcx.sess.span_err(span, "could not evaluate constant pattern");
+ return pat_from_kind(PatKind::Wild);
}
- _ => self.lower_variant_or_leaf(res, id, span, ty, vec![]),
};
- Pat { span, ty, kind: Box::new(kind) }
+ // `mir_const_qualif` must be called with the `DefId` of the item where the const is
+ // defined, not where it is declared. The difference is significant for associated
+ // constants.
+ let mir_structural_match_violation = self.tcx.mir_const_qualif(instance.def_id()).custom_eq;
+ debug!("mir_structural_match_violation({:?}) -> {}", qpath, mir_structural_match_violation);
+
+ match self.tcx.const_eval_instance(param_env_reveal_all, instance, Some(span)) {
+ Ok(value) => {
+ let const_ = ty::Const::from_value(self.tcx, value, self.tables.node_type(id));
+
+ let pattern = self.const_to_pat(&const_, id, span, mir_structural_match_violation);
+
+ if !is_associated_const {
+ return pattern;
+ }
+
+ let user_provided_types = self.tables().user_provided_types();
+ if let Some(u_ty) = user_provided_types.get(id) {
+ let user_ty = PatTyProj::from_user_type(*u_ty);
+ Pat {
+ span,
+ kind: Box::new(PatKind::AscribeUserType {
+ subpattern: pattern,
+ ascription: Ascription {
+ /// Note that use `Contravariant` here. See the
+ /// `variance` field documentation for details.
+ variance: ty::Variance::Contravariant,
+ user_ty,
+ user_ty_span: span,
+ },
+ }),
+ ty: const_.ty,
+ }
+ } else {
+ pattern
+ }
+ }
+ Err(_) => {
+ self.tcx.sess.span_err(span, "could not evaluate constant pattern");
+ pat_from_kind(PatKind::Wild)
+ }
+ }
}
/// Converts literals, paths and negation of literals to patterns.
let lit_input = LitToConstInput { lit: &lit.node, ty: self.tables.expr_ty(expr), neg };
match self.tcx.at(expr.span).lit_to_const(lit_input) {
- Ok(val) => *self.const_to_pat(val, expr.hir_id, lit.span).kind,
+ Ok(val) => *self.const_to_pat(val, expr.hir_id, lit.span, false).kind,
Err(LitToConstError::UnparseableFloat) => {
self.errors.push(PatternError::FloatBug);
PatKind::Wild
use rustc_data_structures::graph::iterate::{
ControlFlow, NodeStatus, TriColorDepthFirstSearch, TriColorVisitor,
};
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
use rustc_hir::intravisit::FnKind;
use rustc_middle::hir::map::blocks::FnLikeNode;
use rustc_middle::mir::{BasicBlock, Body, Operand, TerminatorKind};
use rustc_session::lint::builtin::UNCONDITIONAL_RECURSION;
use rustc_span::Span;
-crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId) {
- let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: LocalDefId) {
+ let hir_id = tcx.hir().as_local_hir_id(def_id);
if let Some(fn_like_node) = FnLikeNode::from_node(tcx.hir().get(hir_id)) {
if let FnKind::Closure(_) = fn_like_node.kind() {
}
// If this is trait/impl method, extract the trait's substs.
- let trait_substs = match tcx.opt_associated_item(def_id) {
+ let trait_substs = match tcx.opt_associated_item(def_id.to_def_id()) {
Some(AssocItem {
container: AssocItemContainer::TraitContainer(trait_def_id), ..
}) => {
let trait_substs_count = tcx.generics_of(trait_def_id).count();
- &InternalSubsts::identity_for_item(tcx, def_id)[..trait_substs_count]
+ &InternalSubsts::identity_for_item(tcx, def_id.to_def_id())[..trait_substs_count]
}
_ => &[],
};
vis.reachable_recursive_calls.sort();
- let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+ let hir_id = tcx.hir().as_local_hir_id(def_id);
let sp = tcx.sess.source_map().guess_head_span(tcx.hir().span(hir_id));
tcx.struct_span_lint_hir(UNCONDITIONAL_RECURSION, hir_id, sp, |lint| {
let mut db = lint.build("function cannot return without recursing");
struct Search<'mir, 'tcx> {
tcx: TyCtxt<'tcx>,
body: &'mir Body<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
trait_substs: &'tcx [GenericArg<'tcx>],
reachable_recursive_calls: Vec<Span>,
// calling into an entirely different method (for example, a call from the default
// method in the trait to `<A as Trait<B>>::method`, where `A` and/or `B` are
// specific types).
- return call_fn_id == def_id && &call_substs[..trait_substs.len()] == trait_substs;
+ return call_fn_id == def_id.to_def_id()
+ && &call_substs[..trait_substs.len()] == trait_substs;
}
false
)
.chain(
// Seed entry point
- tcx.entry_fn(LOCAL_CRATE)
- .map(|(def_id, _)| tcx.hir().as_local_hir_id(def_id.expect_local())),
+ tcx.entry_fn(LOCAL_CRATE).map(|(def_id, _)| tcx.hir().as_local_hir_id(def_id)),
)
.collect::<Vec<_>>();
use rustc_ast::attr;
use rustc_ast::entry::EntryPointType;
use rustc_errors::struct_span_err;
-use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_hir::{HirId, ImplItem, Item, ItemKind, TraitItem};
use rustc_middle::hir::map::Map;
}
}
-fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(DefId, EntryFnType)> {
+fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(LocalDefId, EntryFnType)> {
assert_eq!(cnum, LOCAL_CRATE);
let any_exe =
}
}
-fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(DefId, EntryFnType)> {
+fn configure_main(
+ tcx: TyCtxt<'_>,
+ visitor: &EntryContext<'_, '_>,
+) -> Option<(LocalDefId, EntryFnType)> {
if let Some((hir_id, _)) = visitor.start_fn {
- Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Start))
+ Some((tcx.hir().local_def_id(hir_id), EntryFnType::Start))
} else if let Some((hir_id, _)) = visitor.attr_main_fn {
- Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Main))
+ Some((tcx.hir().local_def_id(hir_id), EntryFnType::Main))
} else if let Some((hir_id, _)) = visitor.main_fn {
- Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Main))
+ Some((tcx.hir().local_def_id(hir_id), EntryFnType::Main))
} else {
no_main_err(tcx, visitor);
None
err.emit();
}
-pub fn find_entry_point(tcx: TyCtxt<'_>) -> Option<(DefId, EntryFnType)> {
+pub fn find_entry_point(tcx: TyCtxt<'_>) -> Option<(LocalDefId, EntryFnType)> {
tcx.entry_fn(LOCAL_CRATE)
}
let owner_def_id = self.tcx.hir().body_owner_def_id(body_id);
let body = self.tcx.hir().body(body_id);
let param_env = self.tcx.param_env(owner_def_id.to_def_id());
- let tables = self.tcx.typeck_tables_of(owner_def_id.to_def_id());
+ let tables = self.tcx.typeck_tables_of(owner_def_id);
ExprVisitor { tcx: self.tcx, param_env, tables }.visit_body(body);
self.visit_body(body);
}
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::def::*;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::{self, FnKind, NestedVisitorMap, Visitor};
use rustc_hir::{Expr, HirId, HirIdMap, HirIdSet, Node};
use rustc_middle::hir::map::Map;
intravisit::walk_fn(&mut fn_maps, fk, decl, body_id, sp, id);
// compute liveness
- let mut lsets = Liveness::new(&mut fn_maps, def_id.to_def_id());
+ let mut lsets = Liveness::new(&mut fn_maps, def_id);
let entry_ln = lsets.compute(&body.value);
// check for various error conditions
}
impl<'a, 'tcx> Liveness<'a, 'tcx> {
- fn new(ir: &'a mut IrMaps<'tcx>, def_id: DefId) -> Liveness<'a, 'tcx> {
+ fn new(ir: &'a mut IrMaps<'tcx>, def_id: LocalDefId) -> Liveness<'a, 'tcx> {
// Special nodes and variables:
// - exit_ln represents the end of the fn, either by return or panic
// - implicit_ret_var is a pseudo-variable that represents
// Make sure the path contains a / or the linker will search for it.
let path = env::current_dir().unwrap().join(&path);
- let lib = match DynamicLibrary::open(Some(&path)) {
+ let lib = match DynamicLibrary::open(&path) {
Ok(lib) => lib,
// this is fatal: there are almost certainly macros we need
// inside this crate, so continue would spew "macro undefined"
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::intravisit::{self, DeepVisitor, NestedVisitorMap, Visitor};
use rustc_hir::{AssocItemKind, HirIdSet, Node, PatKind};
use rustc_middle::bug;
struct TypePrivacyVisitor<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
tables: &'a ty::TypeckTables<'tcx>,
- current_item: DefId,
+ current_item: LocalDefId,
in_body: bool,
span: Span,
empty_tables: &'a ty::TypeckTables<'tcx>,
impl<'a, 'tcx> TypePrivacyVisitor<'a, 'tcx> {
fn item_is_accessible(&self, did: DefId) -> bool {
- def_id_visibility(self.tcx, did).0.is_accessible_from(self.current_item, self.tcx)
+ def_id_visibility(self.tcx, did)
+ .0
+ .is_accessible_from(self.current_item.to_def_id(), self.tcx)
}
// Take node-id of an expression or pattern and check its type for privacy.
// Check types in item interfaces.
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
- let orig_current_item = mem::replace(
- &mut self.current_item,
- self.tcx.hir().local_def_id(item.hir_id).to_def_id(),
- );
+ let orig_current_item =
+ mem::replace(&mut self.current_item, self.tcx.hir().local_def_id(item.hir_id));
let orig_in_body = mem::replace(&mut self.in_body, false);
let orig_tables =
mem::replace(&mut self.tables, item_tables(self.tcx, item.hir_id, self.empty_tables));
};
}
-fn check_mod_privacy(tcx: TyCtxt<'_>, module_def_id: DefId) {
+fn check_mod_privacy(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
let empty_tables = ty::TypeckTables::empty(None);
// Check privacy of names not checked in previous compilation stages.
current_item: None,
empty_tables: &empty_tables,
};
- let (module, span, hir_id) = tcx.hir().get_module(module_def_id.expect_local());
+ let (module, span, hir_id) = tcx.hir().get_module(module_def_id);
intravisit::walk_mod(&mut visitor, module, hir_id);
has_self_arg
}
- fn followed_by_brace(&self, span: Span) -> (bool, Option<(Span, String)>) {
+ fn followed_by_brace(&self, span: Span) -> (bool, Option<Span>) {
// HACK(estebank): find a better way to figure out that this was a
// parser issue where a struct literal is being used on an expression
// where a brace being opened means a block is being started. Look
_ => false,
};
// In case this could be a struct literal that needs to be surrounded
- // by parenthesis, find the appropriate span.
+ // by parentheses, find the appropriate span.
let mut i = 0;
let mut closing_brace = None;
loop {
match sm.span_to_snippet(sp) {
Ok(ref snippet) => {
if snippet == "}" {
- let sp = span.to(sp);
- if let Ok(snippet) = sm.span_to_snippet(sp) {
- closing_brace = Some((sp, snippet));
- }
+ closing_brace = Some(span.to(sp));
break;
}
}
suggested = path_sep(err, &parent);
}
PathSource::Expr(None) if followed_by_brace => {
- if let Some((sp, snippet)) = closing_brace {
- err.span_suggestion(
- sp,
- "surround the struct literal with parenthesis",
- format!("({})", snippet),
+ if let Some(sp) = closing_brace {
+ err.multipart_suggestion(
+ "surround the struct literal with parentheses",
+ vec![
+ (sp.shrink_to_lo(), "(".to_string()),
+ (sp.shrink_to_hi(), ")".to_string()),
+ ],
Applicability::MaybeIncorrect,
);
} else {
err.span_label(
- span, // Note the parenthesis surrounding the suggestion below
- format!("did you mean `({} {{ /* fields */ }})`?", path_str),
+ span, // Note the parentheses surrounding the suggestion below
+ format!(
+ "you might want to surround a struct literal with parentheses: \
+ `({} {{ /* fields */ }})`?",
+ path_str
+ ),
);
}
suggested = true;
err.note("if you want the `try` keyword, you need to be in the 2018 edition");
}
}
- (Res::Def(DefKind::TyAlias, _), PathSource::Trait(_)) => {
+ (Res::Def(DefKind::TyAlias, def_id), PathSource::Trait(_)) => {
err.span_label(span, "type aliases cannot be used as traits");
if nightly_options::is_nightly_build() {
- err.note("did you mean to use a trait alias?");
+ let msg = "you might have meant to use `#![feature(trait_alias)]` instead of a \
+ `type` alias";
+ if let Some(span) = self.r.definitions.opt_span(def_id) {
+ err.span_help(span, msg);
+ } else {
+ err.help(msg);
+ }
}
}
(Res::Def(DefKind::Mod, _), PathSource::Expr(Some(parent))) => {
};
}
- let binding = if let Some(module) = module {
- self.resolve_ident_in_module(
- module,
- ident,
- ns,
- parent_scope,
- record_used,
- path_span,
- )
- } else if ribs.is_none() || opt_ns.is_none() || opt_ns == Some(MacroNS) {
- let scopes = ScopeSet::All(ns, opt_ns.is_none());
- self.early_resolve_ident_in_lexical_scope(
- ident,
- scopes,
- parent_scope,
- record_used,
- record_used,
- path_span,
- )
- } else {
- let record_used_id =
- if record_used { crate_lint.node_id().or(Some(CRATE_NODE_ID)) } else { None };
- match self.resolve_ident_in_lexical_scope(
- ident,
- ns,
- parent_scope,
- record_used_id,
- path_span,
- &ribs.unwrap()[ns],
- ) {
- // we found a locally-imported or available item/module
- Some(LexicalScopeBinding::Item(binding)) => Ok(binding),
- // we found a local variable or type param
- Some(LexicalScopeBinding::Res(res))
- if opt_ns == Some(TypeNS) || opt_ns == Some(ValueNS) =>
- {
- record_segment_res(self, res);
- return PathResult::NonModule(PartialRes::with_unresolved_segments(
- res,
- path.len() - 1,
- ));
+ enum FindBindingResult<'a> {
+ Binding(Result<&'a NameBinding<'a>, Determinacy>),
+ PathResult(PathResult<'a>),
+ }
+ let find_binding_in_ns = |this: &mut Self, ns| {
+ let binding = if let Some(module) = module {
+ this.resolve_ident_in_module(
+ module,
+ ident,
+ ns,
+ parent_scope,
+ record_used,
+ path_span,
+ )
+ } else if ribs.is_none() || opt_ns.is_none() || opt_ns == Some(MacroNS) {
+ let scopes = ScopeSet::All(ns, opt_ns.is_none());
+ this.early_resolve_ident_in_lexical_scope(
+ ident,
+ scopes,
+ parent_scope,
+ record_used,
+ record_used,
+ path_span,
+ )
+ } else {
+ let record_used_id = if record_used {
+ crate_lint.node_id().or(Some(CRATE_NODE_ID))
+ } else {
+ None
+ };
+ match this.resolve_ident_in_lexical_scope(
+ ident,
+ ns,
+ parent_scope,
+ record_used_id,
+ path_span,
+ &ribs.unwrap()[ns],
+ ) {
+ // we found a locally-imported or available item/module
+ Some(LexicalScopeBinding::Item(binding)) => Ok(binding),
+ // we found a local variable or type param
+ Some(LexicalScopeBinding::Res(res))
+ if opt_ns == Some(TypeNS) || opt_ns == Some(ValueNS) =>
+ {
+ record_segment_res(this, res);
+ return FindBindingResult::PathResult(PathResult::NonModule(
+ PartialRes::with_unresolved_segments(res, path.len() - 1),
+ ));
+ }
+ _ => Err(Determinacy::determined(record_used)),
}
- _ => Err(Determinacy::determined(record_used)),
- }
+ };
+ FindBindingResult::Binding(binding)
+ };
+ let binding = match find_binding_in_ns(self, ns) {
+ FindBindingResult::PathResult(x) => return x,
+ FindBindingResult::Binding(binding) => binding,
};
-
match binding {
Ok(binding) => {
if i == 1 {
} else if i == 0 {
(format!("use of undeclared type or module `{}`", ident), None)
} else {
- (format!("could not find `{}` in `{}`", ident, path[i - 1].ident), None)
+ let mut msg =
+ format!("could not find `{}` in `{}`", ident, path[i - 1].ident);
+ if ns == TypeNS || ns == ValueNS {
+ let ns_to_try = if ns == TypeNS { ValueNS } else { TypeNS };
+ if let FindBindingResult::Binding(Ok(binding)) =
+ find_binding_in_ns(self, ns_to_try)
+ {
+ let mut found = |what| {
+ msg = format!(
+ "expected {}, found {} `{}` in `{}`",
+ ns.descr(),
+ what,
+ ident,
+ path[i - 1].ident
+ )
+ };
+ if binding.module().is_some() {
+ found("module")
+ } else {
+ match binding.res() {
+ def::Res::<NodeId>::Def(kind, id) => found(kind.descr(id)),
+ _ => found(ns_to_try.descr()),
+ }
+ }
+ };
+ }
+ (msg, None)
};
return PathResult::Failed {
span: ident.span,
where
F: FnOnce(&mut Self),
{
- let item_def_id = self.tcx.hir().local_def_id_from_node_id(item_id).to_def_id();
+ let item_def_id = self.tcx.hir().local_def_id_from_node_id(item_id);
let tables = if self.tcx.has_typeck_tables(item_def_id) {
self.tcx.typeck_tables_of(item_def_id)
// Make a comma-separated list of names of imported modules.
let def_id = self.tcx.hir().local_def_id_from_node_id(id);
- let names = self.tcx.names_imported_by_glob_use(def_id.to_def_id());
+ let names = self.tcx.names_imported_by_glob_use(def_id);
let names: Vec<_> = names.iter().map(|n| n.to_string()).collect();
// Otherwise it's a span with wrong macro expansion info, which
prints.push(PrintRequest::TargetFeatures);
cg.target_feature = String::new();
}
- if cg.relocation_model.as_ref().map_or(false, |s| s == "help") {
- prints.push(PrintRequest::RelocationModels);
- cg.relocation_model = None;
- }
if cg.code_model.as_ref().map_or(false, |s| s == "help") {
prints.push(PrintRequest::CodeModels);
cg.code_model = None;
}
- if dopts.tls_model.as_ref().map_or(false, |s| s == "help") {
- prints.push(PrintRequest::TlsModels);
- dopts.tls_model = None;
- }
prints.extend(matches.opt_strs("print").into_iter().map(|s| match &*s {
"crate-name" => PrintRequest::CrateName,
use crate::utils::NativeLibraryKind;
use rustc_feature::UnstableFeatures;
use rustc_span::edition::Edition;
- use rustc_target::spec::{MergeFunctions, PanicStrategy, RelroLevel, TargetTriple};
+ use rustc_target::spec::{MergeFunctions, PanicStrategy, RelocModel};
+ use rustc_target::spec::{RelroLevel, TargetTriple, TlsModel};
use std::collections::hash_map::DefaultHasher;
use std::collections::BTreeMap;
use std::hash::Hash;
impl_dep_tracking_hash_via_hash!(Option<(String, u64)>);
impl_dep_tracking_hash_via_hash!(Option<Vec<String>>);
impl_dep_tracking_hash_via_hash!(Option<MergeFunctions>);
+ impl_dep_tracking_hash_via_hash!(Option<RelocModel>);
+ impl_dep_tracking_hash_via_hash!(Option<TlsModel>);
impl_dep_tracking_hash_via_hash!(Option<PanicStrategy>);
impl_dep_tracking_hash_via_hash!(Option<RelroLevel>);
impl_dep_tracking_hash_via_hash!(Option<lint::Level>);
use crate::utils::NativeLibraryKind;
use rustc_target::spec::TargetTriple;
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy};
+use rustc_target::spec::{RelocModel, RelroLevel, TlsModel};
use rustc_feature::UnstableFeatures;
use rustc_span::edition::Edition;
pub const parse_merge_functions: &str = "one of: `disabled`, `trampolines`, or `aliases`";
pub const parse_symbol_mangling_version: &str = "either `legacy` or `v0` (RFC 2603)";
pub const parse_src_file_hash: &str = "either `md5` or `sha1`";
+ pub const parse_relocation_model: &str =
+ "one of supported relocation models (`rustc --print relocation-models`)";
+ pub const parse_tls_model: &str =
+ "one of supported TLS models (`rustc --print tls-models`)";
}
#[allow(dead_code)]
mod $mod_set {
- use super::{$struct_name, Passes, Sanitizer, LtoCli, LinkerPluginLto, SwitchWithOptPath,
- SymbolManglingVersion, CFGuard, SourceFileHashAlgorithm};
- use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
- use std::path::PathBuf;
+ use super::*;
use std::str::FromStr;
// Sometimes different options need to build a common structure.
true
}
+ fn parse_relocation_model(slot: &mut Option<RelocModel>, v: Option<&str>) -> bool {
+ match v.and_then(|s| RelocModel::from_str(s).ok()) {
+ Some(relocation_model) => *slot = Some(relocation_model),
+ None if v == Some("default") => *slot = None,
+ _ => return false,
+ }
+ true
+ }
+
+ fn parse_tls_model(slot: &mut Option<TlsModel>, v: Option<&str>) -> bool {
+ match v.and_then(|s| TlsModel::from_str(s).ok()) {
+ Some(tls_model) => *slot = Some(tls_model),
+ _ => return false,
+ }
+ true
+ }
+
fn parse_symbol_mangling_version(
slot: &mut SymbolManglingVersion,
v: Option<&str>,
"compile the program with profiling instrumentation"),
profile_use: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
"use the given `.profdata` file for profile-guided optimization"),
- relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
- "choose the relocation model to use (`rustc --print relocation-models` for details)"),
+ relocation_model: Option<RelocModel> = (None, parse_relocation_model, [TRACKED],
+ "control generation of position-independent code (PIC) \
+ (`rustc --print relocation-models` for details)"),
remark: Passes = (Passes::Some(Vec::new()), parse_passes, [UNTRACKED],
"print remarks for these optimization passes (space separated, or \"all\")"),
rpath: bool = (false, parse_bool, [UNTRACKED],
"measure time of each LLVM pass (default: no)"),
time_passes: bool = (false, parse_bool, [UNTRACKED],
"measure time of each rustc pass (default: no)"),
- tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
+ tls_model: Option<TlsModel> = (None, parse_tls_model, [TRACKED],
"choose the TLS model to use (`rustc --print tls-models` for details)"),
trace_macros: bool = (false, parse_bool, [UNTRACKED],
"for every macro invocation, print its name and arguments (default: no)"),
use rustc_span::edition::Edition;
use rustc_span::source_map::{self, FileLoader, MultiSpan, RealFileLoader, SourceMap, Span};
use rustc_span::SourceFileHashAlgorithm;
-use rustc_target::spec::{PanicStrategy, RelroLevel, Target, TargetTriple};
+use rustc_target::spec::{PanicStrategy, RelocModel, RelroLevel, Target, TargetTriple, TlsModel};
use std::cell::{self, RefCell};
use std::env;
}
}
+ pub fn relocation_model(&self) -> RelocModel {
+ self.opts.cg.relocation_model.unwrap_or(self.target.target.options.relocation_model)
+ }
+
+ pub fn tls_model(&self) -> TlsModel {
+ self.opts.debugging_opts.tls_model.unwrap_or(self.target.target.options.tls_model)
+ }
+
pub fn must_not_eliminate_frame_pointers(&self) -> bool {
// "mcount" function relies on stack pointer.
// See <https://sourceware.org/binutils/docs/gprof/Implementation.html>.
use std::sync::atomic::Ordering;
use log::debug;
-use std::env;
use std::fs;
use std::io;
/// Query the existence of a file.
fn file_exists(&self, path: &Path) -> bool;
- /// Returns an absolute path to a file, if possible.
- fn abs_path(&self, path: &Path) -> Option<PathBuf>;
-
/// Read the contents of an UTF-8 file into memory.
fn read_file(&self, path: &Path) -> io::Result<String>;
}
fs::metadata(path).is_ok()
}
- fn abs_path(&self, path: &Path) -> Option<PathBuf> {
- if path.is_absolute() {
- Some(path.to_path_buf())
- } else {
- env::current_dir().ok().map(|cwd| cwd.join(path))
- }
- }
-
fn read_file(&self, path: &Path) -> io::Result<String> {
fs::read_to_string(path)
}
//
// For example, `-C target-cpu=cortex-a53`.
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: Some("rust-lld".to_owned()),
features: "+strict-align,+neon,+fp-armv8".to_string(),
executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
disable_redzone: true,
linker_is_gnu: true,
max_atomic_width: Some(128),
//
// For example, `-C target-cpu=cortex-a53`.
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: Some("rust-lld".to_owned()),
features: "+strict-align,-neon,-fp-armv8".to_string(),
executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
disable_redzone: true,
linker_is_gnu: true,
max_atomic_width: Some(128),
// Targets the Big endian Cortex-R4/R5 processor (ARMv7-R)
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
options: TargetOptions {
executables: true,
linker: Some("rust-lld".to_owned()),
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
max_atomic_width: Some(32),
abi_blacklist: super::arm_base::abi_blacklist(),
// Targets the Cortex-R4F/R5F processor (ARMv7-R)
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
options: TargetOptions {
executables: true,
linker: Some("rust-lld".to_owned()),
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
features: "+vfp3,-d32,-fp16".to_string(),
max_atomic_width: Some(32),
// - `relocation-model` set to `static`; also no PIE, no relro and no dynamic
// linking. rationale: matches `thumb` targets
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: Some("rust-lld".to_owned()),
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(64),
panic_strategy: PanicStrategy::Abort,
// changes (list in `armv7a_none_eabi.rs`) to bring it closer to the bare-metal
// `thumb` & `aarch64` targets.
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: Some("rust-lld".to_owned()),
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(64),
panic_strategy: PanicStrategy::Abort,
// Targets the Little-endian Cortex-R4/R5 processor (ARMv7-R)
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
options: TargetOptions {
executables: true,
linker: Some("rust-lld".to_owned()),
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
max_atomic_width: Some(32),
abi_blacklist: super::arm_base::abi_blacklist(),
// Targets the Little-endian Cortex-R4F/R5F processor (ARMv7-R)
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
options: TargetOptions {
executables: true,
linker: Some("rust-lld".to_owned()),
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
features: "+vfp3,-d32,-fp16".to_string(),
max_atomic_width: Some(32),
-use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions, TlsModel};
pub fn opts() -> TargetOptions {
let mut args = LinkArgs::new();
// (Global Offset Table) to obtain the effective address of a
// thread-local variable. Using a GOT is useful only when doing
// dynamic linking.
- tls_model: "local-exec".to_string(),
+ tls_model: TlsModel::LocalExec,
relro_level: RelroLevel::Full,
..Default::default()
}
-use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
+use crate::spec::{RelocModel, TargetOptions, TlsModel};
pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
pre_link_args,
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
target_family: None,
- tls_model: "initial-exec".to_string(),
+ tls_model: TlsModel::InitialExec,
..Default::default()
}
}
-use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
+use crate::spec::{RelocModel, TargetOptions, TlsModel};
pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
pre_link_args,
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
target_family: None,
- tls_model: "initial-exec".to_string(),
+ tls_model: TlsModel::InitialExec,
..Default::default()
}
}
-use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelroLevel, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
position_independent_executables: true,
needs_plt: true,
relro_level: RelroLevel::Full,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
target_family: Some("unix".to_string()),
pre_link_args,
}
}
+#[derive(Clone, Copy, PartialEq, Hash, Debug)]
+pub enum RelocModel {
+ Static,
+ Pic,
+ DynamicNoPic,
+ Ropi,
+ Rwpi,
+ RopiRwpi,
+}
+
+impl FromStr for RelocModel {
+ type Err = ();
+
+ fn from_str(s: &str) -> Result<RelocModel, ()> {
+ Ok(match s {
+ "static" => RelocModel::Static,
+ "pic" => RelocModel::Pic,
+ "dynamic-no-pic" => RelocModel::DynamicNoPic,
+ "ropi" => RelocModel::Ropi,
+ "rwpi" => RelocModel::Rwpi,
+ "ropi-rwpi" => RelocModel::RopiRwpi,
+ _ => return Err(()),
+ })
+ }
+}
+
+impl ToJson for RelocModel {
+ fn to_json(&self) -> Json {
+ match *self {
+ RelocModel::Static => "static",
+ RelocModel::Pic => "pic",
+ RelocModel::DynamicNoPic => "dynamic-no-pic",
+ RelocModel::Ropi => "ropi",
+ RelocModel::Rwpi => "rwpi",
+ RelocModel::RopiRwpi => "ropi-rwpi",
+ }
+ .to_json()
+ }
+}
+
+#[derive(Clone, Copy, PartialEq, Hash, Debug)]
+pub enum TlsModel {
+ GeneralDynamic,
+ LocalDynamic,
+ InitialExec,
+ LocalExec,
+}
+
+impl FromStr for TlsModel {
+ type Err = ();
+
+ fn from_str(s: &str) -> Result<TlsModel, ()> {
+ Ok(match s {
+ // Note the difference "general" vs "global" difference. The model name is "general",
+ // but the user-facing option name is "global" for consistency with other compilers.
+ "global-dynamic" => TlsModel::GeneralDynamic,
+ "local-dynamic" => TlsModel::LocalDynamic,
+ "initial-exec" => TlsModel::InitialExec,
+ "local-exec" => TlsModel::LocalExec,
+ _ => return Err(()),
+ })
+ }
+}
+
+impl ToJson for TlsModel {
+ fn to_json(&self) -> Json {
+ match *self {
+ TlsModel::GeneralDynamic => "global-dynamic",
+ TlsModel::LocalDynamic => "local-dynamic",
+ TlsModel::InitialExec => "initial-exec",
+ TlsModel::LocalExec => "local-exec",
+ }
+ .to_json()
+ }
+}
+
pub enum LoadTargetError {
BuiltinTargetNotFound(String),
Other(String),
/// libraries. Defaults to false.
pub executables: bool,
/// Relocation model to use in object file. Corresponds to `llc
- /// -relocation-model=$relocation_model`. Defaults to "pic".
- pub relocation_model: String,
+ /// -relocation-model=$relocation_model`. Defaults to `Pic`.
+ pub relocation_model: RelocModel,
/// Code model to use. Corresponds to `llc -code-model=$code_model`.
pub code_model: Option<String>,
/// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
/// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
- pub tls_model: String,
+ pub tls_model: TlsModel,
/// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
pub disable_redzone: bool,
/// Eliminate frame pointers from stack frames if possible. Defaults to true.
dynamic_linking: false,
only_cdylib: false,
executables: false,
- relocation_model: "pic".to_string(),
+ relocation_model: RelocModel::Pic,
code_model: None,
- tls_model: "global-dynamic".to_string(),
+ tls_model: TlsModel::GeneralDynamic,
disable_redzone: false,
eliminate_frame_pointer: true,
function_sections: true,
Some(Ok(()))
})).unwrap_or(Ok(()))
} );
+ ($key_name:ident, RelocModel) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ match s.parse::<RelocModel>() {
+ Ok(relocation_model) => base.options.$key_name = relocation_model,
+ _ => return Some(Err(format!("'{}' is not a valid relocation model. \
+ Run `rustc --print relocation-models` to \
+ see the list of supported values.", s))),
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, TlsModel) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ match s.parse::<TlsModel>() {
+ Ok(tls_model) => base.options.$key_name = tls_model,
+ _ => return Some(Err(format!("'{}' is not a valid TLS model. \
+ Run `rustc --print tls-models` to \
+ see the list of supported values.", s))),
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
($key_name:ident, PanicStrategy) => ( {
let name = (stringify!($key_name)).replace("_", "-");
obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
key!(dynamic_linking, bool);
key!(only_cdylib, bool);
key!(executables, bool);
- key!(relocation_model);
+ key!(relocation_model, RelocModel)?;
key!(code_model, optional);
- key!(tls_model);
+ key!(tls_model, TlsModel)?;
key!(disable_redzone, bool);
key!(eliminate_frame_pointer, bool);
key!(function_sections, bool);
-use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
// Similarly, one almost always never wants to use relocatable
// code because of the extra costs it involves.
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
// Right now we invoke an external assembler and this isn't
// compatible with multiple codegen units, and plus we probably
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
features: String::new(),
executables: true,
panic_strategy: PanicStrategy::Abort,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
eliminate_frame_pointer: false,
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
features: "+m,+a,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
eliminate_frame_pointer: false,
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
features: "+m,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
eliminate_frame_pointer: false,
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
features: "+m,+a,+f,+d,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
code_model: Some("medium".to_string()),
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
features: "+m,+a,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
code_model: Some("medium".to_string()),
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
// differentiate these targets from our other `arm(v7)-*-*-gnueabi(hf)` targets in the context of
// build scripts / gcc flags.
-use crate::spec::{PanicStrategy, TargetOptions};
+use crate::spec::{PanicStrategy, RelocModel, TargetOptions};
pub fn opts() -> TargetOptions {
// See rust-lang/rfcs#1645 for a discussion about these defaults
panic_strategy: PanicStrategy::Abort,
// Similarly, one almost always never wants to use relocatable code because of the extra
// costs it involves.
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
abi_blacklist: super::arm_base::abi_blacklist(),
// When this section is added a volatile load to its start address is also generated. This
// volatile load is a footgun as it can end up loading an invalid memory address, depending
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel};
use std::collections::BTreeMap;
pub fn options() -> TargetOptions {
// that eventually we can ship a `pic`-compatible standard library which
// works with `static` as well (or works with some method of generating
// non-relative calls and such later on).
- relocation_model: "static".to_string(),
+ relocation_model: RelocModel::Static,
// When the atomics feature is activated then these two keys matter,
// otherwise they're basically ignored by the standard library. In this
// `has_elf_tls`) and we need to get it to work by specifying
// `local-exec` as that's all that's implemented in LLVM today for wasm.
has_elf_tls: true,
- tls_model: "local-exec".to_string(),
+ tls_model: TlsModel::LocalExec,
// gdb scripts don't work on wasm blobs
emit_debug_gdb_scripts: false,
let opaque_type = tcx.mk_opaque(def_id, opaque_defn.substs);
let required_region_bounds =
- required_region_bounds(tcx, opaque_type, bounds.predicates);
+ required_region_bounds(tcx, opaque_type, bounds.predicates.into_iter());
debug_assert!(!required_region_bounds.is_empty());
for required_region in required_region_bounds {
debug!("instantiate_opaque_types: bounds={:?}", bounds);
- let required_region_bounds = required_region_bounds(tcx, ty, bounds.predicates.clone());
+ let required_region_bounds =
+ required_region_bounds(tcx, ty, bounds.predicates.iter().cloned());
debug!("instantiate_opaque_types: required_region_bounds={:?}", required_region_bounds);
// Make sure that we are in fact defining the *entire* type
crate fn required_region_bounds(
tcx: TyCtxt<'tcx>,
erased_self_ty: Ty<'tcx>,
- predicates: Vec<ty::Predicate<'tcx>>,
+ predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
) -> Vec<ty::Region<'tcx>> {
- debug!(
- "required_region_bounds(erased_self_ty={:?}, predicates={:?})",
- erased_self_ty, predicates
- );
+ debug!("required_region_bounds(erased_self_ty={:?})", erased_self_ty);
assert!(!erased_self_ty.has_escaping_bound_vars());
traits::elaborate_predicates(tcx, predicates)
.filter_map(|obligation| {
+ debug!("required_region_bounds(obligation={:?})", obligation);
match obligation.predicate {
ty::Predicate::Projection(..)
| ty::Predicate::Trait(..)
},
}));
- let mut computed_preds: FxHashSet<_> = param_env.caller_bounds.iter().cloned().collect();
+ let computed_preds = param_env.caller_bounds.iter().cloned();
let mut user_computed_preds: FxHashSet<_> =
user_env.caller_bounds.iter().cloned().collect();
_ => panic!("Unexpected error for '{:?}': {:?}", ty, result),
};
- computed_preds.extend(user_computed_preds.iter().cloned());
- let normalized_preds =
- elaborate_predicates(tcx, computed_preds.iter().cloned().collect())
- .map(|o| o.predicate);
+ let normalized_preds = elaborate_predicates(
+ tcx,
+ computed_preds.clone().chain(user_computed_preds.iter().cloned()),
+ )
+ .map(|o| o.predicate);
new_env =
ty::ParamEnv::new(tcx.mk_predicates(normalized_preds), param_env.reveal, None);
}
if p.ty().skip_binder().has_infer_types() {
if !self.evaluate_nested_obligations(
ty,
- v.clone().iter().cloned(),
+ v.into_iter(),
computed_preds,
fresh_preds,
predicates,
.starts_with("std::convert::From<std::option::NoneError");
let should_convert_result_to_option = format!("{}", trait_ref)
.starts_with("<std::option::NoneError as std::convert::From<");
- if is_try && is_from && should_convert_option_to_result {
- err.span_suggestion_verbose(
- span.shrink_to_lo(),
- "consider converting the `Option<T>` into a `Result<T, _>` using `Option::ok_or` or `Option::ok_or_else`",
- ".ok_or_else(|| /* error value */)".to_string(),
- Applicability::HasPlaceholders,
- );
- } else if is_try && is_from && should_convert_result_to_option {
- err.span_suggestion_verbose(
- span.shrink_to_lo(),
- "consider converting the `Result<T, _>` into an `Option<T>` using `Result::ok`",
- ".ok()".to_string(),
- Applicability::MachineApplicable,
- );
+ if is_try && is_from {
+ if should_convert_option_to_result {
+ err.span_suggestion_verbose(
+ span.shrink_to_lo(),
+ "consider converting the `Option<T>` into a `Result<T, _>` \
+ using `Option::ok_or` or `Option::ok_or_else`",
+ ".ok_or_else(|| /* error value */)".to_string(),
+ Applicability::HasPlaceholders,
+ );
+ } else if should_convert_result_to_option {
+ err.span_suggestion_verbose(
+ span.shrink_to_lo(),
+ "consider converting the `Result<T, _>` into an `Option<T>` \
+ using `Result::ok`",
+ ".ok()".to_string(),
+ Applicability::MachineApplicable,
+ );
+ }
+ if let Some(ret_span) = self.return_type_span(obligation) {
+ err.span_label(
+ ret_span,
+ &format!("expected `{}` because of this", trait_ref.self_ty()),
+ );
+ }
}
let explanation =
}
};
- for obligation in super::elaborate_predicates(self.tcx, vec![*cond]) {
+ for obligation in super::elaborate_predicates(self.tcx, std::iter::once(*cond)) {
if let ty::Predicate::Trait(implication, _) = obligation.predicate {
let error = error.to_poly_trait_ref();
let implication = implication.to_poly_trait_ref();
match simp {
Some(simp) => all_impls
- .iter()
- .filter_map(|&def_id| {
+ .filter_map(|def_id| {
let imp = self.tcx.impl_trait_ref(def_id).unwrap();
let imp_simp = fast_reject::simplify_type(self.tcx, imp.self_ty(), true);
if let Some(imp_simp) = imp_simp {
return None;
}
}
-
Some(imp)
})
.collect(),
- None => {
- all_impls.iter().map(|&def_id| self.tcx.impl_trait_ref(def_id).unwrap()).collect()
- }
+ None => all_impls.map(|def_id| self.tcx.impl_trait_ref(def_id).unwrap()).collect(),
}
}
trait_ref: &ty::Binder<ty::TraitRef<'tcx>>,
);
+ fn return_type_span(&self, obligation: &PredicateObligation<'tcx>) -> Option<Span>;
+
fn suggest_impl_trait(
&self,
err: &mut DiagnosticBuilder<'tcx>,
}
}
+ fn return_type_span(&self, obligation: &PredicateObligation<'tcx>) -> Option<Span> {
+ let hir = self.tcx.hir();
+ let parent_node = hir.get_parent_node(obligation.cause.body_id);
+ let sig = match hir.find(parent_node) {
+ Some(hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(sig, ..), .. })) => sig,
+ _ => return None,
+ };
+
+ if let hir::FnRetTy::Return(ret_ty) = sig.decl.output { Some(ret_ty.span) } else { None }
+ }
+
/// If all conditions are met to identify a returned `dyn Trait`, suggest using `impl Trait` if
/// applicable and signal that the error has been expanded appropriately and needs to be
/// emitted.
let tables: &TypeckTables<'tcx> = match &in_progress_tables {
Some(t) if t.hir_owner.map(|owner| owner.to_def_id()) == Some(generator_did_root) => t,
_ => {
- query_tables = self.tcx.typeck_tables_of(generator_did);
+ query_tables = self.tcx.typeck_tables_of(generator_did.expect_local());
&query_tables
}
};
pub fn predicates_for_generics<'tcx>(
cause: ObligationCause<'tcx>,
param_env: ty::ParamEnv<'tcx>,
- generic_bounds: &ty::InstantiatedPredicates<'tcx>,
-) -> PredicateObligations<'tcx> {
+ generic_bounds: ty::InstantiatedPredicates<'tcx>,
+) -> impl Iterator<Item = PredicateObligation<'tcx>> {
util::predicates_for_generics(cause, 0, param_env, generic_bounds)
}
);
let mut predicates: Vec<_> =
- util::elaborate_predicates(tcx, unnormalized_env.caller_bounds.to_vec())
+ util::elaborate_predicates(tcx, unnormalized_env.caller_bounds.into_iter().cloned())
.map(|obligation| obligation.predicate)
.collect();
// Search for a predicate like `Self : Sized` amongst the trait bounds.
let predicates = tcx.predicates_of(def_id);
let predicates = predicates.instantiate_identity(tcx).predicates;
- elaborate_predicates(tcx, predicates).any(|obligation| match obligation.predicate {
+ elaborate_predicates(tcx, predicates.into_iter()).any(|obligation| match obligation.predicate {
ty::Predicate::Trait(ref trait_pred, _) => {
trait_pred.def_id() == sized_def_id && trait_pred.skip_binder().self_ty().is_param(0)
}
// If so, extract what we know from the trait and try to come up with a good answer.
let trait_predicates = tcx.predicates_of(def_id);
let bounds = trait_predicates.instantiate(tcx, substs);
- let bounds = elaborate_predicates(tcx, bounds.predicates).map(|o| o.predicate);
+ let bounds = elaborate_predicates(tcx, bounds.predicates.into_iter()).map(|o| o.predicate);
assemble_candidates_from_predicates(
selcx,
obligation,
)
}
-fn assemble_candidates_from_predicates<'cx, 'tcx, I>(
+fn assemble_candidates_from_predicates<'cx, 'tcx>(
selcx: &mut SelectionContext<'cx, 'tcx>,
obligation: &ProjectionTyObligation<'tcx>,
obligation_trait_ref: &ty::TraitRef<'tcx>,
candidate_set: &mut ProjectionTyCandidateSet<'tcx>,
ctor: fn(ty::PolyProjectionPredicate<'tcx>) -> ProjectionTyCandidate<'tcx>,
- env_predicates: I,
-) where
- I: IntoIterator<Item = ty::Predicate<'tcx>>,
-{
+ env_predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
+) {
debug!("assemble_candidates_from_predicates(obligation={:?})", obligation);
let infcx = selcx.infcx();
for predicate in env_predicates {
object_ty
),
};
- let env_predicates = data
- .projection_bounds()
- .map(|p| p.with_self_ty(selcx.tcx(), object_ty).to_predicate())
- .collect();
+ let env_predicates =
+ data.projection_bounds().map(|p| p.with_self_ty(selcx.tcx(), object_ty).to_predicate());
let env_predicate = {
let env_predicates = elaborate_predicates(selcx.tcx(), env_predicates);
bounds
);
- let elaborated_predicates = util::elaborate_predicates(self.tcx(), bounds.predicates);
+ let elaborated_predicates =
+ util::elaborate_predicates(self.tcx(), bounds.predicates.into_iter());
let matching_bound = elaborated_predicates.filter_to_traits().find(|bound| {
self.infcx.probe(|_| {
self.match_projection(
let selcx = &mut SelectionContext::new(&infcx);
let target_substs = infcx.fresh_substs_for_item(DUMMY_SP, target_impl);
- let (target_trait_ref, mut obligations) =
+ let (target_trait_ref, obligations) =
impl_trait_ref_and_oblig(selcx, param_env, target_impl, target_substs);
- debug!(
- "fulfill_implication: target_trait_ref={:?}, obligations={:?}",
- target_trait_ref, obligations
- );
// do the impls unify? If not, no specialization.
- match infcx.at(&ObligationCause::dummy(), param_env).eq(source_trait_ref, target_trait_ref) {
- Ok(InferOk { obligations: o, .. }) => {
- obligations.extend(o);
- }
- Err(_) => {
- debug!(
- "fulfill_implication: {:?} does not unify with {:?}",
- source_trait_ref, target_trait_ref
- );
- return Err(());
- }
- }
+ let more_obligations =
+ match infcx.at(&ObligationCause::dummy(), param_env).eq(source_trait_ref, target_trait_ref)
+ {
+ Ok(InferOk { obligations, .. }) => obligations,
+ Err(_) => {
+ debug!(
+ "fulfill_implication: {:?} does not unify with {:?}",
+ source_trait_ref, target_trait_ref
+ );
+ return Err(());
+ }
+ };
// attempt to prove all of the predicates for impl2 given those for impl1
// (which are packed up in penv)
// we already make a mockery out of the region system, so
// why not ignore them a bit earlier?
let mut fulfill_cx = FulfillmentContext::new_ignoring_regions();
- for oblig in obligations.into_iter() {
+ for oblig in obligations.chain(more_obligations) {
fulfill_cx.register_predicate_obligation(&infcx, oblig);
}
match fulfill_cx.select_all_or_error(infcx) {
) -> &specialization_graph::Graph {
let mut sg = specialization_graph::Graph::new();
- let mut trait_impls = tcx.all_impls(trait_id);
+ let mut trait_impls: Vec<_> = tcx.all_impls(trait_id).collect();
// The coherence checking implementation seems to rely on impls being
// iterated over (roughly) in definition order, so we are sorting by
pub fn expand_trait_aliases<'tcx>(
tcx: TyCtxt<'tcx>,
- trait_refs: impl IntoIterator<Item = (ty::PolyTraitRef<'tcx>, Span)>,
+ trait_refs: impl Iterator<Item = (ty::PolyTraitRef<'tcx>, Span)>,
) -> TraitAliasExpander<'tcx> {
- let items: Vec<_> = trait_refs
- .into_iter()
- .map(|(trait_ref, span)| TraitAliasExpansionInfo::new(trait_ref, span))
- .collect();
+ let items: Vec<_> =
+ trait_refs.map(|(trait_ref, span)| TraitAliasExpansionInfo::new(trait_ref, span)).collect();
TraitAliasExpander { tcx, stack: items }
}
param_env: ty::ParamEnv<'tcx>,
impl_def_id: DefId,
impl_substs: SubstsRef<'tcx>,
-) -> (ty::TraitRef<'tcx>, Vec<PredicateObligation<'tcx>>) {
+) -> (ty::TraitRef<'tcx>, impl Iterator<Item = PredicateObligation<'tcx>>) {
let impl_trait_ref = selcx.tcx().impl_trait_ref(impl_def_id).unwrap();
let impl_trait_ref = impl_trait_ref.subst(selcx.tcx(), impl_substs);
let Normalized { value: impl_trait_ref, obligations: normalization_obligations1 } =
let Normalized { value: predicates, obligations: normalization_obligations2 } =
super::normalize(selcx, param_env, ObligationCause::dummy(), &predicates);
let impl_obligations =
- predicates_for_generics(ObligationCause::dummy(), 0, param_env, &predicates);
+ predicates_for_generics(ObligationCause::dummy(), 0, param_env, predicates);
- let impl_obligations: Vec<_> = impl_obligations
- .into_iter()
- .chain(normalization_obligations1)
- .chain(normalization_obligations2)
- .collect();
+ let impl_obligations = impl_obligations
+ .chain(normalization_obligations1.into_iter())
+ .chain(normalization_obligations2.into_iter());
(impl_trait_ref, impl_obligations)
}
cause: ObligationCause<'tcx>,
recursion_depth: usize,
param_env: ty::ParamEnv<'tcx>,
- generic_bounds: &ty::InstantiatedPredicates<'tcx>,
-) -> Vec<PredicateObligation<'tcx>> {
+ generic_bounds: ty::InstantiatedPredicates<'tcx>,
+) -> impl Iterator<Item = PredicateObligation<'tcx>> {
debug!("predicates_for_generics(generic_bounds={:?})", generic_bounds);
- generic_bounds
- .predicates
- .iter()
- .map(|&predicate| Obligation {
- cause: cause.clone(),
- recursion_depth,
- param_env,
- predicate,
- })
- .collect()
+ generic_bounds.predicates.into_iter().map(move |predicate| Obligation {
+ cause: cause.clone(),
+ recursion_depth,
+ param_env,
+ predicate,
+ })
}
pub fn predicate_for_trait_ref<'tcx>(
item: Option<&hir::Item<'tcx>>,
cause: &mut traits::ObligationCause<'tcx>,
pred: &ty::Predicate<'_>,
- mut trait_assoc_items: impl Iterator<Item = ty::AssocItem>,
+ mut trait_assoc_items: impl Iterator<Item = &'tcx ty::AssocItem>,
) {
debug!(
"extended_cause_with_original_assoc_item_obligation {:?} {:?} {:?} {:?}",
let item = self.item;
+ let extend = |obligation: traits::PredicateObligation<'tcx>| {
+ let mut cause = cause.clone();
+ if let Some(parent_trait_ref) = obligation.predicate.to_opt_poly_trait_ref() {
+ let derived_cause = traits::DerivedObligationCause {
+ parent_trait_ref,
+ parent_code: Rc::new(obligation.cause.code.clone()),
+ };
+ cause.code = traits::ObligationCauseCode::DerivedObligation(derived_cause);
+ }
+ extend_cause_with_original_assoc_item_obligation(
+ tcx,
+ trait_ref,
+ item,
+ &mut cause,
+ &obligation.predicate,
+ tcx.associated_items(trait_ref.def_id).in_definition_order(),
+ );
+ traits::Obligation::new(cause, param_env, obligation.predicate)
+ };
+
if let Elaborate::All = elaborate {
- let implied_obligations = traits::util::elaborate_obligations(tcx, obligations.clone());
- let implied_obligations = implied_obligations.map(|obligation| {
- debug!("compute_trait_ref implied_obligation {:?}", obligation);
- debug!("compute_trait_ref implied_obligation cause {:?}", obligation.cause);
- let mut cause = cause.clone();
- if let Some(parent_trait_ref) = obligation.predicate.to_opt_poly_trait_ref() {
- let derived_cause = traits::DerivedObligationCause {
- parent_trait_ref,
- parent_code: Rc::new(obligation.cause.code.clone()),
- };
- cause.code = traits::ObligationCauseCode::DerivedObligation(derived_cause);
- }
- extend_cause_with_original_assoc_item_obligation(
- tcx,
- trait_ref,
- item,
- &mut cause,
- &obligation.predicate,
- tcx.associated_items(trait_ref.def_id).in_definition_order().copied(),
- );
- debug!("compute_trait_ref new cause {:?}", cause);
- traits::Obligation::new(cause, param_env, obligation.predicate)
- });
+ let implied_obligations = traits::util::elaborate_obligations(tcx, obligations);
+ let implied_obligations = implied_obligations.map(extend);
self.out.extend(implied_obligations);
+ } else {
+ self.out.extend(obligations);
}
- self.out.extend(obligations);
-
self.out.extend(trait_ref.substs.types().filter(|ty| !ty.has_escaping_bound_vars()).map(
|ty| traits::Obligation::new(cause.clone(), param_env, ty::Predicate::WellFormed(ty)),
));
// a placeholder type.
let open_ty = tcx.mk_ty_infer(ty::FreshTy(0));
- let predicates = existential_predicates
- .iter()
- .filter_map(|predicate| {
- if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
- None
- } else {
- Some(predicate.with_self_ty(tcx, open_ty))
- }
- })
- .collect();
+ let predicates = existential_predicates.iter().filter_map(|predicate| {
+ if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
+ None
+ } else {
+ Some(predicate.with_self_ty(tcx, open_ty))
+ }
+ });
required_region_bounds(tcx, open_ty, predicates)
}
ty::RawPtr(mt_b) => {
return self.coerce_unsafe_ptr(a, b, mt_b.mutbl);
}
-
- ty::Ref(r_b, ty, mutbl) => {
- let mt_b = ty::TypeAndMut { ty, mutbl };
- return self.coerce_borrowed_pointer(a, b, r_b, mt_b);
+ ty::Ref(r_b, _, mutbl_b) => {
+ return self.coerce_borrowed_pointer(a, b, r_b, mutbl_b);
}
-
_ => {}
}
a: Ty<'tcx>,
b: Ty<'tcx>,
r_b: ty::Region<'tcx>,
- mt_b: TypeAndMut<'tcx>,
+ mutbl_b: hir::Mutability,
) -> CoerceResult<'tcx> {
debug!("coerce_borrowed_pointer(a={:?}, b={:?})", a, b);
let (r_a, mt_a) = match a.kind {
ty::Ref(r_a, ty, mutbl) => {
let mt_a = ty::TypeAndMut { ty, mutbl };
- coerce_mutbls(mt_a.mutbl, mt_b.mutbl)?;
+ coerce_mutbls(mt_a.mutbl, mutbl_b)?;
(r_a, mt_a)
}
_ => return self.unify_and(a, b, identity),
r_a // [3] above
} else {
if r_borrow_var.is_none() {
- // create var lazilly, at most once
+ // create var lazily, at most once
let coercion = Coercion(span);
let r = self.next_region_var(coercion);
r_borrow_var = Some(r); // [4] above
r,
TypeAndMut {
ty: referent_ty,
- mutbl: mt_b.mutbl, // [1] above
+ mutbl: mutbl_b, // [1] above
},
);
match self.unify(derefd_ty_a, b) {
// `self.x` both have `&mut `type would be a move of
// `self.x`, but we auto-coerce it to `foo(&mut *self.x)`,
// which is a borrow.
- assert_eq!(mt_b.mutbl, hir::Mutability::Not); // can only coerce &T -> &U
+ assert_eq!(mutbl_b, hir::Mutability::Not); // can only coerce &T -> &U
return success(vec![], ty, obligations);
}
- let needs = Needs::maybe_mut_place(mt_b.mutbl);
+ let needs = Needs::maybe_mut_place(mutbl_b);
let InferOk { value: mut adjustments, obligations: o } =
autoderef.adjust_steps_as_infer_ok(self, needs);
obligations.extend(o);
ty::Ref(r_borrow, _, _) => r_borrow,
_ => span_bug!(span, "expected a ref type, got {:?}", ty),
};
- let mutbl = match mt_b.mutbl {
+ let mutbl = match mutbl_b {
hir::Mutability::Not => AutoBorrowMutability::Not,
hir::Mutability::Mut => {
AutoBorrowMutability::Mut { allow_two_phase_borrow: self.allow_two_phase }
suggest_to_change_suffix_or_into(err, is_fallible);
true
}
- (&ty::Int(_), &ty::Uint(_)) | (&ty::Uint(_), &ty::Int(_)) => {
+ (&ty::Int(exp), &ty::Uint(found)) => {
+ let is_fallible = match (exp.bit_width(), found.bit_width()) {
+ (Some(exp), Some(found)) if found < exp => false,
+ (None, Some(8)) => false,
+ _ => true,
+ };
+ suggest_to_change_suffix_or_into(err, is_fallible);
+ true
+ }
+ (&ty::Uint(_), &ty::Int(_)) => {
suggest_to_change_suffix_or_into(err, true);
true
}
// a custom error in that case.
if illegal_sized_bound.is_none() {
let method_ty = self.tcx.mk_fn_ptr(ty::Binder::bind(method_sig));
- self.add_obligations(method_ty, all_substs, &method_predicates);
+ self.add_obligations(method_ty, all_substs, method_predicates);
}
// Create the final `MethodCallee`.
&mut self,
fty: Ty<'tcx>,
all_substs: SubstsRef<'tcx>,
- method_predicates: &ty::InstantiatedPredicates<'tcx>,
+ method_predicates: ty::InstantiatedPredicates<'tcx>,
) {
debug!(
"add_obligations: fty={:?} all_substs={:?} method_predicates={:?}",
None => return None,
};
- traits::elaborate_predicates(self.tcx, predicates.predicates.clone())
+ traits::elaborate_predicates(self.tcx, predicates.predicates.iter().copied())
.filter_map(|obligation| match obligation.predicate {
ty::Predicate::Trait(trait_pred, _) if trait_pred.def_id() == sized_def_id => {
let span = predicates
assert!(!bounds.has_escaping_bound_vars());
let cause = traits::ObligationCause::misc(span, self.body_id);
- obligations.extend(traits::predicates_for_generics(cause.clone(), self.param_env, &bounds));
+ obligations.extend(traits::predicates_for_generics(cause.clone(), self.param_env, bounds));
// Also add an obligation for the method type being well-formed.
let method_ty = tcx.mk_fn_ptr(ty::Binder::bind(fn_sig));
// clauses) that must be considered. Make sure that those
// match as well (or at least may match, sometimes we
// don't have enough information to fully evaluate).
- let candidate_obligations: Vec<_> = match probe.kind {
+ match probe.kind {
InherentImplCandidate(ref substs, ref ref_obligations) => {
// Check whether the impl imposes obligations we have to worry about.
let impl_def_id = probe.item.container.id();
// Convert the bounds into obligations.
let impl_obligations =
- traits::predicates_for_generics(cause, self.param_env, &impl_bounds);
+ traits::predicates_for_generics(cause, self.param_env, impl_bounds);
- debug!("impl_obligations={:?}", impl_obligations);
- impl_obligations
- .into_iter()
+ let candidate_obligations = impl_obligations
.chain(norm_obligations.into_iter())
- .chain(ref_obligations.iter().cloned())
- .collect()
+ .chain(ref_obligations.iter().cloned());
+ // Evaluate those obligations to see if they might possibly hold.
+ for o in candidate_obligations {
+ let o = self.resolve_vars_if_possible(&o);
+ if !self.predicate_may_hold(&o) {
+ result = ProbeResult::NoMatch;
+ possibly_unsatisfied_predicates.push((o.predicate, None));
+ }
+ }
}
ObjectCandidate | WhereClauseCandidate(..) => {
// These have no additional conditions to check.
- vec![]
}
TraitCandidate(trait_ref) => {
return ProbeResult::NoMatch;
}
}
- vec![]
}
- };
-
- debug!(
- "consider_probe - candidate_obligations={:?} sub_obligations={:?}",
- candidate_obligations, sub_obligations
- );
+ }
// Evaluate those obligations to see if they might possibly hold.
- for o in candidate_obligations.into_iter().chain(sub_obligations) {
+ for o in sub_obligations {
let o = self.resolve_vars_if_possible(&o);
if !self.predicate_may_hold(&o) {
result = ProbeResult::NoMatch;
});
}
-fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
- wfcheck::check_item_well_formed(tcx, def_id.expect_local());
+fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+ wfcheck::check_item_well_formed(tcx, def_id);
}
-fn check_trait_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
- wfcheck::check_trait_item(tcx, def_id.expect_local());
+fn check_trait_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+ wfcheck::check_trait_item(tcx, def_id);
}
-fn check_impl_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
- wfcheck::check_impl_item(tcx, def_id.expect_local());
+fn check_impl_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+ wfcheck::check_impl_item(tcx, def_id);
}
pub fn provide(providers: &mut Providers<'_>) {
}
}
-fn used_trait_imports(tcx: TyCtxt<'_>, def_id: DefId) -> &DefIdSet {
+fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &DefIdSet {
&*tcx.typeck_tables_of(def_id).used_trait_imports
}
val.fold_with(&mut FixupFolder { tcx })
}
-fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &ty::TypeckTables<'tcx> {
- let fallback = move || tcx.type_of(def_id);
+fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> {
+ let fallback = move || tcx.type_of(def_id.to_def_id());
typeck_tables_of_with_fallback(tcx, def_id, fallback)
}
/// Currently only used for type inference of `static`s and `const`s to avoid type cycle errors.
fn diagnostic_only_typeck_tables_of<'tcx>(
tcx: TyCtxt<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
) -> &ty::TypeckTables<'tcx> {
- assert!(def_id.is_local());
let fallback = move || {
- let span = tcx.hir().span(tcx.hir().as_local_hir_id(def_id.expect_local()));
+ let span = tcx.hir().span(tcx.hir().as_local_hir_id(def_id));
tcx.sess.delay_span_bug(span, "diagnostic only typeck table used");
tcx.types.err
};
fn typeck_tables_of_with_fallback<'tcx>(
tcx: TyCtxt<'tcx>,
- def_id: DefId,
+ def_id: LocalDefId,
fallback: impl Fn() -> Ty<'tcx> + 'tcx,
) -> &'tcx ty::TypeckTables<'tcx> {
// Closures' tables come from their outermost function,
// as they are part of the same "inference environment".
- let outer_def_id = tcx.closure_base_def_id(def_id);
+ let outer_def_id = tcx.closure_base_def_id(def_id.to_def_id()).expect_local();
if outer_def_id != def_id {
return tcx.typeck_tables_of(outer_def_id);
}
- let id = tcx.hir().as_local_hir_id(def_id.expect_local());
+ let id = tcx.hir().as_local_hir_id(def_id);
let span = tcx.hir().span(id);
// Figure out what primary body this item has.
});
let body = tcx.hir().body(body_id);
- let tables = Inherited::build(tcx, def_id.expect_local()).enter(|inh| {
+ let tables = Inherited::build(tcx, def_id).enter(|inh| {
let param_env = tcx.param_env(def_id);
let fcx = if let (Some(header), Some(decl)) = (fn_header, fn_decl) {
let fn_sig = if crate::collect::get_infer_ret_ty(&decl.output).is_some() {
check_abi(tcx, span, fn_sig.abi());
// Compute the fty from point of view of inside the fn.
- let fn_sig = tcx.liberate_late_bound_regions(def_id, &fn_sig);
+ let fn_sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), &fn_sig);
let fn_sig = inh.normalize_associated_types_in(
body.value.span,
body_id.hir_id,
// because they don't constrain other type variables.
fcx.closure_analyze(body);
assert!(fcx.deferred_call_resolutions.borrow().is_empty());
- fcx.resolve_generator_interiors(def_id);
+ fcx.resolve_generator_interiors(def_id.to_def_id());
for (ty, span, code) in fcx.deferred_sized_obligations.borrow_mut().drain(..) {
let ty = fcx.normalize_ty(span, ty);
// Check that the main return type implements the termination trait.
if let Some(term_id) = tcx.lang_items().termination() {
if let Some((def_id, EntryFnType::Main)) = tcx.entry_fn(LOCAL_CRATE) {
- let main_id = hir.as_local_hir_id(def_id.expect_local());
+ let main_id = hir.as_local_hir_id(def_id);
if main_id == fn_id {
let substs = tcx.mk_substs_trait(declared_ret_ty, &[]);
let trait_ref = ty::TraitRef::new(term_id, substs);
pub fn add_obligations_for_parameters(
&self,
cause: traits::ObligationCause<'tcx>,
- predicates: &ty::InstantiatedPredicates<'tcx>,
+ predicates: ty::InstantiatedPredicates<'tcx>,
) {
assert!(!predicates.has_escaping_bound_vars());
let (bounds, _) = self.instantiate_bounds(path_span, did, substs);
let cause =
traits::ObligationCause::new(path_span, self.body_id, traits::ItemObligation(did));
- self.add_obligations_for_parameters(cause, &bounds);
+ self.add_obligations_for_parameters(cause, bounds);
Some((variant, ty))
} else {
for (i, mut obligation) in traits::predicates_for_generics(
traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)),
self.param_env,
- &bounds,
+ bounds,
)
- .into_iter()
.enumerate()
{
// This makes the error point at the bound, but we want to point at the argument
use crate::mem_categorization as mc;
use crate::middle::region;
use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::PatKind;
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
pub fn regionck_expr(&self, body: &'tcx hir::Body<'tcx>) {
- let subject = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
+ let subject = self.tcx.hir().body_owner_def_id(body.id());
let id = body.value.hir_id;
let mut rcx =
RegionCtxt::new(self, RepeatingScope(id), id, Subject(subject), self.param_env);
self,
RepeatingScope(item_id),
item_id,
- Subject(subject.to_def_id()),
+ Subject(subject),
self.param_env,
);
rcx.outlives_environment.add_implied_bounds(self, wf_tys, item_id, span);
/// constraints to add.
pub fn regionck_fn(&self, fn_id: hir::HirId, body: &'tcx hir::Body<'tcx>) {
debug!("regionck_fn(id={})", fn_id);
- let subject = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
+ let subject = self.tcx.hir().body_owner_def_id(body.id());
let hir_id = body.value.hir_id;
let mut rcx =
RegionCtxt::new(self, RepeatingScope(hir_id), hir_id, Subject(subject), self.param_env);
// id of innermost fn body id
body_id: hir::HirId,
- body_owner: DefId,
+ body_owner: LocalDefId,
// call_site scope of innermost fn
call_site_scope: Option<region::Scope>,
repeating_scope: hir::HirId,
// id of AST node being analyzed (the subject of the analysis).
- subject_def_id: DefId,
+ subject_def_id: LocalDefId,
}
impl<'a, 'tcx> Deref for RegionCtxt<'a, 'tcx> {
}
pub struct RepeatingScope(hir::HirId);
-pub struct Subject(DefId);
+pub struct Subject(LocalDefId);
impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
pub fn new(
let body_id = body.id();
self.body_id = body_id.hir_id;
- self.body_owner = self.tcx.hir().body_owner_def_id(body_id).to_def_id();
+ self.body_owner = self.tcx.hir().body_owner_def_id(body_id);
let call_site =
region::Scope { id: body.value.hir_id.local_id, data: region::ScopeData::CallSite };
);
self.fcx.resolve_regions_and_report_errors(
- self.subject_def_id,
+ self.subject_def_id.to_def_id(),
&self.region_scope_tree,
&self.outlives_environment,
mode,
}
}
- let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
- assert_eq!(body_owner_def_id, closure_def_id);
+ let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id());
+ assert_eq!(body_owner_def_id.to_def_id(), closure_def_id);
let mut delegate = InferBorrowKind {
fcx: self,
closure_def_id,
let empty_env = ty::ParamEnv::empty();
let def_id = fcx.tcx.hir().local_def_id(id);
- let predicates = fcx.tcx.predicates_of(def_id).predicates.iter().map(|(p, _)| *p).collect();
+ let predicates = fcx.tcx.predicates_of(def_id).predicates.iter().map(|(p, _)| *p);
// Check elaborated bounds.
let implied_obligations = traits::elaborate_predicates(fcx.tcx, predicates);
let mut used_trait_imports = DefIdSet::default();
for &body_id in tcx.hir().krate().bodies.keys() {
let item_def_id = tcx.hir().body_owner_def_id(body_id);
- let imports = tcx.used_trait_imports(item_def_id.to_def_id());
+ let imports = tcx.used_trait_imports(item_def_id);
debug!("GatherVisitor: item_def_id={:?} with imports {:#?}", item_def_id, imports);
used_trait_imports.extend(imports.iter());
}
}
fn get_type_parameter_bounds(&self, span: Span, def_id: DefId) -> ty::GenericPredicates<'tcx> {
- self.tcx.at(span).type_param_predicates((self.item_def_id, def_id))
+ self.tcx.at(span).type_param_predicates((self.item_def_id, def_id.expect_local()))
}
fn re_infer(&self, _: Option<&ty::GenericParamDef>, _: Span) -> Option<ty::Region<'tcx>> {
/// `X: Foo` where `X` is the type parameter `def_id`.
fn type_param_predicates(
tcx: TyCtxt<'_>,
- (item_def_id, def_id): (DefId, DefId),
+ (item_def_id, def_id): (DefId, LocalDefId),
) -> ty::GenericPredicates<'_> {
use rustc_hir::*;
// written inline like `<T: Foo>` or in a where-clause like
// `where T: Foo`.
- let param_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+ let param_id = tcx.hir().as_local_hir_id(def_id);
let param_owner = tcx.hir().ty_param_owner(param_id);
let param_owner_def_id = tcx.hir().local_def_id(param_owner);
let generics = tcx.generics_of(param_owner_def_id);
- let index = generics.param_def_id_to_index[&def_id];
+ let index = generics.param_def_id_to_index[&def_id.to_def_id()];
let ty = tcx.mk_ty_param(index, tcx.hir().ty_param_name(param_id));
// Don't look for bounds where the type parameter isn't in scope.
let mut result = parent
.map(|parent| {
let icx = ItemCtxt::new(tcx, parent);
- icx.get_type_parameter_bounds(DUMMY_SP, def_id)
+ icx.get_type_parameter_bounds(DUMMY_SP, def_id.to_def_id())
})
.unwrap_or_default();
let mut extend = None;
use rustc_hir::Node::*;
use rustc_hir::*;
- let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+ let def_id = def_id.expect_local();
+ let hir_id = tcx.hir().as_local_hir_id(def_id);
- let icx = ItemCtxt::new(tcx, def_id);
+ let icx = ItemCtxt::new(tcx, def_id.to_def_id());
match tcx.hir().get(hir_id) {
TraitItem(hir::TraitItem {
..
}) => {
let abi = tcx.hir().get_foreign_abi(hir_id);
- compute_sig_of_foreign_fn_decl(tcx, def_id, fn_decl, abi, ident)
+ compute_sig_of_foreign_fn_decl(tcx, def_id.to_def_id(), fn_decl, abi, ident)
}
Ctor(data) | Variant(hir::Variant { data, .. }) if data.ctor_hir_id().is_some() => {
TraitItemKind::Const(ref ty, body_id) => body_id
.and_then(|body_id| {
if is_suggestable_infer_ty(ty) {
- Some(infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident))
+ Some(infer_placeholder_type(
+ tcx,
+ def_id.expect_local(),
+ body_id,
+ ty.span,
+ item.ident,
+ ))
} else {
None
}
}
ImplItemKind::Const(ref ty, body_id) => {
if is_suggestable_infer_ty(ty) {
- infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident)
+ infer_placeholder_type(tcx, def_id.expect_local(), body_id, ty.span, item.ident)
} else {
icx.to_ty(ty)
}
match item.kind {
ItemKind::Static(ref ty, .., body_id) | ItemKind::Const(ref ty, body_id) => {
if is_suggestable_infer_ty(ty) {
- infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident)
+ infer_placeholder_type(
+ tcx,
+ def_id.expect_local(),
+ body_id,
+ ty.span,
+ item.ident,
+ )
} else {
icx.to_ty(ty)
}
ItemKind::OpaqueTy(OpaqueTy { impl_trait_fn: Some(owner), origin, .. }) => {
let concrete_types = match origin {
OpaqueTyOrigin::FnReturn | OpaqueTyOrigin::AsyncFn => {
- &tcx.mir_borrowck(owner).concrete_opaque_types
+ &tcx.mir_borrowck(owner.expect_local()).concrete_opaque_types
}
OpaqueTyOrigin::Misc => {
// We shouldn't leak borrowck results through impl trait in bindings.
// For example, we shouldn't be able to tell if `x` in
// `let x: impl Sized + 'a = &()` has type `&'static ()` or `&'a ()`.
- &tcx.typeck_tables_of(owner).concrete_opaque_types
+ &tcx.typeck_tables_of(owner.expect_local()).concrete_opaque_types
}
OpaqueTyOrigin::TypeAlias => {
span_bug!(item.span, "Type alias impl trait shouldn't have an owner")
),
);
if let Some(ErrorReported) =
- tcx.typeck_tables_of(owner).tainted_by_errors
+ tcx.typeck_tables_of(owner.expect_local()).tainted_by_errors
{
// Some error in the
// owner fn prevented us from populating
}
impl ConstraintLocator<'_> {
- fn check(&mut self, def_id: DefId) {
+ fn check(&mut self, def_id: LocalDefId) {
// Don't try to check items that cannot possibly constrain the type.
if !self.tcx.has_typeck_tables(def_id) {
debug!(
fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) {
if let hir::ExprKind::Closure(..) = ex.kind {
let def_id = self.tcx.hir().local_def_id(ex.hir_id);
- self.check(def_id.to_def_id());
+ self.check(def_id);
}
intravisit::walk_expr(self, ex);
}
fn visit_item(&mut self, it: &'tcx Item<'tcx>) {
debug!("find_existential_constraints: visiting {:?}", it);
- let def_id = self.tcx.hir().local_def_id(it.hir_id).to_def_id();
+ let def_id = self.tcx.hir().local_def_id(it.hir_id);
// The opaque type itself or its children are not within its reveal scope.
- if def_id != self.def_id {
+ if def_id.to_def_id() != self.def_id {
self.check(def_id);
intravisit::walk_item(self, it);
}
}
fn visit_impl_item(&mut self, it: &'tcx ImplItem<'tcx>) {
debug!("find_existential_constraints: visiting {:?}", it);
- let def_id = self.tcx.hir().local_def_id(it.hir_id).to_def_id();
+ let def_id = self.tcx.hir().local_def_id(it.hir_id);
// The opaque type itself or its children are not within its reveal scope.
- if def_id != self.def_id {
+ if def_id.to_def_id() != self.def_id {
self.check(def_id);
intravisit::walk_impl_item(self, it);
}
fn visit_trait_item(&mut self, it: &'tcx TraitItem<'tcx>) {
debug!("find_existential_constraints: visiting {:?}", it);
let def_id = self.tcx.hir().local_def_id(it.hir_id);
- self.check(def_id.to_def_id());
+ self.check(def_id);
intravisit::walk_trait_item(self, it);
}
}
fn infer_placeholder_type(
tcx: TyCtxt<'_>,
- def_id: DefId,
+ def_id: LocalDefId,
body_id: hir::BodyId,
span: Span,
item_ident: Ident,
use rustc_hir as hir;
use rustc_hir::def::Res;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
use rustc_hir::PatKind;
use rustc_infer::infer::InferCtxt;
use rustc_middle::ty::{self, adjustment, TyCtxt};
pub fn new(
delegate: &'a mut (dyn Delegate<'tcx> + 'a),
infcx: &'a InferCtxt<'a, 'tcx>,
- body_owner: DefId,
+ body_owner: LocalDefId,
param_env: ty::ParamEnv<'tcx>,
tables: &'a ty::TypeckTables<'tcx>,
) -> Self {
// which is sound because we forbid impls like the following
//
// impl<D: Debug> AlwaysApplicable for D { }
- let always_applicable_traits: Vec<_> = impl1_predicates
+ let always_applicable_traits = impl1_predicates
.predicates
.iter()
.filter(|predicate| {
Some(TraitSpecializationKind::AlwaysApplicable)
)
})
- .copied()
- .collect();
+ .copied();
// Include the well-formed predicates of the type parameters of the impl.
for ty in tcx.impl_trait_ref(impl1_def_id).unwrap().substs.types() {
fn check_for_entry_fn(tcx: TyCtxt<'_>) {
match tcx.entry_fn(LOCAL_CRATE) {
- Some((def_id, EntryFnType::Main)) => check_main_fn_ty(tcx, def_id.expect_local()),
- Some((def_id, EntryFnType::Start)) => check_start_fn_ty(tcx, def_id.expect_local()),
+ Some((def_id, EntryFnType::Main)) => check_main_fn_ty(tcx, def_id),
+ Some((def_id, EntryFnType::Start)) => check_start_fn_ty(tcx, def_id),
_ => {}
}
}
use rustc_data_structures::fx::FxIndexMap;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
use rustc_hir::PatKind;
use rustc_infer::infer::InferCtxt;
use rustc_span::Span;
crate tables: &'a ty::TypeckTables<'tcx>,
infcx: &'a InferCtxt<'a, 'tcx>,
param_env: ty::ParamEnv<'tcx>,
- body_owner: DefId,
+ body_owner: LocalDefId,
upvars: Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>>,
}
crate fn new(
infcx: &'a InferCtxt<'a, 'tcx>,
param_env: ty::ParamEnv<'tcx>,
- body_owner: DefId,
+ body_owner: LocalDefId,
tables: &'a ty::TypeckTables<'tcx>,
) -> MemCategorizationContext<'a, 'tcx> {
MemCategorizationContext {
let upvar_id = ty::UpvarId {
var_path: ty::UpvarPath { hir_id: var_id },
- closure_expr_id: closure_expr_def_id.expect_local(),
+ closure_expr_id: closure_expr_def_id,
};
let var_ty = self.node_ty(var_id)?;
self.inner.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.inner.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.inner.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
self.inner.flush()
}
self.inner.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.inner.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.inner.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
self.inner.flush()
}
Ok(nread)
}
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
// we can't skip unconditionally because of the large buffer case in read.
unsafe fn initializer(&self) -> Initializer {
self.inner.initializer()
}
}
+ fn is_write_vectored(&self) -> bool {
+ self.get_ref().is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
self.flush_buf().and_then(|()| self.get_mut().flush())
}
Ok(nread)
}
+ fn is_read_vectored(&self) -> bool {
+ true
+ }
+
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
let n = buf.len();
Read::read_exact(&mut self.fill_buf()?, buf)?;
slice_write_vectored(&mut self.pos, self.inner, bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
vec_write_vectored(&mut self.pos, self.inner, bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
vec_write_vectored(&mut self.pos, &mut self.inner, bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
slice_write_vectored(&mut self.pos, &mut self.inner, bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
(**self).read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ (**self).is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
(**self).initializer()
(**self).write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ (**self).is_write_vectored()
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
(**self).flush()
(**self).read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ (**self).is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
(**self).initializer()
(**self).write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ (**self).is_write_vectored()
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
(**self).flush()
Ok(nread)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
Ok(nwritten)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn write_all(&mut self, data: &[u8]) -> io::Result<()> {
if self.write(data)? == data.len() {
Ok(len)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
self.extend_from_slice(buf);
//! [`Read::read`]: trait.Read.html#tymethod.read
//! [`Result`]: ../result/enum.Result.html
//! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap
+// ignore-tidy-filelength
#![stable(feature = "rust1", since = "1.0.0")]
/// Like `read`, except that it reads into a slice of buffers.
///
/// Data is copied to fill each buffer in order, with the final buffer
- /// written to possibly being only partially filled. This method must behave
- /// as a single call to `read` with the buffers concatenated would.
+ /// written to possibly being only partially filled. This method must
+ /// behave equivalently to a single call to `read` with concatenated
+ /// buffers.
///
/// The default implementation calls `read` with either the first nonempty
/// buffer provided, or an empty one if none exists.
default_read_vectored(|b| self.read(b), bufs)
}
+ /// Determines if this `Read`er has an efficient `read_vectored`
+ /// implementation.
+ ///
+ /// If a `Read`er does not override the default `read_vectored`
+ /// implementation, code using it may want to avoid the method all together
+ /// and coalesce writes into a single buffer for higher performance.
+ ///
+ /// The default implementation returns `false`.
+ #[unstable(feature = "can_vector", issue = "69941")]
+ fn is_read_vectored(&self) -> bool {
+ false
+ }
+
/// Determines if this `Read`er can work with buffers of uninitialized
/// memory.
///
default_write_vectored(|b| self.write(b), bufs)
}
+ /// Determines if this `Write`er has an efficient `write_vectored`
+ /// implementation.
+ ///
+ /// If a `Write`er does not override the default `write_vectored`
+ /// implementation, code using it may want to avoid the method all together
+ /// and coalesce writes into a single buffer for higher performance.
+ ///
+ /// The default implementation returns `false`.
+ #[unstable(feature = "can_vector", issue = "69941")]
+ fn is_write_vectored(&self) -> bool {
+ false
+ }
+
/// Flush this output stream, ensuring that all intermediately buffered
/// contents reach their destination.
///
self.0.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.0.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
self.0.flush()
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
self.0.flush()
}
}
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ match self {
+ Maybe::Real(w) => w.is_write_vectored(),
+ Maybe::Fake => true,
+ }
+ }
+
fn flush(&mut self) -> io::Result<()> {
match *self {
Maybe::Real(ref mut w) => handle_ebadf(w.flush(), ()),
Maybe::Fake => Ok(0),
}
}
+
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ match self {
+ Maybe::Real(w) => w.is_read_vectored(),
+ Maybe::Fake => true,
+ }
+ }
}
fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
self.lock().read_vectored(bufs)
}
#[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.lock().is_read_vectored()
+ }
+ #[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
}
self.inner.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.lock().write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.lock().is_write_vectored()
+ }
fn flush(&mut self) -> io::Result<()> {
self.lock().flush()
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.borrow_mut().write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.inner.borrow_mut().is_write_vectored()
+ }
fn flush(&mut self) -> io::Result<()> {
self.inner.borrow_mut().flush()
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.lock().write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.lock().is_write_vectored()
+ }
fn flush(&mut self) -> io::Result<()> {
self.lock().flush()
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.borrow_mut().write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.inner.borrow_mut().is_write_vectored()
+ }
fn flush(&mut self) -> io::Result<()> {
self.inner.borrow_mut().flush()
}
Ok(nwritten)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
Ok(total_len)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
#![feature(box_syntax)]
#![feature(c_variadic)]
#![feature(cfg_accessible)]
+#![feature(can_vector)]
#![feature(cfg_target_has_atomic)]
#![feature(cfg_target_thread_local)]
#![feature(char_error_internals)]
self.0.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.0.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
self.0.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.0.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
self.inner.write_vectored(bufs)
}
+ fn is_write_vectored(&self) -> bool {
+ self.inner.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
self.inner.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.inner.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
);
cnt != DISCONNECTED && cnt != steals
} {
- while let Some(_) = self.queue.pop() {
+ while self.queue.pop().is_some() {
steals += 1;
}
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn flush(&self) -> io::Result<()> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn diverge(&self) -> ! {
match self.0 {}
}
crate::io::default_read_vectored(|buf| self.read(buf), bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ false
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
crate::io::default_write_vectored(|buf| self.write(buf), bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ false
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
Ok(size)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn write(&self, buffer: &[u8]) -> io::Result<usize> {
self.write_vectored(&[IoSlice::new(buffer)])
}
Ok(size)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
Err(io::Error::new(ErrorKind::Other, "peer_addr isn't supported"))
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn diverge(&self) -> ! {
match self.0 {}
}
// .read(data)
Ok(0)
}
+
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
}
impl Stdout {
}
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
}
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
usercalls::read(self.fd, bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
usercalls::write(self.fd, &[IoSlice::new(buf)])
}
usercalls::write(self.fd, bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
usercalls::flush(self.fd)
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn flush(&self) -> io::Result<()> {
match self.0 {}
}
self.inner.inner.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.inner.inner.is_read_vectored()
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.inner.inner.write(buf)
}
self.inner.inner.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.inner.inner.is_write_vectored()
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
addr_to_sockaddr(&self.peer_addr)
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn diverge(&self) -> ! {
match self.0 {}
}
io::Read::read_vectored(&mut &*self, bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ io::Read::is_read_vectored(&&*self)
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
self.0.read_vectored(bufs)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
io::Write::write_vectored(&mut &*self, bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ io::Write::is_write_vectored(&&*self)
+ }
+
fn flush(&mut self) -> io::Result<()> {
io::Write::flush(&mut &*self)
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Ok(ret as usize)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
let mut me = self;
(&mut me).read_to_end(buf)
Ok(ret as usize)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
#[cfg(target_os = "android")]
use super::android::cvt_pwrite64;
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
self.0.read_at(buf, offset)
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
self.0.write_at(buf, offset)
}
unimpl!();
}
+ pub fn is_read_vectored(&self) -> bool {
+ unimpl!();
+ }
+
pub fn peek(&self, _: &mut [u8]) -> io::Result<usize> {
unimpl!();
}
unimpl!();
}
+ pub fn is_write_vectored(&self) -> bool {
+ unimpl!();
+ }
+
pub fn set_timeout(&self, _: Option<Duration>, _: libc::c_int) -> io::Result<()> {
unimpl!();
}
unimpl!();
}
+ pub fn is_read_vectored(&self) -> bool {
+ unimpl!();
+ }
+
pub fn write(&self, _: &[u8]) -> io::Result<usize> {
unimpl!();
}
unimpl!();
}
+ pub fn is_write_vectored(&self) -> bool {
+ unimpl!();
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
unimpl!();
}
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
fn recv_from_with_flags(
&self,
buf: &mut [u8],
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn set_timeout(&self, dur: Option<Duration>, kind: libc::c_int) -> io::Result<()> {
let timeout = match dur {
Some(dur) => {
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn fd(&self) -> &FileDesc {
&self.0
}
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
ManuallyDrop::new(FileDesc::new(libc::STDIN_FILENO)).read_vectored(bufs)
}
+
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ true
+ }
}
impl Stdout {
ManuallyDrop::new(FileDesc::new(libc::STDOUT_FILENO)).write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
ManuallyDrop::new(FileDesc::new(libc::STDERR_FILENO)).write_vectored(bufs)
}
+ #[inline]
+ fn is_write_vectored(&self) -> bool {
+ true
+ }
+
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Ok(ret as usize)
}
+ #[inline]
+ fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
let mut me = self;
(&mut me).read_to_end(buf)
Ok(ret as usize)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
unsafe fn cvt_pwrite(
fd: c_int,
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
self.0.read_at(buf, offset)
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
self.0.write_at(buf, offset)
}
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
fn recv_from_with_flags(
&self,
buf: &mut [u8],
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn set_timeout(&self, dur: Option<Duration>, kind: libc::c_int) -> io::Result<()> {
let timeout = match dur {
Some(dur) => {
pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> {
self.0.read(buf)
}
+
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
self.0.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.0.is_read_vectored()
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
self.0.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.0.is_write_vectored()
+ }
+
pub fn fd(&self) -> &FileDesc {
&self.0
}
self.fd.read(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.write_vectored(&[IoSlice::new(buf)])
}
self.fd.write(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
unsupported()
}
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn write(&self, _: &[u8]) -> io::Result<usize> {
unsupported()
}
unsupported()
}
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
unsupported()
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn diverge(&self) -> ! {
match self.0 {}
}
ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).read(data)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn as_raw_fd(&self) -> u32 {
0
}
ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).write(data)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).write(data)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn flush(&self) -> io::Result<()> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_read_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
match self.0 {}
}
match self.0 {}
}
+ pub fn is_write_vectored(&self) -> bool {
+ match self.0 {}
+ }
+
pub fn diverge(&self) -> ! {
match self.0 {}
}
self.handle.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.handle.is_read_vectored()
+ }
+
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
self.handle.read_at(buf, offset)
}
self.handle.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.handle.is_write_vectored()
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
self.handle.write_at(buf, offset)
}
crate::io::default_read_vectored(|buf| self.read(buf), bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ false
+ }
+
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
let mut read = 0;
let len = cmp::min(buf.len(), <c::DWORD>::max_value() as usize) as c::DWORD;
crate::io::default_write_vectored(|buf| self.write(buf), bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ false
+ }
+
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
let mut written = 0;
let len = cmp::min(buf.len(), <c::DWORD>::max_value() as usize) as c::DWORD;
}
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ true
+ }
+
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
self.recv_with_flags(buf, c::MSG_PEEK)
}
Ok(nwritten as usize)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ true
+ }
+
pub fn set_timeout(&self, dur: Option<Duration>, kind: c_int) -> io::Result<()> {
let timeout = match dur {
Some(dur) => {
self.inner.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
self.inner.write(buf)
}
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.write_vectored(bufs)
}
+
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.inner.is_write_vectored()
+ }
}
pub fn read2(p1: AnonPipe, v1: &mut Vec<u8>, p2: AnonPipe, v2: &mut Vec<u8>) -> io::Result<()> {
self.inner.read_vectored(bufs)
}
+ #[inline]
+ pub fn is_read_vectored(&self) -> bool {
+ self.inner.is_read_vectored()
+ }
+
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t;
let ret = cvt(unsafe {
self.inner.write_vectored(bufs)
}
+ #[inline]
+ pub fn is_write_vectored(&self) -> bool {
+ self.inner.is_write_vectored()
+ }
+
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
sockname(|buf, len| unsafe { c::getpeername(*self.inner.as_inner(), buf, len) })
}
}
}
-enum class LLVMRustRelocMode {
- Default,
+enum class LLVMRustRelocModel {
Static,
PIC,
DynamicNoPic,
ROPIRWPI,
};
-static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
+static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) {
switch (RustReloc) {
- case LLVMRustRelocMode::Default:
- return None;
- case LLVMRustRelocMode::Static:
+ case LLVMRustRelocModel::Static:
return Reloc::Static;
- case LLVMRustRelocMode::PIC:
+ case LLVMRustRelocModel::PIC:
return Reloc::PIC_;
- case LLVMRustRelocMode::DynamicNoPic:
+ case LLVMRustRelocModel::DynamicNoPic:
return Reloc::DynamicNoPIC;
- case LLVMRustRelocMode::ROPI:
+ case LLVMRustRelocModel::ROPI:
return Reloc::ROPI;
- case LLVMRustRelocMode::RWPI:
+ case LLVMRustRelocModel::RWPI:
return Reloc::RWPI;
- case LLVMRustRelocMode::ROPIRWPI:
+ case LLVMRustRelocModel::ROPIRWPI:
return Reloc::ROPI_RWPI;
}
report_fatal_error("Bad RelocModel.");
extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
const char *TripleStr, const char *CPU, const char *Feature,
- const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc,
+ const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocModel RustReloc,
LLVMRustCodeGenOptLevel RustOptLevel, bool UseSoftFloat,
bool PositionIndependentExecutable, bool FunctionSections,
bool DataSections,
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Coverflow-checks=on
-// build-pass (FIXME(62277): could be check-pass?)
+// build-pass
#![warn(arithmetic_overflow)]
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/address-of.rs:4:9: 4:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/address-of.rs:4:14: 4:21
- _2 = [const 0i32; 10]; // bb0[2]: scope 0 at $DIR/address-of.rs:4:14: 4:21
+ StorageLive(_1); // scope 0 at $DIR/address-of.rs:4:9: 4:10
+ StorageLive(_2); // scope 0 at $DIR/address-of.rs:4:14: 4:21
+ _2 = [const 0i32; 10]; // scope 0 at $DIR/address-of.rs:4:14: 4:21
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/address-of.rs:4:15: 4:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- _1 = &_2; // bb0[3]: scope 0 at $DIR/address-of.rs:4:13: 4:21
- FakeRead(ForLet, _1); // bb0[4]: scope 0 at $DIR/address-of.rs:4:9: 4:10
- StorageLive(_3); // bb0[5]: scope 1 at $DIR/address-of.rs:5:9: 5:14
- StorageLive(_4); // bb0[6]: scope 1 at $DIR/address-of.rs:5:22: 5:29
- _4 = [const 0i32; 10]; // bb0[7]: scope 1 at $DIR/address-of.rs:5:22: 5:29
+ _1 = &_2; // scope 0 at $DIR/address-of.rs:4:13: 4:21
+ FakeRead(ForLet, _1); // scope 0 at $DIR/address-of.rs:4:9: 4:10
+ StorageLive(_3); // scope 1 at $DIR/address-of.rs:5:9: 5:14
+ StorageLive(_4); // scope 1 at $DIR/address-of.rs:5:22: 5:29
+ _4 = [const 0i32; 10]; // scope 1 at $DIR/address-of.rs:5:22: 5:29
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/address-of.rs:5:23: 5:24
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- _3 = &mut _4; // bb0[8]: scope 1 at $DIR/address-of.rs:5:17: 5:29
- FakeRead(ForLet, _3); // bb0[9]: scope 1 at $DIR/address-of.rs:5:9: 5:14
- StorageLive(_5); // bb0[10]: scope 2 at $DIR/address-of.rs:7:5: 7:18
- StorageLive(_6); // bb0[11]: scope 2 at $DIR/address-of.rs:7:5: 7:18
- _6 = &raw const (*_1); // bb0[12]: scope 2 at $DIR/address-of.rs:7:5: 7:6
- AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); // bb0[13]: scope 2 at $DIR/address-of.rs:7:5: 7:18
- _5 = _6; // bb0[14]: scope 2 at $DIR/address-of.rs:7:5: 7:18
- StorageDead(_6); // bb0[15]: scope 2 at $DIR/address-of.rs:7:18: 7:19
- StorageDead(_5); // bb0[16]: scope 2 at $DIR/address-of.rs:7:18: 7:19
- StorageLive(_7); // bb0[17]: scope 2 at $DIR/address-of.rs:8:5: 8:26
- _7 = &raw const (*_1); // bb0[18]: scope 2 at $DIR/address-of.rs:8:5: 8:6
- StorageDead(_7); // bb0[19]: scope 2 at $DIR/address-of.rs:8:26: 8:27
- StorageLive(_8); // bb0[20]: scope 2 at $DIR/address-of.rs:9:5: 9:25
- StorageLive(_9); // bb0[21]: scope 2 at $DIR/address-of.rs:9:5: 9:25
- StorageLive(_10); // bb0[22]: scope 2 at $DIR/address-of.rs:9:5: 9:6
- _10 = &raw const (*_1); // bb0[23]: scope 2 at $DIR/address-of.rs:9:5: 9:6
- _9 = move _10 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[24]: scope 2 at $DIR/address-of.rs:9:5: 9:6
- StorageDead(_10); // bb0[25]: scope 2 at $DIR/address-of.rs:9:5: 9:6
- AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); // bb0[26]: scope 2 at $DIR/address-of.rs:9:5: 9:25
- _8 = _9; // bb0[27]: scope 2 at $DIR/address-of.rs:9:5: 9:25
- StorageDead(_9); // bb0[28]: scope 2 at $DIR/address-of.rs:9:25: 9:26
- StorageDead(_8); // bb0[29]: scope 2 at $DIR/address-of.rs:9:25: 9:26
- StorageLive(_11); // bb0[30]: scope 2 at $DIR/address-of.rs:10:5: 10:22
- StorageLive(_12); // bb0[31]: scope 2 at $DIR/address-of.rs:10:5: 10:6
- _12 = &raw const (*_1); // bb0[32]: scope 2 at $DIR/address-of.rs:10:5: 10:6
- _11 = move _12 as *const [i32] (Pointer(Unsize)); // bb0[33]: scope 2 at $DIR/address-of.rs:10:5: 10:6
- StorageDead(_12); // bb0[34]: scope 2 at $DIR/address-of.rs:10:5: 10:6
- StorageDead(_11); // bb0[35]: scope 2 at $DIR/address-of.rs:10:22: 10:23
- StorageLive(_13); // bb0[36]: scope 2 at $DIR/address-of.rs:11:5: 11:20
- StorageLive(_14); // bb0[37]: scope 2 at $DIR/address-of.rs:11:5: 11:6
- _14 = &raw const (*_1); // bb0[38]: scope 2 at $DIR/address-of.rs:11:5: 11:6
- _13 = move _14 as *const i32 (Pointer(ArrayToPointer)); // bb0[39]: scope 2 at $DIR/address-of.rs:11:5: 11:20
- StorageDead(_14); // bb0[40]: scope 2 at $DIR/address-of.rs:11:19: 11:20
- StorageDead(_13); // bb0[41]: scope 2 at $DIR/address-of.rs:11:20: 11:21
- StorageLive(_15); // bb0[42]: scope 2 at $DIR/address-of.rs:13:9: 13:10
- _15 = &raw const (*_1); // bb0[43]: scope 2 at $DIR/address-of.rs:13:23: 13:24
- FakeRead(ForLet, _15); // bb0[44]: scope 2 at $DIR/address-of.rs:13:9: 13:10
- AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // bb0[45]: scope 2 at $DIR/address-of.rs:13:12: 13:20
- StorageLive(_16); // bb0[46]: scope 3 at $DIR/address-of.rs:14:9: 14:10
- _16 = &raw const (*_1); // bb0[47]: scope 3 at $DIR/address-of.rs:14:31: 14:32
- FakeRead(ForLet, _16); // bb0[48]: scope 3 at $DIR/address-of.rs:14:9: 14:10
- AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // bb0[49]: scope 3 at $DIR/address-of.rs:14:12: 14:28
- StorageLive(_17); // bb0[50]: scope 4 at $DIR/address-of.rs:15:9: 15:10
- StorageLive(_18); // bb0[51]: scope 4 at $DIR/address-of.rs:15:30: 15:31
- _18 = &raw const (*_1); // bb0[52]: scope 4 at $DIR/address-of.rs:15:30: 15:31
- _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[53]: scope 4 at $DIR/address-of.rs:15:30: 15:31
- StorageDead(_18); // bb0[54]: scope 4 at $DIR/address-of.rs:15:30: 15:31
- FakeRead(ForLet, _17); // bb0[55]: scope 4 at $DIR/address-of.rs:15:9: 15:10
- AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // bb0[56]: scope 4 at $DIR/address-of.rs:15:12: 15:27
- StorageLive(_19); // bb0[57]: scope 5 at $DIR/address-of.rs:16:9: 16:10
- StorageLive(_20); // bb0[58]: scope 5 at $DIR/address-of.rs:16:27: 16:28
- _20 = &raw const (*_1); // bb0[59]: scope 5 at $DIR/address-of.rs:16:27: 16:28
- _19 = move _20 as *const [i32] (Pointer(Unsize)); // bb0[60]: scope 5 at $DIR/address-of.rs:16:27: 16:28
- StorageDead(_20); // bb0[61]: scope 5 at $DIR/address-of.rs:16:27: 16:28
- FakeRead(ForLet, _19); // bb0[62]: scope 5 at $DIR/address-of.rs:16:9: 16:10
- AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // bb0[63]: scope 5 at $DIR/address-of.rs:16:12: 16:24
- StorageLive(_21); // bb0[64]: scope 6 at $DIR/address-of.rs:18:5: 18:18
- StorageLive(_22); // bb0[65]: scope 6 at $DIR/address-of.rs:18:5: 18:18
- _22 = &raw const (*_3); // bb0[66]: scope 6 at $DIR/address-of.rs:18:5: 18:6
- AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); // bb0[67]: scope 6 at $DIR/address-of.rs:18:5: 18:18
- _21 = _22; // bb0[68]: scope 6 at $DIR/address-of.rs:18:5: 18:18
- StorageDead(_22); // bb0[69]: scope 6 at $DIR/address-of.rs:18:18: 18:19
- StorageDead(_21); // bb0[70]: scope 6 at $DIR/address-of.rs:18:18: 18:19
- StorageLive(_23); // bb0[71]: scope 6 at $DIR/address-of.rs:19:5: 19:26
- _23 = &raw const (*_3); // bb0[72]: scope 6 at $DIR/address-of.rs:19:5: 19:6
- StorageDead(_23); // bb0[73]: scope 6 at $DIR/address-of.rs:19:26: 19:27
- StorageLive(_24); // bb0[74]: scope 6 at $DIR/address-of.rs:20:5: 20:25
- StorageLive(_25); // bb0[75]: scope 6 at $DIR/address-of.rs:20:5: 20:25
- StorageLive(_26); // bb0[76]: scope 6 at $DIR/address-of.rs:20:5: 20:6
- _26 = &raw const (*_3); // bb0[77]: scope 6 at $DIR/address-of.rs:20:5: 20:6
- _25 = move _26 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[78]: scope 6 at $DIR/address-of.rs:20:5: 20:6
- StorageDead(_26); // bb0[79]: scope 6 at $DIR/address-of.rs:20:5: 20:6
- AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); // bb0[80]: scope 6 at $DIR/address-of.rs:20:5: 20:25
- _24 = _25; // bb0[81]: scope 6 at $DIR/address-of.rs:20:5: 20:25
- StorageDead(_25); // bb0[82]: scope 6 at $DIR/address-of.rs:20:25: 20:26
- StorageDead(_24); // bb0[83]: scope 6 at $DIR/address-of.rs:20:25: 20:26
- StorageLive(_27); // bb0[84]: scope 6 at $DIR/address-of.rs:21:5: 21:22
- StorageLive(_28); // bb0[85]: scope 6 at $DIR/address-of.rs:21:5: 21:6
- _28 = &raw const (*_3); // bb0[86]: scope 6 at $DIR/address-of.rs:21:5: 21:6
- _27 = move _28 as *const [i32] (Pointer(Unsize)); // bb0[87]: scope 6 at $DIR/address-of.rs:21:5: 21:6
- StorageDead(_28); // bb0[88]: scope 6 at $DIR/address-of.rs:21:5: 21:6
- StorageDead(_27); // bb0[89]: scope 6 at $DIR/address-of.rs:21:22: 21:23
- StorageLive(_29); // bb0[90]: scope 6 at $DIR/address-of.rs:23:9: 23:10
- _29 = &raw const (*_3); // bb0[91]: scope 6 at $DIR/address-of.rs:23:23: 23:24
- FakeRead(ForLet, _29); // bb0[92]: scope 6 at $DIR/address-of.rs:23:9: 23:10
- AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // bb0[93]: scope 6 at $DIR/address-of.rs:23:12: 23:20
- StorageLive(_30); // bb0[94]: scope 7 at $DIR/address-of.rs:24:9: 24:10
- _30 = &raw const (*_3); // bb0[95]: scope 7 at $DIR/address-of.rs:24:31: 24:32
- FakeRead(ForLet, _30); // bb0[96]: scope 7 at $DIR/address-of.rs:24:9: 24:10
- AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // bb0[97]: scope 7 at $DIR/address-of.rs:24:12: 24:28
- StorageLive(_31); // bb0[98]: scope 8 at $DIR/address-of.rs:25:9: 25:10
- StorageLive(_32); // bb0[99]: scope 8 at $DIR/address-of.rs:25:30: 25:31
- _32 = &raw const (*_3); // bb0[100]: scope 8 at $DIR/address-of.rs:25:30: 25:31
- _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[101]: scope 8 at $DIR/address-of.rs:25:30: 25:31
- StorageDead(_32); // bb0[102]: scope 8 at $DIR/address-of.rs:25:30: 25:31
- FakeRead(ForLet, _31); // bb0[103]: scope 8 at $DIR/address-of.rs:25:9: 25:10
- AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // bb0[104]: scope 8 at $DIR/address-of.rs:25:12: 25:27
- StorageLive(_33); // bb0[105]: scope 9 at $DIR/address-of.rs:26:9: 26:10
- StorageLive(_34); // bb0[106]: scope 9 at $DIR/address-of.rs:26:27: 26:28
- _34 = &raw const (*_3); // bb0[107]: scope 9 at $DIR/address-of.rs:26:27: 26:28
- _33 = move _34 as *const [i32] (Pointer(Unsize)); // bb0[108]: scope 9 at $DIR/address-of.rs:26:27: 26:28
- StorageDead(_34); // bb0[109]: scope 9 at $DIR/address-of.rs:26:27: 26:28
- FakeRead(ForLet, _33); // bb0[110]: scope 9 at $DIR/address-of.rs:26:9: 26:10
- AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // bb0[111]: scope 9 at $DIR/address-of.rs:26:12: 26:24
- StorageLive(_35); // bb0[112]: scope 10 at $DIR/address-of.rs:28:5: 28:16
- StorageLive(_36); // bb0[113]: scope 10 at $DIR/address-of.rs:28:5: 28:16
- _36 = &raw mut (*_3); // bb0[114]: scope 10 at $DIR/address-of.rs:28:5: 28:6
- AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); // bb0[115]: scope 10 at $DIR/address-of.rs:28:5: 28:16
- _35 = _36; // bb0[116]: scope 10 at $DIR/address-of.rs:28:5: 28:16
- StorageDead(_36); // bb0[117]: scope 10 at $DIR/address-of.rs:28:16: 28:17
- StorageDead(_35); // bb0[118]: scope 10 at $DIR/address-of.rs:28:16: 28:17
- StorageLive(_37); // bb0[119]: scope 10 at $DIR/address-of.rs:29:5: 29:24
- _37 = &raw mut (*_3); // bb0[120]: scope 10 at $DIR/address-of.rs:29:5: 29:6
- StorageDead(_37); // bb0[121]: scope 10 at $DIR/address-of.rs:29:24: 29:25
- StorageLive(_38); // bb0[122]: scope 10 at $DIR/address-of.rs:30:5: 30:23
- StorageLive(_39); // bb0[123]: scope 10 at $DIR/address-of.rs:30:5: 30:23
- StorageLive(_40); // bb0[124]: scope 10 at $DIR/address-of.rs:30:5: 30:6
- _40 = &raw mut (*_3); // bb0[125]: scope 10 at $DIR/address-of.rs:30:5: 30:6
- _39 = move _40 as *mut dyn std::marker::Send (Pointer(Unsize)); // bb0[126]: scope 10 at $DIR/address-of.rs:30:5: 30:6
- StorageDead(_40); // bb0[127]: scope 10 at $DIR/address-of.rs:30:5: 30:6
- AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); // bb0[128]: scope 10 at $DIR/address-of.rs:30:5: 30:23
- _38 = _39; // bb0[129]: scope 10 at $DIR/address-of.rs:30:5: 30:23
- StorageDead(_39); // bb0[130]: scope 10 at $DIR/address-of.rs:30:23: 30:24
- StorageDead(_38); // bb0[131]: scope 10 at $DIR/address-of.rs:30:23: 30:24
- StorageLive(_41); // bb0[132]: scope 10 at $DIR/address-of.rs:31:5: 31:20
- StorageLive(_42); // bb0[133]: scope 10 at $DIR/address-of.rs:31:5: 31:6
- _42 = &raw mut (*_3); // bb0[134]: scope 10 at $DIR/address-of.rs:31:5: 31:6
- _41 = move _42 as *mut [i32] (Pointer(Unsize)); // bb0[135]: scope 10 at $DIR/address-of.rs:31:5: 31:6
- StorageDead(_42); // bb0[136]: scope 10 at $DIR/address-of.rs:31:5: 31:6
- StorageDead(_41); // bb0[137]: scope 10 at $DIR/address-of.rs:31:20: 31:21
- StorageLive(_43); // bb0[138]: scope 10 at $DIR/address-of.rs:33:9: 33:10
- _43 = &raw mut (*_3); // bb0[139]: scope 10 at $DIR/address-of.rs:33:21: 33:22
- FakeRead(ForLet, _43); // bb0[140]: scope 10 at $DIR/address-of.rs:33:9: 33:10
- AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // bb0[141]: scope 10 at $DIR/address-of.rs:33:12: 33:18
- StorageLive(_44); // bb0[142]: scope 11 at $DIR/address-of.rs:34:9: 34:10
- _44 = &raw mut (*_3); // bb0[143]: scope 11 at $DIR/address-of.rs:34:29: 34:30
- FakeRead(ForLet, _44); // bb0[144]: scope 11 at $DIR/address-of.rs:34:9: 34:10
- AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // bb0[145]: scope 11 at $DIR/address-of.rs:34:12: 34:26
- StorageLive(_45); // bb0[146]: scope 12 at $DIR/address-of.rs:35:9: 35:10
- StorageLive(_46); // bb0[147]: scope 12 at $DIR/address-of.rs:35:28: 35:29
- _46 = &raw mut (*_3); // bb0[148]: scope 12 at $DIR/address-of.rs:35:28: 35:29
- _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // bb0[149]: scope 12 at $DIR/address-of.rs:35:28: 35:29
- StorageDead(_46); // bb0[150]: scope 12 at $DIR/address-of.rs:35:28: 35:29
- FakeRead(ForLet, _45); // bb0[151]: scope 12 at $DIR/address-of.rs:35:9: 35:10
- AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // bb0[152]: scope 12 at $DIR/address-of.rs:35:12: 35:25
- StorageLive(_47); // bb0[153]: scope 13 at $DIR/address-of.rs:36:9: 36:10
- StorageLive(_48); // bb0[154]: scope 13 at $DIR/address-of.rs:36:25: 36:26
- _48 = &raw mut (*_3); // bb0[155]: scope 13 at $DIR/address-of.rs:36:25: 36:26
- _47 = move _48 as *mut [i32] (Pointer(Unsize)); // bb0[156]: scope 13 at $DIR/address-of.rs:36:25: 36:26
- StorageDead(_48); // bb0[157]: scope 13 at $DIR/address-of.rs:36:25: 36:26
- FakeRead(ForLet, _47); // bb0[158]: scope 13 at $DIR/address-of.rs:36:9: 36:10
- AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // bb0[159]: scope 13 at $DIR/address-of.rs:36:12: 36:22
- _0 = const (); // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2
+ _3 = &mut _4; // scope 1 at $DIR/address-of.rs:5:17: 5:29
+ FakeRead(ForLet, _3); // scope 1 at $DIR/address-of.rs:5:9: 5:14
+ StorageLive(_5); // scope 2 at $DIR/address-of.rs:7:5: 7:18
+ StorageLive(_6); // scope 2 at $DIR/address-of.rs:7:5: 7:18
+ _6 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:7:5: 7:6
+ AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); // scope 2 at $DIR/address-of.rs:7:5: 7:18
+ _5 = _6; // scope 2 at $DIR/address-of.rs:7:5: 7:18
+ StorageDead(_6); // scope 2 at $DIR/address-of.rs:7:18: 7:19
+ StorageDead(_5); // scope 2 at $DIR/address-of.rs:7:18: 7:19
+ StorageLive(_7); // scope 2 at $DIR/address-of.rs:8:5: 8:26
+ _7 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:8:5: 8:6
+ StorageDead(_7); // scope 2 at $DIR/address-of.rs:8:26: 8:27
+ StorageLive(_8); // scope 2 at $DIR/address-of.rs:9:5: 9:25
+ StorageLive(_9); // scope 2 at $DIR/address-of.rs:9:5: 9:25
+ StorageLive(_10); // scope 2 at $DIR/address-of.rs:9:5: 9:6
+ _10 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:9:5: 9:6
+ _9 = move _10 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 2 at $DIR/address-of.rs:9:5: 9:6
+ StorageDead(_10); // scope 2 at $DIR/address-of.rs:9:5: 9:6
+ AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/address-of.rs:9:5: 9:25
+ _8 = _9; // scope 2 at $DIR/address-of.rs:9:5: 9:25
+ StorageDead(_9); // scope 2 at $DIR/address-of.rs:9:25: 9:26
+ StorageDead(_8); // scope 2 at $DIR/address-of.rs:9:25: 9:26
+ StorageLive(_11); // scope 2 at $DIR/address-of.rs:10:5: 10:22
+ StorageLive(_12); // scope 2 at $DIR/address-of.rs:10:5: 10:6
+ _12 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:10:5: 10:6
+ _11 = move _12 as *const [i32] (Pointer(Unsize)); // scope 2 at $DIR/address-of.rs:10:5: 10:6
+ StorageDead(_12); // scope 2 at $DIR/address-of.rs:10:5: 10:6
+ StorageDead(_11); // scope 2 at $DIR/address-of.rs:10:22: 10:23
+ StorageLive(_13); // scope 2 at $DIR/address-of.rs:11:5: 11:20
+ StorageLive(_14); // scope 2 at $DIR/address-of.rs:11:5: 11:6
+ _14 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:11:5: 11:6
+ _13 = move _14 as *const i32 (Pointer(ArrayToPointer)); // scope 2 at $DIR/address-of.rs:11:5: 11:20
+ StorageDead(_14); // scope 2 at $DIR/address-of.rs:11:19: 11:20
+ StorageDead(_13); // scope 2 at $DIR/address-of.rs:11:20: 11:21
+ StorageLive(_15); // scope 2 at $DIR/address-of.rs:13:9: 13:10
+ _15 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:13:23: 13:24
+ FakeRead(ForLet, _15); // scope 2 at $DIR/address-of.rs:13:9: 13:10
+ AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 2 at $DIR/address-of.rs:13:12: 13:20
+ StorageLive(_16); // scope 3 at $DIR/address-of.rs:14:9: 14:10
+ _16 = &raw const (*_1); // scope 3 at $DIR/address-of.rs:14:31: 14:32
+ FakeRead(ForLet, _16); // scope 3 at $DIR/address-of.rs:14:9: 14:10
+ AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // scope 3 at $DIR/address-of.rs:14:12: 14:28
+ StorageLive(_17); // scope 4 at $DIR/address-of.rs:15:9: 15:10
+ StorageLive(_18); // scope 4 at $DIR/address-of.rs:15:30: 15:31
+ _18 = &raw const (*_1); // scope 4 at $DIR/address-of.rs:15:30: 15:31
+ _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 4 at $DIR/address-of.rs:15:30: 15:31
+ StorageDead(_18); // scope 4 at $DIR/address-of.rs:15:30: 15:31
+ FakeRead(ForLet, _17); // scope 4 at $DIR/address-of.rs:15:9: 15:10
+ AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // scope 4 at $DIR/address-of.rs:15:12: 15:27
+ StorageLive(_19); // scope 5 at $DIR/address-of.rs:16:9: 16:10
+ StorageLive(_20); // scope 5 at $DIR/address-of.rs:16:27: 16:28
+ _20 = &raw const (*_1); // scope 5 at $DIR/address-of.rs:16:27: 16:28
+ _19 = move _20 as *const [i32] (Pointer(Unsize)); // scope 5 at $DIR/address-of.rs:16:27: 16:28
+ StorageDead(_20); // scope 5 at $DIR/address-of.rs:16:27: 16:28
+ FakeRead(ForLet, _19); // scope 5 at $DIR/address-of.rs:16:9: 16:10
+ AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // scope 5 at $DIR/address-of.rs:16:12: 16:24
+ StorageLive(_21); // scope 6 at $DIR/address-of.rs:18:5: 18:18
+ StorageLive(_22); // scope 6 at $DIR/address-of.rs:18:5: 18:18
+ _22 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:18:5: 18:6
+ AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); // scope 6 at $DIR/address-of.rs:18:5: 18:18
+ _21 = _22; // scope 6 at $DIR/address-of.rs:18:5: 18:18
+ StorageDead(_22); // scope 6 at $DIR/address-of.rs:18:18: 18:19
+ StorageDead(_21); // scope 6 at $DIR/address-of.rs:18:18: 18:19
+ StorageLive(_23); // scope 6 at $DIR/address-of.rs:19:5: 19:26
+ _23 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:19:5: 19:6
+ StorageDead(_23); // scope 6 at $DIR/address-of.rs:19:26: 19:27
+ StorageLive(_24); // scope 6 at $DIR/address-of.rs:20:5: 20:25
+ StorageLive(_25); // scope 6 at $DIR/address-of.rs:20:5: 20:25
+ StorageLive(_26); // scope 6 at $DIR/address-of.rs:20:5: 20:6
+ _26 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:20:5: 20:6
+ _25 = move _26 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 6 at $DIR/address-of.rs:20:5: 20:6
+ StorageDead(_26); // scope 6 at $DIR/address-of.rs:20:5: 20:6
+ AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); // scope 6 at $DIR/address-of.rs:20:5: 20:25
+ _24 = _25; // scope 6 at $DIR/address-of.rs:20:5: 20:25
+ StorageDead(_25); // scope 6 at $DIR/address-of.rs:20:25: 20:26
+ StorageDead(_24); // scope 6 at $DIR/address-of.rs:20:25: 20:26
+ StorageLive(_27); // scope 6 at $DIR/address-of.rs:21:5: 21:22
+ StorageLive(_28); // scope 6 at $DIR/address-of.rs:21:5: 21:6
+ _28 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:21:5: 21:6
+ _27 = move _28 as *const [i32] (Pointer(Unsize)); // scope 6 at $DIR/address-of.rs:21:5: 21:6
+ StorageDead(_28); // scope 6 at $DIR/address-of.rs:21:5: 21:6
+ StorageDead(_27); // scope 6 at $DIR/address-of.rs:21:22: 21:23
+ StorageLive(_29); // scope 6 at $DIR/address-of.rs:23:9: 23:10
+ _29 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:23:23: 23:24
+ FakeRead(ForLet, _29); // scope 6 at $DIR/address-of.rs:23:9: 23:10
+ AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // scope 6 at $DIR/address-of.rs:23:12: 23:20
+ StorageLive(_30); // scope 7 at $DIR/address-of.rs:24:9: 24:10
+ _30 = &raw const (*_3); // scope 7 at $DIR/address-of.rs:24:31: 24:32
+ FakeRead(ForLet, _30); // scope 7 at $DIR/address-of.rs:24:9: 24:10
+ AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // scope 7 at $DIR/address-of.rs:24:12: 24:28
+ StorageLive(_31); // scope 8 at $DIR/address-of.rs:25:9: 25:10
+ StorageLive(_32); // scope 8 at $DIR/address-of.rs:25:30: 25:31
+ _32 = &raw const (*_3); // scope 8 at $DIR/address-of.rs:25:30: 25:31
+ _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 8 at $DIR/address-of.rs:25:30: 25:31
+ StorageDead(_32); // scope 8 at $DIR/address-of.rs:25:30: 25:31
+ FakeRead(ForLet, _31); // scope 8 at $DIR/address-of.rs:25:9: 25:10
+ AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // scope 8 at $DIR/address-of.rs:25:12: 25:27
+ StorageLive(_33); // scope 9 at $DIR/address-of.rs:26:9: 26:10
+ StorageLive(_34); // scope 9 at $DIR/address-of.rs:26:27: 26:28
+ _34 = &raw const (*_3); // scope 9 at $DIR/address-of.rs:26:27: 26:28
+ _33 = move _34 as *const [i32] (Pointer(Unsize)); // scope 9 at $DIR/address-of.rs:26:27: 26:28
+ StorageDead(_34); // scope 9 at $DIR/address-of.rs:26:27: 26:28
+ FakeRead(ForLet, _33); // scope 9 at $DIR/address-of.rs:26:9: 26:10
+ AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // scope 9 at $DIR/address-of.rs:26:12: 26:24
+ StorageLive(_35); // scope 10 at $DIR/address-of.rs:28:5: 28:16
+ StorageLive(_36); // scope 10 at $DIR/address-of.rs:28:5: 28:16
+ _36 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:28:5: 28:6
+ AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); // scope 10 at $DIR/address-of.rs:28:5: 28:16
+ _35 = _36; // scope 10 at $DIR/address-of.rs:28:5: 28:16
+ StorageDead(_36); // scope 10 at $DIR/address-of.rs:28:16: 28:17
+ StorageDead(_35); // scope 10 at $DIR/address-of.rs:28:16: 28:17
+ StorageLive(_37); // scope 10 at $DIR/address-of.rs:29:5: 29:24
+ _37 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:29:5: 29:6
+ StorageDead(_37); // scope 10 at $DIR/address-of.rs:29:24: 29:25
+ StorageLive(_38); // scope 10 at $DIR/address-of.rs:30:5: 30:23
+ StorageLive(_39); // scope 10 at $DIR/address-of.rs:30:5: 30:23
+ StorageLive(_40); // scope 10 at $DIR/address-of.rs:30:5: 30:6
+ _40 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:30:5: 30:6
+ _39 = move _40 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 10 at $DIR/address-of.rs:30:5: 30:6
+ StorageDead(_40); // scope 10 at $DIR/address-of.rs:30:5: 30:6
+ AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); // scope 10 at $DIR/address-of.rs:30:5: 30:23
+ _38 = _39; // scope 10 at $DIR/address-of.rs:30:5: 30:23
+ StorageDead(_39); // scope 10 at $DIR/address-of.rs:30:23: 30:24
+ StorageDead(_38); // scope 10 at $DIR/address-of.rs:30:23: 30:24
+ StorageLive(_41); // scope 10 at $DIR/address-of.rs:31:5: 31:20
+ StorageLive(_42); // scope 10 at $DIR/address-of.rs:31:5: 31:6
+ _42 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:31:5: 31:6
+ _41 = move _42 as *mut [i32] (Pointer(Unsize)); // scope 10 at $DIR/address-of.rs:31:5: 31:6
+ StorageDead(_42); // scope 10 at $DIR/address-of.rs:31:5: 31:6
+ StorageDead(_41); // scope 10 at $DIR/address-of.rs:31:20: 31:21
+ StorageLive(_43); // scope 10 at $DIR/address-of.rs:33:9: 33:10
+ _43 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:33:21: 33:22
+ FakeRead(ForLet, _43); // scope 10 at $DIR/address-of.rs:33:9: 33:10
+ AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // scope 10 at $DIR/address-of.rs:33:12: 33:18
+ StorageLive(_44); // scope 11 at $DIR/address-of.rs:34:9: 34:10
+ _44 = &raw mut (*_3); // scope 11 at $DIR/address-of.rs:34:29: 34:30
+ FakeRead(ForLet, _44); // scope 11 at $DIR/address-of.rs:34:9: 34:10
+ AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // scope 11 at $DIR/address-of.rs:34:12: 34:26
+ StorageLive(_45); // scope 12 at $DIR/address-of.rs:35:9: 35:10
+ StorageLive(_46); // scope 12 at $DIR/address-of.rs:35:28: 35:29
+ _46 = &raw mut (*_3); // scope 12 at $DIR/address-of.rs:35:28: 35:29
+ _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 12 at $DIR/address-of.rs:35:28: 35:29
+ StorageDead(_46); // scope 12 at $DIR/address-of.rs:35:28: 35:29
+ FakeRead(ForLet, _45); // scope 12 at $DIR/address-of.rs:35:9: 35:10
+ AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // scope 12 at $DIR/address-of.rs:35:12: 35:25
+ StorageLive(_47); // scope 13 at $DIR/address-of.rs:36:9: 36:10
+ StorageLive(_48); // scope 13 at $DIR/address-of.rs:36:25: 36:26
+ _48 = &raw mut (*_3); // scope 13 at $DIR/address-of.rs:36:25: 36:26
+ _47 = move _48 as *mut [i32] (Pointer(Unsize)); // scope 13 at $DIR/address-of.rs:36:25: 36:26
+ StorageDead(_48); // scope 13 at $DIR/address-of.rs:36:25: 36:26
+ FakeRead(ForLet, _47); // scope 13 at $DIR/address-of.rs:36:9: 36:10
+ AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // scope 13 at $DIR/address-of.rs:36:12: 36:22
+ _0 = const (); // scope 0 at $DIR/address-of.rs:3:26: 37:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/address-of.rs:3:26: 37:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_47); // bb0[161]: scope 13 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_45); // bb0[162]: scope 12 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_44); // bb0[163]: scope 11 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_43); // bb0[164]: scope 10 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_33); // bb0[165]: scope 9 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_31); // bb0[166]: scope 8 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_30); // bb0[167]: scope 7 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_29); // bb0[168]: scope 6 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_19); // bb0[169]: scope 5 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_17); // bb0[170]: scope 4 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_16); // bb0[171]: scope 3 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_15); // bb0[172]: scope 2 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_4); // bb0[173]: scope 1 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_3); // bb0[174]: scope 1 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_2); // bb0[175]: scope 0 at $DIR/address-of.rs:37:1: 37:2
- StorageDead(_1); // bb0[176]: scope 0 at $DIR/address-of.rs:37:1: 37:2
- return; // bb0[177]: scope 0 at $DIR/address-of.rs:37:2: 37:2
+ StorageDead(_47); // scope 13 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_45); // scope 12 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_44); // scope 11 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_43); // scope 10 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_33); // scope 9 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_31); // scope 8 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_30); // scope 7 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_29); // scope 6 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_19); // scope 5 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_17); // scope 4 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_16); // scope 3 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_15); // scope 2 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_4); // scope 1 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_3); // scope 1 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_2); // scope 0 at $DIR/address-of.rs:37:1: 37:2
+ StorageDead(_1); // scope 0 at $DIR/address-of.rs:37:1: 37:2
+ return; // scope 0 at $DIR/address-of.rs:37:2: 37:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/address-of.rs:42:9: 42:10
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/address-of.rs:42:13: 42:15
- _3 = &_1; // bb0[2]: scope 0 at $DIR/address-of.rs:42:13: 42:15
- _2 = &raw const (*_3); // bb0[3]: scope 0 at $DIR/address-of.rs:42:13: 42:15
- FakeRead(ForLet, _2); // bb0[4]: scope 0 at $DIR/address-of.rs:42:9: 42:10
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/address-of.rs:42:29: 42:30
- StorageLive(_4); // bb0[6]: scope 1 at $DIR/address-of.rs:43:9: 43:10
- StorageLive(_5); // bb0[7]: scope 1 at $DIR/address-of.rs:43:13: 43:19
- _5 = &mut _1; // bb0[8]: scope 1 at $DIR/address-of.rs:43:13: 43:19
- _4 = &raw const (*_5); // bb0[9]: scope 1 at $DIR/address-of.rs:43:13: 43:19
- FakeRead(ForLet, _4); // bb0[10]: scope 1 at $DIR/address-of.rs:43:9: 43:10
- StorageDead(_5); // bb0[11]: scope 1 at $DIR/address-of.rs:43:33: 43:34
- StorageLive(_6); // bb0[12]: scope 2 at $DIR/address-of.rs:44:9: 44:10
- StorageLive(_7); // bb0[13]: scope 2 at $DIR/address-of.rs:44:13: 44:19
- _7 = &mut _1; // bb0[14]: scope 2 at $DIR/address-of.rs:44:13: 44:19
- _6 = &raw mut (*_7); // bb0[15]: scope 2 at $DIR/address-of.rs:44:13: 44:19
- FakeRead(ForLet, _6); // bb0[16]: scope 2 at $DIR/address-of.rs:44:9: 44:10
- StorageDead(_7); // bb0[17]: scope 2 at $DIR/address-of.rs:44:31: 44:32
- _0 = const (); // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2
+ StorageLive(_2); // scope 0 at $DIR/address-of.rs:42:9: 42:10
+ StorageLive(_3); // scope 0 at $DIR/address-of.rs:42:13: 42:15
+ _3 = &_1; // scope 0 at $DIR/address-of.rs:42:13: 42:15
+ _2 = &raw const (*_3); // scope 0 at $DIR/address-of.rs:42:13: 42:15
+ FakeRead(ForLet, _2); // scope 0 at $DIR/address-of.rs:42:9: 42:10
+ StorageDead(_3); // scope 0 at $DIR/address-of.rs:42:29: 42:30
+ StorageLive(_4); // scope 1 at $DIR/address-of.rs:43:9: 43:10
+ StorageLive(_5); // scope 1 at $DIR/address-of.rs:43:13: 43:19
+ _5 = &mut _1; // scope 1 at $DIR/address-of.rs:43:13: 43:19
+ _4 = &raw const (*_5); // scope 1 at $DIR/address-of.rs:43:13: 43:19
+ FakeRead(ForLet, _4); // scope 1 at $DIR/address-of.rs:43:9: 43:10
+ StorageDead(_5); // scope 1 at $DIR/address-of.rs:43:33: 43:34
+ StorageLive(_6); // scope 2 at $DIR/address-of.rs:44:9: 44:10
+ StorageLive(_7); // scope 2 at $DIR/address-of.rs:44:13: 44:19
+ _7 = &mut _1; // scope 2 at $DIR/address-of.rs:44:13: 44:19
+ _6 = &raw mut (*_7); // scope 2 at $DIR/address-of.rs:44:13: 44:19
+ FakeRead(ForLet, _6); // scope 2 at $DIR/address-of.rs:44:9: 44:10
+ StorageDead(_7); // scope 2 at $DIR/address-of.rs:44:31: 44:32
+ _0 = const (); // scope 0 at $DIR/address-of.rs:41:32: 45:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/address-of.rs:41:32: 45:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_6); // bb0[19]: scope 2 at $DIR/address-of.rs:45:1: 45:2
- StorageDead(_4); // bb0[20]: scope 1 at $DIR/address-of.rs:45:1: 45:2
- StorageDead(_2); // bb0[21]: scope 0 at $DIR/address-of.rs:45:1: 45:2
- return; // bb0[22]: scope 0 at $DIR/address-of.rs:45:2: 45:2
+ StorageDead(_6); // scope 2 at $DIR/address-of.rs:45:1: 45:2
+ StorageDead(_4); // scope 1 at $DIR/address-of.rs:45:1: 45:2
+ StorageDead(_2); // scope 0 at $DIR/address-of.rs:45:1: 45:2
+ return; // scope 0 at $DIR/address-of.rs:45:2: 45:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
- _1 = [const 42u32, const 43u32, const 44u32]; // bb0[1]: scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
+ StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
+ _1 = [const 42u32, const 43u32, const 44u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
- _2 = const 1usize; // bb0[3]: scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
+ StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
+ _2 = const 1usize; // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- StorageLive(_3); // bb0[4]: scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
- StorageLive(_4); // bb0[5]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- _4 = &mut _2; // bb0[6]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- _3 = &raw mut (*_4); // bb0[7]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- StorageDead(_4); // bb0[8]: scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
- StorageLive(_5); // bb0[9]: scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
- StorageLive(_6); // bb0[10]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
- _6 = _3; // bb0[11]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
- _5 = const foo(move _6) -> bb1; // bb0[12]: scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
+ StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+ StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ _4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ _3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
+ StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
+ StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+ _6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+ _5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
// ty::Const
// + ty: unsafe fn(*mut usize) -> u32 {foo}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_6); // bb1[0]: scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
- StorageLive(_7); // bb1[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
- _7 = _2; // bb1[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
- _8 = Len(_1); // bb1[3]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
- _9 = Lt(_7, _8); // bb1[4]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
- assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[5]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
+ StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+ _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+ _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
}
bb2: {
- _1[_7] = move _5; // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
- StorageDead(_5); // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
- StorageDead(_7); // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
- _0 = const (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
+ _1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
+ StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
+ StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
+ _0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_3); // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- StorageDead(_2); // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- StorageDead(_1); // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- return; // bb2[7]: scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
+ StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ return; // scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
- _1 = [const 42u32, const 43u32, const 44u32]; // bb0[1]: scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
+ StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
+ _1 = [const 42u32, const 43u32, const 44u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
- _2 = const 1usize; // bb0[3]: scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
+ StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
+ _2 = const 1usize; // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- StorageLive(_3); // bb0[4]: scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
- StorageLive(_4); // bb0[5]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- _4 = &mut _2; // bb0[6]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- _3 = &raw mut (*_4); // bb0[7]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
- StorageDead(_4); // bb0[8]: scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
- StorageLive(_5); // bb0[9]: scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
- StorageLive(_6); // bb0[10]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
- _6 = _3; // bb0[11]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
- _5 = const foo(move _6) -> bb1; // bb0[12]: scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
+ StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+ StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ _4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ _3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+ StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
+ StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
+ StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+ _6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+ _5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
// ty::Const
// + ty: unsafe fn(*mut usize) -> u32 {foo}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_6); // bb1[0]: scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
- StorageLive(_7); // bb1[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
- _7 = _2; // bb1[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
- _8 = Len(_1); // bb1[3]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
- _9 = Lt(_7, _8); // bb1[4]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
- assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[5]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
+ StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+ _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+ _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+ assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
}
bb2: {
- _1[_7] = move _5; // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
- StorageDead(_5); // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
- StorageDead(_7); // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
- _0 = const (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
+ _1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
+ StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
+ StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
+ _0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_3); // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- StorageDead(_2); // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- StorageDead(_1); // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
- return; // bb2[7]: scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
+ StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+ return; // scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
- _1 = const false; // bb0[1]: scope 0 at $DIR/basic_assignment.rs:11:20: 11:25
+ StorageLive(_1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
+ _1 = const false; // scope 0 at $DIR/basic_assignment.rs:11:20: 11:25
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/basic_assignment.rs:11:20: 11:25
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/basic_assignment.rs:12:9: 12:17
- StorageLive(_3); // bb0[4]: scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
- _3 = _1; // bb0[5]: scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
- _2 = move _3; // bb0[6]: scope 2 at $DIR/basic_assignment.rs:16:5: 16:24
- StorageDead(_3); // bb0[7]: scope 2 at $DIR/basic_assignment.rs:16:23: 16:24
- StorageLive(_4); // bb0[8]: scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
- _4 = std::option::Option::<std::boxed::Box<u32>>::None; // bb0[9]: scope 2 at $DIR/basic_assignment.rs:18:36: 18:40
- FakeRead(ForLet, _4); // bb0[10]: scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
- AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // bb0[11]: scope 2 at $DIR/basic_assignment.rs:18:17: 18:33
- StorageLive(_5); // bb0[12]: scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
- StorageLive(_6); // bb0[13]: scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
- _6 = move _4; // bb0[14]: scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
- replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // bb0[15]: scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
+ FakeRead(ForLet, _1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
+ StorageLive(_2); // scope 1 at $DIR/basic_assignment.rs:12:9: 12:17
+ StorageLive(_3); // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
+ _3 = _1; // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
+ _2 = move _3; // scope 2 at $DIR/basic_assignment.rs:16:5: 16:24
+ StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:16:23: 16:24
+ StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
+ _4 = std::option::Option::<std::boxed::Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:18:36: 18:40
+ FakeRead(ForLet, _4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
+ AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:18:17: 18:33
+ StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
+ StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
+ _6 = move _4; // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
+ replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
+ resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
}
bb2: {
- drop(_6) -> [return: bb6, unwind: bb4]; // bb2[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+ drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}
bb3 (cleanup): {
- drop(_4) -> bb1; // bb3[0]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+ drop(_4) -> bb1; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
}
bb4 (cleanup): {
- drop(_5) -> bb3; // bb4[0]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+ drop(_5) -> bb3; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}
bb5 (cleanup): {
- drop(_6) -> bb4; // bb5[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+ drop(_6) -> bb4; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}
bb6: {
- StorageDead(_6); // bb6[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
- _0 = const (); // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
+ StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+ _0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/basic_assignment.rs:10:11: 24:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_5) -> [return: bb7, unwind: bb3]; // bb6[2]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+ drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}
bb7: {
- StorageDead(_5); // bb7[0]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
- drop(_4) -> [return: bb8, unwind: bb1]; // bb7[1]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+ StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+ drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
}
bb8: {
- StorageDead(_4); // bb8[0]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
- StorageDead(_2); // bb8[1]: scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
- StorageDead(_1); // bb8[2]: scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
- return; // bb8[3]: scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
+ StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+ StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
+ StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
+ return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/box_expr.rs:7:9: 7:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
- _2 = Box(S); // bb0[2]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
- (*_2) = const S::new() -> [return: bb2, unwind: bb3]; // bb0[3]: scope 0 at $DIR/box_expr.rs:7:17: 7:25
+ StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
+ StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+ _2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+ (*_2) = const S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// ty::Const
// + ty: fn() -> S {S::new}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/box_expr.rs:6:1: 9:2
+ resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
bb2: {
- _1 = move _2; // bb2[0]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
- drop(_2) -> bb4; // bb2[1]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
+ _1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+ drop(_2) -> bb4; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb3 (cleanup): {
- drop(_2) -> bb1; // bb3[0]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
+ drop(_2) -> bb1; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb4: {
- StorageDead(_2); // bb4[0]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
- StorageLive(_3); // bb4[1]: scope 1 at $DIR/box_expr.rs:8:5: 8:12
- StorageLive(_4); // bb4[2]: scope 1 at $DIR/box_expr.rs:8:10: 8:11
- _4 = move _1; // bb4[3]: scope 1 at $DIR/box_expr.rs:8:10: 8:11
- _3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // bb4[4]: scope 1 at $DIR/box_expr.rs:8:5: 8:12
+ StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
+ StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
+ StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
+ _4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
+ _3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// ty::Const
// + ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}
// + val: Value(Scalar(<ZST>))
}
bb5: {
- StorageDead(_4); // bb5[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12
- StorageDead(_3); // bb5[1]: scope 1 at $DIR/box_expr.rs:8:12: 8:13
- _0 = const (); // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2
+ StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
+ StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
+ _0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/box_expr.rs:6:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_1) -> bb8; // bb5[3]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
+ drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb6 (cleanup): {
- drop(_1) -> bb1; // bb6[0]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
+ drop(_1) -> bb1; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb7 (cleanup): {
- drop(_4) -> bb6; // bb7[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12
+ drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb8: {
- StorageDead(_1); // bb8[0]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
- return; // bb8[1]: scope 0 at $DIR/box_expr.rs:9:2: 9:2
+ StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
+ return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/byte_slice.rs:5:9: 5:10
- _1 = const b"foo"; // bb0[1]: scope 0 at $DIR/byte_slice.rs:5:13: 5:19
+ StorageLive(_1); // scope 0 at $DIR/byte_slice.rs:5:9: 5:10
+ _1 = const b"foo"; // scope 0 at $DIR/byte_slice.rs:5:13: 5:19
// ty::Const
// + ty: &[u8; 3]
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/byte_slice.rs:5:13: 5:19
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0+0x0)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/byte_slice.rs:6:9: 6:10
- _2 = [const 5u8, const 120u8]; // bb0[3]: scope 1 at $DIR/byte_slice.rs:6:13: 6:24
+ StorageLive(_2); // scope 1 at $DIR/byte_slice.rs:6:9: 6:10
+ _2 = [const 5u8, const 120u8]; // scope 1 at $DIR/byte_slice.rs:6:13: 6:24
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x05))
// mir::Constant
// + span: $DIR/byte_slice.rs:6:19: 6:23
// + literal: Const { ty: u8, val: Value(Scalar(0x78)) }
- _0 = const (); // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2
+ _0 = const (); // scope 0 at $DIR/byte_slice.rs:4:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/byte_slice.rs:4:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb0[5]: scope 1 at $DIR/byte_slice.rs:7:1: 7:2
- StorageDead(_1); // bb0[6]: scope 0 at $DIR/byte_slice.rs:7:1: 7:2
- return; // bb0[7]: scope 0 at $DIR/byte_slice.rs:7:2: 7:2
+ StorageDead(_2); // scope 1 at $DIR/byte_slice.rs:7:1: 7:2
+ StorageDead(_1); // scope 0 at $DIR/byte_slice.rs:7:1: 7:2
+ return; // scope 0 at $DIR/byte_slice.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
- _3 = const 0usize; // bb0[2]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+ StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
+ StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+ _3 = const 0usize; // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/combine_array_len.rs:5:15: 5:16
// + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-- _4 = Len(_1); // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+ _4 = const 2usize; // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
++ _4 = const 2usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/combine_array_len.rs:5:13: 5:17
+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
- _5 = Lt(_3, _4); // bb0[4]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[5]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
}
bb1: {
- _2 = _1[_3]; // bb1[0]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
- StorageDead(_3); // bb1[1]: scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
- StorageLive(_6); // bb1[2]: scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
- StorageLive(_7); // bb1[3]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
- _7 = const 1usize; // bb1[4]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+ _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
+ StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
+ StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+ _7 = const 1usize; // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/combine_array_len.rs:6:15: 6:16
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-- _8 = Len(_1); // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+ _8 = const 2usize; // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
++ _8 = const 2usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/combine_array_len.rs:6:13: 6:17
+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
- _9 = Lt(_7, _8); // bb1[6]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
- assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[7]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
}
bb2: {
- _6 = _1[_7]; // bb2[0]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
- StorageDead(_7); // bb2[1]: scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
- StorageLive(_10); // bb2[2]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
- StorageLive(_11); // bb2[3]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
- _11 = _2; // bb2[4]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
- StorageLive(_12); // bb2[5]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- _12 = _2; // bb2[6]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- _10 = Mul(move _11, move _12); // bb2[7]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
- StorageDead(_12); // bb2[8]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- StorageDead(_11); // bb2[9]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- StorageLive(_13); // bb2[10]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
- StorageLive(_14); // bb2[11]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
- _14 = _6; // bb2[12]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
- StorageLive(_15); // bb2[13]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _15 = _6; // bb2[14]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _13 = Mul(move _14, move _15); // bb2[15]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
- StorageDead(_15); // bb2[16]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_14); // bb2[17]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _0 = Add(move _10, move _13); // bb2[18]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
- StorageDead(_13); // bb2[19]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_10); // bb2[20]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_6); // bb2[21]: scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
- StorageDead(_2); // bb2[22]: scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
- return; // bb2[23]: scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
+ _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
+ StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+ StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+ _11 = _2; // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+ StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ _12 = _2; // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+ StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+ StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+ _14 = _6; // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+ StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _15 = _6; // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+ StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
+ StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
+ StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
+ return; // scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
- _3 = const 0usize; // bb0[2]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+ StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
+ StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+ _3 = const 0usize; // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000000))
// mir::Constant
// + span: $DIR/combine_array_len.rs:5:15: 5:16
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-- _4 = Len(_1); // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+ _4 = const 2usize; // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
++ _4 = const 2usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x0000000000000002))
+ // mir::Constant
+ // + span: $DIR/combine_array_len.rs:5:13: 5:17
+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
- _5 = Lt(_3, _4); // bb0[4]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[5]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
}
bb1: {
- _2 = _1[_3]; // bb1[0]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
- StorageDead(_3); // bb1[1]: scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
- StorageLive(_6); // bb1[2]: scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
- StorageLive(_7); // bb1[3]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
- _7 = const 1usize; // bb1[4]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+ _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
+ StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
+ StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+ _7 = const 1usize; // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $DIR/combine_array_len.rs:6:15: 6:16
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-- _8 = Len(_1); // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+ _8 = const 2usize; // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
++ _8 = const 2usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x0000000000000002))
+ // mir::Constant
+ // + span: $DIR/combine_array_len.rs:6:13: 6:17
+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
- _9 = Lt(_7, _8); // bb1[6]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
- assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[7]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
}
bb2: {
- _6 = _1[_7]; // bb2[0]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
- StorageDead(_7); // bb2[1]: scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
- StorageLive(_10); // bb2[2]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
- StorageLive(_11); // bb2[3]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
- _11 = _2; // bb2[4]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
- StorageLive(_12); // bb2[5]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- _12 = _2; // bb2[6]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- _10 = Mul(move _11, move _12); // bb2[7]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
- StorageDead(_12); // bb2[8]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- StorageDead(_11); // bb2[9]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
- StorageLive(_13); // bb2[10]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
- StorageLive(_14); // bb2[11]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
- _14 = _6; // bb2[12]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
- StorageLive(_15); // bb2[13]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _15 = _6; // bb2[14]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _13 = Mul(move _14, move _15); // bb2[15]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
- StorageDead(_15); // bb2[16]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_14); // bb2[17]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- _0 = Add(move _10, move _13); // bb2[18]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
- StorageDead(_13); // bb2[19]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_10); // bb2[20]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
- StorageDead(_6); // bb2[21]: scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
- StorageDead(_2); // bb2[22]: scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
- return; // bb2[23]: scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
+ _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
+ StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+ StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+ _11 = _2; // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+ StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ _12 = _2; // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+ StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+ StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+ StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+ _14 = _6; // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+ StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _15 = _6; // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+ StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
+ StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+ StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
+ StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
+ return; // scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
}
}
let mut _3: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
bb0: {
- _3 = const {alloc0+0x0: &i32}; // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ _3 = const {alloc0+0x0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
// ty::Const
// + ty: &i32
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
// + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
- _2 = _3; // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- _1 = [move _2]; // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- _0 = &_1; // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- return; // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ _2 = _3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+ _1 = [move _2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ _0 = &_1; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
}
}
+ let mut _6: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-- StorageLive(_3); // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-- StorageLive(_4); // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
-- StorageLive(_5); // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
-- _5 = const {alloc0+0x0: &i32}; // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
-+ _6 = const BAR::promoted[0]; // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ StorageLive(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ StorageLive(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+- StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+- _5 = const {alloc0+0x0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
++ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
// ty::Const
- // + ty: &i32
- // + val: Value(Scalar(alloc0+0x0))
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
-- _4 = &(*_5); // bb0[6]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
-- _3 = [move _4]; // bb0[7]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-- _2 = &_3; // bb0[8]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-- _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[9]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-- _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[10]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
+- _4 = &(*_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), [], Some(promoted[0])) }
-+ _2 = &(*_6); // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-+ _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-+ _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
++ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+ _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
// ty::Const
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}
bb2: {
-- StorageDead(_5); // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
-- StorageDead(_3); // bb2[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
-- return; // bb2[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
-+ return; // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
+- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}
- }
-
}
bb0: {
- _3 = const {alloc2+0x0: &i32}; // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+ _3 = const {alloc2+0x0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
// ty::Const
// + ty: &i32
// + val: Value(Scalar(alloc2+0x0))
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
// + literal: Const { ty: &i32, val: Value(Scalar(alloc2+0x0)) }
- _2 = _3; // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
- _1 = [move _2]; // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- _0 = &_1; // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- return; // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ _2 = _3; // scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
+ _1 = [move _2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ _0 = &_1; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-- StorageLive(_3); // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-- StorageLive(_4); // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
-- StorageLive(_5); // bb0[4]: scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
-- _5 = const {alloc2+0x0: &i32}; // bb0[5]: scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
-+ _6 = const FOO::promoted[0]; // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ StorageLive(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ StorageLive(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+- StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
+- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+- _5 = const {alloc2+0x0: &i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
++ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
// ty::Const
- // + ty: &i32
- // + val: Value(Scalar(alloc2+0x0))
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc2+0x0)) }
-- _4 = &(*_5); // bb0[6]: scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
-- _3 = [move _4]; // bb0[7]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-- _2 = &_3; // bb0[8]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-- _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[9]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-- _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[10]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
+- _4 = &(*_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
+- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), [], Some(promoted[0])) }
-+ _2 = &(*_6); // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-+ _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-+ _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
++ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+ _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
// ty::Const
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}
bb2: {
-- StorageDead(_5); // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
-- StorageDead(_3); // bb2[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
-- return; // bb2[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
-+ return; // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
+- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}
}
-
let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // bb0[2]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+ _0 = const (); // scope 0 at $DIR/const_allocation.rs:7:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
+ return; // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
}
}
let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // bb0[2]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+ _0 = const (); // scope 0 at $DIR/const_allocation.rs:7:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
+ return; // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
}
}
let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // bb0[2]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+ _0 = const (); // scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation2.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
+ return; // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
}
}
let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // bb0[2]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+ _0 = const (); // scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation2.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
+ return; // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
}
}
let mut _2: &&Packed; // in scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- _2 = const {alloc0+0x0: &&Packed}; // bb0[2]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ _2 = const {alloc0+0x0: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
// ty::Const
// + ty: &&Packed
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+ _0 = const (); // scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation3.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
+ return; // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
}
}
let mut _2: &&Packed; // in scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- _2 = const {alloc0+0x0: &&Packed}; // bb0[2]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ _2 = const {alloc0+0x0: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
// ty::Const
// + ty: &&Packed
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc0+0x0)) }
- _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
- StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
- _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
+ _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+ StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+ StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+ _0 = const (); // scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation3.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
+ return; // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/aggregate.rs:5:9: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/aggregate.rs:5:13: 5:22
- _3 = (const 0i32, const 1i32, const 2i32); // bb0[3]: scope 0 at $DIR/aggregate.rs:5:13: 5:22
+ StorageLive(_1); // scope 0 at $DIR/aggregate.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/aggregate.rs:5:13: 5:24
+ StorageLive(_3); // scope 0 at $DIR/aggregate.rs:5:13: 5:22
+ _3 = (const 0i32, const 1i32, const 2i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:22
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/aggregate.rs:5:20: 5:21
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-- _2 = (_3.1: i32); // bb0[4]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
-- _1 = Add(move _2, const 0i32); // bb0[5]: scope 0 at $DIR/aggregate.rs:5:13: 5:28
-+ _2 = const 1i32; // bb0[4]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
+- _2 = (_3.1: i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:24
+- _1 = Add(move _2, const 0i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:28
++ _2 = const 1i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:24
// ty::Const
// + ty: i32
- // + val: Value(Scalar(0x00000000))
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
+ // + span: $DIR/aggregate.rs:5:13: 5:24
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ _1 = const 1i32; // bb0[5]: scope 0 at $DIR/aggregate.rs:5:13: 5:28
++ _1 = const 1i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:28
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+ // + span: $DIR/aggregate.rs:5:13: 5:28
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- StorageDead(_2); // bb0[6]: scope 0 at $DIR/aggregate.rs:5:27: 5:28
- StorageDead(_3); // bb0[7]: scope 0 at $DIR/aggregate.rs:5:28: 5:29
- _0 = const (); // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2
+ StorageDead(_2); // scope 0 at $DIR/aggregate.rs:5:27: 5:28
+ StorageDead(_3); // scope 0 at $DIR/aggregate.rs:5:28: 5:29
+ _0 = const (); // scope 0 at $DIR/aggregate.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/aggregate.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb0[9]: scope 0 at $DIR/aggregate.rs:6:1: 6:2
- return; // bb0[10]: scope 0 at $DIR/aggregate.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/aggregate.rs:6:1: 6:2
+ return; // scope 0 at $DIR/aggregate.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/array_index.rs:5:9: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/array_index.rs:5:18: 5:30
- _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // bb0[2]: scope 0 at $DIR/array_index.rs:5:18: 5:30
+ StorageLive(_1); // scope 0 at $DIR/array_index.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/array_index.rs:5:18: 5:30
+ _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/array_index.rs:5:28: 5:29
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_3); // bb0[3]: scope 0 at $DIR/array_index.rs:5:31: 5:32
- _3 = const 2usize; // bb0[4]: scope 0 at $DIR/array_index.rs:5:31: 5:32
+ StorageLive(_3); // scope 0 at $DIR/array_index.rs:5:31: 5:32
+ _3 = const 2usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/array_index.rs:5:31: 5:32
// + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
- _4 = const 4usize; // bb0[5]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _4 = const 4usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/array_index.rs:5:18: 5:33
// + literal: Const { ty: usize, val: Value(Scalar(0x00000004)) }
-- _5 = Lt(_3, _4); // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ _5 = const true; // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33
+- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++ _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/array_index.rs:5:18: 5:33
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _1 = _2[_3]; // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ _1 = const 2u32; // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++ _1 = const 2u32; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/array_index.rs:5:18: 5:33
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageDead(_3); // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34
- StorageDead(_2); // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34
- _0 = const (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
+ StorageDead(_3); // scope 0 at $DIR/array_index.rs:5:33: 5:34
+ StorageDead(_2); // scope 0 at $DIR/array_index.rs:5:33: 5:34
+ _0 = const (); // scope 0 at $DIR/array_index.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array_index.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2
- return; // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/array_index.rs:6:1: 6:2
+ return; // scope 0 at $DIR/array_index.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/array_index.rs:5:9: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/array_index.rs:5:18: 5:30
- _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // bb0[2]: scope 0 at $DIR/array_index.rs:5:18: 5:30
+ StorageLive(_1); // scope 0 at $DIR/array_index.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/array_index.rs:5:18: 5:30
+ _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/array_index.rs:5:28: 5:29
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_3); // bb0[3]: scope 0 at $DIR/array_index.rs:5:31: 5:32
- _3 = const 2usize; // bb0[4]: scope 0 at $DIR/array_index.rs:5:31: 5:32
+ StorageLive(_3); // scope 0 at $DIR/array_index.rs:5:31: 5:32
+ _3 = const 2usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000002))
// mir::Constant
// + span: $DIR/array_index.rs:5:31: 5:32
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
- _4 = const 4usize; // bb0[5]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _4 = const 4usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000004))
// mir::Constant
// + span: $DIR/array_index.rs:5:18: 5:33
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000004)) }
-- _5 = Lt(_3, _4); // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ _5 = const true; // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33
+- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++ _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/array_index.rs:5:18: 5:33
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _1 = _2[_3]; // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ _1 = const 2u32; // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++ _1 = const 2u32; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/array_index.rs:5:18: 5:33
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageDead(_3); // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34
- StorageDead(_2); // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34
- _0 = const (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
+ StorageDead(_3); // scope 0 at $DIR/array_index.rs:5:33: 5:34
+ StorageDead(_2); // scope 0 at $DIR/array_index.rs:5:33: 5:34
+ _0 = const (); // scope 0 at $DIR/array_index.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array_index.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2
- return; // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/array_index.rs:6:1: 6:2
+ return; // scope 0 at $DIR/array_index.rs:6:2: 6:2
}
}
--- /dev/null
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+ let y = 0;
+ let _z = 1 / y;
+}
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/bad_op_div_by_zero.rs:3:11: 3:11
+ let _1: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+ let mut _3: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+ let mut _4: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ let mut _5: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ let mut _6: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ let mut _7: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ scope 1 {
+ debug y => _1; // in scope 1 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+ let _2: i32; // in scope 1 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+ scope 2 {
+ debug _z => _2; // in scope 2 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+ _1 = const 0i32; // scope 0 at $DIR/bad_op_div_by_zero.rs:4:13: 4:14
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+ // + span: $DIR/bad_op_div_by_zero.rs:4:13: 4:14
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
+ StorageLive(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+ StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+- _4 = Eq(_3, const 0i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ _3 = const 0i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + span: $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
++ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x01))
++ // mir::Constant
++ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(!move _4, "attempt to divide by zero") -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0xffffffff))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
+- _6 = Eq(const 1i32, const std::i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0x00000001))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
+- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
++ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0x80000000))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+- // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
+- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+- assert(!move _7, "attempt to divide with overflow") -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ assert(!const false, "attempt to divide with overflow") -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ }
+
+ bb2: {
+ _2 = Div(const 1i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+ StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+ _0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:3:11: 6:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/bad_op_div_by_zero.rs:3:11: 6:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:6:1: 6:2
+ StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:6:1: 6:2
+ return; // scope 0 at $DIR/bad_op_div_by_zero.rs:6:2: 6:2
+ }
+ }
+
--- /dev/null
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+ let y = 0;
+ let _z = 1 % y;
+}
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/bad_op_mod_by_zero.rs:3:11: 3:11
+ let _1: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+ let mut _3: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+ let mut _4: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ let mut _5: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ let mut _6: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ let mut _7: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ scope 1 {
+ debug y => _1; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+ let _2: i32; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+ scope 2 {
+ debug _z => _2; // in scope 2 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+ _1 = const 0i32; // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+ // + span: $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
+ StorageLive(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+ StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+- _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+- _4 = Eq(_3, const 0i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ _3 = const 0i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + span: $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
++ _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x01))
++ // mir::Constant
++ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(!move _4, "attempt to calculate the remainder with a divisor of zero") -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0xffffffff))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
+- _6 = Eq(const 1i32, const std::i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0x00000001))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
+- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
++ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ // ty::Const
+- // + ty: i32
+- // + val: Value(Scalar(0x80000000))
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+- // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
+- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+- assert(!move _7, "attempt to calculate the remainder with overflow") -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ assert(!const false, "attempt to calculate the remainder with overflow") -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ }
+
+ bb2: {
+ _2 = Rem(const 1i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+ StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+ _0 = const (); // scope 0 at $DIR/bad_op_mod_by_zero.rs:3:11: 6:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/bad_op_mod_by_zero.rs:3:11: 6:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:6:1: 6:2
+ StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:6:1: 6:2
+ return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:6:2: 6:2
+ }
+ }
+
--- /dev/null
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+ let a: *const [_] = &[1, 2, 3];
+ unsafe {
+ let _b = (*a)[3];
+ }
+}
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
+ let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
+ let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ scope 1 {
+ debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ scope 2 {
+ let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ scope 3 {
+ debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ // ty::Const
+ // + ty: &[i32; 3]
+ // + val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0]))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ // + literal: Const { ty: &[i32; 3], val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0])) }
+ _3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:34: 5:35
+ StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:35: 5:36
+ StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ _6 = const 3usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x00000003))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
+- _7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ _7 = const 3usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // ty::Const
++ // + ty: usize
++ // + val: Value(Scalar(0x00000003))
++ // mir::Constant
++ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
++ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ }
+
+ bb1: {
+ _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:25: 7:26
+ _0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:8:5: 8:6
+ StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:1: 9:2
+ return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:2: 9:2
+ }
+ }
+
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
+ let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
+ let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ scope 1 {
+ debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ scope 2 {
+ let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ scope 3 {
+ debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ // ty::Const
+ // + ty: &[i32; 3]
+ // + val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0]))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ // + literal: Const { ty: &[i32; 3], val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0])) }
+ _3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+ StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:34: 5:35
+ StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:35: 5:36
+ StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+ StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ _6 = const 3usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x0000000000000003))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
+- _7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ _7 = const 3usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // ty::Const
++ // + ty: usize
++ // + val: Value(Scalar(0x0000000000000003))
++ // mir::Constant
++ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
++ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ }
+
+ bb1: {
+ _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:25: 7:26
+ _0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:8:5: 8:6
+ StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:1: 9:2
+ return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:2: 9:2
+ }
+ }
+
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/boxes.rs:12:9: 12:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/boxes.rs:12:13: 12:22
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/boxes.rs:12:14: 12:22
- StorageLive(_4); // bb0[3]: scope 0 at $DIR/boxes.rs:12:14: 12:22
- _4 = Box(i32); // bb0[4]: scope 0 at $DIR/boxes.rs:12:14: 12:22
- (*_4) = const 42i32; // bb0[5]: scope 0 at $DIR/boxes.rs:12:19: 12:21
+ StorageLive(_1); // scope 0 at $DIR/boxes.rs:12:9: 12:10
+ StorageLive(_2); // scope 0 at $DIR/boxes.rs:12:13: 12:22
+ StorageLive(_3); // scope 0 at $DIR/boxes.rs:12:14: 12:22
+ StorageLive(_4); // scope 0 at $DIR/boxes.rs:12:14: 12:22
+ _4 = Box(i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
+ (*_4) = const 42i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/boxes.rs:12:19: 12:21
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- _3 = move _4; // bb0[6]: scope 0 at $DIR/boxes.rs:12:14: 12:22
- StorageDead(_4); // bb0[7]: scope 0 at $DIR/boxes.rs:12:21: 12:22
- _2 = (*_3); // bb0[8]: scope 0 at $DIR/boxes.rs:12:13: 12:22
- _1 = Add(move _2, const 0i32); // bb0[9]: scope 0 at $DIR/boxes.rs:12:13: 12:26
+ _3 = move _4; // scope 0 at $DIR/boxes.rs:12:14: 12:22
+ StorageDead(_4); // scope 0 at $DIR/boxes.rs:12:21: 12:22
+ _2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
+ _1 = Add(move _2, const 0i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/boxes.rs:12:25: 12:26
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- StorageDead(_2); // bb0[10]: scope 0 at $DIR/boxes.rs:12:25: 12:26
- drop(_3) -> [return: bb2, unwind: bb1]; // bb0[11]: scope 0 at $DIR/boxes.rs:12:26: 12:27
+ StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
+ drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/boxes.rs:11:1: 13:2
+ resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
}
bb2: {
- StorageDead(_3); // bb2[0]: scope 0 at $DIR/boxes.rs:12:26: 12:27
- _0 = const (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2
+ StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
+ _0 = const (); // scope 0 at $DIR/boxes.rs:11:11: 13:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/boxes.rs:11:11: 13:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb2[2]: scope 0 at $DIR/boxes.rs:13:1: 13:2
- return; // bb2[3]: scope 0 at $DIR/boxes.rs:13:2: 13:2
+ StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
+ return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/cast.rs:4:9: 4:10
-- _1 = const 42u8 as u32 (Misc); // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
-+ _1 = const 42u32; // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
+ StorageLive(_1); // scope 0 at $DIR/cast.rs:4:9: 4:10
+- _1 = const 42u8 as u32 (Misc); // scope 0 at $DIR/cast.rs:4:13: 4:24
++ _1 = const 42u32; // scope 0 at $DIR/cast.rs:4:13: 4:24
// ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x2a))
- // mir::Constant
- // + span: $DIR/cast.rs:4:13: 4:17
- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
-- StorageLive(_2); // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
-- _2 = const 42u32 as u8 (Misc); // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
+- StorageLive(_2); // scope 1 at $DIR/cast.rs:6:9: 6:10
+- _2 = const 42u32 as u8 (Misc); // scope 1 at $DIR/cast.rs:6:13: 6:24
- // ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
- // + span: $DIR/cast.rs:6:13: 6:18
+ // + span: $DIR/cast.rs:4:13: 4:24
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+ StorageLive(_2); // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
-+ _2 = const 42u8; // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
++ StorageLive(_2); // scope 1 at $DIR/cast.rs:6:9: 6:10
++ _2 = const 42u8; // scope 1 at $DIR/cast.rs:6:13: 6:24
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x2a))
+ // mir::Constant
+ // + span: $DIR/cast.rs:6:13: 6:24
+ // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
- _0 = const (); // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2
+ _0 = const (); // scope 0 at $DIR/cast.rs:3:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/cast.rs:3:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb0[5]: scope 1 at $DIR/cast.rs:7:1: 7:2
- StorageDead(_1); // bb0[6]: scope 0 at $DIR/cast.rs:7:1: 7:2
- return; // bb0[7]: scope 0 at $DIR/cast.rs:7:2: 7:2
+ StorageDead(_2); // scope 1 at $DIR/cast.rs:7:1: 7:2
+ StorageDead(_1); // scope 0 at $DIR/cast.rs:7:1: 7:2
+ return; // scope 0 at $DIR/cast.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/checked_add.rs:5:9: 5:10
-- _2 = CheckedAdd(const 1u32, const 1u32); // bb0[1]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+ _2 = (const 2u32, const false); // bb0[1]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ StorageLive(_1); // scope 0 at $DIR/checked_add.rs:5:9: 5:10
+- _2 = CheckedAdd(const 1u32, const 1u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
++ _2 = (const 2u32, const false); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
// ty::Const
// + ty: u32
- // + val: Value(Scalar(0x00000001))
// mir::Constant
- // + span: $DIR/checked_add.rs:5:22: 5:23
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ // + span: $DIR/checked_add.rs:5:18: 5:23
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
++ assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
-- _1 = move (_2.0: u32); // bb1[0]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+ _1 = const 2u32; // bb1[0]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
++ _1 = const 2u32; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/checked_add.rs:5:18: 5:23
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- _0 = const (); // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2
+ _0 = const (); // scope 0 at $DIR/checked_add.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/checked_add.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[2]: scope 0 at $DIR/checked_add.rs:6:1: 6:2
- return; // bb1[3]: scope 0 at $DIR/checked_add.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/checked_add.rs:6:1: 6:2
+ return; // scope 0 at $DIR/checked_add.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
- _3 = const main::FOO; // bb0[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+ StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10
+ StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
+ StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+ _3 = const main::FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), [], None)
// mir::Constant
// + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), [], None) }
- _2 = &raw const (*_3); // bb0[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
- _1 = move _2 as usize (Misc); // bb0[5]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
- StorageDead(_2); // bb0[6]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
- StorageDead(_3); // bb0[7]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:39: 7:40
- StorageLive(_4); // bb0[8]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
- StorageLive(_5); // bb0[9]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
- _5 = _1; // bb0[10]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
- _4 = const read(move _5) -> bb1; // bb0[11]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
+ _2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+ _1 = move _2 as usize (Misc); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
+ StorageDead(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
+ StorageDead(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:39: 7:40
+ StorageLive(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
+ StorageLive(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
+ _5 = _1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
+ _4 = const read(move _5) -> bb1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
// ty::Const
// + ty: fn(usize) {read}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_5); // bb1[0]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12
- StorageDead(_4); // bb1[1]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13
- _0 = const (); // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
+ StorageDead(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12
+ StorageDead(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13
+ _0 = const (); // scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2
- return; // bb1[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2
+ StorageDead(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2
+ return; // scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2
}
}
let mut _2: !; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
-- _1 = const <bool as NeedsDrop>::NEEDS; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
-+ _1 = const false; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+ StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+- _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
++ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
// ty::Const
// + ty: bool
- // + val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None)
// mir::Constant
// + span: $DIR/control-flow-simplification.rs:12:8: 12:21
- // + literal: Const { ty: bool, val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None) }
-- switchInt(_1) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
++ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
- _0 = const (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+ _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/control-flow-simplification.rs:12:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[1]: scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
- return; // bb1[2]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
+ StorageDead(_1); // scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
+ return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
}
bb2: {
- StorageLive(_2); // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
- const std::rt::begin_panic::<&str>(const "explicit panic"); // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+ StorageLive(_2); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+ const std::rt::begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
// ty::Const
// + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
// + val: Value(Scalar(<ZST>))
let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14
bb0: {
- _0 = const (); // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+ _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/control-flow-simplification.rs:12:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
+ return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-- _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+ _3 = const std::option::Option::<bool>::Some(true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+ StorageLive(_1); // scope 0 at $DIR/discriminant.rs:6:9: 6:10
+ StorageLive(_2); // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ StorageLive(_3); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+- _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
++ _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
// ty::Const
- // + ty: bool
+ // + ty: std::option::Option<bool>
// mir::Constant
- // + span: $DIR/discriminant.rs:6:39: 6:43
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-- _4 = discriminant(_3); // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
-- switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
+- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+- switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // + span: $DIR/discriminant.rs:6:34: 6:44
+ // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+ _4 = const 1isize; // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++ _4 = const 1isize; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+ // + span: $DIR/discriminant.rs:6:21: 6:31
+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
-+ switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++ switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x00000001))
}
bb1: {
- _2 = const 10i32; // bb1[0]: scope 0 at $DIR/discriminant.rs:6:59: 6:61
+ _2 = const 10i32; // scope 0 at $DIR/discriminant.rs:6:59: 6:61
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000000a))
// mir::Constant
// + span: $DIR/discriminant.rs:6:59: 6:61
// + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
- goto -> bb4; // bb1[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ goto -> bb4; // scope 0 at $DIR/discriminant.rs:6:13: 6:64
}
bb2: {
-- switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+ switchInt(const true) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
+- switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
++ switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb3: {
- _2 = const 42i32; // bb3[0]: scope 0 at $DIR/discriminant.rs:6:47: 6:49
+ _2 = const 42i32; // scope 0 at $DIR/discriminant.rs:6:47: 6:49
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/discriminant.rs:6:47: 6:49
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- goto -> bb4; // bb3[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ goto -> bb4; // scope 0 at $DIR/discriminant.rs:6:13: 6:64
}
bb4: {
- _1 = Add(move _2, const 0i32); // bb4[0]: scope 0 at $DIR/discriminant.rs:6:13: 6:68
+ _1 = Add(move _2, const 0i32); // scope 0 at $DIR/discriminant.rs:6:13: 6:68
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/discriminant.rs:6:67: 6:68
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- StorageDead(_2); // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
- StorageDead(_3); // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
- _0 = const (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
+ StorageDead(_2); // scope 0 at $DIR/discriminant.rs:6:67: 6:68
+ StorageDead(_3); // scope 0 at $DIR/discriminant.rs:6:68: 6:69
+ _0 = const (); // scope 0 at $DIR/discriminant.rs:5:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/discriminant.rs:5:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
- return; // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
+ StorageDead(_1); // scope 0 at $DIR/discriminant.rs:7:1: 7:2
+ return; // scope 0 at $DIR/discriminant.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-- _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+ _3 = const std::option::Option::<bool>::Some(true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+ StorageLive(_1); // scope 0 at $DIR/discriminant.rs:6:9: 6:10
+ StorageLive(_2); // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ StorageLive(_3); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+- _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
++ _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
// ty::Const
- // + ty: bool
+ // + ty: std::option::Option<bool>
// mir::Constant
- // + span: $DIR/discriminant.rs:6:39: 6:43
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-- _4 = discriminant(_3); // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
-- switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
+- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+- switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // + span: $DIR/discriminant.rs:6:34: 6:44
+ // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+ _4 = const 1isize; // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++ _4 = const 1isize; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x0000000000000001))
+ // mir::Constant
+ // + span: $DIR/discriminant.rs:6:21: 6:31
+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
-+ switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++ switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x0000000000000001))
}
bb1: {
- _2 = const 10i32; // bb1[0]: scope 0 at $DIR/discriminant.rs:6:59: 6:61
+ _2 = const 10i32; // scope 0 at $DIR/discriminant.rs:6:59: 6:61
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000000a))
// mir::Constant
// + span: $DIR/discriminant.rs:6:59: 6:61
// + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
- goto -> bb4; // bb1[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ goto -> bb4; // scope 0 at $DIR/discriminant.rs:6:13: 6:64
}
bb2: {
-- switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+ switchInt(const true) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
+- switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
++ switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb3: {
- _2 = const 42i32; // bb3[0]: scope 0 at $DIR/discriminant.rs:6:47: 6:49
+ _2 = const 42i32; // scope 0 at $DIR/discriminant.rs:6:47: 6:49
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/discriminant.rs:6:47: 6:49
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- goto -> bb4; // bb3[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+ goto -> bb4; // scope 0 at $DIR/discriminant.rs:6:13: 6:64
}
bb4: {
- _1 = Add(move _2, const 0i32); // bb4[0]: scope 0 at $DIR/discriminant.rs:6:13: 6:68
+ _1 = Add(move _2, const 0i32); // scope 0 at $DIR/discriminant.rs:6:13: 6:68
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/discriminant.rs:6:67: 6:68
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- StorageDead(_2); // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
- StorageDead(_3); // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
- _0 = const (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
+ StorageDead(_2); // scope 0 at $DIR/discriminant.rs:6:67: 6:68
+ StorageDead(_3); // scope 0 at $DIR/discriminant.rs:6:68: 6:69
+ _0 = const (); // scope 0 at $DIR/discriminant.rs:5:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/discriminant.rs:5:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
- return; // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
+ StorageDead(_1); // scope 0 at $DIR/discriminant.rs:7:1: 7:2
+ return; // scope 0 at $DIR/discriminant.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/indirect.rs:5:9: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/indirect.rs:5:13: 5:25
-- _2 = const 2u32 as u8 (Misc); // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
-+ _2 = const 2u8; // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
+ StorageLive(_1); // scope 0 at $DIR/indirect.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/indirect.rs:5:13: 5:25
+- _2 = const 2u32 as u8 (Misc); // scope 0 at $DIR/indirect.rs:5:13: 5:25
++ _2 = const 2u8; // scope 0 at $DIR/indirect.rs:5:13: 5:25
// ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
// mir::Constant
- // + span: $DIR/indirect.rs:5:14: 5:18
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-- _3 = CheckedAdd(move _2, const 1u8); // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+- _3 = CheckedAdd(move _2, const 1u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ // + span: $DIR/indirect.rs:5:13: 5:25
+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+ _3 = (const 3u8, const false); // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
++ _3 = (const 3u8, const false); // scope 0 at $DIR/indirect.rs:5:13: 5:29
// ty::Const
// + ty: u8
- // + val: Value(Scalar(0x01))
// mir::Constant
- // + span: $DIR/indirect.rs:5:28: 5:29
- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
-- assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+- assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ // + span: $DIR/indirect.rs:5:13: 5:29
+ // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
+ // ty::Const
+ // mir::Constant
+ // + span: $DIR/indirect.rs:5:13: 5:29
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ assert(!const false, "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
++ assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
-- _1 = move (_3.0: u8); // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
-+ _1 = const 3u8; // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
++ _1 = const 3u8; // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x03))
+ // mir::Constant
+ // + span: $DIR/indirect.rs:5:13: 5:29
+ // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
- StorageDead(_2); // bb1[1]: scope 0 at $DIR/indirect.rs:5:28: 5:29
- _0 = const (); // bb1[2]: scope 0 at $DIR/indirect.rs:4:11: 6:2
+ StorageDead(_2); // scope 0 at $DIR/indirect.rs:5:28: 5:29
+ _0 = const (); // scope 0 at $DIR/indirect.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/indirect.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[3]: scope 0 at $DIR/indirect.rs:6:1: 6:2
- return; // bb1[4]: scope 0 at $DIR/indirect.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/indirect.rs:6:1: 6:2
+ return; // scope 0 at $DIR/indirect.rs:6:2: 6:2
}
}
let mut _3: (); // in scope 0 at $DIR/issue-66971.rs:16:13: 16:15
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/issue-66971.rs:16:5: 16:23
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/issue-66971.rs:16:12: 16:22
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
-- _3 = (); // bb0[3]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
-+ _3 = const (); // bb0[3]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
+ StorageLive(_1); // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
+ StorageLive(_2); // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
+ StorageLive(_3); // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
+- _3 = (); // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
++ _3 = const (); // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/issue-66971.rs:16:13: 16:15
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- _2 = (move _3, const 0u8, const 0u8); // bb0[4]: scope 0 at $DIR/issue-66971.rs:16:12: 16:22
+ _2 = (move _3, const 0u8, const 0u8); // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-66971.rs:16:20: 16:21
// + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/issue-66971.rs:16:21: 16:22
- _1 = const encode(move _2) -> bb1; // bb0[6]: scope 0 at $DIR/issue-66971.rs:16:5: 16:23
+ StorageDead(_3); // scope 0 at $DIR/issue-66971.rs:16:21: 16:22
+ _1 = const encode(move _2) -> bb1; // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
// ty::Const
// + ty: fn(((), u8, u8)) {encode}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_2); // bb1[0]: scope 0 at $DIR/issue-66971.rs:16:22: 16:23
- StorageDead(_1); // bb1[1]: scope 0 at $DIR/issue-66971.rs:16:23: 16:24
- _0 = const (); // bb1[2]: scope 0 at $DIR/issue-66971.rs:15:11: 17:2
+ StorageDead(_2); // scope 0 at $DIR/issue-66971.rs:16:22: 16:23
+ StorageDead(_1); // scope 0 at $DIR/issue-66971.rs:16:23: 16:24
+ _0 = const (); // scope 0 at $DIR/issue-66971.rs:15:11: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-66971.rs:15:11: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[3]: scope 0 at $DIR/issue-66971.rs:17:2: 17:2
+ return; // scope 0 at $DIR/issue-66971.rs:17:2: 17:2
}
}
let mut _3: (u8, u8); // in scope 0 at $DIR/issue-67019.rs:11:11: 11:17
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/issue-67019.rs:11:5: 11:20
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/issue-67019.rs:11:10: 11:19
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/issue-67019.rs:11:11: 11:17
- _3 = (const 1u8, const 2u8); // bb0[3]: scope 0 at $DIR/issue-67019.rs:11:11: 11:17
+ StorageLive(_1); // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
+ StorageLive(_2); // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
+ StorageLive(_3); // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
+ _3 = (const 1u8, const 2u8); // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x01))
- // + span: $DIR/issue-67019.rs:11:15: 11:16
+ // + span: $DIR/issue-67019.rs:11:11: 11:17
// + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
- _2 = (move _3,); // bb0[4]: scope 0 at $DIR/issue-67019.rs:11:10: 11:19
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/issue-67019.rs:11:18: 11:19
- _1 = const test(move _2) -> bb1; // bb0[6]: scope 0 at $DIR/issue-67019.rs:11:5: 11:20
+ _2 = (move _3,); // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
+ StorageDead(_3); // scope 0 at $DIR/issue-67019.rs:11:18: 11:19
+ _1 = const test(move _2) -> bb1; // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
// ty::Const
// + ty: fn(((u8, u8),)) {test}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_2); // bb1[0]: scope 0 at $DIR/issue-67019.rs:11:19: 11:20
- StorageDead(_1); // bb1[1]: scope 0 at $DIR/issue-67019.rs:11:20: 11:21
- _0 = const (); // bb1[2]: scope 0 at $DIR/issue-67019.rs:10:11: 12:2
+ StorageDead(_2); // scope 0 at $DIR/issue-67019.rs:11:19: 11:20
+ StorageDead(_1); // scope 0 at $DIR/issue-67019.rs:11:20: 11:21
+ _0 = const (); // scope 0 at $DIR/issue-67019.rs:10:11: 12:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-67019.rs:10:11: 12:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[3]: scope 0 at $DIR/issue-67019.rs:12:2: 12:2
+ return; // scope 0 at $DIR/issue-67019.rs:12:2: 12:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
-- _2 = CheckedAdd(const 2i32, const 2i32); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _2 = (const 4i32, const false); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+- _2 = CheckedAdd(const 2i32, const 2i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ _2 = (const 4i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
// ty::Const
// + ty: i32
- // + val: Value(Scalar(0x00000002))
// mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
-- _1 = move (_2.0: i32); // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _1 = const 4i32; // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ _1 = const 4i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000004))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageLive(_3); // bb1[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
- StorageLive(_4); // bb1[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
- _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // bb1[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+ StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+ StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+ _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
// + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
- StorageLive(_5); // bb1[4]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
- _5 = const 3usize; // bb1[5]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+ StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+ _5 = const 3usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
// + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
- _6 = const 6usize; // bb1[6]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _6 = const 6usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000006))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
// + literal: Const { ty: usize, val: Value(Scalar(0x00000006)) }
-- _7 = Lt(_5, _6); // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ _7 = const true; // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb2: {
-- _3 = _4[_5]; // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ _3 = const 3i32; // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ _3 = const 3i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000003))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_5); // bb2[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
- StorageDead(_4); // bb2[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
- StorageLive(_8); // bb2[3]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
- StorageLive(_9); // bb2[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- _9 = Point { x: const 12u32, y: const 42u32 }; // bb2[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+ StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+ StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+ StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+ StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+ _9 = Point { x: const 12u32, y: const 42u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000000c))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-- _8 = (_9.1: u32); // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ _8 = const 42u32; // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
++ _8 = const 42u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x0000002a))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageDead(_9); // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
- _0 = const (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+ StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
+ _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_8); // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_3); // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_1); // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- return; // bb2[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+ StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
- _1 = const 4i32; // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+ _1 = const 4i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
// + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
- _2 = const 3i32; // bb0[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+ _2 = const 3i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageLive(_3); // bb0[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
- _3 = const 42u32; // bb0[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+ _3 = const 42u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- _0 = const (); // bb0[6]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+ _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_3); // bb0[7]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_2); // bb0[8]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_1); // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- return; // bb0[10]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+ StorageDead(_3); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_2); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
-- _2 = CheckedAdd(const 2i32, const 2i32); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _2 = (const 4i32, const false); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+- _2 = CheckedAdd(const 2i32, const 2i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ _2 = (const 4i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
// ty::Const
// + ty: i32
- // + val: Value(Scalar(0x00000002))
// mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+- assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
-- _1 = move (_2.0: i32); // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _1 = const 4i32; // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++ _1 = const 4i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000004))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageLive(_3); // bb1[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
- StorageLive(_4); // bb1[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
- _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // bb1[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+ StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+ StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+ _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
// + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
- StorageLive(_5); // bb1[4]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
- _5 = const 3usize; // bb1[5]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+ StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+ _5 = const 3usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000003))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
- _6 = const 6usize; // bb1[6]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _6 = const 6usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000006))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000006)) }
-- _7 = Lt(_5, _6); // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ _7 = const true; // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb2: {
-- _3 = _4[_5]; // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ _3 = const 3i32; // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++ _3 = const 3i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000003))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_5); // bb2[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
- StorageDead(_4); // bb2[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
- StorageLive(_8); // bb2[3]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
- StorageLive(_9); // bb2[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- _9 = Point { x: const 12u32, y: const 42u32 }; // bb2[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+ StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+ StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+ StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+ StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+ _9 = Point { x: const 12u32, y: const 42u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000000c))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-- _8 = (_9.1: u32); // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ _8 = const 42u32; // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
++ _8 = const 42u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x0000002a))
+ // mir::Constant
+ // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageDead(_9); // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
- _0 = const (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+ StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
+ _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_8); // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_3); // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_1); // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- return; // bb2[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+ StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
- _1 = const 4i32; // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+ _1 = const 4i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
// + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
- _2 = const 3i32; // bb0[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+ _2 = const 3i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageLive(_3); // bb0[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
- _3 = const 42u32; // bb0[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+ _3 = const 42u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- _0 = const (); // bb0[6]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+ _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_3); // bb0[7]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_2); // bb0[8]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- StorageDead(_1); // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
- return; // bb0[10]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+ StorageDead(_3); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_2); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+ return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
- _3 = const {alloc0+0x0: &u8}; // bb0[3]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+ StorageLive(_1); // scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
+ StorageLive(_2); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+ StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+ _3 = const {alloc0+0x0: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
// ty::Const
// + ty: &u8
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/read_immutable_static.rs:7:13: 7:16
// + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0x0)) }
-- _2 = (*_3); // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
-+ _2 = const 2u8; // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+- _2 = (*_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
++ _2 = const 2u8; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x02))
+ // mir::Constant
+ // + span: $DIR/read_immutable_static.rs:7:13: 7:16
+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
- StorageLive(_4); // bb0[5]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
- StorageLive(_5); // bb0[6]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
- _5 = const {alloc0+0x0: &u8}; // bb0[7]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+ StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+ StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+ _5 = const {alloc0+0x0: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
// ty::Const
// + ty: &u8
// + val: Value(Scalar(alloc0+0x0))
// mir::Constant
// + span: $DIR/read_immutable_static.rs:7:19: 7:22
// + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0x0)) }
-- _4 = (*_5); // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
-- _1 = Add(move _2, move _4); // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
-+ _4 = const 2u8; // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+- _4 = (*_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+- _1 = Add(move _2, move _4); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
++ _4 = const 2u8; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x02))
+ // mir::Constant
+ // + span: $DIR/read_immutable_static.rs:7:19: 7:22
+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+ _1 = const 4u8; // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
++ _1 = const 4u8; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x04))
+ // mir::Constant
+ // + span: $DIR/read_immutable_static.rs:7:13: 7:22
+ // + literal: Const { ty: u8, val: Value(Scalar(0x04)) }
- StorageDead(_4); // bb0[10]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
- StorageDead(_2); // bb0[11]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
- StorageDead(_5); // bb0[12]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
- StorageDead(_3); // bb0[13]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
- _0 = const (); // bb0[14]: scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2
+ StorageDead(_4); // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
+ StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
+ StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
+ StorageDead(_3); // scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
+ _0 = const (); // scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/read_immutable_static.rs:6:11: 8:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb0[15]: scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2
- return; // bb0[16]: scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2
+ StorageDead(_1); // scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2
+ return; // scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2
}
}
let mut _4: &i32; // in scope 0 at $DIR/ref_deref.rs:5:6: 5:10
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
- _4 = const main::promoted[0]; // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/ref_deref.rs:5:6: 5:10
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0])) }
- _2 = _4; // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-- _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-+ _1 = const 4i32; // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ _2 = _4; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
++ _1 = const 4i32; // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000004))
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:5: 5:10
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
- StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
- _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
+ StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+ StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+ _0 = const (); // scope 0 at $DIR/ref_deref.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/ref_deref.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
+ return; // scope 0 at $DIR/ref_deref.rs:6:2: 6:2
}
}
+ let mut _4: &i32; // in scope 0 at $DIR/ref_deref.rs:5:6: 5:10
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-- StorageLive(_3); // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:8: 5:9
-- _3 = const 4i32; // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:8: 5:9
-+ _4 = const main::promoted[0]; // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+- StorageLive(_3); // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
+- _3 = const 4i32; // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
++ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
// ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
// mir::Constant
- // + span: $DIR/ref_deref.rs:5:8: 5:9
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-- _2 = &_3; // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-- _1 = (*_2); // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-- StorageDead(_3); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-- StorageDead(_2); // bb0[7]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-- StorageDead(_1); // bb0[8]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-- _0 = const (); // bb0[9]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
+- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0])) }
-+ _2 = &(*_4); // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-+ _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-+ StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-+ StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-+ _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
++ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+- StorageDead(_3); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+ StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+ StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+ _0 = const (); // scope 0 at $DIR/ref_deref.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/ref_deref.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- return; // bb0[10]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
-+ return; // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
+ return; // scope 0 at $DIR/ref_deref.rs:6:2: 6:2
}
}
let mut _4: &(i32, i32); // in scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
- _4 = const main::promoted[0]; // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+ StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
// ty::Const
// + ty: &(i32, i32)
// + val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/ref_deref_project.rs:5:6: 5:17
// + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
- _2 = &((*_4).1: i32); // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
- _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
- StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
- StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
- _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
+ _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ _1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+ StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+ StorageDead(_1); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+ _0 = const (); // scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/ref_deref_project.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
+ return; // scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
}
}
+ let mut _4: &(i32, i32); // in scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-- StorageLive(_3); // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
-- _3 = (const 4i32, const 5i32); // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
-+ _4 = const main::promoted[0]; // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+ StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+- StorageLive(_3); // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
+- _3 = (const 4i32, const 5i32); // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
++ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
// ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
// mir::Constant
- // + span: $DIR/ref_deref_project.rs:5:9: 5:10
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-+ // + span: $DIR/ref_deref_project.rs:5:6: 5:17
-+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
-+ _2 = &((*_4).1: i32); // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-+ _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-+ StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-+ StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-+ _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
- // ty::Const
+- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/ref_deref_project.rs:5:12: 5:13
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
-- _2 = &(_3.1: i32); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-- _1 = (*_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-- StorageDead(_3); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-- StorageDead(_2); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-- StorageDead(_1); // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-- _0 = const (); // bb0[9]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
-- // ty::Const
+- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
++ // + span: $DIR/ref_deref_project.rs:5:6: 5:17
++ // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
++ _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ _1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+- StorageDead(_3); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+ StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+ StorageDead(_1); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+ _0 = const (); // scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
+ // ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/ref_deref_project.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- return; // bb0[10]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
-+ return; // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
+ return; // scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
- _3 = const main as fn() (Pointer(ReifyFnPointer)); // bb0[3]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
+ StorageLive(_1); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
+ StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
+ StorageLive(_3); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
+ _3 = const main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
// ty::Const
// + ty: fn() {main}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/reify_fn_ptr.rs:4:13: 4:17
// + literal: Const { ty: fn() {main}, val: Value(Scalar(<ZST>)) }
- _2 = move _3 as usize (Misc); // bb0[4]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/reify_fn_ptr.rs:4:25: 4:26
- _1 = move _2 as *const fn() (Misc); // bb0[6]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
- StorageDead(_2); // bb0[7]: scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41
- StorageDead(_1); // bb0[8]: scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42
- _0 = const (); // bb0[9]: scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2
+ _2 = move _3 as usize (Misc); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
+ StorageDead(_3); // scope 0 at $DIR/reify_fn_ptr.rs:4:25: 4:26
+ _1 = move _2 as *const fn() (Misc); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
+ StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41
+ StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42
+ _0 = const (); // scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/reify_fn_ptr.rs:3:11: 5:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[10]: scope 0 at $DIR/reify_fn_ptr.rs:5:2: 5:2
+ return; // scope 0 at $DIR/reify_fn_ptr.rs:5:2: 5:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/repeat.rs:6:9: 6:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/repeat.rs:6:18: 6:28
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/repeat.rs:6:18: 6:25
- _3 = [const 42u32; 8]; // bb0[3]: scope 0 at $DIR/repeat.rs:6:18: 6:25
+ StorageLive(_1); // scope 0 at $DIR/repeat.rs:6:9: 6:10
+ StorageLive(_2); // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ StorageLive(_3); // scope 0 at $DIR/repeat.rs:6:18: 6:25
+ _3 = [const 42u32; 8]; // scope 0 at $DIR/repeat.rs:6:18: 6:25
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/repeat.rs:6:19: 6:21
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageLive(_4); // bb0[4]: scope 0 at $DIR/repeat.rs:6:26: 6:27
- _4 = const 2usize; // bb0[5]: scope 0 at $DIR/repeat.rs:6:26: 6:27
+ StorageLive(_4); // scope 0 at $DIR/repeat.rs:6:26: 6:27
+ _4 = const 2usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/repeat.rs:6:26: 6:27
// + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
- _5 = const 8usize; // bb0[6]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+ _5 = const 8usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000008))
// mir::Constant
// + span: $DIR/repeat.rs:6:18: 6:28
// + literal: Const { ty: usize, val: Value(Scalar(0x00000008)) }
-- _6 = Lt(_4, _5); // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ _6 = const true; // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28
+- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
++ _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/repeat.rs:6:18: 6:28
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _2 = _3[_4]; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-- _1 = Add(move _2, const 0u32); // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
-+ _2 = const 42u32; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _1 = Add(move _2, const 0u32); // scope 0 at $DIR/repeat.rs:6:18: 6:32
++ _2 = const 42u32; // scope 0 at $DIR/repeat.rs:6:18: 6:28
// ty::Const
// + ty: u32
- // + val: Value(Scalar(0x00000000))
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
+ // + span: $DIR/repeat.rs:6:18: 6:28
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+ _1 = const 42u32; // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
++ _1 = const 42u32; // scope 0 at $DIR/repeat.rs:6:18: 6:32
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x0000002a))
+ // mir::Constant
+ // + span: $DIR/repeat.rs:6:18: 6:32
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageDead(_2); // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32
- StorageDead(_4); // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33
- StorageDead(_3); // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33
- _0 = const (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2
+ StorageDead(_2); // scope 0 at $DIR/repeat.rs:6:31: 6:32
+ StorageDead(_4); // scope 0 at $DIR/repeat.rs:6:32: 6:33
+ StorageDead(_3); // scope 0 at $DIR/repeat.rs:6:32: 6:33
+ _0 = const (); // scope 0 at $DIR/repeat.rs:5:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/repeat.rs:5:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2
- return; // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2
+ StorageDead(_1); // scope 0 at $DIR/repeat.rs:7:1: 7:2
+ return; // scope 0 at $DIR/repeat.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/repeat.rs:6:9: 6:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/repeat.rs:6:18: 6:28
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/repeat.rs:6:18: 6:25
- _3 = [const 42u32; 8]; // bb0[3]: scope 0 at $DIR/repeat.rs:6:18: 6:25
+ StorageLive(_1); // scope 0 at $DIR/repeat.rs:6:9: 6:10
+ StorageLive(_2); // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ StorageLive(_3); // scope 0 at $DIR/repeat.rs:6:18: 6:25
+ _3 = [const 42u32; 8]; // scope 0 at $DIR/repeat.rs:6:18: 6:25
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/repeat.rs:6:19: 6:21
// + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageLive(_4); // bb0[4]: scope 0 at $DIR/repeat.rs:6:26: 6:27
- _4 = const 2usize; // bb0[5]: scope 0 at $DIR/repeat.rs:6:26: 6:27
+ StorageLive(_4); // scope 0 at $DIR/repeat.rs:6:26: 6:27
+ _4 = const 2usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000002))
// mir::Constant
// + span: $DIR/repeat.rs:6:26: 6:27
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
- _5 = const 8usize; // bb0[6]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+ _5 = const 8usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000008))
// mir::Constant
// + span: $DIR/repeat.rs:6:18: 6:28
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000008)) }
-- _6 = Lt(_4, _5); // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ _6 = const true; // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28
+- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
++ _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/repeat.rs:6:18: 6:28
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _2 = _3[_4]; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-- _1 = Add(move _2, const 0u32); // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
-+ _2 = const 42u32; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+- _1 = Add(move _2, const 0u32); // scope 0 at $DIR/repeat.rs:6:18: 6:32
++ _2 = const 42u32; // scope 0 at $DIR/repeat.rs:6:18: 6:28
// ty::Const
// + ty: u32
- // + val: Value(Scalar(0x00000000))
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
+ // + span: $DIR/repeat.rs:6:18: 6:28
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+ _1 = const 42u32; // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
++ _1 = const 42u32; // scope 0 at $DIR/repeat.rs:6:18: 6:32
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x0000002a))
+ // mir::Constant
+ // + span: $DIR/repeat.rs:6:18: 6:32
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- StorageDead(_2); // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32
- StorageDead(_4); // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33
- StorageDead(_3); // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33
- _0 = const (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2
+ StorageDead(_2); // scope 0 at $DIR/repeat.rs:6:31: 6:32
+ StorageDead(_4); // scope 0 at $DIR/repeat.rs:6:32: 6:33
+ StorageDead(_3); // scope 0 at $DIR/repeat.rs:6:32: 6:33
+ _0 = const (); // scope 0 at $DIR/repeat.rs:5:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/repeat.rs:5:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2
- return; // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2
+ StorageDead(_1); // scope 0 at $DIR/repeat.rs:7:1: 7:2
+ return; // scope 0 at $DIR/repeat.rs:7:2: 7:2
}
}
let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:6:5: 6:10
bb0: {
-- _1 = CheckedAdd(const 2u32, const 2u32); // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
-+ _1 = (const 4u32, const false); // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+- _1 = CheckedAdd(const 2u32, const 2u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10
++ _1 = (const 4u32, const false); // scope 0 at $DIR/return_place.rs:6:5: 6:10
// ty::Const
// + ty: u32
- // + val: Value(Scalar(0x00000002))
// mir::Constant
- // + span: $DIR/return_place.rs:6:9: 6:10
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-- assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1; // bb0[1]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+- assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
+ // + span: $DIR/return_place.rs:6:5: 6:10
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ assert(!const false, "attempt to add with overflow") -> bb1; // bb0[1]: scope 0 at $DIR/return_place.rs:6:5: 6:10
++ assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
}
bb1: {
-- _0 = move (_1.0: u32); // bb1[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
-+ _0 = const 4u32; // bb1[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+- _0 = move (_1.0: u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10
++ _0 = const 4u32; // scope 0 at $DIR/return_place.rs:6:5: 6:10
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000004))
+ // mir::Constant
+ // + span: $DIR/return_place.rs:6:5: 6:10
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
- return; // bb1[1]: scope 0 at $DIR/return_place.rs:7:2: 7:2
+ return; // scope 0 at $DIR/return_place.rs:7:2: 7:2
}
}
let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:5:13: 5:16
bb0: {
- _0 = const 4u32; // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+ _0 = const 4u32; // scope 0 at $DIR/return_place.rs:6:5: 6:10
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/return_place.rs:6:5: 6:10
// + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
- return; // bb0[1]: scope 0 at $DIR/return_place.rs:7:2: 7:2
+ return; // scope 0 at $DIR/return_place.rs:7:2: 7:2
}
}
--- /dev/null
+// EMIT_MIR rustc.main.ConstProp.diff
+fn main() {
+ let x = 1;
+ consume(x);
+}
+
+#[inline(never)]
+fn consume(_: u32) { }
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/scalar_literal_propagation.rs:2:11: 2:11
+ let _1: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+ let _2: (); // in scope 0 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+ let mut _3: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
+ scope 1 {
+ debug x => _1; // in scope 1 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+ _1 = const 1u32; // scope 0 at $DIR/scalar_literal_propagation.rs:3:13: 3:14
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+ // + span: $DIR/scalar_literal_propagation.rs:3:13: 3:14
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+ StorageLive(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+ StorageLive(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
+- _3 = _1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
++ _3 = const 1u32; // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
++ // ty::Const
++ // + ty: u32
++ // + val: Value(Scalar(0x00000001))
++ // mir::Constant
++ // + span: $DIR/scalar_literal_propagation.rs:4:13: 4:14
++ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+ _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+ // ty::Const
+ // + ty: fn(u32) {consume}
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
+ // + literal: Const { ty: fn(u32) {consume}, val: Value(Scalar(<ZST>)) }
+ }
+
+ bb1: {
+ StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:4:14: 4:15
+ StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:4:15: 4:16
+ _0 = const (); // scope 0 at $DIR/scalar_literal_propagation.rs:2:11: 5:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/scalar_literal_propagation.rs:2:11: 5:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:5:1: 5:2
+ return; // scope 0 at $DIR/scalar_literal_propagation.rs:5:2: 5:2
+ }
+ }
+
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/slice_len.rs:5:5: 5:30
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- StorageLive(_4); // bb0[3]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _9 = const main::promoted[0]; // bb0[4]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageLive(_1); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ StorageLive(_2); // scope 0 at $DIR/slice_len.rs:5:5: 5:30
+ StorageLive(_3); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageLive(_4); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
// ty::Const
// + ty: &[u32; 3]
// + val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0])) }
- _4 = _9; // bb0[5]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _3 = _4; // bb0[6]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _2 = move _3 as &[u32] (Pointer(Unsize)); // bb0[7]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- StorageDead(_3); // bb0[8]: scope 0 at $DIR/slice_len.rs:5:18: 5:19
- StorageLive(_6); // bb0[9]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
- _6 = const 1usize; // bb0[10]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
+ _4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageDead(_3); // scope 0 at $DIR/slice_len.rs:5:18: 5:19
+ StorageLive(_6); // scope 0 at $DIR/slice_len.rs:5:31: 5:32
+ _6 = const 1usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/slice_len.rs:5:31: 5:32
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-- _7 = Len((*_2)); // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-- _8 = Lt(_6, _7); // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ _7 = const 3usize; // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _7 = const 3usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x00000003))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
-+ _8 = const true; // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _1 = (*_2)[_6]; // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ _1 = const 2u32; // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _1 = const 2u32; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageDead(_6); // bb1[1]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_4); // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_2); // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_1); // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- _0 = const (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2
+ StorageDead(_6); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_4); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_2); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_1); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ _0 = const (); // scope 0 at $DIR/slice_len.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/slice_len.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2
+ return; // scope 0 at $DIR/slice_len.rs:6:2: 6:2
}
}
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/slice_len.rs:5:5: 5:30
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- StorageLive(_4); // bb0[3]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _9 = const main::promoted[0]; // bb0[4]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageLive(_1); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ StorageLive(_2); // scope 0 at $DIR/slice_len.rs:5:5: 5:30
+ StorageLive(_3); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageLive(_4); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
// ty::Const
// + ty: &[u32; 3]
// + val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0])) }
- _4 = _9; // bb0[5]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _3 = _4; // bb0[6]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- _2 = move _3 as &[u32] (Pointer(Unsize)); // bb0[7]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
- StorageDead(_3); // bb0[8]: scope 0 at $DIR/slice_len.rs:5:18: 5:19
- StorageLive(_6); // bb0[9]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
- _6 = const 1usize; // bb0[10]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
+ _4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+ StorageDead(_3); // scope 0 at $DIR/slice_len.rs:5:18: 5:19
+ StorageLive(_6); // scope 0 at $DIR/slice_len.rs:5:31: 5:32
+ _6 = const 1usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $DIR/slice_len.rs:5:31: 5:32
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-- _7 = Len((*_2)); // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-- _8 = Lt(_6, _7); // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ _7 = const 3usize; // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _7 = const 3usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x0000000000000003))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
-+ _8 = const true; // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x01))
}
bb1: {
-- _1 = (*_2)[_6]; // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ _1 = const 2u32; // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++ _1 = const 2u32; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+ // + span: $DIR/slice_len.rs:5:5: 5:33
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageDead(_6); // bb1[1]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_4); // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_2); // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- StorageDead(_1); // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
- _0 = const (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2
+ StorageDead(_6); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_4); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_2); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ StorageDead(_1); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+ _0 = const (); // scope 0 at $DIR/slice_len.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/slice_len.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2
+ return; // scope 0 at $DIR/slice_len.rs:6:2: 6:2
}
}
let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:7:11: 7:12
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
- _1 = const 1i32; // bb0[1]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
+ StorageLive(_1); // scope 0 at $DIR/switch_int.rs:7:11: 7:12
+ _1 = const 1i32; // scope 0 at $DIR/switch_int.rs:7:11: 7:12
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/switch_int.rs:7:11: 7:12
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-- switchInt(_1) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
-+ switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
+- switchInt(_1) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
++ switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
+ // ty::Const
+ // + ty: i32
+ // + val: Value(Scalar(0x00000001))
}
bb1: {
- _0 = const foo(const -1i32) -> bb3; // bb1[0]: scope 0 at $DIR/switch_int.rs:9:14: 9:21
+ _0 = const foo(const -1i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
// ty::Const
// + ty: fn(i32) {foo}
// + val: Value(Scalar(<ZST>))
}
bb2: {
- _0 = const foo(const 0i32) -> bb3; // bb2[0]: scope 0 at $DIR/switch_int.rs:8:14: 8:20
+ _0 = const foo(const 0i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
// ty::Const
// + ty: fn(i32) {foo}
// + val: Value(Scalar(<ZST>))
}
bb3: {
- StorageDead(_1); // bb3[0]: scope 0 at $DIR/switch_int.rs:11:1: 11:2
- return; // bb3[1]: scope 0 at $DIR/switch_int.rs:11:2: 11:2
+ StorageDead(_1); // scope 0 at $DIR/switch_int.rs:11:1: 11:2
+ return; // scope 0 at $DIR/switch_int.rs:11:2: 11:2
}
}
let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:7:11: 7:12
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
- _1 = const 1i32; // bb0[1]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
+ StorageLive(_1); // scope 0 at $DIR/switch_int.rs:7:11: 7:12
+ _1 = const 1i32; // scope 0 at $DIR/switch_int.rs:7:11: 7:12
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/switch_int.rs:7:11: 7:12
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-- switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
+- switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/switch_int.rs:8:9: 8:10
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ goto -> bb2; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
++ goto -> bb2; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
}
bb1: {
- _0 = const foo(const -1i32) -> bb3; // bb1[0]: scope 0 at $DIR/switch_int.rs:9:14: 9:21
+ _0 = const foo(const -1i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
// ty::Const
// + ty: fn(i32) {foo}
// + val: Value(Scalar(<ZST>))
}
bb2: {
- _0 = const foo(const 0i32) -> bb3; // bb2[0]: scope 0 at $DIR/switch_int.rs:8:14: 8:20
+ _0 = const foo(const 0i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
// ty::Const
// + ty: fn(i32) {foo}
// + val: Value(Scalar(<ZST>))
}
bb3: {
- StorageDead(_1); // bb3[0]: scope 0 at $DIR/switch_int.rs:11:1: 11:2
- return; // bb3[1]: scope 0 at $DIR/switch_int.rs:11:2: 11:2
+ StorageDead(_1); // scope 0 at $DIR/switch_int.rs:11:1: 11:2
+ return; // scope 0 at $DIR/switch_int.rs:11:2: 11:2
}
}
--- /dev/null
+// EMIT_MIR rustc.main.ConstProp.diff
+fn main() {
+ let x = (1, 2);
+
+ consume(x);
+}
+
+#[inline(never)]
+fn consume(_: (u32, u32)) { }
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/tuple_literal_propagation.rs:2:11: 2:11
+ let _1: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+ let _2: (); // in scope 0 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+ let mut _3: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
+ scope 1 {
+ debug x => _1; // in scope 1 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+ _1 = (const 1u32, const 2u32); // scope 0 at $DIR/tuple_literal_propagation.rs:3:13: 3:19
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000001))
+ // mir::Constant
+- // + span: $DIR/tuple_literal_propagation.rs:3:14: 3:15
++ // + span: $DIR/tuple_literal_propagation.rs:3:13: 3:19
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+ // ty::Const
+ // + ty: u32
+ // + val: Value(Scalar(0x00000002))
+ // mir::Constant
+- // + span: $DIR/tuple_literal_propagation.rs:3:17: 3:18
++ // + span: $DIR/tuple_literal_propagation.rs:3:13: 3:19
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
+ StorageLive(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+ StorageLive(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
+- _3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
++ _3 = (const 1u32, const 2u32); // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
++ // ty::Const
++ // + ty: u32
++ // + val: Value(Scalar(0x00000001))
++ // mir::Constant
++ // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
++ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
++ // ty::Const
++ // + ty: u32
++ // + val: Value(Scalar(0x00000002))
++ // mir::Constant
++ // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
++ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
+ _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+ // ty::Const
+ // + ty: fn((u32, u32)) {consume}
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/tuple_literal_propagation.rs:5:5: 5:12
+ // + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(Scalar(<ZST>)) }
+ }
+
+ bb1: {
+ StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:5:14: 5:15
+ StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:5:15: 5:16
+ _0 = const (); // scope 0 at $DIR/tuple_literal_propagation.rs:2:11: 6:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/tuple_literal_propagation.rs:2:11: 6:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:6:1: 6:2
+ return; // scope 0 at $DIR/tuple_literal_propagation.rs:6:2: 6:2
+ }
+ }
+
}
bb0: {
-- StorageLive(_2); // bb0[0]: scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
-- _2 = _1; // bb0[1]: scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
-- _0 = _2; // bb0[2]: scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
-- StorageDead(_2); // bb0[3]: scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
-+ nop; // bb0[0]: scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
-+ nop; // bb0[1]: scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
-+ _0 = _1; // bb0[2]: scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
-+ nop; // bb0[3]: scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
- return; // bb0[4]: scope 0 at $DIR/copy_propagation.rs:6:2: 6:2
+- StorageLive(_2); // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
+- _2 = _1; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
+- _0 = _2; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
+- StorageDead(_2); // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
++ nop; // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
++ nop; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
++ _0 = _1; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
++ nop; // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
+ return; // scope 0 at $DIR/copy_propagation.rs:6:2: 6:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
- _2 = _1; // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
- _1 = const 123i32; // bb0[2]: scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
+ StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
+ _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
+ _1 = const 123i32; // scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000007b))
// mir::Constant
// + span: $DIR/copy_propagation_arg.rs:29:5: 29:12
// + literal: Const { ty: i32, val: Value(Scalar(0x0000007b)) }
- _0 = _2; // bb0[3]: scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
- StorageDead(_2); // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
- return; // bb0[5]: scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
+ _0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
+ StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
+ return; // scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
}
}
let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
- _3 = _1; // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
- _2 = const dummy(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
+ StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
+ StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
+ _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
+ _2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
// ty::Const
// + ty: fn(u8) -> u8 {dummy}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_3); // bb1[0]: scope 0 at $DIR/copy_propagation_arg.rs:16:12: 16:13
- StorageDead(_2); // bb1[1]: scope 0 at $DIR/copy_propagation_arg.rs:16:13: 16:14
- _1 = const 5u8; // bb1[2]: scope 0 at $DIR/copy_propagation_arg.rs:17:5: 17:10
+ StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:16:12: 16:13
+ StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:16:13: 16:14
+ _1 = const 5u8; // scope 0 at $DIR/copy_propagation_arg.rs:17:5: 17:10
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x05))
// mir::Constant
// + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
// + literal: Const { ty: u8, val: Value(Scalar(0x05)) }
- _0 = const (); // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2
+ _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/copy_propagation_arg.rs:15:19: 18:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:18:2: 18:2
+ return; // scope 0 at $DIR/copy_propagation_arg.rs:18:2: 18:2
}
}
let mut _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
- _2 = _1; // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
- _1 = move _2; // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
- StorageDead(_2); // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
- _0 = const (); // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2
+ StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+ _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+ _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
+ StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+ _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/copy_propagation_arg.rs:21:20: 24:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb0[5]: scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2
+ return; // scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2
}
}
let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
- _3 = _1; // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
- _2 = const dummy(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
+ StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
+ StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
+ _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
+ _2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
// ty::Const
// + ty: fn(u8) -> u8 {dummy}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_3); // bb1[0]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
- _1 = move _2; // bb1[1]: scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
- StorageDead(_2); // bb1[2]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
- _0 = const (); // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2
+ StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
+ _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
+ StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
+ _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/copy_propagation_arg.rs:9:19: 12:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2
+ return; // scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2
}
}
let mut _2: usize; // in scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
- _2 = _1; // bb0[1]: scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
-- _0 = Baz { x: move _2, y: const 0f32, z: const false }; // bb0[2]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
-+ (_0.0: usize) = move _2; // bb0[2]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
-+ (_0.1: f32) = const 0f32; // bb0[3]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
+ StorageLive(_2); // scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
+ _2 = _1; // scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
+- _0 = Baz { x: move _2, y: const 0f32, z: const false }; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++ (_0.0: usize) = move _2; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++ (_0.1: f32) = const 0f32; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
// ty::Const
// + ty: f32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/deaggregator_test.rs:9:20: 9:23
// + literal: Const { ty: f32, val: Value(Scalar(0x00000000)) }
-+ (_0.2: bool) = const false; // bb0[4]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++ (_0.2: bool) = const false; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/deaggregator_test.rs:9:28: 9:33
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-- StorageDead(_2); // bb0[3]: scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
-- return; // bb0[4]: scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
-+ StorageDead(_2); // bb0[5]: scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
-+ return; // bb0[6]: scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
+ StorageDead(_2); // scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
+ return; // scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
}
}
let mut _2: usize; // in scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
- _2 = _1; // bb0[1]: scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
-- _0 = Baz::Foo { x: move _2 }; // bb0[2]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
-- StorageDead(_2); // bb0[3]: scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
-- return; // bb0[4]: scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
-+ ((_0 as Foo).0: usize) = move _2; // bb0[2]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
-+ discriminant(_0) = 1; // bb0[3]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
-+ StorageDead(_2); // bb0[4]: scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
-+ return; // bb0[5]: scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
+ StorageLive(_2); // scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
+ _2 = _1; // scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
+- _0 = Baz::Foo { x: move _2 }; // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
++ ((_0 as Foo).0: usize) = move _2; // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
++ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
+ StorageDead(_2); // scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
+ return; // scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
}
}
let mut _5: i32; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
bb0: {
- StorageLive(_3); // bb0[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
- _3 = _1; // bb0[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
- switchInt(_3) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+ StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
+ _3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
+ switchInt(_3) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
}
bb1: {
- StorageLive(_5); // bb1[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
- _5 = _2; // bb1[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
-- _0 = Foo::B(move _5); // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
-- StorageDead(_5); // bb1[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
-- goto -> bb3; // bb1[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
-+ ((_0 as B).0: i32) = move _5; // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
-+ discriminant(_0) = 1; // bb1[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
-+ StorageDead(_5); // bb1[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
-+ goto -> bb3; // bb1[5]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+ StorageLive(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
+ _5 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
+- _0 = Foo::B(move _5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
++ ((_0 as B).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
++ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
+ StorageDead(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
+ goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
}
bb2: {
- StorageLive(_4); // bb2[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
- _4 = _2; // bb2[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
-- _0 = Foo::A(move _4); // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
-- StorageDead(_4); // bb2[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
-- goto -> bb3; // bb2[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
-+ ((_0 as A).0: i32) = move _4; // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
-+ discriminant(_0) = 0; // bb2[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
-+ StorageDead(_4); // bb2[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
-+ goto -> bb3; // bb2[5]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+ StorageLive(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
+ _4 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
+- _0 = Foo::A(move _4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
++ ((_0 as A).0: i32) = move _4; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
++ discriminant(_0) = 0; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
+ StorageDead(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
+ goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
}
bb3: {
- StorageDead(_3); // bb3[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2
- return; // bb3[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2
+ StorageDead(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2
+ return; // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2
}
}
let mut _5: i32; // in scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
- _3 = _1; // bb0[2]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
-- _2 = Foo::A(move _3); // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-- StorageDead(_3); // bb0[4]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
-- StorageLive(_4); // bb0[5]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-- StorageLive(_5); // bb0[6]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-- _5 = _1; // bb0[7]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-- _4 = Foo::A(move _5); // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-- StorageDead(_5); // bb0[9]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
-- _0 = [move _2, move _4]; // bb0[10]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
-- StorageDead(_4); // bb0[11]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-- StorageDead(_2); // bb0[12]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-- return; // bb0[13]: scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
-+ ((_2 as A).0: i32) = move _3; // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-+ discriminant(_2) = 0; // bb0[4]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-+ StorageDead(_3); // bb0[5]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
-+ StorageLive(_4); // bb0[6]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+ StorageLive(_5); // bb0[7]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-+ _5 = _1; // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-+ ((_4 as A).0: i32) = move _5; // bb0[9]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+ discriminant(_4) = 0; // bb0[10]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+ StorageDead(_5); // bb0[11]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
-+ _0 = [move _2, move _4]; // bb0[12]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
-+ StorageDead(_4); // bb0[13]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-+ StorageDead(_2); // bb0[14]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-+ return; // bb0[15]: scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
+ StorageLive(_2); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
+ StorageLive(_3); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
+ _3 = _1; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
+- _2 = Foo::A(move _3); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
++ ((_2 as A).0: i32) = move _3; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
++ discriminant(_2) = 0; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
+ StorageDead(_3); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
+ StorageLive(_4); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
+ StorageLive(_5); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
+ _5 = _1; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
+- _4 = Foo::A(move _5); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
++ ((_4 as A).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
++ discriminant(_4) = 0; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
+ StorageDead(_5); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
+ _0 = [move _2, move _4]; // scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
+ StorageDead(_4); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
+ StorageDead(_2); // scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
+ return; // scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
}
}
}
bb0: {
- FakeRead(ForMatchedPlace, _1); // bb0[0]: scope 0 at $DIR/exponential-or.rs:7:11: 7:12
- switchInt((_1.0: u32)) -> [1u32: bb2, 4u32: bb2, otherwise: bb1]; // bb0[1]: scope 0 at $DIR/exponential-or.rs:8:15: 8:16
+ FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/exponential-or.rs:7:11: 7:12
+ switchInt((_1.0: u32)) -> [1u32: bb2, 4u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:15: 8:16
}
bb1: {
- _0 = const 0u32; // bb1[0]: scope 0 at $DIR/exponential-or.rs:9:14: 9:15
+ _0 = const 0u32; // scope 0 at $DIR/exponential-or.rs:9:14: 9:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/exponential-or.rs:9:14: 9:15
// + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- goto -> bb10; // bb1[1]: scope 0 at $DIR/exponential-or.rs:7:5: 10:6
+ goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
}
bb2: {
- _2 = discriminant((_1.2: std::option::Option<i32>)); // bb2[0]: scope 0 at $DIR/exponential-or.rs:8:37: 8:48
- switchInt(move _2) -> [0isize: bb4, 1isize: bb3, otherwise: bb1]; // bb2[1]: scope 0 at $DIR/exponential-or.rs:8:37: 8:48
+ _2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
+ switchInt(move _2) -> [0isize: bb4, 1isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
}
bb3: {
- switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1i32: bb4, 8i32: bb4, otherwise: bb1]; // bb3[0]: scope 0 at $DIR/exponential-or.rs:8:42: 8:43
+ switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1i32: bb4, 8i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:42: 8:43
}
bb4: {
- _5 = Le(const 6u32, (_1.3: u32)); // bb4[0]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+ _5 = Le(const 6u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000006))
// mir::Constant
// + span: $DIR/exponential-or.rs:8:62: 8:67
// + literal: Const { ty: u32, val: Value(Scalar(0x00000006)) }
- switchInt(move _5) -> [false: bb6, otherwise: bb5]; // bb4[1]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+ switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
}
bb5: {
- _6 = Le((_1.3: u32), const 9u32); // bb5[0]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+ _6 = Le((_1.3: u32), const 9u32); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000009))
// mir::Constant
// + span: $DIR/exponential-or.rs:8:62: 8:67
// + literal: Const { ty: u32, val: Value(Scalar(0x00000009)) }
- switchInt(move _6) -> [false: bb6, otherwise: bb8]; // bb5[1]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+ switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
}
bb6: {
- _3 = Le(const 13u32, (_1.3: u32)); // bb6[0]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+ _3 = Le(const 13u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x0000000d))
// mir::Constant
// + span: $DIR/exponential-or.rs:8:70: 8:77
// + literal: Const { ty: u32, val: Value(Scalar(0x0000000d)) }
- switchInt(move _3) -> [false: bb1, otherwise: bb7]; // bb6[1]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+ switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
}
bb7: {
- _4 = Le((_1.3: u32), const 16u32); // bb7[0]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+ _4 = Le((_1.3: u32), const 16u32); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000010))
// mir::Constant
// + span: $DIR/exponential-or.rs:8:70: 8:77
// + literal: Const { ty: u32, val: Value(Scalar(0x00000010)) }
- switchInt(move _4) -> [false: bb1, otherwise: bb8]; // bb7[1]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+ switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
}
bb8: {
- falseEdges -> [real: bb9, imaginary: bb1]; // bb8[0]: scope 0 at $DIR/exponential-or.rs:8:9: 8:79
+ falseEdges -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/exponential-or.rs:8:9: 8:79
}
bb9: {
- StorageLive(_7); // bb9[0]: scope 0 at $DIR/exponential-or.rs:8:10: 8:21
- _7 = (_1.0: u32); // bb9[1]: scope 0 at $DIR/exponential-or.rs:8:10: 8:21
- StorageLive(_8); // bb9[2]: scope 0 at $DIR/exponential-or.rs:8:57: 8:78
- _8 = (_1.3: u32); // bb9[3]: scope 0 at $DIR/exponential-or.rs:8:57: 8:78
- StorageLive(_9); // bb9[4]: scope 1 at $DIR/exponential-or.rs:8:83: 8:84
- _9 = _7; // bb9[5]: scope 1 at $DIR/exponential-or.rs:8:83: 8:84
- StorageLive(_10); // bb9[6]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
- _10 = _8; // bb9[7]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
- _0 = BitXor(move _9, move _10); // bb9[8]: scope 1 at $DIR/exponential-or.rs:8:83: 8:88
- StorageDead(_10); // bb9[9]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
- StorageDead(_9); // bb9[10]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
- StorageDead(_8); // bb9[11]: scope 0 at $DIR/exponential-or.rs:8:88: 8:89
- StorageDead(_7); // bb9[12]: scope 0 at $DIR/exponential-or.rs:8:88: 8:89
- goto -> bb10; // bb9[13]: scope 0 at $DIR/exponential-or.rs:7:5: 10:6
+ StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
+ _7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
+ StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
+ _8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
+ StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
+ _9 = _7; // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
+ StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+ _10 = _8; // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+ _0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
+ StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+ StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+ StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
+ StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
+ goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
}
bb10: {
- return; // bb10[0]: scope 0 at $DIR/exponential-or.rs:11:2: 11:2
+ return; // scope 0 at $DIR/exponential-or.rs:11:2: 11:2
}
}
}
bb0: {
- _9 = discriminant((*_1)); // bb0[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
- switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // bb0[1]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ _9 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb2 (cleanup): {
- nop; // bb2[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
- goto -> bb8; // bb2[1]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}
bb3: {
- StorageDead(_5); // bb3[0]: scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
- StorageDead(_4); // bb3[1]: scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
- drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // bb3[2]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
+ StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
+ drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}
bb4: {
- nop; // bb4[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
- goto -> bb9; // bb4[1]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}
bb5: {
- return; // bb5[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb6: {
- return; // bb6[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb7: {
- goto -> bb10; // bb7[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ goto -> bb10; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb8 (cleanup): {
- goto -> bb1; // bb8[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}
bb9: {
- goto -> bb5; // bb9[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+ goto -> bb5; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}
bb10: {
- goto -> bb6; // bb10[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb11: {
- StorageLive(_4); // bb11[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
- StorageLive(_5); // bb11[1]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
- goto -> bb3; // bb11[2]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
bb12: {
- return; // bb12[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
}
}
bb0: {
- StorageLive(_3); // bb0[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
- _3 = Foo(const 5i32); // bb0[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
+ StorageLive(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
+ _3 = Foo(const 5i32); // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000005))
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:23:21: 23:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
- StorageLive(_4); // bb0[2]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
- _4 = Bar(const 6i32); // bb0[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
+ StorageLive(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
+ _4 = Bar(const 6i32); // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000006))
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:24:21: 24:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000006)) }
- StorageLive(_5); // bb0[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
- StorageLive(_6); // bb0[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
- _6 = (); // bb0[6]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
- _5 = yield(move _6) -> [resume: bb2, drop: bb4]; // bb0[7]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+ StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+ StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+ _6 = (); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+ _5 = yield(move _6) -> [resume: bb2, drop: bb4]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
+ resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
}
bb2: {
- StorageDead(_6); // bb2[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
- StorageDead(_5); // bb2[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
- StorageLive(_7); // bb2[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
- StorageLive(_8); // bb2[3]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
- _8 = move _3; // bb2[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
- _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9]; // bb2[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
+ StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
+ StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
+ StorageLive(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
+ StorageLive(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
+ _8 = move _3; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
+ _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
// ty::Const
// + ty: fn(Foo) {take::<Foo>}
// + val: Value(Scalar(<ZST>))
}
bb3 (cleanup): {
- StorageDead(_3); // bb3[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- drop(_1) -> bb1; // bb3[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ drop(_1) -> bb1; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
}
bb4: {
- StorageDead(_6); // bb4[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
- StorageDead(_5); // bb4[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
- StorageDead(_4); // bb4[2]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- drop(_3) -> [return: bb5, unwind: bb3]; // bb4[3]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
+ StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
+ StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ drop(_3) -> [return: bb5, unwind: bb3]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
}
bb5: {
- StorageDead(_3); // bb5[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- drop(_1) -> [return: bb6, unwind: bb1]; // bb5[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ drop(_1) -> [return: bb6, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
}
bb6: {
- generator_drop; // bb6[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
+ generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
}
bb7: {
- StorageDead(_8); // bb7[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
- StorageDead(_7); // bb7[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
- StorageLive(_9); // bb7[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
- StorageLive(_10); // bb7[3]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
- _10 = move _4; // bb7[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
- _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11]; // bb7[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
+ StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
+ StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
+ StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
+ StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
+ _10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
+ _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
// ty::Const
// + ty: fn(Bar) {take::<Bar>}
// + val: Value(Scalar(<ZST>))
}
bb8 (cleanup): {
- StorageDead(_4); // bb8[0]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- StorageDead(_3); // bb8[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- drop(_1) -> bb1; // bb8[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ drop(_1) -> bb1; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
}
bb9 (cleanup): {
- StorageDead(_8); // bb9[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
- StorageDead(_7); // bb9[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
- goto -> bb8; // bb9[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
+ StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
+ StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
+ goto -> bb8; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
}
bb10: {
- StorageDead(_10); // bb10[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
- StorageDead(_9); // bb10[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
- _0 = const (); // bb10[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
+ StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
+ StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
+ _0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_4); // bb10[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- StorageDead(_3); // bb10[4]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
- drop(_1) -> [return: bb12, unwind: bb1]; // bb10[5]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+ drop(_1) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
}
bb11 (cleanup): {
- StorageDead(_10); // bb11[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
- StorageDead(_9); // bb11[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
- goto -> bb8; // bb11[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
+ StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
+ StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
+ goto -> bb8; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
}
bb12: {
- return; // bb12[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6
+ return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6
}
}
}
bb0: {
- _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))); // bb0[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- switchInt(move _11) -> [0u32: bb1, 3u32: bb5, otherwise: bb6]; // bb0[1]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))); // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ switchInt(move _11) -> [0u32: bb1, 3u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
}
bb1: {
- _10 = move _2; // bb1[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- nop; // bb1[1]: scope 0 at $DIR/generator-tiny.rs:19:13: 19:15
- (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}])) as variant#3).0: HasDrop) = HasDrop; // bb1[2]: scope 0 at $DIR/generator-tiny.rs:19:18: 19:25
- StorageLive(_4); // bb1[3]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
- goto -> bb2; // bb1[4]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+ _10 = move _2; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ nop; // scope 0 at $DIR/generator-tiny.rs:19:13: 19:15
+ (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator-tiny.rs:19:18: 19:25
+ StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+ goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
}
bb2: {
- StorageLive(_6); // bb2[0]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
- StorageLive(_7); // bb2[1]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
- _7 = (); // bb2[2]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
- _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7); // bb2[3]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
- discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))) = 3; // bb2[4]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
- return; // bb2[5]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ StorageLive(_6); // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ StorageLive(_7); // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ _7 = (); // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7); // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))) = 3; // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+ return; // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
}
bb3: {
- StorageDead(_7); // bb3[0]: scope 1 at $DIR/generator-tiny.rs:21:17: 21:18
- StorageDead(_6); // bb3[1]: scope 1 at $DIR/generator-tiny.rs:21:18: 21:19
- StorageLive(_8); // bb3[2]: scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
- _8 = const callee() -> bb4; // bb3[3]: scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
+ StorageDead(_7); // scope 1 at $DIR/generator-tiny.rs:21:17: 21:18
+ StorageDead(_6); // scope 1 at $DIR/generator-tiny.rs:21:18: 21:19
+ StorageLive(_8); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
+ _8 = const callee() -> bb4; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
// ty::Const
// + ty: fn() {callee}
// + val: Value(Scalar(<ZST>))
}
bb4: {
- StorageDead(_8); // bb4[0]: scope 1 at $DIR/generator-tiny.rs:22:21: 22:22
- _5 = const (); // bb4[1]: scope 1 at $DIR/generator-tiny.rs:20:14: 23:10
+ StorageDead(_8); // scope 1 at $DIR/generator-tiny.rs:22:21: 22:22
+ _5 = const (); // scope 1 at $DIR/generator-tiny.rs:20:14: 23:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/generator-tiny.rs:20:14: 23:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb2; // bb4[2]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+ goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
}
bb5: {
- StorageLive(_4); // bb5[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- StorageLive(_6); // bb5[1]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- StorageLive(_7); // bb5[2]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- _6 = move _2; // bb5[3]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
- goto -> bb3; // bb5[4]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ _6 = move _2; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
}
bb6: {
- unreachable; // bb6[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+ unreachable; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10
- _1 = const foo; // bb0[1]: scope 0 at $DIR/inline-any-operand.rs:11:13: 11:16
+ StorageLive(_1); // scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10
+ _1 = const foo; // scope 0 at $DIR/inline-any-operand.rs:11:13: 11:16
// ty::Const
// + ty: fn(i32, i32) -> bool {foo}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/inline-any-operand.rs:11:13: 11:16
// + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(Scalar(<ZST>)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
- _2 = _1; // bb0[3]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
- _3 = const 1i32; // bb0[4]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
+ StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
+ _2 = _1; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
+ _3 = const 1i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/inline-any-operand.rs:12:7: 12:8
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- _4 = const -1i32; // bb0[5]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
+ _4 = const -1i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
// ty::Const
// + ty: i32
// + val: Value(Scalar(0xffffffff))
// mir::Constant
// + span: $DIR/inline-any-operand.rs:12:10: 12:12
// + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
- _0 = Eq(move _3, move _4); // bb0[6]: scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
- StorageDead(_2); // bb0[7]: scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
- StorageDead(_1); // bb0[8]: scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
- return; // bb0[9]: scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2
+ _0 = Eq(move _3, move _4); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
+ StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
+ StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
+ return; // scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2
}
}
}
bb0: {
- StorageLive(_3); // bb0[0]: scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10
- _3 = [closure@foo::<T>::{{closure}}#0]; // bb0[1]: scope 0 at $DIR/inline-closure-borrows-arg.rs:12:13: 15:6
+ StorageLive(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10
+ _3 = [closure@foo::<T>::{{closure}}#0]; // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:13: 15:6
// closure
// + def_id: DefId(0:6 ~ inline_closure_borrows_arg[317d]::foo[0]::{{closure}}[0])
// + substs: [
// for<'r, 's> extern "rust-call" fn((&'r i32, &'s i32)) -> i32,
// (),
// ]
- StorageLive(_4); // bb0[2]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
- _4 = &_3; // bb0[3]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
- StorageLive(_5); // bb0[4]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
- StorageLive(_6); // bb0[5]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
- _6 = &(*_2); // bb0[6]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
- StorageLive(_7); // bb0[7]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
- _7 = &(*_2); // bb0[8]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
- _5 = (move _6, move _7); // bb0[9]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
- _8 = move (_5.0: &i32); // bb0[10]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
- _9 = move (_5.1: &i32); // bb0[11]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
- _0 = (*_8); // bb0[12]: scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18
- StorageDead(_7); // bb0[13]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
- StorageDead(_6); // bb0[14]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
- StorageDead(_5); // bb0[15]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
- StorageDead(_4); // bb0[16]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
- StorageDead(_3); // bb0[17]: scope 0 at $DIR/inline-closure-borrows-arg.rs:17:1: 17:2
- return; // bb0[18]: scope 0 at $DIR/inline-closure-borrows-arg.rs:17:2: 17:2
+ StorageLive(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
+ _4 = &_3; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
+ StorageLive(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+ StorageLive(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
+ _6 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
+ StorageLive(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
+ _7 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
+ _5 = (move _6, move _7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+ _8 = move (_5.0: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+ _9 = move (_5.1: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+ _0 = (*_8); // scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18
+ StorageDead(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+ StorageDead(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+ StorageDead(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+ StorageDead(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+ StorageDead(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:1: 17:2
+ return; // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:2: 17:2
}
}
}
bb0: {
- StorageLive(_3); // bb0[0]: scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
- StorageLive(_4); // bb0[1]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
- _4 = &_2; // bb0[2]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
- StorageLive(_5); // bb0[3]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
- _5 = &_1; // bb0[4]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
- _3 = [closure@foo::<T>::{{closure}}#0] { q: move _4, t: move _5 }; // bb0[5]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+ StorageLive(_3); // scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
+ StorageLive(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+ _4 = &_2; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+ StorageLive(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+ _5 = &_1; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+ _3 = [closure@foo::<T>::{{closure}}#0] { q: move _4, t: move _5 }; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
// closure
// + def_id: DefId(0:6 ~ inline_closure_captures[317d]::foo[0]::{{closure}}[0])
// + substs: [
// extern "rust-call" fn((i32,)) -> (i32, T),
// (&i32, &T),
// ]
- StorageDead(_5); // bb0[6]: scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
- StorageDead(_4); // bb0[7]: scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
- StorageLive(_6); // bb0[8]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
- _6 = &_3; // bb0[9]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
- StorageLive(_7); // bb0[10]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
- StorageLive(_8); // bb0[11]: scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
- _8 = _2; // bb0[12]: scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
- _7 = (move _8,); // bb0[13]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
- _11 = move (_7.0: i32); // bb0[14]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
- StorageLive(_9); // bb0[15]: scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
- _9 = (*((*_6).0: &i32)); // bb0[16]: scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
- StorageLive(_10); // bb0[17]: scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
- _10 = (*((*_6).1: &T)); // bb0[18]: scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
- (_0.0: i32) = move _9; // bb0[19]: scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
- (_0.1: T) = move _10; // bb0[20]: scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
- StorageDead(_10); // bb0[21]: scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
- StorageDead(_9); // bb0[22]: scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
- StorageDead(_8); // bb0[23]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
- StorageDead(_7); // bb0[24]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
- StorageDead(_6); // bb0[25]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
- StorageDead(_3); // bb0[26]: scope 0 at $DIR/inline-closure-captures.rs:13:1: 13:2
- return; // bb0[27]: scope 0 at $DIR/inline-closure-captures.rs:13:2: 13:2
+ StorageDead(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
+ StorageDead(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
+ StorageLive(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
+ _6 = &_3; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
+ StorageLive(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+ StorageLive(_8); // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
+ _8 = _2; // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
+ _7 = (move _8,); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+ _11 = move (_7.0: i32); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+ StorageLive(_9); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
+ _9 = (*((*_6).0: &i32)); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
+ StorageLive(_10); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
+ _10 = (*((*_6).1: &T)); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
+ (_0.0: i32) = move _9; // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
+ (_0.1: T) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
+ StorageDead(_10); // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
+ StorageDead(_9); // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
+ StorageDead(_8); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+ StorageDead(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+ StorageDead(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+ StorageDead(_3); // scope 0 at $DIR/inline-closure-captures.rs:13:1: 13:2
+ return; // scope 0 at $DIR/inline-closure-captures.rs:13:2: 13:2
}
}
}
bb0: {
- StorageLive(_3); // bb0[0]: scope 0 at $DIR/inline-closure.rs:11:9: 11:10
- _3 = [closure@foo::<T>::{{closure}}#0]; // bb0[1]: scope 0 at $DIR/inline-closure.rs:11:13: 11:24
+ StorageLive(_3); // scope 0 at $DIR/inline-closure.rs:11:9: 11:10
+ _3 = [closure@foo::<T>::{{closure}}#0]; // scope 0 at $DIR/inline-closure.rs:11:13: 11:24
// closure
// + def_id: DefId(0:6 ~ inline_closure[317d]::foo[0]::{{closure}}[0])
// + substs: [
// extern "rust-call" fn((i32, i32)) -> i32,
// (),
// ]
- StorageLive(_4); // bb0[2]: scope 1 at $DIR/inline-closure.rs:12:5: 12:6
- _4 = &_3; // bb0[3]: scope 1 at $DIR/inline-closure.rs:12:5: 12:6
- StorageLive(_5); // bb0[4]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
- StorageLive(_6); // bb0[5]: scope 1 at $DIR/inline-closure.rs:12:7: 12:8
- _6 = _2; // bb0[6]: scope 1 at $DIR/inline-closure.rs:12:7: 12:8
- StorageLive(_7); // bb0[7]: scope 1 at $DIR/inline-closure.rs:12:10: 12:11
- _7 = _2; // bb0[8]: scope 1 at $DIR/inline-closure.rs:12:10: 12:11
- _5 = (move _6, move _7); // bb0[9]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
- _8 = move (_5.0: i32); // bb0[10]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
- _9 = move (_5.1: i32); // bb0[11]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
- _0 = _8; // bb0[12]: scope 2 at $DIR/inline-closure.rs:11:22: 11:24
- StorageDead(_7); // bb0[13]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
- StorageDead(_6); // bb0[14]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
- StorageDead(_5); // bb0[15]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
- StorageDead(_4); // bb0[16]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
- StorageDead(_3); // bb0[17]: scope 0 at $DIR/inline-closure.rs:13:1: 13:2
- return; // bb0[18]: scope 0 at $DIR/inline-closure.rs:13:2: 13:2
+ StorageLive(_4); // scope 1 at $DIR/inline-closure.rs:12:5: 12:6
+ _4 = &_3; // scope 1 at $DIR/inline-closure.rs:12:5: 12:6
+ StorageLive(_5); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+ StorageLive(_6); // scope 1 at $DIR/inline-closure.rs:12:7: 12:8
+ _6 = _2; // scope 1 at $DIR/inline-closure.rs:12:7: 12:8
+ StorageLive(_7); // scope 1 at $DIR/inline-closure.rs:12:10: 12:11
+ _7 = _2; // scope 1 at $DIR/inline-closure.rs:12:10: 12:11
+ _5 = (move _6, move _7); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+ _8 = move (_5.0: i32); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+ _9 = move (_5.1: i32); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+ _0 = _8; // scope 2 at $DIR/inline-closure.rs:11:22: 11:24
+ StorageDead(_7); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+ StorageDead(_6); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+ StorageDead(_5); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+ StorageDead(_4); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+ StorageDead(_3); // scope 0 at $DIR/inline-closure.rs:13:1: 13:2
+ return; // scope 0 at $DIR/inline-closure.rs:13:2: 13:2
}
}
+ }
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- _2 = Box(std::vec::Vec<u32>); // bb0[2]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-- (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ _4 = &mut (*_2); // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
+ StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+ StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+ _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+- (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
// ty::Const
- // + ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}
- // + val: Value(Scalar(<ZST>))
- }
-
- bb1 (cleanup): {
-- resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
+- resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb2: {
-- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-- _0 = const (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
-+ ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
- // ty::Const
++ ((*_4).1: usize) = const 0usize; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
++ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-+ _1 = move _2; // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-+ StorageDead(_2); // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-+ _0 = const (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
-+ // ty::Const
+ _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+ StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+ // ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+ drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+- drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb3: {
-- StorageDead(_1); // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-- return; // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+- StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+- return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+ bb1 (cleanup): {
-+ resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
++ resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
}
- bb4 (cleanup): {
-- _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+- _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // ty::Const
- // + ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}
- // + val: Value(Scalar(<ZST>))
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }
+ bb2: {
-+ StorageDead(_1); // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+ return; // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
++ StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++ return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
}
+ }
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- _2 = Box(std::vec::Vec<u32>); // bb0[2]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-- (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ _4 = &mut (*_2); // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
+ StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+ StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+ _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+- (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
// ty::Const
- // + ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}
- // + val: Value(Scalar(<ZST>))
- }
-
- bb1 (cleanup): {
-- resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
+- resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb2: {
-- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-- _0 = const (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
-+ ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
- // ty::Const
++ ((*_4).1: usize) = const 0usize; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
++ // ty::Const
+ // + ty: usize
+ // + val: Value(Scalar(0x0000000000000000))
+ // mir::Constant
+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-+ _1 = move _2; // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-+ StorageDead(_2); // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-+ _0 = const (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
-+ // ty::Const
+ _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+ StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+ // ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+ drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+- drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb3: {
-- StorageDead(_1); // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-- return; // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+- StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+- return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+ bb1 (cleanup): {
-+ resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
++ resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
}
- bb4 (cleanup): {
-- _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+- _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // ty::Const
- // + ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}
- // + val: Value(Scalar(<ZST>))
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }
+ bb2: {
-+ StorageDead(_1); // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+ return; // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
++ StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++ return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-retag.rs:11:9: 11:10
- _1 = const foo; // bb0[1]: scope 0 at $DIR/inline-retag.rs:11:13: 11:16
+ StorageLive(_1); // scope 0 at $DIR/inline-retag.rs:11:9: 11:10
+ _1 = const foo; // scope 0 at $DIR/inline-retag.rs:11:13: 11:16
// ty::Const
// + ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/inline-retag.rs:11:13: 11:16
// + literal: Const { ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}, val: Value(Scalar(<ZST>)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/inline-retag.rs:12:5: 12:6
- _2 = _1; // bb0[3]: scope 1 at $DIR/inline-retag.rs:12:5: 12:6
- StorageLive(_3); // bb0[4]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- StorageLive(_4); // bb0[5]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- _10 = const bar::promoted[1]; // bb0[6]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ StorageLive(_2); // scope 1 at $DIR/inline-retag.rs:12:5: 12:6
+ _2 = _1; // scope 1 at $DIR/inline-retag.rs:12:5: 12:6
+ StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ StorageLive(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ _10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[1]))
// mir::Constant
// + span: $DIR/inline-retag.rs:12:7: 12:9
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[1])) }
- Retag(_10); // bb0[7]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- _4 = &(*_10); // bb0[8]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- Retag(_4); // bb0[9]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- _3 = &(*_4); // bb0[10]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- Retag(_3); // bb0[11]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
- StorageLive(_6); // bb0[12]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- StorageLive(_7); // bb0[13]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- _9 = const bar::promoted[0]; // bb0[14]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ Retag(_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ _4 = &(*_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ Retag(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ _3 = &(*_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ Retag(_3); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+ StorageLive(_6); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ StorageLive(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ _9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/inline-retag.rs:12:11: 12:14
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[0])) }
- Retag(_9); // bb0[15]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- _7 = &(*_9); // bb0[16]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- Retag(_7); // bb0[17]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- _6 = &(*_7); // bb0[18]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- Retag(_6); // bb0[19]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
- Retag(_3); // bb0[20]: scope 2 at $DIR/inline-retag.rs:16:1: 18:2
- Retag(_6); // bb0[21]: scope 2 at $DIR/inline-retag.rs:16:1: 18:2
- StorageLive(_11); // bb0[22]: scope 2 at $DIR/inline-retag.rs:17:5: 17:7
- _11 = (*_3); // bb0[23]: scope 2 at $DIR/inline-retag.rs:17:5: 17:7
- StorageLive(_12); // bb0[24]: scope 2 at $DIR/inline-retag.rs:17:11: 17:13
- _12 = (*_6); // bb0[25]: scope 2 at $DIR/inline-retag.rs:17:11: 17:13
- _0 = Eq(move _11, move _12); // bb0[26]: scope 2 at $DIR/inline-retag.rs:17:5: 17:13
- StorageDead(_12); // bb0[27]: scope 2 at $DIR/inline-retag.rs:17:12: 17:13
- StorageDead(_11); // bb0[28]: scope 2 at $DIR/inline-retag.rs:17:12: 17:13
- StorageDead(_6); // bb0[29]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
- StorageDead(_3); // bb0[30]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
- StorageDead(_2); // bb0[31]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
- StorageDead(_1); // bb0[32]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
- StorageDead(_7); // bb0[33]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
- StorageDead(_4); // bb0[34]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
- return; // bb0[35]: scope 0 at $DIR/inline-retag.rs:13:2: 13:2
+ Retag(_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ _7 = &(*_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ Retag(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ _6 = &(*_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ Retag(_6); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+ Retag(_3); // scope 2 at $DIR/inline-retag.rs:16:1: 18:2
+ Retag(_6); // scope 2 at $DIR/inline-retag.rs:16:1: 18:2
+ StorageLive(_11); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ _11 = (*_3); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ StorageLive(_12); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _12 = (*_6); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline-retag.rs:17:5: 17:13
+ StorageDead(_12); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+ StorageDead(_11); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+ StorageDead(_6); // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+ StorageDead(_3); // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+ StorageDead(_2); // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+ StorageDead(_1); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+ StorageDead(_7); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+ StorageDead(_4); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+ return; // scope 0 at $DIR/inline-retag.rs:13:2: 13:2
}
}
+ }
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
-- _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1; // bb0[1]: scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
-+ _1 = const 123u32; // bb0[1]: scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
+ StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
+- _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
++ _1 = const 123u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
// ty::Const
- // + ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}
- // + val: Value(Scalar(<ZST>))
- }
-
- bb1: {
-- _0 = const (); // bb1[0]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
+ // + span: $DIR/inline-specialization.rs:14:31: 14:34
+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000007b)) }
-+ _0 = const (); // bb0[2]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
+ _0 = const (); // scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/inline-specialization.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageDead(_1); // bb1[1]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
-- return; // bb1[2]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
-+ StorageDead(_1); // bb0[3]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
-+ return; // bb0[4]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
+ StorageDead(_1); // scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
+ return; // scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
}
}
let mut _2: &dyn X; // in scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
- _2 = &(*_1); // bb0[1]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
- _0 = const <dyn X as X>::y(move _2) -> bb1; // bb0[2]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10
+ StorageLive(_2); // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
+ _2 = &(*_1); // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
+ _0 = const <dyn X as X>::y(move _2) -> bb1; // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10
// ty::Const
// + ty: for<'r> fn(&'r dyn X) -> u32 {<dyn X as X>::y}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_2); // bb1[0]: scope 0 at $DIR/inline-trait-method.rs:9:9: 9:10
- return; // bb1[1]: scope 0 at $DIR/inline-trait-method.rs:10:2: 10:2
+ StorageDead(_2); // scope 0 at $DIR/inline-trait-method.rs:9:9: 9:10
+ return; // scope 0 at $DIR/inline-trait-method.rs:10:2: 10:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
- _3 = &(*_1); // bb0[2]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
- _2 = move _3 as &dyn X (Pointer(Unsize)); // bb0[3]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
- StorageDead(_3); // bb0[4]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
- _0 = const <dyn X as X>::y(move _2) -> bb1; // bb0[5]: scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+ StorageLive(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+ StorageLive(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+ _3 = &(*_1); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+ _2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+ StorageDead(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+ _0 = const <dyn X as X>::y(move _2) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
// ty::Const
// + ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_2); // bb1[0]: scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12
- return; // bb1[1]: scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2
+ StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12
+ return; // scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2
}
}
--- /dev/null
+// EMIT_MIR rustc.a.Inline.after.mir
+pub fn a<T>(x: &mut [T]) -> &mut [T] {
+ x.as_mut()
+}
+
+// EMIT_MIR rustc.b.Inline.after.mir
+pub fn b<T>(x: &mut Box<T>) -> &mut T {
+ x.as_mut()
+}
+
+// EMIT_MIR rustc.c.Inline.after.mir
+pub fn c<T>(x: &[T]) -> &[T] {
+ x.as_ref()
+}
+
+// EMIT_MIR rustc.d.Inline.after.mir
+pub fn d<T>(x: &Box<T>) -> &T {
+ x.as_ref()
+}
+
+fn main() {
+ let mut boxed = Box::new(1);
+ println!("{:?}", a(&mut [1]));
+ println!("{:?}", b(&mut boxed));
+ println!("{:?}", c(&[1]));
+ println!("{:?}", d(&boxed));
+}
--- /dev/null
+// MIR for `a` after Inline
+
+fn a(_1: &mut [T]) -> &mut [T] {
+ debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:13: 2:14
+ let mut _0: &mut [T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:29: 2:37
+ let mut _2: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ let mut _3: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ let mut _4: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+ scope 1 {
+ debug self => _4; // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ let mut _5: &mut [T]; // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+ _4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+ StorageLive(_5); // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ _5 = _4; // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ _3 = _5; // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ StorageDead(_5); // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:14: 3:15
+ _0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+ StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2
+ StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2
+ return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:2: 4:2
+ }
+}
--- /dev/null
+// MIR for `b` after Inline
+
+fn b(_1: &mut std::boxed::Box<T>) -> &mut T {
+ debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:13: 7:14
+ let mut _0: &mut T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:32: 7:38
+ let mut _2: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ let mut _3: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+ scope 1 {
+ debug self => _4; // in scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ let mut _5: &mut T; // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ let mut _6: &mut T; // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+ _4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+ StorageLive(_5); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ StorageLive(_6); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _6 = &mut (*(*_4)); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _5 = _6; // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _3 = _5; // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ StorageDead(_6); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ StorageDead(_5); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:14: 8:15
+ _0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+ StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2
+ StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2
+ return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:2: 9:2
+ }
+}
--- /dev/null
+// MIR for `c` after Inline
+
+fn c(_1: &[T]) -> &[T] {
+ debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:13: 12:14
+ let mut _0: &[T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:25: 12:29
+ let _2: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+ let mut _3: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+ scope 1 {
+ debug self => _3; // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+ StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+ _3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+ _2 = _3; // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ _0 = &(*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+ StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:14: 13:15
+ StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:1: 14:2
+ return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:2: 14:2
+ }
+}
--- /dev/null
+// MIR for `d` after Inline
+
+fn d(_1: &std::boxed::Box<T>) -> &T {
+ debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:13: 17:14
+ let mut _0: &T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:28: 17:30
+ let _2: &T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+ let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+ scope 1 {
+ debug self => _3; // in scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ let _4: &T; // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+ StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+ _3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+ StorageLive(_4); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _4 = &(*(*_3)); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _2 = _4; // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ StorageDead(_4); // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+ _0 = &(*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+ StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:14: 18:15
+ StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:1: 19:2
+ return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:2: 19:2
+ }
+}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/issue-38669.rs:5:9: 5:25
- _1 = const false; // bb0[1]: scope 0 at $DIR/issue-38669.rs:5:28: 5:33
+ StorageLive(_1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
+ _1 = const false; // scope 0 at $DIR/issue-38669.rs:5:28: 5:33
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-38669.rs:5:28: 5:33
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/issue-38669.rs:5:9: 5:25
- goto -> bb2; // bb0[3]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+ FakeRead(ForLet, _1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
+ goto -> bb2; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-38669.rs:4:1: 12:2
+ resume; // scope 0 at $DIR/issue-38669.rs:4:1: 12:2
}
bb2: {
- falseUnwind -> [real: bb3, cleanup: bb1]; // bb2[0]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+ falseUnwind -> [real: bb3, cleanup: bb1]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
}
bb3: {
- StorageLive(_3); // bb3[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
- StorageLive(_4); // bb3[1]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
- _4 = _1; // bb3[2]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
- FakeRead(ForMatchedPlace, _4); // bb3[3]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
- switchInt(_4) -> [false: bb5, otherwise: bb4]; // bb3[4]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+ StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+ StorageLive(_4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+ _4 = _1; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+ FakeRead(ForMatchedPlace, _4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+ switchInt(_4) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
}
bb4: {
- falseEdges -> [real: bb6, imaginary: bb5]; // bb4[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+ falseEdges -> [real: bb6, imaginary: bb5]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
}
bb5: {
- _3 = const (); // bb5[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+ _3 = const (); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-38669.rs:7:9: 9:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_4); // bb5[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
- StorageDead(_3); // bb5[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
- _1 = const true; // bb5[3]: scope 1 at $DIR/issue-38669.rs:10:9: 10:28
+ StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+ StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+ _1 = const true; // scope 1 at $DIR/issue-38669.rs:10:9: 10:28
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-38669.rs:10:24: 10:28
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _2 = const (); // bb5[4]: scope 1 at $DIR/issue-38669.rs:6:10: 11:6
+ _2 = const (); // scope 1 at $DIR/issue-38669.rs:6:10: 11:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-38669.rs:6:10: 11:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb2; // bb5[5]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+ goto -> bb2; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
}
bb6: {
- _0 = const (); // bb6[0]: scope 1 at $DIR/issue-38669.rs:8:13: 8:18
+ _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-38669.rs:8:13: 8:18
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_4); // bb6[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
- StorageDead(_3); // bb6[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
- StorageDead(_1); // bb6[3]: scope 0 at $DIR/issue-38669.rs:12:1: 12:2
- return; // bb6[4]: scope 0 at $DIR/issue-38669.rs:12:2: 12:2
+ StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+ StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+ StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2
+ return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2
}
}
}
bb0: {
- _5 = const false; // bb0[0]: scope 0 at $DIR/issue-41110.rs:8:9: 8:10
+ _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:8:9: 8:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageLive(_1); // bb0[1]: scope 0 at $DIR/issue-41110.rs:8:9: 8:10
- StorageLive(_2); // bb0[2]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
- _5 = const true; // bb0[3]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+ StorageLive(_1); // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
+ StorageLive(_2); // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+ _5 = const true; // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41110.rs:8:13: 8:14
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _2 = S; // bb0[4]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
- StorageLive(_3); // bb0[5]: scope 0 at $DIR/issue-41110.rs:8:21: 8:27
- StorageLive(_4); // bb0[6]: scope 0 at $DIR/issue-41110.rs:8:21: 8:22
- _4 = S; // bb0[7]: scope 0 at $DIR/issue-41110.rs:8:21: 8:22
- _3 = const S::id(move _4) -> [return: bb2, unwind: bb4]; // bb0[8]: scope 0 at $DIR/issue-41110.rs:8:21: 8:27
+ _2 = S; // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+ StorageLive(_3); // scope 0 at $DIR/issue-41110.rs:8:21: 8:27
+ StorageLive(_4); // scope 0 at $DIR/issue-41110.rs:8:21: 8:22
+ _4 = S; // scope 0 at $DIR/issue-41110.rs:8:21: 8:22
+ _3 = const S::id(move _4) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-41110.rs:8:21: 8:27
// ty::Const
// + ty: fn(S) -> S {S::id}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-41110.rs:7:1: 9:2
+ resume; // scope 0 at $DIR/issue-41110.rs:7:1: 9:2
}
bb2: {
- StorageDead(_4); // bb2[0]: scope 0 at $DIR/issue-41110.rs:8:26: 8:27
- _5 = const false; // bb2[1]: scope 0 at $DIR/issue-41110.rs:8:13: 8:28
+ StorageDead(_4); // scope 0 at $DIR/issue-41110.rs:8:26: 8:27
+ _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:8:13: 8:28
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _1 = const S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // bb2[2]: scope 0 at $DIR/issue-41110.rs:8:13: 8:28
+ _1 = const S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
// ty::Const
// + ty: fn(S, S) {S::other}
// + val: Value(Scalar(<ZST>))
}
bb3 (cleanup): {
- goto -> bb9; // bb3[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ goto -> bb9; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
bb4 (cleanup): {
- goto -> bb3; // bb4[0]: scope 0 at $DIR/issue-41110.rs:8:26: 8:27
+ goto -> bb3; // scope 0 at $DIR/issue-41110.rs:8:26: 8:27
}
bb5 (cleanup): {
- goto -> bb3; // bb5[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ goto -> bb3; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
bb6: {
- StorageDead(_3); // bb6[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
- _5 = const false; // bb6[1]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ StorageDead(_3); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:8:27: 8:28
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageDead(_2); // bb6[2]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
- _0 = const (); // bb6[3]: scope 0 at $DIR/issue-41110.rs:7:11: 9:2
+ StorageDead(_2); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ _0 = const (); // scope 0 at $DIR/issue-41110.rs:7:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-41110.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb6[4]: scope 0 at $DIR/issue-41110.rs:9:1: 9:2
- return; // bb6[5]: scope 0 at $DIR/issue-41110.rs:9:2: 9:2
+ StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:9:1: 9:2
+ return; // scope 0 at $DIR/issue-41110.rs:9:2: 9:2
}
bb7 (cleanup): {
- drop(_2) -> bb1; // bb7[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ drop(_2) -> bb1; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
bb8 (cleanup): {
- _5 = const false; // bb8[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:8:27: 8:28
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- goto -> bb7; // bb8[1]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ goto -> bb7; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
bb9 (cleanup): {
- switchInt(_5) -> [false: bb1, otherwise: bb8]; // bb9[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+ switchInt(_5) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
}
}
bb0: {
- _6 = const false; // bb0[0]: scope 0 at $DIR/issue-41110.rs:15:9: 15:10
+ _6 = const false; // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:15:9: 15:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageLive(_1); // bb0[1]: scope 0 at $DIR/issue-41110.rs:15:9: 15:10
- _6 = const true; // bb0[2]: scope 0 at $DIR/issue-41110.rs:15:13: 15:14
+ StorageLive(_1); // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
+ _6 = const true; // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41110.rs:15:13: 15:14
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _1 = S; // bb0[3]: scope 0 at $DIR/issue-41110.rs:15:13: 15:14
- StorageLive(_2); // bb0[4]: scope 1 at $DIR/issue-41110.rs:16:9: 16:14
- _2 = S; // bb0[5]: scope 1 at $DIR/issue-41110.rs:16:17: 16:18
- StorageLive(_3); // bb0[6]: scope 2 at $DIR/issue-41110.rs:17:5: 17:12
- StorageLive(_4); // bb0[7]: scope 2 at $DIR/issue-41110.rs:17:10: 17:11
- _4 = move _2; // bb0[8]: scope 2 at $DIR/issue-41110.rs:17:10: 17:11
- _3 = const std::mem::drop::<S>(move _4) -> [return: bb2, unwind: bb5]; // bb0[9]: scope 2 at $DIR/issue-41110.rs:17:5: 17:12
+ _1 = S; // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
+ StorageLive(_2); // scope 1 at $DIR/issue-41110.rs:16:9: 16:14
+ _2 = S; // scope 1 at $DIR/issue-41110.rs:16:17: 16:18
+ StorageLive(_3); // scope 2 at $DIR/issue-41110.rs:17:5: 17:12
+ StorageLive(_4); // scope 2 at $DIR/issue-41110.rs:17:10: 17:11
+ _4 = move _2; // scope 2 at $DIR/issue-41110.rs:17:10: 17:11
+ _3 = const std::mem::drop::<S>(move _4) -> [return: bb2, unwind: bb5]; // scope 2 at $DIR/issue-41110.rs:17:5: 17:12
// ty::Const
// + ty: fn(S) {std::mem::drop::<S>}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-41110.rs:14:1: 19:2
+ resume; // scope 0 at $DIR/issue-41110.rs:14:1: 19:2
}
bb2: {
- StorageDead(_4); // bb2[0]: scope 2 at $DIR/issue-41110.rs:17:11: 17:12
- StorageDead(_3); // bb2[1]: scope 2 at $DIR/issue-41110.rs:17:12: 17:13
- StorageLive(_5); // bb2[2]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
- _6 = const false; // bb2[3]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ StorageDead(_4); // scope 2 at $DIR/issue-41110.rs:17:11: 17:12
+ StorageDead(_3); // scope 2 at $DIR/issue-41110.rs:17:12: 17:13
+ StorageLive(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ _6 = const false; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:18:9: 18:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _5 = move _1; // bb2[4]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
- goto -> bb12; // bb2[5]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+ _5 = move _1; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ goto -> bb12; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
}
bb3 (cleanup): {
- goto -> bb15; // bb3[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ goto -> bb15; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
bb4 (cleanup): {
- goto -> bb3; // bb4[0]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+ goto -> bb3; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
}
bb5 (cleanup): {
- goto -> bb4; // bb5[0]: scope 2 at $DIR/issue-41110.rs:17:11: 17:12
+ goto -> bb4; // scope 2 at $DIR/issue-41110.rs:17:11: 17:12
}
bb6: {
- goto -> bb8; // bb6[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ goto -> bb8; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
}
bb7 (cleanup): {
- goto -> bb4; // bb7[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ goto -> bb4; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
}
bb8: {
- StorageDead(_5); // bb8[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
- _0 = const (); // bb8[1]: scope 0 at $DIR/issue-41110.rs:14:15: 19:2
+ StorageDead(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+ _0 = const (); // scope 0 at $DIR/issue-41110.rs:14:15: 19:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-41110.rs:14:15: 19:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_2) -> [return: bb9, unwind: bb3]; // bb8[2]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+ drop(_2) -> [return: bb9, unwind: bb3]; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
}
bb9: {
- StorageDead(_2); // bb9[0]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
- goto -> bb10; // bb9[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ StorageDead(_2); // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+ goto -> bb10; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
bb10: {
- _6 = const false; // bb10[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ _6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:19:1: 19:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageDead(_1); // bb10[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
- return; // bb10[2]: scope 0 at $DIR/issue-41110.rs:19:2: 19:2
+ StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ return; // scope 0 at $DIR/issue-41110.rs:19:2: 19:2
}
bb11 (cleanup): {
- _2 = move _5; // bb11[0]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
- goto -> bb7; // bb11[1]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+ _2 = move _5; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+ goto -> bb7; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
}
bb12: {
- _2 = move _5; // bb12[0]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
- goto -> bb6; // bb12[1]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+ _2 = move _5; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+ goto -> bb6; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
}
bb13 (cleanup): {
- drop(_1) -> bb1; // bb13[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ drop(_1) -> bb1; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
bb14 (cleanup): {
- _6 = const false; // bb14[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ _6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41110.rs:19:1: 19:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- goto -> bb13; // bb14[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ goto -> bb13; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
bb15 (cleanup): {
- switchInt(_6) -> [false: bb1, otherwise: bb14]; // bb15[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+ switchInt(_6) -> [false: bb1, otherwise: bb14]; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
}
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
bb0: {
- _1 = CheckedAdd(const 1usize, const 1usize); // bb0[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ _1 = CheckedAdd(const 1usize, const 1usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/issue-41697.rs:18:21: 18:22
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // bb0[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
bb2: {
- _0 = move (_1.0: usize); // bb2[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- return; // bb2[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ _0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ return; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
}
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
bb0: {
- _1 = CheckedAdd(const 1usize, const 1usize); // bb0[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ _1 = CheckedAdd(const 1usize, const 1usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $DIR/issue-41697.rs:18:21: 18:22
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // bb0[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
bb2: {
- _0 = move (_1.0: usize); // bb2[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- return; // bb2[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ _0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+ return; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
}
}
}
bb0: {
- _9 = const false; // bb0[0]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+ _9 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:7:9: 7:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _7 = const false; // bb0[1]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+ _7 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:7:9: 7:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _8 = const false; // bb0[2]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+ _8 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:7:9: 7:10
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageLive(_1); // bb0[3]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
- StorageLive(_2); // bb0[4]: scope 1 at $DIR/issue-41888.rs:8:8: 8:14
- _2 = const cond() -> [return: bb2, unwind: bb3]; // bb0[5]: scope 1 at $DIR/issue-41888.rs:8:8: 8:14
+ StorageLive(_1); // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+ StorageLive(_2); // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
+ _2 = const cond() -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
// ty::Const
// + ty: fn() -> bool {cond}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-41888.rs:6:1: 15:2
+ resume; // scope 0 at $DIR/issue-41888.rs:6:1: 15:2
}
bb2: {
- switchInt(_2) -> [false: bb4, otherwise: bb5]; // bb2[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+ switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
}
bb3 (cleanup): {
- goto -> bb1; // bb3[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ goto -> bb1; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb4: {
- _0 = const (); // bb4[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+ _0 = const (); // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-41888.rs:8:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb11; // bb4[1]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+ goto -> bb11; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
}
bb5: {
- StorageLive(_3); // bb5[0]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
- StorageLive(_4); // bb5[1]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
- _4 = K; // bb5[2]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
- _3 = E::F(move _4); // bb5[3]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
- StorageDead(_4); // bb5[4]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
- goto -> bb14; // bb5[5]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ StorageLive(_3); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
+ StorageLive(_4); // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
+ _4 = K; // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
+ _3 = E::F(move _4); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
+ StorageDead(_4); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+ goto -> bb14; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
}
bb6: {
- goto -> bb8; // bb6[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+ goto -> bb8; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
}
bb7 (cleanup): {
- goto -> bb3; // bb7[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+ goto -> bb3; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
}
bb8: {
- StorageDead(_3); // bb8[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
- _5 = discriminant(_1); // bb8[1]: scope 1 at $DIR/issue-41888.rs:10:16: 10:24
- switchInt(move _5) -> [0isize: bb10, otherwise: bb9]; // bb8[2]: scope 1 at $DIR/issue-41888.rs:10:16: 10:24
+ StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+ _5 = discriminant(_1); // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
+ switchInt(move _5) -> [0isize: bb10, otherwise: bb9]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
}
bb9: {
- _0 = const (); // bb9[0]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+ _0 = const (); // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-41888.rs:10:9: 13:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb11; // bb9[1]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+ goto -> bb11; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
}
bb10: {
- StorageLive(_6); // bb10[0]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
- _9 = const false; // bb10[1]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+ StorageLive(_6); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+ _9 = const false; // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:10:21: 10:23
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _6 = move ((_1 as F).0: K); // bb10[2]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
- _0 = const (); // bb10[3]: scope 2 at $DIR/issue-41888.rs:10:29: 13:10
+ _6 = move ((_1 as F).0: K); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+ _0 = const (); // scope 2 at $DIR/issue-41888.rs:10:29: 13:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-41888.rs:10:29: 13:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_6); // bb10[4]: scope 1 at $DIR/issue-41888.rs:13:9: 13:10
- goto -> bb11; // bb10[5]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+ StorageDead(_6); // scope 1 at $DIR/issue-41888.rs:13:9: 13:10
+ goto -> bb11; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
}
bb11: {
- goto -> bb21; // bb11[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ goto -> bb21; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb12: {
- _7 = const false; // bb12[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:15:1: 15:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _8 = const false; // bb12[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _8 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:15:1: 15:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _9 = const false; // bb12[2]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _9 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:15:1: 15:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- StorageDead(_1); // bb12[3]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- StorageDead(_2); // bb12[4]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- return; // bb12[5]: scope 0 at $DIR/issue-41888.rs:15:2: 15:2
+ StorageDead(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ StorageDead(_2); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ return; // scope 0 at $DIR/issue-41888.rs:15:2: 15:2
}
bb13 (cleanup): {
- _7 = const true; // bb13[0]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _8 = const true; // bb13[1]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _9 = const true; // bb13[2]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _1 = move _3; // bb13[3]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- goto -> bb7; // bb13[4]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ goto -> bb7; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
}
bb14: {
- _7 = const true; // bb14[0]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _8 = const true; // bb14[1]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _9 = const true; // bb14[2]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-41888.rs:9:9: 9:10
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _1 = move _3; // bb14[3]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- goto -> bb6; // bb14[4]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+ goto -> bb6; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
}
bb15: {
- _7 = const false; // bb15[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:15:1: 15:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- goto -> bb12; // bb15[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ goto -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb16 (cleanup): {
- _7 = const false; // bb16[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/issue-41888.rs:15:1: 15:2
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- goto -> bb1; // bb16[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ goto -> bb1; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb17 (cleanup): {
- goto -> bb16; // bb17[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ goto -> bb16; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb18: {
- drop(_1) -> [return: bb15, unwind: bb16]; // bb18[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ drop(_1) -> [return: bb15, unwind: bb16]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb19 (cleanup): {
- drop(_1) -> bb16; // bb19[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ drop(_1) -> bb16; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb20: {
- _10 = discriminant(_1); // bb20[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- switchInt(move _10) -> [0isize: bb15, otherwise: bb18]; // bb20[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _10 = discriminant(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ switchInt(move _10) -> [0isize: bb15, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb21: {
- switchInt(_7) -> [false: bb15, otherwise: bb20]; // bb21[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ switchInt(_7) -> [false: bb15, otherwise: bb20]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb22 (cleanup): {
- _11 = discriminant(_1); // bb22[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- switchInt(move _11) -> [0isize: bb17, otherwise: bb19]; // bb22[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ _11 = discriminant(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ switchInt(move _11) -> [0isize: bb17, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb23 (cleanup): {
- switchInt(_7) -> [false: bb16, otherwise: bb22]; // bb23[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+ switchInt(_7) -> [false: bb16, otherwise: bb22]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
}
}
bb0: {
- goto -> bb1; // bb0[0]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+ goto -> bb1; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
}
bb1: {
- falseUnwind -> [real: bb3, cleanup: bb4]; // bb1[0]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+ falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
}
bb2: {
- goto -> bb14; // bb2[0]: scope 0 at $DIR/issue-49232.rs:15:2: 15:2
+ goto -> bb14; // scope 0 at $DIR/issue-49232.rs:15:2: 15:2
}
bb3: {
- StorageLive(_2); // bb3[0]: scope 0 at $DIR/issue-49232.rs:7:13: 7:19
- StorageLive(_3); // bb3[1]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
- _3 = const true; // bb3[2]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+ StorageLive(_2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19
+ StorageLive(_3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+ _3 = const true; // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/issue-49232.rs:8:19: 8:23
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- FakeRead(ForMatchedPlace, _3); // bb3[3]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
- switchInt(_3) -> [false: bb5, otherwise: bb6]; // bb3[4]: scope 0 at $DIR/issue-49232.rs:9:17: 9:22
+ FakeRead(ForMatchedPlace, _3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+ switchInt(_3) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22
}
bb4 (cleanup): {
- resume; // bb4[0]: scope 0 at $DIR/issue-49232.rs:5:1: 15:2
+ resume; // scope 0 at $DIR/issue-49232.rs:5:1: 15:2
}
bb5: {
- falseEdges -> [real: bb7, imaginary: bb6]; // bb5[0]: scope 0 at $DIR/issue-49232.rs:9:17: 9:22
+ falseEdges -> [real: bb7, imaginary: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22
}
bb6: {
- _0 = const (); // bb6[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ _0 = const (); // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-49232.rs:10:25: 10:30
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb8; // bb6[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ goto -> bb8; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
}
bb7: {
- _2 = const 4i32; // bb7[0]: scope 0 at $DIR/issue-49232.rs:9:26: 9:27
+ _2 = const 4i32; // scope 0 at $DIR/issue-49232.rs:9:26: 9:27
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/issue-49232.rs:9:26: 9:27
// + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- goto -> bb12; // bb7[1]: scope 0 at $DIR/issue-49232.rs:8:13: 11:14
+ goto -> bb12; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14
}
bb8: {
- StorageDead(_3); // bb8[0]: scope 0 at $DIR/issue-49232.rs:12:10: 12:11
- goto -> bb9; // bb8[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11
+ goto -> bb9; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
}
bb9: {
- StorageDead(_2); // bb9[0]: scope 0 at $DIR/issue-49232.rs:14:5: 14:6
- goto -> bb2; // bb9[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ StorageDead(_2); // scope 0 at $DIR/issue-49232.rs:14:5: 14:6
+ goto -> bb2; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
}
bb10: {
- _4 = const (); // bb10[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ _4 = const (); // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-49232.rs:10:25: 10:30
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- unreachable; // bb10[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+ unreachable; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
}
bb11: {
- goto -> bb12; // bb11[0]: scope 0 at $DIR/issue-49232.rs:8:13: 11:14
+ goto -> bb12; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14
}
bb12: {
- FakeRead(ForLet, _2); // bb12[0]: scope 0 at $DIR/issue-49232.rs:7:13: 7:19
- StorageDead(_3); // bb12[1]: scope 0 at $DIR/issue-49232.rs:12:10: 12:11
- StorageLive(_5); // bb12[2]: scope 1 at $DIR/issue-49232.rs:13:9: 13:22
- StorageLive(_6); // bb12[3]: scope 1 at $DIR/issue-49232.rs:13:14: 13:21
- _6 = &_2; // bb12[4]: scope 1 at $DIR/issue-49232.rs:13:14: 13:21
- _5 = const std::mem::drop::<&i32>(move _6) -> [return: bb13, unwind: bb4]; // bb12[5]: scope 1 at $DIR/issue-49232.rs:13:9: 13:22
+ FakeRead(ForLet, _2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19
+ StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11
+ StorageLive(_5); // scope 1 at $DIR/issue-49232.rs:13:9: 13:22
+ StorageLive(_6); // scope 1 at $DIR/issue-49232.rs:13:14: 13:21
+ _6 = &_2; // scope 1 at $DIR/issue-49232.rs:13:14: 13:21
+ _5 = const std::mem::drop::<&i32>(move _6) -> [return: bb13, unwind: bb4]; // scope 1 at $DIR/issue-49232.rs:13:9: 13:22
// ty::Const
// + ty: fn(&i32) {std::mem::drop::<&i32>}
// + val: Value(Scalar(<ZST>))
}
bb13: {
- StorageDead(_6); // bb13[0]: scope 1 at $DIR/issue-49232.rs:13:21: 13:22
- StorageDead(_5); // bb13[1]: scope 1 at $DIR/issue-49232.rs:13:22: 13:23
- _1 = const (); // bb13[2]: scope 0 at $DIR/issue-49232.rs:6:10: 14:6
+ StorageDead(_6); // scope 1 at $DIR/issue-49232.rs:13:21: 13:22
+ StorageDead(_5); // scope 1 at $DIR/issue-49232.rs:13:22: 13:23
+ _1 = const (); // scope 0 at $DIR/issue-49232.rs:6:10: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-49232.rs:6:10: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb13[3]: scope 0 at $DIR/issue-49232.rs:14:5: 14:6
- goto -> bb1; // bb13[4]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+ StorageDead(_2); // scope 0 at $DIR/issue-49232.rs:14:5: 14:6
+ goto -> bb1; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
}
bb14: {
- return; // bb14[0]: scope 0 at $DIR/issue-49232.rs:15:2: 15:2
+ return; // scope 0 at $DIR/issue-49232.rs:15:2: 15:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
- _2 = Box(u32); // bb0[2]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
- StorageLive(_3); // bb0[3]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
- StorageLive(_4); // bb0[4]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
- _4 = std::option::Option::<u32>::None; // bb0[5]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
- _3 = const <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // bb0[6]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+ StorageLive(_1); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+ StorageLive(_2); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+ _2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+ StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+ StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
+ _4 = std::option::Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
+ _3 = const <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
// ty::Const
// + ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/issue-62289.rs:8:1: 10:2
+ resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
}
bb2: {
- StorageDead(_4); // bb2[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- _5 = discriminant(_3); // bb2[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- switchInt(move _5) -> [0isize: bb4, 1isize: bb6, otherwise: bb5]; // bb2[2]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageDead(_4); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ _5 = discriminant(_3); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ switchInt(move _5) -> [0isize: bb4, 1isize: bb6, otherwise: bb5]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
}
bb3 (cleanup): {
- drop(_2) -> bb1; // bb3[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+ drop(_2) -> bb1; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb4: {
- StorageLive(_10); // bb4[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
- _10 = ((_3 as Ok).0: u32); // bb4[1]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
- (*_2) = _10; // bb4[2]: scope 4 at $DIR/issue-62289.rs:9:15: 9:20
- StorageDead(_10); // bb4[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- _1 = move _2; // bb4[4]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
- drop(_2) -> [return: bb12, unwind: bb11]; // bb4[5]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+ StorageLive(_10); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+ _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+ (*_2) = _10; // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
+ StorageDead(_10); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ _1 = move _2; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+ drop(_2) -> [return: bb12, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb5: {
- unreachable; // bb5[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+ unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
}
bb6: {
- StorageLive(_6); // bb6[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- _6 = ((_3 as Err).0: std::option::NoneError); // bb6[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- StorageLive(_8); // bb6[2]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
- StorageLive(_9); // bb6[3]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
- _9 = _6; // bb6[4]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
- _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // bb6[5]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ _6 = ((_3 as Err).0: std::option::NoneError); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageLive(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ _9 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
// ty::Const
// + ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}
// + val: Value(Scalar(<ZST>))
}
bb7: {
- return; // bb7[0]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
+ return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb8: {
- StorageDead(_9); // bb8[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
- _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // bb8[1]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageDead(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
// ty::Const
// + ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}
// + val: Value(Scalar(<ZST>))
}
bb9: {
- StorageDead(_8); // bb9[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
- StorageDead(_6); // bb9[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
- drop(_2) -> bb10; // bb9[2]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+ StorageDead(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ drop(_2) -> bb10; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb10: {
- StorageDead(_2); // bb10[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
- StorageDead(_1); // bb10[1]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
- StorageDead(_3); // bb10[2]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
- goto -> bb7; // bb10[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+ StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+ StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+ StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
+ goto -> bb7; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
}
bb11 (cleanup): {
- drop(_1) -> bb1; // bb11[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+ drop(_1) -> bb1; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
}
bb12: {
- StorageDead(_2); // bb12[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
- _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // bb12[1]: scope 0 at $DIR/issue-62289.rs:9:5: 9:22
- drop(_1) -> bb13; // bb12[2]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+ StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+ _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
+ drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
}
bb13: {
- StorageDead(_1); // bb13[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
- StorageDead(_3); // bb13[1]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
- goto -> bb7; // bb13[2]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
+ StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+ StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
+ goto -> bb7; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
- _2 = const true; // bb0[2]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
+ StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6
+ StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12
+ _2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/loop_test.rs:10:8: 10:12
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- FakeRead(ForMatchedPlace, _2); // bb0[3]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
- switchInt(_2) -> [false: bb3, otherwise: bb2]; // bb0[4]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12
+ switchInt(_2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/loop_test.rs:6:1: 17:2
+ resume; // scope 0 at $DIR/loop_test.rs:6:1: 17:2
}
bb2: {
- falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+ falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
}
bb3: {
- _1 = const (); // bb3[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+ _1 = const (); // scope 0 at $DIR/loop_test.rs:10:5: 12:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/loop_test.rs:10:5: 12:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb3[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
- StorageDead(_1); // bb3[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
- StorageLive(_4); // bb3[3]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
- goto -> bb5; // bb3[4]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
+ StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+ StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+ StorageLive(_4); // scope 0 at $DIR/loop_test.rs:13:5: 16:6
+ goto -> bb5; // scope 0 at $DIR/loop_test.rs:13:5: 16:6
}
bb4: {
- _0 = const (); // bb4[0]: scope 0 at $DIR/loop_test.rs:11:9: 11:15
+ _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/loop_test.rs:11:9: 11:15
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb4[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
- StorageDead(_1); // bb4[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
- return; // bb4[3]: scope 0 at $DIR/loop_test.rs:17:2: 17:2
+ StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+ StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+ return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2
}
bb5: {
- falseUnwind -> [real: bb6, cleanup: bb1]; // bb5[0]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
+ falseUnwind -> [real: bb6, cleanup: bb1]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6
}
bb6: {
- StorageLive(_6); // bb6[0]: scope 0 at $DIR/loop_test.rs:14:13: 14:14
- _6 = const 1i32; // bb6[1]: scope 0 at $DIR/loop_test.rs:14:17: 14:18
+ StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14
+ _6 = const 1i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/loop_test.rs:14:17: 14:18
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- FakeRead(ForLet, _6); // bb6[2]: scope 0 at $DIR/loop_test.rs:14:13: 14:14
- StorageDead(_6); // bb6[3]: scope 0 at $DIR/loop_test.rs:16:5: 16:6
- goto -> bb5; // bb6[4]: scope 0 at $DIR/loop_test.rs:15:9: 15:17
+ FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14
+ StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6
+ goto -> bb5; // scope 0 at $DIR/loop_test.rs:15:9: 15:17
}
}
}
bb0: {
- switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb2]; // bb0[0]: scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
+ switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
+ resume; // scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
}
bb2: {
- switchInt((_2.1: bool)) -> [false: bb14, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
+ switchInt((_2.1: bool)) -> [false: bb14, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
}
bb3: {
- switchInt((_2.0: bool)) -> [false: bb4, otherwise: bb21]; // bb3[0]: scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
+ switchInt((_2.0: bool)) -> [false: bb4, otherwise: bb21]; // scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
}
bb4: {
- StorageLive(_15); // bb4[0]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
- _15 = (_2.1: bool); // bb4[1]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
- StorageLive(_16); // bb4[2]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
- _16 = move (_2.2: std::string::String); // bb4[3]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
- goto -> bb20; // bb4[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+ StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+ _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb5: {
- _0 = const 1i32; // bb5[0]: scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
+ _0 = const 1i32; // scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:77: 16:78
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- drop(_7) -> [return: bb19, unwind: bb10]; // bb5[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
}
bb6: {
- StorageLive(_6); // bb6[0]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- _6 = &(_2.1: bool); // bb6[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- StorageLive(_8); // bb6[2]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- _8 = &(_2.2: std::string::String); // bb6[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- StorageLive(_9); // bb6[4]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
- StorageLive(_10); // bb6[5]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- _10 = _1; // bb6[6]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- switchInt(_10) -> [false: bb7, otherwise: bb8]; // bb6[7]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ _6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ switchInt(_10) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb7: {
- _9 = (*_6); // bb7[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
- StorageDead(_10); // bb7[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- switchInt(move _9) -> [false: bb13, otherwise: bb12]; // bb7[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+ StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb8: {
- _0 = const 3i32; // bb8[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+ _0 = const 3i32; // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_10); // bb8[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageDead(_9); // bb8[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb8[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb8[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb11; // bb8[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+ StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
}
bb9: {
- return; // bb9[0]: scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
+ return; // scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
}
bb10 (cleanup): {
- goto -> bb25; // bb10[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb11: {
- drop(_2) -> [return: bb9, unwind: bb1]; // bb11[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb12: {
- StorageDead(_9); // bb12[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageLive(_5); // bb12[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- _5 = (_2.1: bool); // bb12[2]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- StorageLive(_7); // bb12[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- _7 = move (_2.2: std::string::String); // bb12[4]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- goto -> bb5; // bb12[5]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ _5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ goto -> bb5; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb13: {
- StorageDead(_9); // bb13[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb13[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb13[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb2; // bb13[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb14: {
- StorageLive(_6); // bb14[0]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- _6 = &(_2.0: bool); // bb14[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- StorageLive(_8); // bb14[2]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- _8 = &(_2.2: std::string::String); // bb14[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- StorageLive(_12); // bb14[4]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
- StorageLive(_13); // bb14[5]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- _13 = _1; // bb14[6]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- switchInt(_13) -> [false: bb15, otherwise: bb16]; // bb14[7]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ _6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ switchInt(_13) -> [false: bb15, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb15: {
- _12 = (*_6); // bb15[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
- StorageDead(_13); // bb15[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- switchInt(move _12) -> [false: bb18, otherwise: bb17]; // bb15[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+ StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ switchInt(move _12) -> [false: bb18, otherwise: bb17]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb16: {
- _0 = const 3i32; // bb16[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+ _0 = const 3i32; // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_13); // bb16[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageDead(_12); // bb16[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb16[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb16[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb11; // bb16[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+ StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
}
bb17: {
- StorageDead(_12); // bb17[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageLive(_5); // bb17[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- _5 = (_2.0: bool); // bb17[2]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- StorageLive(_7); // bb17[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- _7 = move (_2.2: std::string::String); // bb17[4]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- goto -> bb5; // bb17[5]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ _5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ goto -> bb5; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb18: {
- StorageDead(_12); // bb18[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb18[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb18[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb3; // bb18[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb3; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb19: {
- StorageDead(_7); // bb19[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_5); // bb19[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb19[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb19[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb23; // bb19[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb20: {
- _0 = const 2i32; // bb20[0]: scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
+ _0 = const 2i32; // scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:17:41: 17:42
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- drop(_16) -> [return: bb22, unwind: bb10]; // bb20[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
}
bb21: {
- StorageLive(_15); // bb21[0]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
- _15 = (_2.1: bool); // bb21[1]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
- StorageLive(_16); // bb21[2]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
- _16 = move (_2.2: std::string::String); // bb21[3]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
- goto -> bb20; // bb21[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+ StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+ _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb22: {
- StorageDead(_16); // bb22[0]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
- StorageDead(_15); // bb22[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
- goto -> bb23; // bb22[2]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb23: {
- goto -> bb29; // bb23[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb29; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb24 (cleanup): {
- goto -> bb1; // bb24[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb25 (cleanup): {
- goto -> bb24; // bb25[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb26: {
- goto -> bb9; // bb26[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb9; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb27 (cleanup): {
- goto -> bb1; // bb27[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb28 (cleanup): {
- goto -> bb27; // bb28[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb29: {
- goto -> bb26; // bb29[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
}
}
bb0: {
- FakeRead(ForMatchedPlace, _2); // bb0[0]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
- switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+ switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
+ resume; // scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
}
bb2: {
- falseEdges -> [real: bb9, imaginary: bb4]; // bb2[0]: scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:22
+ falseEdges -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:22
}
bb3: {
- switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // bb3[0]: scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
+ switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
}
bb4: {
- falseEdges -> [real: bb18, imaginary: bb6]; // bb4[0]: scope 0 at $DIR/match-arm-scopes.rs:16:25: 16:38
+ falseEdges -> [real: bb18, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:25: 16:38
}
bb5: {
- switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // bb5[0]: scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
+ switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
}
bb6: {
- falseEdges -> [real: bb26, imaginary: bb7]; // bb6[0]: scope 0 at $DIR/match-arm-scopes.rs:17:9: 17:21
+ falseEdges -> [real: bb26, imaginary: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:17:9: 17:21
}
bb7: {
- StorageLive(_15); // bb7[0]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
- _15 = (_2.1: bool); // bb7[1]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
- StorageLive(_16); // bb7[2]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
- _16 = move (_2.2: std::string::String); // bb7[3]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
- goto -> bb25; // bb7[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+ StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+ _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+ goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb8: {
- _0 = const 1i32; // bb8[0]: scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
+ _0 = const 1i32; // scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:77: 16:78
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- drop(_7) -> [return: bb24, unwind: bb14]; // bb8[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
}
bb9: {
- StorageLive(_6); // bb9[0]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- _6 = &(_2.1: bool); // bb9[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- StorageLive(_8); // bb9[2]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- _8 = &(_2.2: std::string::String); // bb9[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- _3 = &shallow (_2.0: bool); // bb9[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
- _4 = &shallow (_2.1: bool); // bb9[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
- StorageLive(_9); // bb9[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
- StorageLive(_10); // bb9[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- _10 = _1; // bb9[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- FakeRead(ForMatchedPlace, _10); // bb9[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- switchInt(_10) -> [false: bb11, otherwise: bb10]; // bb9[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ _6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+ _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+ StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ FakeRead(ForMatchedPlace, _10); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ switchInt(_10) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb10: {
- falseEdges -> [real: bb12, imaginary: bb11]; // bb10[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ falseEdges -> [real: bb12, imaginary: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb11: {
- _9 = (*_6); // bb11[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
- StorageDead(_10); // bb11[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- switchInt(move _9) -> [false: bb17, otherwise: bb16]; // bb11[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+ StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ switchInt(move _9) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb12: {
- _0 = const 3i32; // bb12[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+ _0 = const 3i32; // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_10); // bb12[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageDead(_9); // bb12[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb12[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb12[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb15; // bb12[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+ StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
}
bb13: {
- return; // bb13[0]: scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
+ return; // scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
}
bb14 (cleanup): {
- drop(_2) -> bb1; // bb14[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ drop(_2) -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb15: {
- drop(_2) -> [return: bb13, unwind: bb1]; // bb15[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
bb16: {
- StorageDead(_9); // bb16[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- FakeRead(ForMatchGuard, _3); // bb16[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForMatchGuard, _4); // bb16[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForGuardBinding, _6); // bb16[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForGuardBinding, _8); // bb16[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageLive(_5); // bb16[5]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- _5 = (_2.1: bool); // bb16[6]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
- StorageLive(_7); // bb16[7]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- _7 = move (_2.2: std::string::String); // bb16[8]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
- goto -> bb8; // bb16[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ _5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+ StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+ goto -> bb8; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb17: {
- StorageDead(_9); // bb17[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb17[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb17[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- falseEdges -> [real: bb3, imaginary: bb4]; // bb17[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ falseEdges -> [real: bb3, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb18: {
- StorageLive(_6); // bb18[0]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- _6 = &(_2.0: bool); // bb18[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- StorageLive(_8); // bb18[2]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- _8 = &(_2.2: std::string::String); // bb18[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- _3 = &shallow (_2.0: bool); // bb18[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
- _4 = &shallow (_2.1: bool); // bb18[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
- StorageLive(_12); // bb18[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
- StorageLive(_13); // bb18[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- _13 = _1; // bb18[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- FakeRead(ForMatchedPlace, _13); // bb18[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
- switchInt(_13) -> [false: bb20, otherwise: bb19]; // bb18[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ _6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+ _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+ StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ FakeRead(ForMatchedPlace, _13); // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+ switchInt(_13) -> [false: bb20, otherwise: bb19]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb19: {
- falseEdges -> [real: bb21, imaginary: bb20]; // bb19[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ falseEdges -> [real: bb21, imaginary: bb20]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb20: {
- _12 = (*_6); // bb20[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
- StorageDead(_13); // bb20[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- switchInt(move _12) -> [false: bb23, otherwise: bb22]; // bb20[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+ StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ switchInt(move _12) -> [false: bb23, otherwise: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb21: {
- _0 = const 3i32; // bb21[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+ _0 = const 3i32; // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_13); // bb21[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageDead(_12); // bb21[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb21[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb21[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb15; // bb21[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+ StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
}
bb22: {
- StorageDead(_12); // bb22[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- FakeRead(ForMatchGuard, _3); // bb22[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForMatchGuard, _4); // bb22[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForGuardBinding, _6); // bb22[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- FakeRead(ForGuardBinding, _8); // bb22[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
- StorageLive(_5); // bb22[5]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- _5 = (_2.0: bool); // bb22[6]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
- StorageLive(_7); // bb22[7]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- _7 = move (_2.2: std::string::String); // bb22[8]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
- goto -> bb8; // bb22[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+ StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ _5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+ StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+ goto -> bb8; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb23: {
- StorageDead(_12); // bb23[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb23[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb23[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- falseEdges -> [real: bb5, imaginary: bb6]; // bb23[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+ StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ falseEdges -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
}
bb24: {
- StorageDead(_7); // bb24[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_5); // bb24[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_8); // bb24[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- StorageDead(_6); // bb24[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
- goto -> bb28; // bb24[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+ goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb25: {
- _0 = const 2i32; // bb25[0]: scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
+ _0 = const 2i32; // scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match-arm-scopes.rs:17:41: 17:42
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- drop(_16) -> [return: bb27, unwind: bb14]; // bb25[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
}
bb26: {
- StorageLive(_15); // bb26[0]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
- _15 = (_2.1: bool); // bb26[1]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
- StorageLive(_16); // bb26[2]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
- _16 = move (_2.2: std::string::String); // bb26[3]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
- goto -> bb25; // bb26[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+ StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+ _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+ goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb27: {
- StorageDead(_16); // bb27[0]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
- StorageDead(_15); // bb27[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
- goto -> bb28; // bb27[2]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+ StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+ goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
}
bb28: {
- drop(_2) -> [return: bb13, unwind: bb1]; // bb28[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+ drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
- _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+ StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+ StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+ _2 = std::option::Option::<i32>::Some(const 42i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/match_false_edges.rs:15:24: 15:26
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- FakeRead(ForMatchedPlace, _2); // bb0[3]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
- _3 = discriminant(_2); // bb0[4]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
- switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+ _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+ switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/match_false_edges.rs:14:1: 20:2
+ resume; // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2
}
bb2: {
- _1 = (const 3i32, const 3i32); // bb2[0]: scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
+ _1 = (const 3i32, const 3i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match_false_edges.rs:18:21: 18:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- goto -> bb11; // bb2[1]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
}
bb3: {
- falseEdges -> [real: bb6, imaginary: bb4]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+ falseEdges -> [real: bb6, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
}
bb4: {
- falseEdges -> [real: bb10, imaginary: bb2]; // bb4[0]: scope 0 at $DIR/match_false_edges.rs:17:9: 17:16
+ falseEdges -> [real: bb10, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16
}
bb5: {
- unreachable; // bb5[0]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+ unreachable; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
}
bb6: {
- StorageLive(_6); // bb6[0]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
- _11 = const full_tested_match::promoted[0]; // bb6[1]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+ StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+ _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
// ty::Const
// + ty: &std::option::Option<i32>
// + val: Unevaluated(DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/match_false_edges.rs:16:14: 16:15
// + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), [], Some(promoted[0])) }
- _6 = &(((*_11) as Some).0: i32); // bb6[2]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
- _4 = &shallow _2; // bb6[3]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
- StorageLive(_7); // bb6[4]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
- _7 = const guard() -> [return: bb7, unwind: bb1]; // bb6[5]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+ _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+ _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+ StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+ _7 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
// ty::Const
// + ty: fn() -> bool {guard}
// + val: Value(Scalar(<ZST>))
}
bb7: {
- switchInt(move _7) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+ switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
}
bb8: {
- StorageDead(_7); // bb8[0]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
- FakeRead(ForMatchGuard, _4); // bb8[1]: scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
- FakeRead(ForGuardBinding, _6); // bb8[2]: scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
- StorageLive(_5); // bb8[3]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
- _5 = ((_2 as Some).0: i32); // bb8[4]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
- StorageLive(_8); // bb8[5]: scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
- _8 = _5; // bb8[6]: scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
- _1 = (const 1i32, move _8); // bb8[7]: scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+ FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
+ FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
+ StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+ _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+ StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
+ _8 = _5; // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
+ _1 = (const 1i32, move _8); // scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match_false_edges.rs:16:32: 16:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- StorageDead(_8); // bb8[8]: scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
- StorageDead(_5); // bb8[9]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
- StorageDead(_6); // bb8[10]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
- goto -> bb11; // bb8[11]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+ StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
+ StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+ StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
}
bb9: {
- StorageDead(_7); // bb9[0]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
- StorageDead(_6); // bb9[1]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
- goto -> bb4; // bb9[2]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+ StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+ goto -> bb4; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
}
bb10: {
- StorageLive(_9); // bb10[0]: scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
- _9 = ((_2 as Some).0: i32); // bb10[1]: scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
- StorageLive(_10); // bb10[2]: scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
- _10 = _9; // bb10[3]: scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
- _1 = (const 2i32, move _10); // bb10[4]: scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
+ StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
+ _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
+ StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
+ _10 = _9; // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
+ _1 = (const 2i32, move _10); // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match_false_edges.rs:17:21: 17:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- StorageDead(_10); // bb10[5]: scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
- StorageDead(_9); // bb10[6]: scope 0 at $DIR/match_false_edges.rs:17:26: 17:27
- goto -> bb11; // bb10[7]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+ StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
+ StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:26: 17:27
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
}
bb11: {
- StorageDead(_2); // bb11[0]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
- StorageDead(_1); // bb11[1]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
- _0 = const (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:14:28: 20:2
+ StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
+ StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
+ _0 = const (); // scope 0 at $DIR/match_false_edges.rs:14:28: 20:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/match_false_edges.rs:14:28: 20:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb11[3]: scope 0 at $DIR/match_false_edges.rs:20:2: 20:2
+ return; // scope 0 at $DIR/match_false_edges.rs:20:2: 20:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
- _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+ StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+ StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+ _2 = std::option::Option::<i32>::Some(const 42i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/match_false_edges.rs:26:24: 26:26
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- FakeRead(ForMatchedPlace, _2); // bb0[3]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
- _3 = discriminant(_2); // bb0[4]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
- switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+ _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+ switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
+ resume; // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
}
bb2: {
- falseEdges -> [real: bb10, imaginary: bb4]; // bb2[0]: scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
+ falseEdges -> [real: bb10, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
}
bb3: {
- falseEdges -> [real: bb6, imaginary: bb2]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+ falseEdges -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
}
bb4: {
- StorageLive(_9); // bb4[0]: scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
- _9 = ((_2 as Some).0: i32); // bb4[1]: scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
- StorageLive(_10); // bb4[2]: scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
- _10 = _9; // bb4[3]: scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
- _1 = (const 2i32, move _10); // bb4[4]: scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
+ StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
+ _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
+ StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
+ _10 = _9; // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
+ _1 = (const 2i32, move _10); // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match_false_edges.rs:29:21: 29:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- StorageDead(_10); // bb4[5]: scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
- StorageDead(_9); // bb4[6]: scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
- goto -> bb11; // bb4[7]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+ StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
+ StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
}
bb5: {
- unreachable; // bb5[0]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+ unreachable; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
}
bb6: {
- StorageLive(_6); // bb6[0]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
- _6 = &((_2 as Some).0: i32); // bb6[1]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
- _4 = &shallow _2; // bb6[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
- StorageLive(_7); // bb6[3]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
- _7 = const guard() -> [return: bb7, unwind: bb1]; // bb6[4]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+ StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+ _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+ _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+ StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+ _7 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
// ty::Const
// + ty: fn() -> bool {guard}
// + val: Value(Scalar(<ZST>))
}
bb7: {
- switchInt(move _7) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+ switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
}
bb8: {
- StorageDead(_7); // bb8[0]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
- FakeRead(ForMatchGuard, _4); // bb8[1]: scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
- FakeRead(ForGuardBinding, _6); // bb8[2]: scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
- StorageLive(_5); // bb8[3]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
- _5 = ((_2 as Some).0: i32); // bb8[4]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
- StorageLive(_8); // bb8[5]: scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
- _8 = _5; // bb8[6]: scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
- _1 = (const 1i32, move _8); // bb8[7]: scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+ FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
+ FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
+ StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+ _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+ StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
+ _8 = _5; // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
+ _1 = (const 1i32, move _8); // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match_false_edges.rs:27:32: 27:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- StorageDead(_8); // bb8[8]: scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
- StorageDead(_5); // bb8[9]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
- StorageDead(_6); // bb8[10]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
- goto -> bb11; // bb8[11]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+ StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
+ StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+ StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
}
bb9: {
- StorageDead(_7); // bb9[0]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
- StorageDead(_6); // bb9[1]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
- falseEdges -> [real: bb4, imaginary: bb2]; // bb9[2]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+ StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+ falseEdges -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
}
bb10: {
- _1 = (const 3i32, const 3i32); // bb10[0]: scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
+ _1 = (const 3i32, const 3i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match_false_edges.rs:28:21: 28:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- goto -> bb11; // bb10[1]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+ goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
}
bb11: {
- StorageDead(_2); // bb11[0]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
- StorageDead(_1); // bb11[1]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
- _0 = const (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
+ StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
+ StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
+ _0 = const (); // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/match_false_edges.rs:25:29: 31:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb11[3]: scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
+ return; // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
- _2 = std::option::Option::<i32>::Some(const 1i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+ StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+ StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+ _2 = std::option::Option::<i32>::Some(const 1i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match_false_edges.rs:35:24: 35:25
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- FakeRead(ForMatchedPlace, _2); // bb0[3]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
- _4 = discriminant(_2); // bb0[4]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
- switchInt(move _4) -> [1isize: bb3, otherwise: bb2]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+ _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+ switchInt(move _4) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/match_false_edges.rs:34:1: 41:2
+ resume; // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2
}
bb2: {
- falseEdges -> [real: bb10, imaginary: bb5]; // bb2[0]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+ falseEdges -> [real: bb10, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
}
bb3: {
- falseEdges -> [real: bb6, imaginary: bb2]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+ falseEdges -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
}
bb4: {
- StorageLive(_14); // bb4[0]: scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
- _14 = _2; // bb4[1]: scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
- _1 = const 4i32; // bb4[2]: scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
+ StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
+ _14 = _2; // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
+ _1 = const 4i32; // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000004))
// mir::Constant
// + span: $DIR/match_false_edges.rs:39:15: 39:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- StorageDead(_14); // bb4[3]: scope 0 at $DIR/match_false_edges.rs:39:16: 39:17
- goto -> bb15; // bb4[4]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+ StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:16: 39:17
+ goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
bb5: {
- falseEdges -> [real: bb11, imaginary: bb4]; // bb5[0]: scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
+ falseEdges -> [real: bb11, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
}
bb6: {
- StorageLive(_7); // bb6[0]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
- _7 = &((_2 as Some).0: i32); // bb6[1]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
- _5 = &shallow _2; // bb6[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
- StorageLive(_8); // bb6[3]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
- _8 = const guard() -> [return: bb7, unwind: bb1]; // bb6[4]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+ StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+ _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+ _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+ StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+ _8 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
// ty::Const
// + ty: fn() -> bool {guard}
// + val: Value(Scalar(<ZST>))
}
bb7: {
- switchInt(move _8) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+ switchInt(move _8) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
}
bb8: {
- StorageDead(_8); // bb8[0]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
- FakeRead(ForMatchGuard, _5); // bb8[1]: scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
- FakeRead(ForGuardBinding, _7); // bb8[2]: scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
- StorageLive(_6); // bb8[3]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
- _6 = ((_2 as Some).0: i32); // bb8[4]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
- _1 = const 1i32; // bb8[5]: scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
+ StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+ FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+ FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+ StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+ _6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+ _1 = const 1i32; // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match_false_edges.rs:36:32: 36:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- StorageDead(_6); // bb8[6]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
- StorageDead(_7); // bb8[7]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
- goto -> bb15; // bb8[8]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+ StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+ goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
bb9: {
- StorageDead(_8); // bb9[0]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
- StorageDead(_7); // bb9[1]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
- falseEdges -> [real: bb2, imaginary: bb2]; // bb9[2]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+ StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+ StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+ falseEdges -> [real: bb2, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
}
bb10: {
- StorageLive(_9); // bb10[0]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
- _9 = _2; // bb10[1]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
- _1 = const 2i32; // bb10[2]: scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
+ StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+ _9 = _2; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+ _1 = const 2i32; // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match_false_edges.rs:37:15: 37:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- StorageDead(_9); // bb10[3]: scope 0 at $DIR/match_false_edges.rs:37:16: 37:17
- goto -> bb15; // bb10[4]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+ StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:16: 37:17
+ goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
bb11: {
- StorageLive(_11); // bb11[0]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
- _11 = &((_2 as Some).0: i32); // bb11[1]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
- _5 = &shallow _2; // bb11[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
- StorageLive(_12); // bb11[3]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
- StorageLive(_13); // bb11[4]: scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
- _13 = (*_11); // bb11[5]: scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
- _12 = const guard2(move _13) -> [return: bb12, unwind: bb1]; // bb11[6]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+ StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+ _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+ _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+ StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+ StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
+ _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
+ _12 = const guard2(move _13) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
// ty::Const
// + ty: fn(i32) -> bool {guard2}
// + val: Value(Scalar(<ZST>))
}
bb12: {
- StorageDead(_13); // bb12[0]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
- switchInt(move _12) -> [false: bb14, otherwise: bb13]; // bb12[1]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+ StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
}
bb13: {
- StorageDead(_12); // bb13[0]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
- FakeRead(ForMatchGuard, _5); // bb13[1]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
- FakeRead(ForGuardBinding, _11); // bb13[2]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
- StorageLive(_10); // bb13[3]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
- _10 = ((_2 as Some).0: i32); // bb13[4]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
- _1 = const 3i32; // bb13[5]: scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
+ StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+ FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+ FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+ StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+ _10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+ _1 = const 3i32; // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match_false_edges.rs:38:33: 38:34
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- StorageDead(_10); // bb13[6]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
- StorageDead(_11); // bb13[7]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
- goto -> bb15; // bb13[8]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+ StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+ StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+ goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
bb14: {
- StorageDead(_12); // bb14[0]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
- StorageDead(_11); // bb14[1]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
- falseEdges -> [real: bb4, imaginary: bb4]; // bb14[2]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+ StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+ StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+ falseEdges -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
}
bb15: {
- StorageDead(_2); // bb15[0]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
- StorageDead(_1); // bb15[1]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
- _0 = const (); // bb15[2]: scope 0 at $DIR/match_false_edges.rs:34:11: 41:2
+ StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
+ StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
+ _0 = const (); // scope 0 at $DIR/match_false_edges.rs:34:11: 41:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/match_false_edges.rs:34:11: 41:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb15[3]: scope 0 at $DIR/match_false_edges.rs:41:2: 41:2
+ return; // scope 0 at $DIR/match_false_edges.rs:41:2: 41:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/match_test.rs:7:9: 7:10
- _1 = const 3i32; // bb0[1]: scope 0 at $DIR/match_test.rs:7:13: 7:14
+ StorageLive(_1); // scope 0 at $DIR/match_test.rs:7:9: 7:10
+ _1 = const 3i32; // scope 0 at $DIR/match_test.rs:7:13: 7:14
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match_test.rs:7:13: 7:14
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/match_test.rs:7:9: 7:10
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/match_test.rs:8:9: 8:10
- _2 = const true; // bb0[4]: scope 1 at $DIR/match_test.rs:8:13: 8:17
+ FakeRead(ForLet, _1); // scope 0 at $DIR/match_test.rs:7:9: 7:10
+ StorageLive(_2); // scope 1 at $DIR/match_test.rs:8:9: 8:10
+ _2 = const true; // scope 1 at $DIR/match_test.rs:8:13: 8:17
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/match_test.rs:8:13: 8:17
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- FakeRead(ForLet, _2); // bb0[5]: scope 1 at $DIR/match_test.rs:8:9: 8:10
- StorageLive(_3); // bb0[6]: scope 2 at $DIR/match_test.rs:12:5: 17:6
- FakeRead(ForMatchedPlace, _1); // bb0[7]: scope 2 at $DIR/match_test.rs:12:11: 12:12
- _6 = Le(const 0i32, _1); // bb0[8]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+ FakeRead(ForLet, _2); // scope 1 at $DIR/match_test.rs:8:9: 8:10
+ StorageLive(_3); // scope 2 at $DIR/match_test.rs:12:5: 17:6
+ FakeRead(ForMatchedPlace, _1); // scope 2 at $DIR/match_test.rs:12:11: 12:12
+ _6 = Le(const 0i32, _1); // scope 2 at $DIR/match_test.rs:13:9: 13:14
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/match_test.rs:13:9: 13:14
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- switchInt(move _6) -> [false: bb4, otherwise: bb1]; // bb0[9]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+ switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
}
bb1: {
- _7 = Lt(_1, const 10i32); // bb1[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+ _7 = Lt(_1, const 10i32); // scope 2 at $DIR/match_test.rs:13:9: 13:14
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000000a))
// mir::Constant
// + span: $DIR/match_test.rs:13:9: 13:14
// + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
- switchInt(move _7) -> [false: bb4, otherwise: bb2]; // bb1[1]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+ switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
}
bb2: {
- falseEdges -> [real: bb9, imaginary: bb6]; // bb2[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+ falseEdges -> [real: bb9, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
}
bb3: {
- _3 = const 3i32; // bb3[0]: scope 2 at $DIR/match_test.rs:16:14: 16:15
+ _3 = const 3i32; // scope 2 at $DIR/match_test.rs:16:14: 16:15
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/match_test.rs:16:14: 16:15
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- goto -> bb14; // bb3[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+ goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb4: {
- _4 = Le(const 10i32, _1); // bb4[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+ _4 = Le(const 10i32, _1); // scope 2 at $DIR/match_test.rs:14:9: 14:16
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000000a))
// mir::Constant
// + span: $DIR/match_test.rs:14:9: 14:16
// + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
- switchInt(move _4) -> [false: bb7, otherwise: bb5]; // bb4[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+ switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
}
bb5: {
- _5 = Le(_1, const 20i32); // bb5[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+ _5 = Le(_1, const 20i32); // scope 2 at $DIR/match_test.rs:14:9: 14:16
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000014))
// mir::Constant
// + span: $DIR/match_test.rs:14:9: 14:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000014)) }
- switchInt(move _5) -> [false: bb7, otherwise: bb6]; // bb5[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+ switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
}
bb6: {
- falseEdges -> [real: bb12, imaginary: bb8]; // bb6[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+ falseEdges -> [real: bb12, imaginary: bb8]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
}
bb7: {
- switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // bb7[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
+ switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
}
bb8: {
- falseEdges -> [real: bb13, imaginary: bb3]; // bb8[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
+ falseEdges -> [real: bb13, imaginary: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
}
bb9: {
- _8 = &shallow _1; // bb9[0]: scope 2 at $DIR/match_test.rs:12:11: 12:12
- StorageLive(_9); // bb9[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
- _9 = _2; // bb9[2]: scope 2 at $DIR/match_test.rs:13:18: 13:19
- switchInt(move _9) -> [false: bb11, otherwise: bb10]; // bb9[3]: scope 2 at $DIR/match_test.rs:13:18: 13:19
+ _8 = &shallow _1; // scope 2 at $DIR/match_test.rs:12:11: 12:12
+ StorageLive(_9); // scope 2 at $DIR/match_test.rs:13:18: 13:19
+ _9 = _2; // scope 2 at $DIR/match_test.rs:13:18: 13:19
+ switchInt(move _9) -> [false: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
}
bb10: {
- StorageDead(_9); // bb10[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
- FakeRead(ForMatchGuard, _8); // bb10[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
- _3 = const 0i32; // bb10[2]: scope 2 at $DIR/match_test.rs:13:23: 13:24
+ StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:24: 13:25
+ FakeRead(ForMatchGuard, _8); // scope 2 at $DIR/match_test.rs:13:18: 13:19
+ _3 = const 0i32; // scope 2 at $DIR/match_test.rs:13:23: 13:24
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/match_test.rs:13:23: 13:24
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- goto -> bb14; // bb10[3]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+ goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb11: {
- StorageDead(_9); // bb11[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
- falseEdges -> [real: bb3, imaginary: bb6]; // bb11[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
+ StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:24: 13:25
+ falseEdges -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
}
bb12: {
- _3 = const 1i32; // bb12[0]: scope 2 at $DIR/match_test.rs:14:20: 14:21
+ _3 = const 1i32; // scope 2 at $DIR/match_test.rs:14:20: 14:21
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/match_test.rs:14:20: 14:21
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- goto -> bb14; // bb12[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+ goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb13: {
- _3 = const 2i32; // bb13[0]: scope 2 at $DIR/match_test.rs:15:15: 15:16
+ _3 = const 2i32; // scope 2 at $DIR/match_test.rs:15:15: 15:16
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/match_test.rs:15:15: 15:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- goto -> bb14; // bb13[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+ goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb14: {
- StorageDead(_3); // bb14[0]: scope 2 at $DIR/match_test.rs:17:6: 17:7
- _0 = const (); // bb14[1]: scope 0 at $DIR/match_test.rs:6:11: 18:2
+ StorageDead(_3); // scope 2 at $DIR/match_test.rs:17:6: 17:7
+ _0 = const (); // scope 0 at $DIR/match_test.rs:6:11: 18:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/match_test.rs:6:11: 18:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb14[2]: scope 1 at $DIR/match_test.rs:18:1: 18:2
- StorageDead(_1); // bb14[3]: scope 0 at $DIR/match_test.rs:18:1: 18:2
- return; // bb14[4]: scope 0 at $DIR/match_test.rs:18:2: 18:2
+ StorageDead(_2); // scope 1 at $DIR/match_test.rs:18:1: 18:2
+ StorageDead(_1); // scope 0 at $DIR/match_test.rs:18:1: 18:2
+ return; // scope 0 at $DIR/match_test.rs:18:2: 18:2
}
}
}
bb0: {
- _2 = discriminant(_1); // bb0[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
- switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
+ _2 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
+ switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
+ resume; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
}
bb2: {
- StorageLive(_4); // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
- const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+ StorageLive(_4); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+ const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
// ty::Const
// + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
// + val: Value(Scalar(<ZST>))
}
bb3: {
- unreachable; // bb3[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14
+ unreachable; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14
}
bb4: {
- StorageLive(_3); // bb4[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
- _3 = move ((_1 as Some).0: T); // bb4[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
- _0 = move _3; // bb4[2]: scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
- StorageDead(_3); // bb4[3]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
- _5 = discriminant(_1); // bb4[4]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
- return; // bb4[5]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
+ StorageLive(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
+ _3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
+ _0 = move _3; // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
+ StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
+ _5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
+ return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
}
bb5 (cleanup): {
- drop(_1) -> bb1; // bb5[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
+ drop(_1) -> bb1; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
}
}
let _4: &str; // in scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
- StorageLive(_4); // bb0[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
- _4 = const ""; // bb0[4]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+ StorageLive(_1); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
+ StorageLive(_2); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
+ StorageLive(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+ StorageLive(_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+ _4 = const ""; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 })
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) }
- _3 = &(*_4); // bb0[5]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
- _2 = const <str as std::string::ToString>::to_string(move _3) -> bb2; // bb0[6]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
+ _3 = &(*_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+ _2 = const <str as std::string::ToString>::to_string(move _3) -> bb2; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
// ty::Const
// + ty: for<'r> fn(&'r str) -> std::string::String {<str as std::string::ToString>::to_string}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2
+ resume; // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2
}
bb2: {
- StorageDead(_3); // bb2[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34
- _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; // bb2[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
+ StorageDead(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34
+ _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
// ty::Const
// + ty: fn(std::string::String) {std::mem::drop::<std::string::String>}
// + val: Value(Scalar(<ZST>))
}
bb3: {
- StorageDead(_2); // bb3[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
- StorageDead(_4); // bb3[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
- StorageDead(_1); // bb3[2]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
- _0 = const (); // bb3[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
+ StorageDead(_2); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
+ StorageDead(_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
+ StorageDead(_1); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
+ _0 = const (); // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb3[4]: scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2
+ return; // scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2
}
bb4 (cleanup): {
- drop(_2) -> bb1; // bb4[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
+ drop(_2) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
- _3 = Droppy(const 0usize); // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+ StorageLive(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
+ StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+ StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+ _3 = Droppy(const 0usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
// + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
- _2 = Aligned(move _3); // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
- _1 = Packed(move _2); // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
- StorageDead(_2); // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
- StorageLive(_4); // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
- StorageLive(_5); // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
- _5 = Droppy(const 0usize); // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+ _2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+ StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
+ _1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+ StorageDead(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
+ StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+ StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+ _5 = Droppy(const 0usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
// + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
- _4 = Aligned(move _5); // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
- StorageDead(_5); // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
- StorageLive(_6); // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- _6 = move (_1.0: Aligned); // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- drop(_6) -> [return: bb4, unwind: bb3]; // bb0[15]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ _4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+ StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+ StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ _6 = move (_1.0: Aligned); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
+ resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
}
bb2: {
- StorageDead(_1); // bb2[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
- return; // bb2[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
+ StorageDead(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ return; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
}
bb3 (cleanup): {
- (_1.0: Aligned) = move _4; // bb3[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- drop(_1) -> bb1; // bb3[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ drop(_1) -> bb1; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
}
bb4: {
- StorageDead(_6); // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- (_1.0: Aligned) = move _4; // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- StorageDead(_4); // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
- _0 = const (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
+ StorageDead(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+ _0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
- _3 = Droppy(const 0usize); // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+ StorageLive(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
+ StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+ StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+ _3 = Droppy(const 0usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000000))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
- _2 = Aligned(move _3); // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
- StorageDead(_3); // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
- _1 = Packed(move _2); // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
- StorageDead(_2); // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
- StorageLive(_4); // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
- StorageLive(_5); // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
- _5 = Droppy(const 0usize); // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+ _2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+ StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
+ _1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+ StorageDead(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
+ StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+ StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+ _5 = Droppy(const 0usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000000))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
- _4 = Aligned(move _5); // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
- StorageDead(_5); // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
- StorageLive(_6); // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- _6 = move (_1.0: Aligned); // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- drop(_6) -> [return: bb4, unwind: bb3]; // bb0[15]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ _4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+ StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+ StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ _6 = move (_1.0: Aligned); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
+ resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
}
bb2: {
- StorageDead(_1); // bb2[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
- return; // bb2[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
+ StorageDead(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ return; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
}
bb3 (cleanup): {
- (_1.0: Aligned) = move _4; // bb3[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- drop(_1) -> bb1; // bb3[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ drop(_1) -> bb1; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
}
bb4: {
- StorageDead(_6); // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- (_1.0: Aligned) = move _4; // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
- StorageDead(_4); // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
- _0 = const (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
+ StorageDead(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+ StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+ _0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
}
}
}
bb0: {
- unreachable; // bb0[0]: scope 0 at $DIR/remove-never-const.rs:20:13: 20:33
+ unreachable; // scope 0 at $DIR/remove-never-const.rs:20:13: 20:33
}
}
let mut _8: bool; // in scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
bb0: {
-- FakeRead(ForMatchedPlace, _1); // bb0[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+ nop; // bb0[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
- _3 = discriminant(_1); // bb0[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
- switchInt(move _3) -> [1isize: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+- FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+ _3 = discriminant(_1); // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+ switchInt(move _3) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
}
bb1: {
- _0 = const 1i32; // bb1[0]: scope 0 at $DIR/remove_fake_borrows.rs:9:14: 9:15
+ _0 = const 1i32; // scope 0 at $DIR/remove_fake_borrows.rs:9:14: 9:15
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/remove_fake_borrows.rs:9:14: 9:15
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- goto -> bb7; // bb1[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
+ goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
}
bb2: {
- switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1]; // bb2[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:14: 8:15
+ switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:8:14: 8:15
}
bb3: {
- goto -> bb4; // bb3[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+ goto -> bb4; // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
}
bb4: {
-- _4 = &shallow _1; // bb4[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-- _5 = &shallow ((_1 as Some).0: &&i32); // bb4[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-- _6 = &shallow (*((_1 as Some).0: &&i32)); // bb4[2]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-- _7 = &shallow (*(*((_1 as Some).0: &&i32))); // bb4[3]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+ nop; // bb4[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+ nop; // bb4[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+ nop; // bb4[2]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+ nop; // bb4[3]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
- StorageLive(_8); // bb4[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
- _8 = _2; // bb4[5]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
- switchInt(move _8) -> [false: bb6, otherwise: bb5]; // bb4[6]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+- _4 = &shallow _1; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+- _5 = &shallow ((_1 as Some).0: &&i32); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+- _6 = &shallow (*((_1 as Some).0: &&i32)); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+- _7 = &shallow (*(*((_1 as Some).0: &&i32))); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+ StorageLive(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+ _8 = _2; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+ switchInt(move _8) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
}
bb5: {
- StorageDead(_8); // bb5[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
-- FakeRead(ForMatchGuard, _4); // bb5[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-- FakeRead(ForMatchGuard, _5); // bb5[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-- FakeRead(ForMatchGuard, _6); // bb5[3]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-- FakeRead(ForMatchGuard, _7); // bb5[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+ nop; // bb5[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+ nop; // bb5[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+ nop; // bb5[3]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+ nop; // bb5[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
- _0 = const 0i32; // bb5[5]: scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
+ StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+- FakeRead(ForMatchGuard, _6); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+- FakeRead(ForMatchGuard, _7); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+ _0 = const 0i32; // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/remove_fake_borrows.rs:8:25: 8:26
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- goto -> bb7; // bb5[6]: scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
+ goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
}
bb6: {
- StorageDead(_8); // bb6[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
- goto -> bb1; // bb6[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+ StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+ goto -> bb1; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
}
bb7: {
- return; // bb7[0]: scope 0 at $DIR/remove_fake_borrows.rs:11:2: 11:2
+ return; // scope 0 at $DIR/remove_fake_borrows.rs:11:2: 11:2
}
bb8 (cleanup): {
- resume; // bb8[0]: scope 0 at $DIR/remove_fake_borrows.rs:6:1: 11:2
+ resume; // scope 0 at $DIR/remove_fake_borrows.rs:6:1: 11:2
}
}
}
bb0: {
- Retag([fn entry] _1); // bb0[0]: scope 0 at $DIR/retag.rs:40:31: 43:6
- Retag([fn entry] _2); // bb0[1]: scope 0 at $DIR/retag.rs:40:31: 43:6
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/retag.rs:41:13: 41:15
- _3 = _2; // bb0[3]: scope 0 at $DIR/retag.rs:41:18: 41:19
- Retag(_3); // bb0[4]: scope 0 at $DIR/retag.rs:41:18: 41:19
- _0 = _2; // bb0[5]: scope 1 at $DIR/retag.rs:42:9: 42:10
- Retag(_0); // bb0[6]: scope 1 at $DIR/retag.rs:42:9: 42:10
- StorageDead(_3); // bb0[7]: scope 0 at $DIR/retag.rs:43:5: 43:6
- return; // bb0[8]: scope 0 at $DIR/retag.rs:43:6: 43:6
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:40:31: 43:6
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:40:31: 43:6
+ StorageLive(_3); // scope 0 at $DIR/retag.rs:41:13: 41:15
+ _3 = _2; // scope 0 at $DIR/retag.rs:41:18: 41:19
+ Retag(_3); // scope 0 at $DIR/retag.rs:41:18: 41:19
+ _0 = _2; // scope 1 at $DIR/retag.rs:42:9: 42:10
+ Retag(_0); // scope 1 at $DIR/retag.rs:42:9: 42:10
+ StorageDead(_3); // scope 0 at $DIR/retag.rs:43:5: 43:6
+ return; // scope 0 at $DIR/retag.rs:43:6: 43:6
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/retag.rs:30:9: 30:14
- _1 = const 0i32; // bb0[1]: scope 0 at $DIR/retag.rs:30:17: 30:18
+ StorageLive(_1); // scope 0 at $DIR/retag.rs:30:9: 30:14
+ _1 = const 0i32; // scope 0 at $DIR/retag.rs:30:17: 30:18
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/retag.rs:30:17: 30:18
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/retag.rs:31:5: 37:6
- StorageLive(_3); // bb0[3]: scope 1 at $DIR/retag.rs:32:13: 32:14
- StorageLive(_4); // bb0[4]: scope 1 at $DIR/retag.rs:32:17: 32:24
- StorageLive(_5); // bb0[5]: scope 1 at $DIR/retag.rs:32:17: 32:24
- _5 = Test(const 0i32); // bb0[6]: scope 1 at $DIR/retag.rs:32:17: 32:24
+ StorageLive(_2); // scope 1 at $DIR/retag.rs:31:5: 37:6
+ StorageLive(_3); // scope 1 at $DIR/retag.rs:32:13: 32:14
+ StorageLive(_4); // scope 1 at $DIR/retag.rs:32:17: 32:24
+ StorageLive(_5); // scope 1 at $DIR/retag.rs:32:17: 32:24
+ _5 = Test(const 0i32); // scope 1 at $DIR/retag.rs:32:17: 32:24
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/retag.rs:32:22: 32:23
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- _4 = &_5; // bb0[7]: scope 1 at $DIR/retag.rs:32:17: 32:24
- Retag(_4); // bb0[8]: scope 1 at $DIR/retag.rs:32:17: 32:24
- StorageLive(_6); // bb0[9]: scope 1 at $DIR/retag.rs:32:29: 32:35
- StorageLive(_7); // bb0[10]: scope 1 at $DIR/retag.rs:32:29: 32:35
- _7 = &mut _1; // bb0[11]: scope 1 at $DIR/retag.rs:32:29: 32:35
- Retag(_7); // bb0[12]: scope 1 at $DIR/retag.rs:32:29: 32:35
- _6 = &mut (*_7); // bb0[13]: scope 1 at $DIR/retag.rs:32:29: 32:35
- Retag([2phase] _6); // bb0[14]: scope 1 at $DIR/retag.rs:32:29: 32:35
- _3 = const Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // bb0[15]: scope 1 at $DIR/retag.rs:32:17: 32:36
+ _4 = &_5; // scope 1 at $DIR/retag.rs:32:17: 32:24
+ Retag(_4); // scope 1 at $DIR/retag.rs:32:17: 32:24
+ StorageLive(_6); // scope 1 at $DIR/retag.rs:32:29: 32:35
+ StorageLive(_7); // scope 1 at $DIR/retag.rs:32:29: 32:35
+ _7 = &mut _1; // scope 1 at $DIR/retag.rs:32:29: 32:35
+ Retag(_7); // scope 1 at $DIR/retag.rs:32:29: 32:35
+ _6 = &mut (*_7); // scope 1 at $DIR/retag.rs:32:29: 32:35
+ Retag([2phase] _6); // scope 1 at $DIR/retag.rs:32:29: 32:35
+ _3 = const Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/retag.rs:32:17: 32:36
// ty::Const
// + ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}
// + val: Value(Scalar(<ZST>))
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/retag.rs:29:1: 51:2
+ resume; // scope 0 at $DIR/retag.rs:29:1: 51:2
}
bb2: {
- Retag(_3); // bb2[0]: scope 1 at $DIR/retag.rs:32:17: 32:36
- StorageDead(_6); // bb2[1]: scope 1 at $DIR/retag.rs:32:35: 32:36
- StorageDead(_4); // bb2[2]: scope 1 at $DIR/retag.rs:32:35: 32:36
- StorageDead(_7); // bb2[3]: scope 1 at $DIR/retag.rs:32:36: 32:37
- drop(_5) -> [return: bb4, unwind: bb1]; // bb2[4]: scope 1 at $DIR/retag.rs:32:36: 32:37
+ Retag(_3); // scope 1 at $DIR/retag.rs:32:17: 32:36
+ StorageDead(_6); // scope 1 at $DIR/retag.rs:32:35: 32:36
+ StorageDead(_4); // scope 1 at $DIR/retag.rs:32:35: 32:36
+ StorageDead(_7); // scope 1 at $DIR/retag.rs:32:36: 32:37
+ drop(_5) -> [return: bb4, unwind: bb1]; // scope 1 at $DIR/retag.rs:32:36: 32:37
}
bb3 (cleanup): {
- drop(_5) -> bb1; // bb3[0]: scope 1 at $DIR/retag.rs:32:36: 32:37
+ drop(_5) -> bb1; // scope 1 at $DIR/retag.rs:32:36: 32:37
}
bb4: {
- StorageDead(_5); // bb4[0]: scope 1 at $DIR/retag.rs:32:36: 32:37
- StorageLive(_8); // bb4[1]: scope 2 at $DIR/retag.rs:33:13: 33:14
- StorageLive(_9); // bb4[2]: scope 2 at $DIR/retag.rs:33:19: 33:20
- _9 = move _3; // bb4[3]: scope 2 at $DIR/retag.rs:33:19: 33:20
- Retag(_9); // bb4[4]: scope 2 at $DIR/retag.rs:33:19: 33:20
- _8 = &mut (*_9); // bb4[5]: scope 2 at $DIR/retag.rs:33:19: 33:20
- Retag(_8); // bb4[6]: scope 2 at $DIR/retag.rs:33:19: 33:20
- StorageDead(_9); // bb4[7]: scope 2 at $DIR/retag.rs:33:22: 33:23
- StorageLive(_10); // bb4[8]: scope 3 at $DIR/retag.rs:34:13: 34:14
- _10 = move _8; // bb4[9]: scope 3 at $DIR/retag.rs:34:17: 34:18
- Retag(_10); // bb4[10]: scope 3 at $DIR/retag.rs:34:17: 34:18
- StorageLive(_11); // bb4[11]: scope 4 at $DIR/retag.rs:36:13: 36:15
- StorageLive(_12); // bb4[12]: scope 4 at $DIR/retag.rs:36:18: 36:29
- _12 = &raw mut (*_10); // bb4[13]: scope 4 at $DIR/retag.rs:36:18: 36:19
- Retag([raw] _12); // bb4[14]: scope 4 at $DIR/retag.rs:36:18: 36:19
- _11 = _12; // bb4[15]: scope 4 at $DIR/retag.rs:36:18: 36:29
- StorageDead(_12); // bb4[16]: scope 4 at $DIR/retag.rs:36:29: 36:30
- _2 = const (); // bb4[17]: scope 1 at $DIR/retag.rs:31:5: 37:6
+ StorageDead(_5); // scope 1 at $DIR/retag.rs:32:36: 32:37
+ StorageLive(_8); // scope 2 at $DIR/retag.rs:33:13: 33:14
+ StorageLive(_9); // scope 2 at $DIR/retag.rs:33:19: 33:20
+ _9 = move _3; // scope 2 at $DIR/retag.rs:33:19: 33:20
+ Retag(_9); // scope 2 at $DIR/retag.rs:33:19: 33:20
+ _8 = &mut (*_9); // scope 2 at $DIR/retag.rs:33:19: 33:20
+ Retag(_8); // scope 2 at $DIR/retag.rs:33:19: 33:20
+ StorageDead(_9); // scope 2 at $DIR/retag.rs:33:22: 33:23
+ StorageLive(_10); // scope 3 at $DIR/retag.rs:34:13: 34:14
+ _10 = move _8; // scope 3 at $DIR/retag.rs:34:17: 34:18
+ Retag(_10); // scope 3 at $DIR/retag.rs:34:17: 34:18
+ StorageLive(_11); // scope 4 at $DIR/retag.rs:36:13: 36:15
+ StorageLive(_12); // scope 4 at $DIR/retag.rs:36:18: 36:29
+ _12 = &raw mut (*_10); // scope 4 at $DIR/retag.rs:36:18: 36:19
+ Retag([raw] _12); // scope 4 at $DIR/retag.rs:36:18: 36:19
+ _11 = _12; // scope 4 at $DIR/retag.rs:36:18: 36:29
+ StorageDead(_12); // scope 4 at $DIR/retag.rs:36:29: 36:30
+ _2 = const (); // scope 1 at $DIR/retag.rs:31:5: 37:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/retag.rs:31:5: 37:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_11); // bb4[18]: scope 4 at $DIR/retag.rs:37:5: 37:6
- StorageDead(_10); // bb4[19]: scope 3 at $DIR/retag.rs:37:5: 37:6
- StorageDead(_8); // bb4[20]: scope 2 at $DIR/retag.rs:37:5: 37:6
- StorageDead(_3); // bb4[21]: scope 1 at $DIR/retag.rs:37:5: 37:6
- StorageDead(_2); // bb4[22]: scope 1 at $DIR/retag.rs:37:5: 37:6
- StorageLive(_13); // bb4[23]: scope 1 at $DIR/retag.rs:40:9: 40:10
- StorageLive(_14); // bb4[24]: scope 1 at $DIR/retag.rs:40:31: 43:6
- _14 = [closure@main::{{closure}}#0]; // bb4[25]: scope 1 at $DIR/retag.rs:40:31: 43:6
+ StorageDead(_11); // scope 4 at $DIR/retag.rs:37:5: 37:6
+ StorageDead(_10); // scope 3 at $DIR/retag.rs:37:5: 37:6
+ StorageDead(_8); // scope 2 at $DIR/retag.rs:37:5: 37:6
+ StorageDead(_3); // scope 1 at $DIR/retag.rs:37:5: 37:6
+ StorageDead(_2); // scope 1 at $DIR/retag.rs:37:5: 37:6
+ StorageLive(_13); // scope 1 at $DIR/retag.rs:40:9: 40:10
+ StorageLive(_14); // scope 1 at $DIR/retag.rs:40:31: 43:6
+ _14 = [closure@main::{{closure}}#0]; // scope 1 at $DIR/retag.rs:40:31: 43:6
// closure
// + def_id: DefId(0:14 ~ retag[317d]::main[0]::{{closure}}[0])
// + substs: [
// for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32,
// (),
// ]
- Retag(_14); // bb4[26]: scope 1 at $DIR/retag.rs:40:31: 43:6
- _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // bb4[27]: scope 1 at $DIR/retag.rs:40:31: 43:6
- StorageDead(_14); // bb4[28]: scope 1 at $DIR/retag.rs:43:5: 43:6
- StorageLive(_15); // bb4[29]: scope 6 at $DIR/retag.rs:44:9: 44:11
- StorageLive(_16); // bb4[30]: scope 6 at $DIR/retag.rs:44:14: 44:15
- _16 = _13; // bb4[31]: scope 6 at $DIR/retag.rs:44:14: 44:15
- StorageLive(_17); // bb4[32]: scope 6 at $DIR/retag.rs:44:16: 44:18
- StorageLive(_18); // bb4[33]: scope 6 at $DIR/retag.rs:44:16: 44:18
- _18 = &_1; // bb4[34]: scope 6 at $DIR/retag.rs:44:16: 44:18
- Retag(_18); // bb4[35]: scope 6 at $DIR/retag.rs:44:16: 44:18
- _17 = &(*_18); // bb4[36]: scope 6 at $DIR/retag.rs:44:16: 44:18
- Retag(_17); // bb4[37]: scope 6 at $DIR/retag.rs:44:16: 44:18
- _15 = move _16(move _17) -> bb5; // bb4[38]: scope 6 at $DIR/retag.rs:44:14: 44:19
+ Retag(_14); // scope 1 at $DIR/retag.rs:40:31: 43:6
+ _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:40:31: 43:6
+ StorageDead(_14); // scope 1 at $DIR/retag.rs:43:5: 43:6
+ StorageLive(_15); // scope 6 at $DIR/retag.rs:44:9: 44:11
+ StorageLive(_16); // scope 6 at $DIR/retag.rs:44:14: 44:15
+ _16 = _13; // scope 6 at $DIR/retag.rs:44:14: 44:15
+ StorageLive(_17); // scope 6 at $DIR/retag.rs:44:16: 44:18
+ StorageLive(_18); // scope 6 at $DIR/retag.rs:44:16: 44:18
+ _18 = &_1; // scope 6 at $DIR/retag.rs:44:16: 44:18
+ Retag(_18); // scope 6 at $DIR/retag.rs:44:16: 44:18
+ _17 = &(*_18); // scope 6 at $DIR/retag.rs:44:16: 44:18
+ Retag(_17); // scope 6 at $DIR/retag.rs:44:16: 44:18
+ _15 = move _16(move _17) -> bb5; // scope 6 at $DIR/retag.rs:44:14: 44:19
}
bb5: {
- Retag(_15); // bb5[0]: scope 6 at $DIR/retag.rs:44:14: 44:19
- StorageDead(_17); // bb5[1]: scope 6 at $DIR/retag.rs:44:18: 44:19
- StorageDead(_16); // bb5[2]: scope 6 at $DIR/retag.rs:44:18: 44:19
- StorageDead(_18); // bb5[3]: scope 6 at $DIR/retag.rs:44:19: 44:20
- StorageLive(_19); // bb5[4]: scope 7 at $DIR/retag.rs:47:5: 47:24
- StorageLive(_20); // bb5[5]: scope 7 at $DIR/retag.rs:47:5: 47:12
- StorageLive(_21); // bb5[6]: scope 7 at $DIR/retag.rs:47:5: 47:12
- _21 = Test(const 0i32); // bb5[7]: scope 7 at $DIR/retag.rs:47:5: 47:12
+ Retag(_15); // scope 6 at $DIR/retag.rs:44:14: 44:19
+ StorageDead(_17); // scope 6 at $DIR/retag.rs:44:18: 44:19
+ StorageDead(_16); // scope 6 at $DIR/retag.rs:44:18: 44:19
+ StorageDead(_18); // scope 6 at $DIR/retag.rs:44:19: 44:20
+ StorageLive(_19); // scope 7 at $DIR/retag.rs:47:5: 47:24
+ StorageLive(_20); // scope 7 at $DIR/retag.rs:47:5: 47:12
+ StorageLive(_21); // scope 7 at $DIR/retag.rs:47:5: 47:12
+ _21 = Test(const 0i32); // scope 7 at $DIR/retag.rs:47:5: 47:12
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/retag.rs:47:10: 47:11
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- _20 = &_21; // bb5[8]: scope 7 at $DIR/retag.rs:47:5: 47:12
- Retag(_20); // bb5[9]: scope 7 at $DIR/retag.rs:47:5: 47:12
- StorageLive(_22); // bb5[10]: scope 7 at $DIR/retag.rs:47:21: 47:23
- StorageLive(_23); // bb5[11]: scope 7 at $DIR/retag.rs:47:21: 47:23
- _27 = const main::promoted[0]; // bb5[12]: scope 7 at $DIR/retag.rs:47:21: 47:23
+ _20 = &_21; // scope 7 at $DIR/retag.rs:47:5: 47:12
+ Retag(_20); // scope 7 at $DIR/retag.rs:47:5: 47:12
+ StorageLive(_22); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ StorageLive(_23); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ _27 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:47:21: 47:23
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:13 ~ retag[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/retag.rs:47:21: 47:23
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:13 ~ retag[317d]::main[0]), [], Some(promoted[0])) }
- Retag(_27); // bb5[13]: scope 7 at $DIR/retag.rs:47:21: 47:23
- _23 = &(*_27); // bb5[14]: scope 7 at $DIR/retag.rs:47:21: 47:23
- Retag(_23); // bb5[15]: scope 7 at $DIR/retag.rs:47:21: 47:23
- _22 = &(*_23); // bb5[16]: scope 7 at $DIR/retag.rs:47:21: 47:23
- Retag(_22); // bb5[17]: scope 7 at $DIR/retag.rs:47:21: 47:23
- _19 = const Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // bb5[18]: scope 7 at $DIR/retag.rs:47:5: 47:24
+ Retag(_27); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ _23 = &(*_27); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ Retag(_23); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ _22 = &(*_23); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ Retag(_22); // scope 7 at $DIR/retag.rs:47:21: 47:23
+ _19 = const Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // scope 7 at $DIR/retag.rs:47:5: 47:24
// ty::Const
// + ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}
// + val: Value(Scalar(<ZST>))
}
bb6: {
- Retag(_19); // bb6[0]: scope 7 at $DIR/retag.rs:47:5: 47:24
- StorageDead(_22); // bb6[1]: scope 7 at $DIR/retag.rs:47:23: 47:24
- StorageDead(_20); // bb6[2]: scope 7 at $DIR/retag.rs:47:23: 47:24
- StorageDead(_23); // bb6[3]: scope 7 at $DIR/retag.rs:47:24: 47:25
- drop(_21) -> [return: bb8, unwind: bb1]; // bb6[4]: scope 7 at $DIR/retag.rs:47:24: 47:25
+ Retag(_19); // scope 7 at $DIR/retag.rs:47:5: 47:24
+ StorageDead(_22); // scope 7 at $DIR/retag.rs:47:23: 47:24
+ StorageDead(_20); // scope 7 at $DIR/retag.rs:47:23: 47:24
+ StorageDead(_23); // scope 7 at $DIR/retag.rs:47:24: 47:25
+ drop(_21) -> [return: bb8, unwind: bb1]; // scope 7 at $DIR/retag.rs:47:24: 47:25
}
bb7 (cleanup): {
- drop(_21) -> bb1; // bb7[0]: scope 7 at $DIR/retag.rs:47:24: 47:25
+ drop(_21) -> bb1; // scope 7 at $DIR/retag.rs:47:24: 47:25
}
bb8: {
- StorageDead(_21); // bb8[0]: scope 7 at $DIR/retag.rs:47:24: 47:25
- StorageDead(_19); // bb8[1]: scope 7 at $DIR/retag.rs:47:24: 47:25
- StorageLive(_25); // bb8[2]: scope 7 at $DIR/retag.rs:50:9: 50:11
- StorageLive(_26); // bb8[3]: scope 7 at $DIR/retag.rs:50:14: 50:28
- _26 = &raw const (*_15); // bb8[4]: scope 7 at $DIR/retag.rs:50:14: 50:16
- Retag([raw] _26); // bb8[5]: scope 7 at $DIR/retag.rs:50:14: 50:16
- _25 = _26; // bb8[6]: scope 7 at $DIR/retag.rs:50:14: 50:28
- StorageDead(_26); // bb8[7]: scope 7 at $DIR/retag.rs:50:28: 50:29
- _0 = const (); // bb8[8]: scope 0 at $DIR/retag.rs:29:11: 51:2
+ StorageDead(_21); // scope 7 at $DIR/retag.rs:47:24: 47:25
+ StorageDead(_19); // scope 7 at $DIR/retag.rs:47:24: 47:25
+ StorageLive(_25); // scope 7 at $DIR/retag.rs:50:9: 50:11
+ StorageLive(_26); // scope 7 at $DIR/retag.rs:50:14: 50:28
+ _26 = &raw const (*_15); // scope 7 at $DIR/retag.rs:50:14: 50:16
+ Retag([raw] _26); // scope 7 at $DIR/retag.rs:50:14: 50:16
+ _25 = _26; // scope 7 at $DIR/retag.rs:50:14: 50:28
+ StorageDead(_26); // scope 7 at $DIR/retag.rs:50:28: 50:29
+ _0 = const (); // scope 0 at $DIR/retag.rs:29:11: 51:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/retag.rs:29:11: 51:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_25); // bb8[9]: scope 7 at $DIR/retag.rs:51:1: 51:2
- StorageDead(_15); // bb8[10]: scope 6 at $DIR/retag.rs:51:1: 51:2
- StorageDead(_13); // bb8[11]: scope 1 at $DIR/retag.rs:51:1: 51:2
- StorageDead(_1); // bb8[12]: scope 0 at $DIR/retag.rs:51:1: 51:2
- return; // bb8[13]: scope 0 at $DIR/retag.rs:51:2: 51:2
+ StorageDead(_25); // scope 7 at $DIR/retag.rs:51:1: 51:2
+ StorageDead(_15); // scope 6 at $DIR/retag.rs:51:1: 51:2
+ StorageDead(_13); // scope 1 at $DIR/retag.rs:51:1: 51:2
+ StorageDead(_1); // scope 0 at $DIR/retag.rs:51:1: 51:2
+ return; // scope 0 at $DIR/retag.rs:51:2: 51:2
}
}
let mut _3: (); // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
bb0: {
- Retag([raw] _1); // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _2 = &mut (*_1); // bb0[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _3 = const <Test as std::ops::Drop>::drop(move _2) -> bb1; // bb0[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ Retag([raw] _1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _2 = &mut (*_1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _3 = const <Test as std::ops::Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: for<'r> fn(&'r mut Test) {<Test as std::ops::Drop>::drop}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- return; // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ return; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
}
let mut _3: &mut i32; // in scope 0 at $DIR/retag.rs:14:9: 14:10
bb0: {
- Retag([fn entry] _1); // bb0[0]: scope 0 at $DIR/retag.rs:13:5: 15:6
- Retag([fn entry] _2); // bb0[1]: scope 0 at $DIR/retag.rs:13:5: 15:6
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/retag.rs:14:9: 14:10
- _3 = &mut (*_2); // bb0[3]: scope 0 at $DIR/retag.rs:14:9: 14:10
- Retag(_3); // bb0[4]: scope 0 at $DIR/retag.rs:14:9: 14:10
- _0 = &mut (*_3); // bb0[5]: scope 0 at $DIR/retag.rs:14:9: 14:10
- Retag(_0); // bb0[6]: scope 0 at $DIR/retag.rs:14:9: 14:10
- StorageDead(_3); // bb0[7]: scope 0 at $DIR/retag.rs:15:5: 15:6
- return; // bb0[8]: scope 0 at $DIR/retag.rs:15:6: 15:6
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:13:5: 15:6
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:13:5: 15:6
+ StorageLive(_3); // scope 0 at $DIR/retag.rs:14:9: 14:10
+ _3 = &mut (*_2); // scope 0 at $DIR/retag.rs:14:9: 14:10
+ Retag(_3); // scope 0 at $DIR/retag.rs:14:9: 14:10
+ _0 = &mut (*_3); // scope 0 at $DIR/retag.rs:14:9: 14:10
+ Retag(_0); // scope 0 at $DIR/retag.rs:14:9: 14:10
+ StorageDead(_3); // scope 0 at $DIR/retag.rs:15:5: 15:6
+ return; // scope 0 at $DIR/retag.rs:15:6: 15:6
}
}
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:16:42: 16:49
bb0: {
- Retag([fn entry] _1); // bb0[0]: scope 0 at $DIR/retag.rs:16:5: 18:6
- Retag([fn entry] _2); // bb0[1]: scope 0 at $DIR/retag.rs:16:5: 18:6
- _0 = _2; // bb0[2]: scope 0 at $DIR/retag.rs:17:9: 17:10
- Retag(_0); // bb0[3]: scope 0 at $DIR/retag.rs:17:9: 17:10
- return; // bb0[4]: scope 0 at $DIR/retag.rs:18:6: 18:6
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:16:5: 18:6
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:16:5: 18:6
+ _0 = _2; // scope 0 at $DIR/retag.rs:17:9: 17:10
+ Retag(_0); // scope 0 at $DIR/retag.rs:17:9: 17:10
+ return; // scope 0 at $DIR/retag.rs:18:6: 18:6
}
}
let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32
bb0: {
- FakeRead(ForMatchedPlace, _1); // bb0[0]: scope 0 at $DIR/simple-match.rs:6:11: 6:12
- switchInt(_1) -> [false: bb3, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+ FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12
+ switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/simple-match.rs:5:1: 10:2
+ resume; // scope 0 at $DIR/simple-match.rs:5:1: 10:2
}
bb2: {
- falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+ falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
}
bb3: {
- _0 = const 20usize; // bb3[0]: scope 0 at $DIR/simple-match.rs:8:14: 8:16
+ _0 = const 20usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000014))
// mir::Constant
// + span: $DIR/simple-match.rs:8:14: 8:16
// + literal: Const { ty: usize, val: Value(Scalar(0x00000014)) }
- goto -> bb5; // bb3[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+ goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb4: {
- _0 = const 10usize; // bb4[0]: scope 0 at $DIR/simple-match.rs:7:17: 7:19
+ _0 = const 10usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000a))
// mir::Constant
// + span: $DIR/simple-match.rs:7:17: 7:19
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000a)) }
- goto -> bb5; // bb4[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+ goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb5: {
- goto -> bb6; // bb5[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+ goto -> bb6; // scope 0 at $DIR/simple-match.rs:10:2: 10:2
}
bb6: {
- return; // bb6[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+ return; // scope 0 at $DIR/simple-match.rs:10:2: 10:2
}
}
let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32
bb0: {
- FakeRead(ForMatchedPlace, _1); // bb0[0]: scope 0 at $DIR/simple-match.rs:6:11: 6:12
- switchInt(_1) -> [false: bb3, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+ FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12
+ switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/simple-match.rs:5:1: 10:2
+ resume; // scope 0 at $DIR/simple-match.rs:5:1: 10:2
}
bb2: {
- falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+ falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
}
bb3: {
- _0 = const 20usize; // bb3[0]: scope 0 at $DIR/simple-match.rs:8:14: 8:16
+ _0 = const 20usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000014))
// mir::Constant
// + span: $DIR/simple-match.rs:8:14: 8:16
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000014)) }
- goto -> bb5; // bb3[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+ goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb4: {
- _0 = const 10usize; // bb4[0]: scope 0 at $DIR/simple-match.rs:7:17: 7:19
+ _0 = const 10usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x000000000000000a))
// mir::Constant
// + span: $DIR/simple-match.rs:7:17: 7:19
// + literal: Const { ty: usize, val: Value(Scalar(0x000000000000000a)) }
- goto -> bb5; // bb4[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+ goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb5: {
- goto -> bb6; // bb5[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+ goto -> bb6; // scope 0 at $DIR/simple-match.rs:10:2: 10:2
}
bb6: {
- return; // bb6[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+ return; // scope 0 at $DIR/simple-match.rs:10:2: 10:2
}
}
// Regression test for issue #66856.
//
// compile-flags: -Zmir-opt-level=2
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
enum Src {
Foo(u8),
--- /dev/null
+- // MIR for `main` before SimplifyArmIdentity
++ // MIR for `main` after SimplifyArmIdentity
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
+ let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ let mut _2: Dst; // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+ let mut _3: isize; // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+ let mut _5: u8; // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34
+ scope 1 {
+ debug e => _1; // in scope 1 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ let _4: u8; // in scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ scope 2 {
+ }
+ scope 3 {
+ debug x => _4; // in scope 3 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
+ // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
+ discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+ StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+ _3 = const 0isize; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
+ _4 = ((_1 as Foo).0: u8); // scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ ((_2 as Foo).0: u8) = move _4; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+ discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+ StorageDead(_2); // scope 1 at $DIR/simplify-arm-identity.rs:22:6: 22:7
+ _0 = const (); // scope 0 at $DIR/simplify-arm-identity.rs:17:11: 23:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:17:11: 23:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_1); // scope 0 at $DIR/simplify-arm-identity.rs:23:1: 23:2
+ return; // scope 0 at $DIR/simplify-arm-identity.rs:23:2: 23:2
+ }
+ }
+
--- /dev/null
+- // MIR for `main` before SimplifyArmIdentity
++ // MIR for `main` after SimplifyArmIdentity
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
+ let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ let mut _2: Dst; // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+ let mut _3: isize; // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+ let mut _5: u8; // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34
+ scope 1 {
+ debug e => _1; // in scope 1 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ let _4: u8; // in scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ scope 2 {
+ }
+ scope 3 {
+ debug x => _4; // in scope 3 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+ ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+ // ty::Const
+ // + ty: u8
+ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
+ // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
+ discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+ StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+ _3 = const 0isize; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+ // ty::Const
+ // + ty: isize
+ // + val: Value(Scalar(0x0000000000000000))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
+ _4 = ((_1 as Foo).0: u8); // scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+ ((_2 as Foo).0: u8) = move _4; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+ discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+ StorageDead(_2); // scope 1 at $DIR/simplify-arm-identity.rs:22:6: 22:7
+ _0 = const (); // scope 0 at $DIR/simplify-arm-identity.rs:17:11: 23:2
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/simplify-arm-identity.rs:17:11: 23:2
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ StorageDead(_1); // scope 0 at $DIR/simplify-arm-identity.rs:23:1: 23:2
+ return; // scope 0 at $DIR/simplify-arm-identity.rs:23:2: 23:2
+ }
+ }
+
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10
- ((_1 as Foo).0: u8) = const 0u8; // bb0[1]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
+ StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10
+ ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/simplify-arm-identity.rs:17:27: 17:28
// + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
- discriminant(_1) = 0; // bb0[2]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
- _3 = discriminant(_1); // bb0[4]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
- switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; // bb0[5]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
+ discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
+ StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+ _3 = discriminant(_1); // scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
+ switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; // scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
}
bb1: {
- ((_2 as Foo).0: u8) = const 0u8; // bb1[0]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
+ ((_2 as Foo).0: u8) = const 0u8; // scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/simplify-arm-identity.rs:20:30: 20:31
// + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
- discriminant(_2) = 0; // bb1[1]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
- goto -> bb4; // bb1[2]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+ discriminant(_2) = 0; // scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
+ goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
}
bb2: {
- unreachable; // bb2[0]: scope 1 at $DIR/simplify-arm-identity.rs:18:24: 18:25
+ unreachable; // scope 1 at $DIR/simplify-arm-identity.rs:18:24: 18:25
}
bb3: {
- _4 = ((_1 as Foo).0: u8); // bb3[0]: scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19
- ((_2 as Foo).0: u8) = move _4; // bb3[1]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
- discriminant(_2) = 0; // bb3[2]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
- goto -> bb4; // bb3[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+ _4 = ((_1 as Foo).0: u8); // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19
+ ((_2 as Foo).0: u8) = move _4; // scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
+ discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
+ goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
}
bb4: {
- StorageDead(_2); // bb4[0]: scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7
- _0 = const (); // bb4[1]: scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2
+ StorageDead(_2); // scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7
+ _0 = const (); // scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-arm-identity.rs:16:11: 22:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb4[2]: scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2
- return; // bb4[3]: scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2
+ StorageDead(_1); // scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2
+ return; // scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
- discriminant(_2) = 0; // bb0[2]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
- StorageLive(_3); // bb0[3]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
- discriminant(_3) = 0; // bb0[4]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
- (_1.0: std::option::Option<u8>) = move _2; // bb0[5]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
- (_1.1: std::option::Option<T>) = move _3; // bb0[6]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
- StorageDead(_3); // bb0[7]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
- StorageDead(_2); // bb0[8]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
- _5 = discriminant((_1.0: std::option::Option<u8>)); // bb0[9]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
- switchInt(move _5) -> [1isize: bb2, otherwise: bb1]; // bb0[10]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
+ StorageLive(_1); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+ StorageLive(_2); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+ discriminant(_2) = 0; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+ StorageLive(_3); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+ discriminant(_3) = 0; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+ (_1.0: std::option::Option<u8>) = move _2; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+ (_1.1: std::option::Option<T>) = move _3; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+ StorageDead(_3); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+ StorageDead(_2); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+ _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
+ switchInt(move _5) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
}
bb1: {
- _0 = const (); // bb1[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+ _0 = const (); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb7; // bb1[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+ goto -> bb7; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
}
bb2: {
- _4 = discriminant((_1.1: std::option::Option<T>)); // bb2[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
- switchInt(move _4) -> [0isize: bb3, otherwise: bb1]; // bb2[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
+ _4 = discriminant((_1.1: std::option::Option<T>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
+ switchInt(move _4) -> [0isize: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
}
bb3: {
- StorageLive(_6); // bb3[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
- _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // bb3[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
- StorageLive(_7); // bb3[2]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
- StorageLive(_8); // bb3[3]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
- _8 = _6; // bb3[4]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
- _7 = Gt(move _8, const 42u8); // bb3[5]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+ StorageLive(_6); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
+ _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
+ StorageLive(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+ StorageLive(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+ _8 = _6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+ _7 = Gt(move _8, const 42u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
// ty::Const
// + ty: u8
// + val: Value(Scalar(0x2a))
// mir::Constant
// + span: $DIR/simplify-locals-fixedpoint.rs:5:16: 5:20
// + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
- StorageDead(_8); // bb3[6]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
- switchInt(_7) -> [false: bb4, otherwise: bb5]; // bb3[7]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+ StorageDead(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
+ switchInt(_7) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
}
bb4: {
- _0 = const (); // bb4[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+ _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb6; // bb4[1]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+ goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
}
bb5: {
- _0 = const (); // bb5[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
+ _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb6; // bb5[1]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+ goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
}
bb6: {
- StorageDead(_7); // bb6[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
- StorageDead(_6); // bb6[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
- goto -> bb7; // bb6[2]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+ StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
+ StorageDead(_6); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
+ goto -> bb7; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
}
bb7: {
- drop(_1) -> bb8; // bb7[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
+ drop(_1) -> bb8; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
}
bb8: {
- StorageDead(_1); // bb8[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
- return; // bb8[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:2: 9:2
+ StorageDead(_1); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
+ return; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:2: 9:2
}
}
}
bb0: {
-- StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
-- StorageLive(_2); // bb0[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
-- _2 = const (); // bb0[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
-+ StorageLive(_1); // bb0[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
-+ _1 = const use_zst(const ((), ())) -> bb1; // bb0[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+- StorageLive(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
+- StorageLive(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
+- _2 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
++ StorageLive(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
++ _1 = const use_zst(const ((), ())) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
// ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageLive(_3); // bb0[3]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
-- _3 = const (); // bb0[4]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
+- StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
+- _3 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- _1 = const ((), ()); // bb0[5]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
+- _1 = const ((), ()); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
- // ty::Const
- // + ty: ((), ())
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
- // + literal: Const { ty: ((), ()), val: Value(Scalar(<ZST>)) }
-- StorageDead(_3); // bb0[6]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
-- StorageDead(_2); // bb0[7]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
-- StorageDead(_1); // bb0[8]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:28: 13:29
-- StorageLive(_4); // bb0[9]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
-- StorageLive(_6); // bb0[10]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
-- _6 = const (); // bb0[11]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
+- StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
+- StorageDead(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
+- StorageDead(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:28: 13:29
+- StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+- StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
+- _6 = const (); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageLive(_7); // bb0[12]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
-- _7 = const (); // bb0[13]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
+- StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
+- _7 = const (); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageDead(_7); // bb0[14]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
-- StorageDead(_6); // bb0[15]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
-- _4 = const use_zst(const ((), ())) -> bb1; // bb0[16]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+- StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
+- StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
+- _4 = const use_zst(const ((), ())) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
- // ty::Const
// + ty: fn(((), ())) {use_zst}
// + val: Value(Scalar(<ZST>))
}
bb1: {
-- StorageDead(_4); // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
-- StorageLive(_8); // bb1[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
-- StorageLive(_10); // bb1[2]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
-- StorageLive(_11); // bb1[3]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
-- _11 = const Temp { x: 40u8 }; // bb1[4]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
-+ StorageDead(_1); // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
-+ StorageLive(_2); // bb1[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
-+ _2 = const use_u8(const 42u8) -> bb2; // bb1[2]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+- StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
+- StorageLive(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+- StorageLive(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
+- StorageLive(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
+- _11 = const Temp { x: 40u8 }; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
++ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
++ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
++ _2 = const use_u8(const 42u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
// ty::Const
- // + ty: Temp
- // + val: Value(Scalar(0x28))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
- // + literal: Const { ty: Temp, val: Value(Scalar(0x28)) }
-- _10 = const 40u8; // bb1[5]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
+- _10 = const 40u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x28))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
- // + literal: Const { ty: u8, val: Value(Scalar(0x28)) }
-- StorageDead(_10); // bb1[6]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:33: 16:34
-- _8 = const use_u8(const 42u8) -> bb2; // bb1[7]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+- StorageDead(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:33: 16:34
+- _8 = const use_u8(const 42u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
- // ty::Const
// + ty: fn(u8) {use_u8}
// + val: Value(Scalar(<ZST>))
}
bb2: {
-- StorageDead(_11); // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
-- StorageDead(_8); // bb2[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
-- _0 = const (); // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
-+ StorageDead(_2); // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
-+ _0 = const (); // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
+- StorageDead(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
+- StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
++ StorageDead(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
+ _0 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- return; // bb2[3]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
-+ return; // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
+ return; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
}
}
}
bb0: {
- _2 = discriminant(_1); // bb0[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- switchInt(move _2) -> [0isize: bb2, otherwise: bb1]; // bb0[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+ _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+ switchInt(move _2) -> [0isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
}
bb1: {
- _0 = move _1; // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
- goto -> bb3; // bb1[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
+ _0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
+ goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
}
bb2: {
- discriminant(_0) = 0; // bb2[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
- goto -> bb3; // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
+ discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
+ goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
}
bb3: {
-- _5 = discriminant(_1); // bb3[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
-- return; // bb3[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
-+ return; // bb3[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
+- _5 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
+ return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
}
}
let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
bb0: {
-- goto -> bb1; // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
- }
-
- bb1: {
-- StorageLive(_2); // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-- _2 = const bar() -> bb3; // bb1[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+ StorageLive(_2); // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+ _2 = const bar() -> bb1; // bb0[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+ StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+- _2 = const bar() -> bb3; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
++ _2 = const bar() -> bb1; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
// ty::Const
// + ty: fn() -> bool {bar}
// + val: Value(Scalar(<ZST>))
}
- bb2 (cleanup): {
-- resume; // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+- resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+ bb1: {
-+ switchInt(_2) -> [false: bb2, otherwise: bb3]; // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++ switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
}
- bb3: {
-- nop; // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-- switchInt(_2) -> [false: bb5, otherwise: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+- nop; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+- switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
- }
-
- bb4: {
-- goto -> bb6; // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+- goto -> bb6; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
- }
-
- bb5: {
-- _1 = const (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ bb2: {
-+ _1 = const (); // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_cfg.rs:7:9: 9:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageDead(_2); // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-- goto -> bb0; // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
-+ StorageDead(_2); // bb2[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+ goto -> bb0; // bb2[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
}
- bb6: {
-- _0 = const (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+ bb3: {
-+ _0 = const (); // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+ _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_cfg.rs:8:13: 8:18
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- StorageDead(_2); // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-- return; // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
-+ StorageDead(_2); // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+ return; // bb3[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+ return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
}
}
let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
bb0: {
-- goto -> bb1; // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
-+ falseUnwind -> [real: bb1, cleanup: bb2]; // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
++ falseUnwind -> [real: bb1, cleanup: bb2]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
}
bb1: {
-- falseUnwind -> [real: bb3, cleanup: bb4]; // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+- falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
- }
-
- bb2: {
-- goto -> bb13; // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+- goto -> bb13; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
- }
-
- bb3: {
-- StorageLive(_2); // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-- _2 = const bar() -> [return: bb5, unwind: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+ StorageLive(_2); // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+ _2 = const bar() -> [return: bb3, unwind: bb2]; // bb1[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+ StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+- _2 = const bar() -> [return: bb5, unwind: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
++ _2 = const bar() -> [return: bb3, unwind: bb2]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
// ty::Const
// + ty: fn() -> bool {bar}
// + val: Value(Scalar(<ZST>))
}
- bb4 (cleanup): {
-- resume; // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+ bb2 (cleanup): {
-+ resume; // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+ resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
}
- bb5: {
-- FakeRead(ForMatchedPlace, _2); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-- switchInt(_2) -> [false: bb7, otherwise: bb6]; // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ bb3: {
-+ FakeRead(ForMatchedPlace, _2); // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+ switchInt(_2) -> [false: bb5, otherwise: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+- switchInt(_2) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++ switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
}
- bb6: {
-- falseEdges -> [real: bb8, imaginary: bb7]; // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+- falseEdges -> [real: bb8, imaginary: bb7]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ bb4: {
-+ falseEdges -> [real: bb6, imaginary: bb5]; // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++ falseEdges -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
}
- bb7: {
-- _1 = const (); // bb7[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ bb5: {
-+ _1 = const (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+ _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_cfg.rs:7:9: 9:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb12; // bb7[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
-+ StorageDead(_2); // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+ goto -> bb0; // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+- goto -> bb12; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
++ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
}
- bb8: {
-- _0 = const (); // bb8[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+ bb6: {
-+ _0 = const (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+ _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_cfg.rs:8:13: 8:18
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb9; // bb8[1]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
- }
-
- bb9: {
-- StorageDead(_2); // bb9[0]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-- goto -> bb2; // bb9[1]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+- goto -> bb2; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
- }
-
- bb10: {
-- unreachable; // bb10[0]: scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
+- unreachable; // scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
- }
-
- bb11: {
-- goto -> bb12; // bb11[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+- goto -> bb12; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
- }
-
- bb12: {
-- StorageDead(_2); // bb12[0]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-- goto -> bb1; // bb12[1]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
- }
-
- bb13: {
-- return; // bb13[0]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
-+ StorageDead(_2); // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+ return; // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+ return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
}
}
let _2: (); // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13
- _1 = const false; // bb0[1]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13
+ StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
+ _1 = const false; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $DIR/simplify_if.rs:6:8: 6:13
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-- switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+- switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify_if.rs:6:5: 8:6
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ goto -> bb1; // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
++ goto -> bb1; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
}
bb1: {
- _0 = const (); // bb1[0]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+ _0 = const (); // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_if.rs:6:5: 8:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb4; // bb1[1]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+ goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
}
bb2: {
- StorageLive(_2); // bb2[0]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15
- _2 = const noop() -> bb3; // bb2[1]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15
+ StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
+ _2 = const noop() -> bb3; // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
// ty::Const
// + ty: fn() {noop}
// + val: Value(Scalar(<ZST>))
}
bb3: {
- StorageDead(_2); // bb3[0]: scope 0 at $DIR/simplify_if.rs:7:15: 7:16
- _0 = const (); // bb3[1]: scope 0 at $DIR/simplify_if.rs:6:14: 8:6
+ StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:7:15: 7:16
+ _0 = const (); // scope 0 at $DIR/simplify_if.rs:6:14: 8:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify_if.rs:6:14: 8:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb4; // bb3[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+ goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
}
bb4: {
- StorageDead(_1); // bb4[0]: scope 0 at $DIR/simplify_if.rs:9:1: 9:2
- return; // bb4[1]: scope 0 at $DIR/simplify_if.rs:9:2: 9:2
+ StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:9:1: 9:2
+ return; // scope 0 at $DIR/simplify_if.rs:9:2: 9:2
}
}
#[inline(never)]
fn noop() {}
-// EMIT_MIR rustc.main.SimplifyBranches-after-copy-prop.diff
+// EMIT_MIR rustc.main.ConstProp.diff
fn main() {
match { let x = false; x } {
true => noop(),
--- /dev/null
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11
+ let mut _1: bool; // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31
+ let _2: bool; // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/simplify_match.rs:6:11: 6:31
+ StorageLive(_2); // scope 0 at $DIR/simplify_match.rs:6:17: 6:18
+ _2 = const false; // scope 0 at $DIR/simplify_match.rs:6:21: 6:26
+ // ty::Const
+ // + ty: bool
+ // + val: Value(Scalar(0x00))
+ // mir::Constant
+ // + span: $DIR/simplify_match.rs:6:21: 6:26
+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+- _1 = _2; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
++ _1 = const false; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/simplify_match.rs:6:28: 6:29
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:6:30: 6:31
+- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
++ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
++ // ty::Const
++ // + ty: bool
++ // + val: Value(Scalar(0x00))
++ // mir::Constant
++ // + span: $DIR/simplify_match.rs:7:9: 7:13
++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ }
+
+ bb1: {
+ _0 = const (); // scope 0 at $DIR/simplify_match.rs:8:18: 8:20
+ // ty::Const
+ // + ty: ()
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/simplify_match.rs:8:18: 8:20
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+ goto -> bb3; // scope 0 at $DIR/simplify_match.rs:6:5: 9:6
+ }
+
+ bb2: {
+ _0 = const noop() -> bb3; // scope 0 at $DIR/simplify_match.rs:7:17: 7:23
+ // ty::Const
+ // + ty: fn() {noop}
+ // + val: Value(Scalar(<ZST>))
+ // mir::Constant
+ // + span: $DIR/simplify_match.rs:7:17: 7:21
+ // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) }
+ }
+
+ bb3: {
+ StorageDead(_1); // scope 0 at $DIR/simplify_match.rs:10:1: 10:2
+ return; // scope 0 at $DIR/simplify_match.rs:10:2: 10:2
+ }
+ }
+
+++ /dev/null
-- // MIR for `main` before SimplifyBranches-after-copy-prop
-+ // MIR for `main` after SimplifyBranches-after-copy-prop
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11
- let mut _1: bool; // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31
- let _2: bool; // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18
- scope 1 {
- debug x => _2; // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18
- }
-
- bb0: {
- nop; // bb0[0]: scope 0 at $DIR/simplify_match.rs:6:11: 6:31
- nop; // bb0[1]: scope 0 at $DIR/simplify_match.rs:6:17: 6:18
- nop; // bb0[2]: scope 0 at $DIR/simplify_match.rs:6:21: 6:26
- nop; // bb0[3]: scope 1 at $DIR/simplify_match.rs:6:28: 6:29
- nop; // bb0[4]: scope 0 at $DIR/simplify_match.rs:6:30: 6:31
-- switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[5]: scope 0 at $DIR/simplify_match.rs:7:9: 7:13
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x00))
-- // mir::Constant
-- // + span: $DIR/simplify_match.rs:6:21: 6:26
-- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ goto -> bb1; // bb0[5]: scope 0 at $DIR/simplify_match.rs:7:9: 7:13
- }
-
- bb1: {
- _0 = const (); // bb1[0]: scope 0 at $DIR/simplify_match.rs:8:18: 8:20
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify_match.rs:8:18: 8:20
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb3; // bb1[1]: scope 0 at $DIR/simplify_match.rs:6:5: 9:6
- }
-
- bb2: {
- _0 = const noop() -> bb3; // bb2[0]: scope 0 at $DIR/simplify_match.rs:7:17: 7:23
- // ty::Const
- // + ty: fn() {noop}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify_match.rs:7:17: 7:21
- // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) }
- }
-
- bb3: {
- nop; // bb3[0]: scope 0 at $DIR/simplify_match.rs:10:1: 10:2
- return; // bb3[1]: scope 0 at $DIR/simplify_match.rs:10:2: 10:2
- }
- }
-
}
bb0: {
- _5 = discriminant(_1); // bb0[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- switchInt(move _5) -> [0isize: bb1, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ _5 = discriminant(_1); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ switchInt(move _5) -> [0isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb1: {
-- _10 = ((_1 as Ok).0: u32); // bb1[0]: scope 0 at $DIR/simplify_try.rs:6:13: 6:15
-- ((_0 as Ok).0: u32) = move _10; // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-- discriminant(_0) = 0; // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+ _0 = move _1; // bb1[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+ nop; // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+ nop; // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- goto -> bb3; // bb1[3]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+- _10 = ((_1 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
+- ((_0 as Ok).0: u32) = move _10; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+- discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++ _0 = move _1; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++ nop; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++ nop; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+ goto -> bb3; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
bb2: {
-- _6 = ((_1 as Err).0: i32); // bb2[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
-- ((_0 as Err).0: i32) = move _6; // bb2[1]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-- discriminant(_0) = 1; // bb2[2]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+ _0 = move _1; // bb2[0]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+ nop; // bb2[1]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+ nop; // bb2[2]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- goto -> bb3; // bb2[3]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+- _6 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+- ((_0 as Err).0: i32) = move _6; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
+- discriminant(_0) = 1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++ _0 = move _1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++ nop; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++ nop; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
+ goto -> bb3; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb3: {
- return; // bb3[0]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+ return; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
}
}
bb0: {
- _5 = discriminant(_1); // bb0[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- goto -> bb1; // bb0[1]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ _5 = discriminant(_1); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ goto -> bb1; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb1: {
- _0 = move _1; // bb1[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- nop; // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- nop; // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- goto -> bb2; // bb1[3]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+ _0 = move _1; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+ nop; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+ nop; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+ goto -> bb2; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
bb2: {
- return; // bb2[0]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+ return; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
}
}
bb0: {
- _0 = move _1; // bb0[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- return; // bb0[1]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+ _0 = move _1; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+ return; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
}
let mut _15: *mut [std::string::String]; // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
bb0: {
- goto -> bb15; // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb15; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb1: {
- return; // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ return; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb2 (cleanup): {
- resume; // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ resume; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb3 (cleanup): {
- _5 = &raw mut (*_1)[_4]; // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _4 = Add(move _4, const 1usize); // bb3[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- drop((*_5)) -> bb4; // bb3[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb4 (cleanup): {
- _6 = Eq(_4, _3); // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _6) -> [false: bb3, otherwise: bb2]; // bb4[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _6 = Eq(_4, _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb5: {
- _7 = &raw mut (*_1)[_4]; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _4 = Add(move _4, const 1usize); // bb5[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- drop((*_7)) -> [return: bb6, unwind: bb4]; // bb5[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb6: {
- _8 = Eq(_4, _3); // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _8) -> [false: bb5, otherwise: bb1]; // bb6[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _8 = Eq(_4, _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb7: {
- _4 = const 0usize; // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = const 0usize; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
- goto -> bb6; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb6; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb8: {
- goto -> bb7; // bb8[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb7; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb9 (cleanup): {
- _11 = _9; // bb9[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = Offset(move _9, const 1usize); // bb9[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _11 = _9; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- drop((*_11)) -> bb10; // bb9[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb10 (cleanup): {
- _12 = Eq(_9, _10); // bb10[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _12) -> [false: bb9, otherwise: bb2]; // bb10[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _12 = Eq(_9, _10); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb11: {
- _13 = _9; // bb11[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = Offset(move _9, const 1usize); // bb11[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _13 = _9; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- drop((*_13)) -> [return: bb12, unwind: bb10]; // bb11[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb12: {
- _14 = Eq(_9, _10); // bb12[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _14) -> [false: bb11, otherwise: bb1]; // bb12[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _14 = Eq(_9, _10); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb13: {
- _15 = &raw mut (*_1); // bb13[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = move _15 as *mut std::string::String (Misc); // bb13[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _10 = Offset(_9, move _3); // bb13[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- goto -> bb12; // bb13[3]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _15 = &raw mut (*_1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _10 = Offset(_9, move _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb12; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb14: {
- goto -> bb13; // bb14[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb13; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb15: {
- _2 = SizeOf(std::string::String); // bb15[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _3 = Len((*_1)); // bb15[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // bb15[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _3 = Len((*_1)); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
}
let mut _15: *mut [std::string::String]; // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
bb0: {
- goto -> bb15; // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb15; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb1: {
- return; // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ return; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb2 (cleanup): {
- resume; // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ resume; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb3 (cleanup): {
- _5 = &raw mut (*_1)[_4]; // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _4 = Add(move _4, const 1usize); // bb3[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- drop((*_5)) -> bb4; // bb3[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb4 (cleanup): {
- _6 = Eq(_4, _3); // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _6) -> [false: bb3, otherwise: bb2]; // bb4[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _6 = Eq(_4, _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb5: {
- _7 = &raw mut (*_1)[_4]; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _4 = Add(move _4, const 1usize); // bb5[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- drop((*_7)) -> [return: bb6, unwind: bb4]; // bb5[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb6: {
- _8 = Eq(_4, _3); // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _8) -> [false: bb5, otherwise: bb1]; // bb6[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _8 = Eq(_4, _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb7: {
- _4 = const 0usize; // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _4 = const 0usize; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000000))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
- goto -> bb6; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb6; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb8: {
- goto -> bb7; // bb8[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb7; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb9 (cleanup): {
- _11 = _9; // bb9[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = Offset(move _9, const 1usize); // bb9[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _11 = _9; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- drop((*_11)) -> bb10; // bb9[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb10 (cleanup): {
- _12 = Eq(_9, _10); // bb10[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _12) -> [false: bb9, otherwise: bb2]; // bb10[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _12 = Eq(_9, _10); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb11: {
- _13 = _9; // bb11[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = Offset(move _9, const 1usize); // bb11[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _13 = _9; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x0000000000000001))
// mir::Constant
// + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- drop((*_13)) -> [return: bb12, unwind: bb10]; // bb11[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb12: {
- _14 = Eq(_9, _10); // bb12[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _14) -> [false: bb11, otherwise: bb1]; // bb12[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _14 = Eq(_9, _10); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb13: {
- _15 = &raw mut (*_1); // bb13[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _9 = move _15 as *mut std::string::String (Misc); // bb13[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _10 = Offset(_9, move _3); // bb13[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- goto -> bb12; // bb13[3]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _15 = &raw mut (*_1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _10 = Offset(_9, move _3); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb12; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb14: {
- goto -> bb13; // bb14[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb13; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb15: {
- _2 = SizeOf(std::string::String); // bb15[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _3 = Len((*_1)); // bb15[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // bb15[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _3 = Len((*_1)); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
}
let mut _48: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- StorageLive(_4); // bb0[3]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- StorageLive(_5); // bb0[4]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- StorageLive(_6); // bb0[5]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
- StorageLive(_7); // bb0[6]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
- _7 = (const 0u32, const 1u32); // bb0[7]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
+ StorageLive(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+ StorageLive(_2); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
+ StorageLive(_3); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ StorageLive(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ StorageLive(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ StorageLive(_6); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
+ StorageLive(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
+ _7 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:8:13: 8:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_8); // bb0[8]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
- _8 = (const 0u32, const 2u32); // bb0[9]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
+ StorageLive(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
+ _8 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:8:21: 8:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_9); // bb0[10]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
- _9 = (const 0u32, const 3u32); // bb0[11]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
+ StorageLive(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
+ _9 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:8:29: 8:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_10); // bb0[12]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
- _10 = (const 0u32, const 1u32); // bb0[13]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
+ StorageLive(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
+ _10 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:9:13: 9:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_11); // bb0[14]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
- _11 = (const 0u32, const 2u32); // bb0[15]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
+ StorageLive(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
+ _11 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:9:21: 9:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_12); // bb0[16]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
- _12 = (const 0u32, const 3u32); // bb0[17]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
+ StorageLive(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
+ _12 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:9:29: 9:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_13); // bb0[18]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
- _13 = (const 0u32, const 1u32); // bb0[19]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
+ StorageLive(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
+ _13 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:10:13: 10:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_14); // bb0[20]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
- _14 = (const 0u32, const 2u32); // bb0[21]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
+ StorageLive(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
+ _14 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:10:21: 10:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_15); // bb0[22]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
- _15 = (const 0u32, const 3u32); // bb0[23]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
+ StorageLive(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
+ _15 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:10:29: 10:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_16); // bb0[24]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
- _16 = (const 0u32, const 1u32); // bb0[25]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
+ StorageLive(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
+ _16 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:11:13: 11:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_17); // bb0[26]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
- _17 = (const 0u32, const 2u32); // bb0[27]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
+ StorageLive(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
+ _17 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:11:21: 11:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_18); // bb0[28]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
- _18 = (const 0u32, const 3u32); // bb0[29]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
+ StorageLive(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
+ _18 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:11:29: 11:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_19); // bb0[30]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
- _19 = (const 0u32, const 1u32); // bb0[31]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
+ StorageLive(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
+ _19 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:12:13: 12:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_20); // bb0[32]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
- _20 = (const 0u32, const 2u32); // bb0[33]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
+ StorageLive(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
+ _20 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:12:21: 12:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_21); // bb0[34]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
- _21 = (const 0u32, const 3u32); // bb0[35]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
+ StorageLive(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
+ _21 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:12:29: 12:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_22); // bb0[36]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
- _22 = (const 0u32, const 1u32); // bb0[37]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
+ StorageLive(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
+ _22 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:13:13: 13:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_23); // bb0[38]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
- _23 = (const 0u32, const 2u32); // bb0[39]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
+ StorageLive(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
+ _23 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:13:21: 13:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_24); // bb0[40]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
- _24 = (const 0u32, const 3u32); // bb0[41]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
+ StorageLive(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
+ _24 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:13:29: 13:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_25); // bb0[42]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
- _25 = (const 0u32, const 1u32); // bb0[43]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
+ StorageLive(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
+ _25 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:14:13: 14:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_26); // bb0[44]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
- _26 = (const 0u32, const 2u32); // bb0[45]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
+ StorageLive(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
+ _26 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:14:21: 14:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_27); // bb0[46]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
- _27 = (const 0u32, const 3u32); // bb0[47]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
+ StorageLive(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
+ _27 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:14:29: 14:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_28); // bb0[48]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
- _28 = (const 0u32, const 1u32); // bb0[49]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
+ StorageLive(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
+ _28 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:15:13: 15:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_29); // bb0[50]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
- _29 = (const 0u32, const 2u32); // bb0[51]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
+ StorageLive(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
+ _29 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:15:21: 15:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_30); // bb0[52]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
- _30 = (const 0u32, const 3u32); // bb0[53]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
+ StorageLive(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
+ _30 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:15:29: 15:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_31); // bb0[54]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
- _31 = (const 0u32, const 1u32); // bb0[55]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
+ StorageLive(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
+ _31 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:16:13: 16:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_32); // bb0[56]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
- _32 = (const 0u32, const 2u32); // bb0[57]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
+ StorageLive(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
+ _32 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:16:21: 16:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_33); // bb0[58]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
- _33 = (const 0u32, const 3u32); // bb0[59]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
+ StorageLive(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
+ _33 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:16:29: 16:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_34); // bb0[60]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
- _34 = (const 0u32, const 1u32); // bb0[61]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
+ StorageLive(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
+ _34 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:17:13: 17:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_35); // bb0[62]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
- _35 = (const 0u32, const 2u32); // bb0[63]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
+ StorageLive(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
+ _35 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:17:21: 17:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_36); // bb0[64]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
- _36 = (const 0u32, const 3u32); // bb0[65]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
+ StorageLive(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
+ _36 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:17:29: 17:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_37); // bb0[66]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
- _37 = (const 0u32, const 1u32); // bb0[67]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
+ StorageLive(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
+ _37 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:18:13: 18:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_38); // bb0[68]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
- _38 = (const 0u32, const 2u32); // bb0[69]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
+ StorageLive(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
+ _38 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:18:21: 18:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_39); // bb0[70]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
- _39 = (const 0u32, const 3u32); // bb0[71]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
+ StorageLive(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
+ _39 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:18:29: 18:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_40); // bb0[72]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
- _40 = (const 0u32, const 1u32); // bb0[73]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
+ StorageLive(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
+ _40 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:19:13: 19:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_41); // bb0[74]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
- _41 = (const 0u32, const 2u32); // bb0[75]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
+ StorageLive(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
+ _41 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:19:21: 19:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_42); // bb0[76]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
- _42 = (const 0u32, const 3u32); // bb0[77]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
+ StorageLive(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
+ _42 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:19:29: 19:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_43); // bb0[78]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
- _43 = (const 0u32, const 1u32); // bb0[79]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
+ StorageLive(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
+ _43 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:20:13: 20:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_44); // bb0[80]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
- _44 = (const 0u32, const 2u32); // bb0[81]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
+ StorageLive(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
+ _44 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:20:21: 20:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_45); // bb0[82]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
- _45 = (const 0u32, const 3u32); // bb0[83]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
+ StorageLive(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
+ _45 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:20:29: 20:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- StorageLive(_46); // bb0[84]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
- _46 = (const 0u32, const 1u32); // bb0[85]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
+ StorageLive(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
+ _46 = (const 0u32, const 1u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:21:13: 21:14
// + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- StorageLive(_47); // bb0[86]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
- _47 = (const 0u32, const 2u32); // bb0[87]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
+ StorageLive(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
+ _47 = (const 0u32, const 2u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:21:21: 21:22
// + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- StorageLive(_48); // bb0[88]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
- _48 = (const 0u32, const 3u32); // bb0[89]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
+ StorageLive(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
+ _48 = (const 0u32, const 3u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
// ty::Const
// + ty: u32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:21:29: 21:30
// + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
- _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // bb0[90]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
- _5 = &_6; // bb0[91]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- _4 = &(*_5); // bb0[92]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // bb0[93]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
- _2 = Foo { tup: const "hi", data: move _3 }; // bb0[94]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
+ _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
+ _5 = &_6; // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ _4 = &(*_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+ _2 = Foo { tup: const "hi", data: move _3 }; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [3], len: Size { raw: 2 } }, size: Size { raw: 2 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 })
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:6:10: 6:14
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [3], len: Size { raw: 2 } }, size: Size { raw: 2 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 }) }
- _1 = &_2; // bb0[95]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
- _0 = &(*_1); // bb0[96]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
- StorageDead(_5); // bb0[97]: scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
- StorageDead(_1); // bb0[98]: scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
- return; // bb0[99]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
+ _1 = &_2; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+ _0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+ StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
+ StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
+ return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
+ resume; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
- _1 = const 0i32; // bb0[1]: scope 0 at $DIR/storage_ranges.rs:4:13: 4:14
+ StorageLive(_1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
+ _1 = const 0i32; // scope 0 at $DIR/storage_ranges.rs:4:13: 4:14
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/storage_ranges.rs:4:13: 4:14
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
- StorageLive(_3); // bb0[4]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
- StorageLive(_4); // bb0[5]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
- StorageLive(_5); // bb0[6]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
- _5 = _1; // bb0[7]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
- _4 = std::option::Option::<i32>::Some(move _5); // bb0[8]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
- StorageDead(_5); // bb0[9]: scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
- _3 = &_4; // bb0[10]: scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
- FakeRead(ForLet, _3); // bb0[11]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
- _2 = const (); // bb0[12]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
+ FakeRead(ForLet, _1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
+ StorageLive(_2); // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
+ StorageLive(_3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
+ StorageLive(_4); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
+ StorageLive(_5); // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
+ _5 = _1; // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
+ _4 = std::option::Option::<i32>::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
+ StorageDead(_5); // scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
+ _3 = &_4; // scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
+ FakeRead(ForLet, _3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
+ _2 = const (); // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/storage_ranges.rs:5:5: 7:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_4); // bb0[13]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
- StorageDead(_3); // bb0[14]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
- StorageDead(_2); // bb0[15]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
- StorageLive(_6); // bb0[16]: scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
- _6 = const 1i32; // bb0[17]: scope 1 at $DIR/storage_ranges.rs:8:13: 8:14
+ StorageDead(_4); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+ StorageDead(_3); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+ StorageDead(_2); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+ StorageLive(_6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
+ _6 = const 1i32; // scope 1 at $DIR/storage_ranges.rs:8:13: 8:14
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/storage_ranges.rs:8:13: 8:14
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- FakeRead(ForLet, _6); // bb0[18]: scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
- _0 = const (); // bb0[19]: scope 0 at $DIR/storage_ranges.rs:3:11: 9:2
+ FakeRead(ForLet, _6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
+ _0 = const (); // scope 0 at $DIR/storage_ranges.rs:3:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/storage_ranges.rs:3:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_6); // bb0[20]: scope 1 at $DIR/storage_ranges.rs:9:1: 9:2
- StorageDead(_1); // bb0[21]: scope 0 at $DIR/storage_ranges.rs:9:1: 9:2
- return; // bb0[22]: scope 0 at $DIR/storage_ranges.rs:9:2: 9:2
+ StorageDead(_6); // scope 1 at $DIR/storage_ranges.rs:9:1: 9:2
+ StorageDead(_1); // scope 0 at $DIR/storage_ranges.rs:9:1: 9:2
+ return; // scope 0 at $DIR/storage_ranges.rs:9:2: 9:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
- _3 = Box(i32); // bb0[3]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
- (*_3) = const 1i32; // bb0[4]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+ StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
+ StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+ StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+ _3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+ (*_3) = const 1i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:18: 11:19
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- _2 = move _3; // bb0[5]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
- drop(_3) -> [return: bb4, unwind: bb2]; // bb0[6]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+ _2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+ drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
+ resume; // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
}
bb2 (cleanup): {
- drop(_2) -> bb1; // bb2[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ drop(_2) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb3 (cleanup): {
- drop(_3) -> bb2; // bb3[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+ drop(_3) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
}
bb4: {
- StorageDead(_3); // bb4[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
- StorageLive(_4); // bb4[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
- StorageLive(_5); // bb4[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
- _5 = Box(i32); // bb4[3]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
- (*_5) = const 2i32; // bb4[4]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+ StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+ StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+ StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+ _5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+ (*_5) = const 2i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:25: 11:26
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- _4 = move _5; // bb4[5]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
- drop(_5) -> [return: bb7, unwind: bb5]; // bb4[6]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+ _4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+ drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
}
bb5 (cleanup): {
- drop(_4) -> bb2; // bb5[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ drop(_4) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb6 (cleanup): {
- drop(_5) -> bb5; // bb6[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+ drop(_5) -> bb5; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
}
bb7: {
- StorageDead(_5); // bb7[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
- _1 = [move _2, move _4]; // bb7[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
- drop(_4) -> [return: bb8, unwind: bb2]; // bb7[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+ _1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
+ drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb8: {
- StorageDead(_4); // bb8[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
- drop(_2) -> [return: bb9, unwind: bb1]; // bb8[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb9: {
- StorageDead(_2); // bb9[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
- FakeRead(ForLet, _1); // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
- StorageLive(_6); // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
- _6 = move _1[0..2]; // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
- _0 = const (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
+ StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+ FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
+ StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
+ _6 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
+ _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:10:27: 13:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb10 (cleanup): {
- drop(_1) -> bb1; // bb10[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ drop(_1) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb11 (cleanup): {
- drop(_6) -> bb10; // bb11[0]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ drop(_6) -> bb10; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb12: {
- StorageDead(_6); // bb12[0]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
- drop(_1) -> [return: bb13, unwind: bb1]; // bb12[1]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb13: {
- StorageDead(_1); // bb13[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
- goto -> bb14; // bb13[1]: scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
+ StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+ goto -> bb14; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
}
bb14: {
- return; // bb14[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
+ return; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
- StorageLive(_3); // bb0[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
- _3 = Box(i32); // bb0[3]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
- (*_3) = const 1i32; // bb0[4]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+ StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
+ StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+ StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+ _3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+ (*_3) = const 1i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:18: 5:19
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- _2 = move _3; // bb0[5]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
- drop(_3) -> [return: bb4, unwind: bb2]; // bb0[6]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+ _2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+ drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
+ resume; // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
}
bb2 (cleanup): {
- drop(_2) -> bb1; // bb2[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ drop(_2) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb3 (cleanup): {
- drop(_3) -> bb2; // bb3[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+ drop(_3) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
}
bb4: {
- StorageDead(_3); // bb4[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
- StorageLive(_4); // bb4[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
- StorageLive(_5); // bb4[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
- _5 = Box(i32); // bb4[3]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
- (*_5) = const 2i32; // bb4[4]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+ StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+ StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+ StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+ _5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+ (*_5) = const 2i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:25: 5:26
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- _4 = move _5; // bb4[5]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
- drop(_5) -> [return: bb7, unwind: bb5]; // bb4[6]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+ _4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+ drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
}
bb5 (cleanup): {
- drop(_4) -> bb2; // bb5[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ drop(_4) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb6 (cleanup): {
- drop(_5) -> bb5; // bb6[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+ drop(_5) -> bb5; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
}
bb7: {
- StorageDead(_5); // bb7[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
- _1 = [move _2, move _4]; // bb7[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
- drop(_4) -> [return: bb8, unwind: bb2]; // bb7[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+ _1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
+ drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb8: {
- StorageDead(_4); // bb8[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
- drop(_2) -> [return: bb9, unwind: bb1]; // bb8[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb9: {
- StorageDead(_2); // bb9[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
- FakeRead(ForLet, _1); // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
- StorageLive(_6); // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
- _6 = move _1[1 of 2]; // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
- _0 = const (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
+ StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+ FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
+ StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
+ _6 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
+ _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:4:24: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb10 (cleanup): {
- drop(_1) -> bb1; // bb10[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ drop(_1) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb11 (cleanup): {
- drop(_6) -> bb10; // bb11[0]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ drop(_6) -> bb10; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb12: {
- StorageDead(_6); // bb12[0]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
- drop(_1) -> [return: bb13, unwind: bb1]; // bb12[1]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb13: {
- StorageDead(_1); // bb13[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
- goto -> bb14; // bb13[1]: scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
+ StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+ goto -> bb14; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
}
bb14: {
- return; // bb14[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
+ return; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/uninhabited-enum.rs:8:8: 8:14
- _2 = &(*_1); // bb0[1]: scope 2 at $DIR/uninhabited-enum.rs:8:26: 8:33
- StorageDead(_2); // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:9:1: 9:2
- unreachable; // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:7:39: 9:2
+ StorageLive(_2); // scope 0 at $DIR/uninhabited-enum.rs:8:8: 8:14
+ _2 = &(*_1); // scope 2 at $DIR/uninhabited-enum.rs:8:26: 8:33
+ StorageDead(_2); // scope 0 at $DIR/uninhabited-enum.rs:9:1: 9:2
+ unreachable; // scope 0 at $DIR/uninhabited-enum.rs:7:39: 9:2
}
}
}
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/uninhabited-enum.rs:14:8: 14:14
- _2 = &(*_1); // bb0[1]: scope 2 at $DIR/uninhabited-enum.rs:14:26: 14:33
- _0 = const (); // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:13:41: 17:2
+ StorageLive(_2); // scope 0 at $DIR/uninhabited-enum.rs:14:8: 14:14
+ _2 = &(*_1); // scope 2 at $DIR/uninhabited-enum.rs:14:26: 14:33
+ _0 = const (); // scope 0 at $DIR/uninhabited-enum.rs:13:41: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/uninhabited-enum.rs:13:41: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_2); // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2
- return; // bb0[4]: scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2
+ StorageDead(_2); // scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2
+ return; // scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2
}
}
let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
- _2 = Test1::C; // bb0[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
- _3 = discriminant(_2); // bb0[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
- StorageLive(_5); // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- _5 = const "C"; // bb0[5]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+ StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+ _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+ _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+ StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ _5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- _1 = &(*_5); // bb0[6]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- StorageDead(_5); // bb0[7]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
- StorageDead(_2); // bb0[8]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
- StorageDead(_1); // bb0[9]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
- StorageLive(_6); // bb0[10]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
- StorageLive(_7); // bb0[11]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
- _7 = Test2::D; // bb0[12]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
- _8 = discriminant(_7); // bb0[13]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
- switchInt(move _8) -> [4isize: bb2, otherwise: bb1]; // bb0[14]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+ _1 = &(*_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ StorageDead(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
+ StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+ StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+ StorageLive(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ StorageLive(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+ _7 = Test2::D; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+ _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+ switchInt(move _8) -> [4isize: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
}
bb1: {
- StorageLive(_9); // bb1[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- _9 = const "E"; // bb1[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ _9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- _6 = &(*_9); // bb1[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- StorageDead(_9); // bb1[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
- goto -> bb3; // bb1[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ _6 = &(*_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ StorageDead(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
+ goto -> bb3; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
}
bb2: {
- _6 = const "D"; // bb2[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
+ _6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- goto -> bb3; // bb2[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ goto -> bb3; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
}
bb3: {
- StorageDead(_7); // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
- StorageDead(_6); // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
- _0 = const (); // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
+ StorageDead(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+ StorageDead(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+ _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
+ return; // scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
}
}
let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
- StorageLive(_2); // bb0[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
- _2 = Test1::C; // bb0[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
- _3 = discriminant(_2); // bb0[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
-- switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb1]; // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
-+ switchInt(move _3) -> bb1; // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+ StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+ StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+ _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+ _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+- switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
++ switchInt(move _3) -> bb1; // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
}
bb1: {
- StorageLive(_5); // bb1[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- _5 = const "C"; // bb1[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ _5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- _1 = &(*_5); // bb1[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- StorageDead(_5); // bb1[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
- goto -> bb4; // bb1[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+ _1 = &(*_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+ StorageDead(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
+ goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
}
bb2: {
- _1 = const "A(Empty)"; // bb2[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34
+ _1 = const "A(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
- goto -> bb4; // bb2[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+ goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
}
bb3: {
- StorageLive(_4); // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
- _4 = const "B(Empty)"; // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+ StorageLive(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+ _4 = const "B(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
- _1 = &(*_4); // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
- StorageDead(_4); // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:33: 22:34
- goto -> bb4; // bb3[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+ _1 = &(*_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+ StorageDead(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:22:33: 22:34
+ goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
}
bb4: {
- StorageDead(_2); // bb4[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
- StorageDead(_1); // bb4[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
- StorageLive(_6); // bb4[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
- StorageLive(_7); // bb4[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
- _7 = Test2::D; // bb4[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
- _8 = discriminant(_7); // bb4[5]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
- switchInt(move _8) -> [4isize: bb6, otherwise: bb5]; // bb4[6]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+ StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+ StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+ StorageLive(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ StorageLive(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+ _7 = Test2::D; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+ _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+ switchInt(move _8) -> [4isize: bb6, otherwise: bb5]; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
}
bb5: {
- StorageLive(_9); // bb5[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- _9 = const "E"; // bb5[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ _9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- _6 = &(*_9); // bb5[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- StorageDead(_9); // bb5[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
- goto -> bb7; // bb5[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ _6 = &(*_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+ StorageDead(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
+ goto -> bb7; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
}
bb6: {
- _6 = const "D"; // bb6[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
+ _6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
- goto -> bb7; // bb6[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+ goto -> bb7; // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
}
bb7: {
- StorageDead(_7); // bb7[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
- StorageDead(_6); // bb7[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
- _0 = const (); // bb7[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
+ StorageDead(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+ StorageDead(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+ _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- return; // bb7[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
+ return; // scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/unreachable.rs:9:23: 9:30
- _1 = const empty() -> bb1; // bb0[1]: scope 0 at $DIR/unreachable.rs:9:23: 9:30
+ StorageLive(_1); // scope 0 at $DIR/unreachable.rs:9:23: 9:30
+ _1 = const empty() -> bb1; // scope 0 at $DIR/unreachable.rs:9:23: 9:30
// ty::Const
// + ty: fn() -> std::option::Option<Empty> {empty}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- _2 = discriminant(_1); // bb1[0]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
-- switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
-+ goto -> bb2; // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
+ _2 = discriminant(_1); // scope 0 at $DIR/unreachable.rs:9:12: 9:20
+- switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
++ goto -> bb2; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
}
bb2: {
- _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable.rs:9:5: 19:6
+ _0 = const (); // scope 0 at $DIR/unreachable.rs:9:5: 19:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable.rs:9:5: 19:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable.rs:20:1: 20:2
- return; // bb2[2]: scope 0 at $DIR/unreachable.rs:20:2: 20:2
+ StorageDead(_1); // scope 0 at $DIR/unreachable.rs:20:1: 20:2
+ return; // scope 0 at $DIR/unreachable.rs:20:2: 20:2
- }
-
- bb3: {
-- StorageLive(_3); // bb3[0]: scope 0 at $DIR/unreachable.rs:9:17: 9:19
-- _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable.rs:9:17: 9:19
-- StorageLive(_4); // bb3[2]: scope 1 at $DIR/unreachable.rs:10:13: 10:19
-- StorageLive(_5); // bb3[3]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
-- StorageLive(_6); // bb3[4]: scope 2 at $DIR/unreachable.rs:12:12: 12:16
-- _6 = const true; // bb3[5]: scope 2 at $DIR/unreachable.rs:12:12: 12:16
+- StorageLive(_3); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
+- _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
+- StorageLive(_4); // scope 1 at $DIR/unreachable.rs:10:13: 10:19
+- StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10
+- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16
+- _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/unreachable.rs:12:12: 12:16
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-- switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
- }
-
- bb4: {
-- _4 = const 42i32; // bb4[0]: scope 2 at $DIR/unreachable.rs:15:13: 15:20
+- _4 = const 42i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/unreachable.rs:15:18: 15:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-- _5 = const (); // bb4[1]: scope 2 at $DIR/unreachable.rs:14:16: 16:10
+- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/unreachable.rs:14:16: 16:10
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb6; // bb4[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+- goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
- }
-
- bb5: {
-- _4 = const 21i32; // bb5[0]: scope 2 at $DIR/unreachable.rs:13:13: 13:20
+- _4 = const 21i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000015))
- // mir::Constant
- // + span: $DIR/unreachable.rs:13:18: 13:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
-- _5 = const (); // bb5[1]: scope 2 at $DIR/unreachable.rs:12:17: 14:10
+- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10
- // ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/unreachable.rs:12:17: 14:10
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb6; // bb5[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+- goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
- }
-
- bb6: {
-- StorageDead(_6); // bb6[0]: scope 2 at $DIR/unreachable.rs:16:9: 16:10
-- StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable.rs:16:9: 16:10
-- StorageLive(_7); // bb6[2]: scope 2 at $DIR/unreachable.rs:18:9: 18:21
-- unreachable; // bb6[3]: scope 2 at $DIR/unreachable.rs:18:15: 18:17
+- StorageDead(_6); // scope 2 at $DIR/unreachable.rs:16:9: 16:10
+- StorageDead(_5); // scope 2 at $DIR/unreachable.rs:16:9: 16:10
+- StorageLive(_7); // scope 2 at $DIR/unreachable.rs:18:9: 18:21
+- unreachable; // scope 2 at $DIR/unreachable.rs:18:15: 18:17
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
- _1 = const empty() -> bb1; // bb0[1]: scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
+ StorageLive(_1); // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
+ _1 = const empty() -> bb1; // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
// ty::Const
// + ty: fn() -> std::option::Option<Empty> {empty}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- _2 = discriminant(_1); // bb1[0]: scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
- switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
+ _2 = discriminant(_1); // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
+ switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
}
bb2: {
- _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6
+ _0 = const (); // scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:11:5: 23:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
- return; // bb2[2]: scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
+ StorageDead(_1); // scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
+ return; // scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
}
bb3: {
- StorageLive(_3); // bb3[0]: scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
- _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
- StorageLive(_4); // bb3[2]: scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
- StorageLive(_5); // bb3[3]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
- StorageLive(_6); // bb3[4]: scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
- _6 = const true; // bb3[5]: scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
+ StorageLive(_3); // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
+ _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
+ StorageLive(_4); // scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
+ StorageLive(_5); // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+ StorageLive(_6); // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
+ _6 = const true; // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:14:12: 14:16
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+ switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
}
bb4: {
- _4 = const 42i32; // bb4[0]: scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
+ _4 = const 42i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:17:18: 17:20
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- _5 = const (); // bb4[1]: scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
+ _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:16:16: 18:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb6; // bb4[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+ goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
}
bb5: {
- _4 = const 21i32; // bb5[0]: scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
+ _4 = const 21i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000015))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:15:18: 15:20
// + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
- _5 = const (); // bb5[1]: scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
+ _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:14:17: 16:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb6; // bb5[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+ goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
}
bb6: {
- StorageDead(_6); // bb6[0]: scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
- StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
- StorageLive(_7); // bb6[2]: scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37
- llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb6[3]: scope 3 at $DIR/unreachable_asm.rs:21:18: 21:35
- _7 = const (); // bb6[4]: scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37
+ StorageDead(_6); // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
+ StorageDead(_5); // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
+ StorageLive(_7); // scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37
+ llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm.rs:21:18: 21:35
+ _7 = const (); // scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm.rs:21:9: 21:37
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_7); // bb6[5]: scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37
- StorageLive(_8); // bb6[6]: scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21
- unreachable; // bb6[7]: scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17
+ StorageDead(_7); // scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37
+ StorageLive(_8); // scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21
+ unreachable; // scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
- _1 = const empty() -> bb1; // bb0[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
+ StorageLive(_1); // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
+ _1 = const empty() -> bb1; // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
// ty::Const
// + ty: fn() -> std::option::Option<Empty> {empty}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- _2 = discriminant(_1); // bb1[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
- switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
+ _2 = discriminant(_1); // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
+ switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
}
bb2: {
- _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6
+ _0 = const (); // scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:11:5: 25:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
- return; // bb2[2]: scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
+ StorageDead(_1); // scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
+ return; // scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
}
bb3: {
- StorageLive(_3); // bb3[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
- _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
- StorageLive(_4); // bb3[2]: scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
- StorageLive(_5); // bb3[3]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
- StorageLive(_6); // bb3[4]: scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
- _6 = const true; // bb3[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
+ StorageLive(_3); // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
+ _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
+ StorageLive(_4); // scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
+ StorageLive(_5); // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+ StorageLive(_6); // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
+ _6 = const true; // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:14:12: 14:16
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+ switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
}
bb4: {
- StorageLive(_8); // bb4[0]: scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41
- llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb4[1]: scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39
- _8 = const (); // bb4[2]: scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41
+ StorageLive(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41
+ llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39
+ _8 = const (); // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:20:13: 20:41
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_8); // bb4[3]: scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
- _4 = const 42i32; // bb4[4]: scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
+ StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
+ _4 = const 42i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x0000002a))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:21:18: 21:20
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- _5 = const (); // bb4[5]: scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
+ _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:18:16: 22:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb6; // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-+ unreachable; // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
++ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
}
bb5: {
- StorageLive(_7); // bb5[0]: scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41
- llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb5[1]: scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39
- _7 = const (); // bb5[2]: scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41
+ StorageLive(_7); // scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41
+ llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39
+ _7 = const (); // scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:16:13: 16:41
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_7); // bb5[3]: scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
- _4 = const 21i32; // bb5[4]: scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
+ StorageDead(_7); // scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
+ _4 = const 21i32; // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000015))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:17:18: 17:20
// + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
- _5 = const (); // bb5[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
+ _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_asm_2.rs:14:17: 18:10
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb6; // bb5[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
- }
-
- bb6: {
-- StorageDead(_6); // bb6[0]: scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
-- StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
-- StorageLive(_9); // bb6[2]: scope 2 at $DIR/unreachable_asm_2.rs:24:9: 24:21
-- unreachable; // bb6[3]: scope 2 at $DIR/unreachable_asm_2.rs:24:15: 24:17
-+ unreachable; // bb5[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+- StorageDead(_6); // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
+- StorageDead(_5); // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
+- StorageLive(_9); // scope 2 at $DIR/unreachable_asm_2.rs:24:9: 24:21
+- unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:24:15: 24:17
++ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
- _1 = const true; // bb0[1]: scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
+ StorageLive(_1); // scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
+ _1 = const true; // scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/unreachable_diverging.rs:13:13: 13:17
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- StorageLive(_2); // bb0[2]: scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
- _2 = const empty() -> bb1; // bb0[3]: scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
+ StorageLive(_2); // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
+ _2 = const empty() -> bb1; // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
// ty::Const
// + ty: fn() -> std::option::Option<Empty> {empty}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- _3 = discriminant(_2); // bb1[0]: scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
- switchInt(move _3) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
+ _3 = discriminant(_2); // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
+ switchInt(move _3) -> [1isize: bb3, otherwise: bb2]; // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
}
bb2: {
- _0 = const (); // bb2[0]: scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6
+ _0 = const (); // scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/unreachable_diverging.rs:14:5: 19:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
- StorageDead(_2); // bb2[2]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
- return; // bb2[3]: scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2
+ StorageDead(_1); // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
+ StorageDead(_2); // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
+ return; // scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2
}
bb3: {
- StorageLive(_4); // bb3[0]: scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
- _4 = move ((_2 as Some).0: Empty); // bb3[1]: scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
- StorageLive(_5); // bb3[2]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
- StorageLive(_6); // bb3[3]: scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
- _6 = _1; // bb3[4]: scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
-- switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[5]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-+ goto -> bb4; // bb3[5]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+ StorageLive(_4); // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
+ _4 = move ((_2 as Some).0: Empty); // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
+ StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+ StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
+ _6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
+- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
++ goto -> bb4; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
}
bb4: {
-- _5 = const (); // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-+ _5 = const loop_forever() -> bb5; // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
+- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
++ _5 = const loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
// ty::Const
- // + ty: ()
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/unreachable_diverging.rs:15:9: 17:10
- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-- goto -> bb6; // bb4[1]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+- goto -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
- }
-
- bb5: {
-- _5 = const loop_forever() -> bb6; // bb5[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
+- _5 = const loop_forever() -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
- // ty::Const
// + ty: fn() {loop_forever}
// + val: Value(Scalar(<ZST>))
}
- bb6: {
-- StorageDead(_6); // bb6[0]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-- StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-- StorageLive(_7); // bb6[2]: scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
-- unreachable; // bb6[3]: scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
+ bb5: {
-+ StorageDead(_6); // bb5[0]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-+ StorageDead(_5); // bb5[1]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-+ StorageLive(_7); // bb5[2]: scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
-+ unreachable; // bb5[3]: scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
+ StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
+ StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
+ StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
+ unreachable; // scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
}
}
let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
bb0: {
- _0 = const 5isize; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ _0 = const 5isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
// ty::Const
// + ty: isize
// + val: Value(Scalar(0x00000005))
// mir::Constant
// + span: $DIR/unusual-item-types.rs:22:9: 22:10
// + literal: Const { ty: isize, val: Value(Scalar(0x00000005)) }
- return; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ resume; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
}
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
bb0: {
- ((_0 as X).0: usize) = move _1; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
- discriminant(_0) = 0; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
- return; // bb0[2]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
}
}
let mut _3: (); // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
bb0: {
- goto -> bb7; // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb7; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb1: {
- return; // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ return; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb2 (cleanup): {
- resume; // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ resume; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb3: {
- goto -> bb1; // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb1; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb4 (cleanup): {
- goto -> bb2; // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb2; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb5 (cleanup): {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb6: {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb7: {
- _2 = &mut (*_1); // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _2 = &mut (*_1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}
// + val: Value(Scalar(<ZST>))
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
bb0: {
- _0 = const 2i32; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
+ _0 = const 2i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/unusual-item-types.rs:10:38: 10:39
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- return; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ resume; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
}
let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
bb0: {
- _0 = const 5isize; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ _0 = const 5isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
// ty::Const
// + ty: isize
// + val: Value(Scalar(0x0000000000000005))
// mir::Constant
// + span: $DIR/unusual-item-types.rs:22:9: 22:10
// + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000005)) }
- return; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+ resume; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
}
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
bb0: {
- ((_0 as X).0: usize) = move _1; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
- discriminant(_0) = 0; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
- return; // bb0[2]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+ return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
}
}
let mut _3: (); // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
bb0: {
- goto -> bb7; // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb7; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb1: {
- return; // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ return; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb2 (cleanup): {
- resume; // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ resume; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb3: {
- goto -> bb1; // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb1; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb4 (cleanup): {
- goto -> bb2; // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ goto -> bb2; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb5 (cleanup): {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb6: {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
}
bb7: {
- _2 = &mut (*_1); // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
- _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _2 = &mut (*_1); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+ _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
// ty::Const
// + ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}
// + val: Value(Scalar(<ZST>))
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
bb0: {
- _0 = const 2i32; // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
+ _0 = const 2i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/unusual-item-types.rs:10:38: 10:39
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- return; // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
bb1 (cleanup): {
- resume; // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ resume; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
}
let mut _5: bool; // in scope 0 at $DIR/while-storage.rs:11:21: 11:22
bb0: {
- StorageLive(_2); // bb0[0]: scope 0 at $DIR/while-storage.rs:10:11: 10:22
- StorageLive(_3); // bb0[1]: scope 0 at $DIR/while-storage.rs:10:20: 10:21
- _3 = _1; // bb0[2]: scope 0 at $DIR/while-storage.rs:10:20: 10:21
- _2 = const get_bool(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/while-storage.rs:10:11: 10:22
+ StorageLive(_2); // scope 0 at $DIR/while-storage.rs:10:11: 10:22
+ StorageLive(_3); // scope 0 at $DIR/while-storage.rs:10:20: 10:21
+ _3 = _1; // scope 0 at $DIR/while-storage.rs:10:20: 10:21
+ _2 = const get_bool(move _3) -> bb1; // scope 0 at $DIR/while-storage.rs:10:11: 10:22
// ty::Const
// + ty: fn(bool) -> bool {get_bool}
// + val: Value(Scalar(<ZST>))
}
bb1: {
- StorageDead(_3); // bb1[0]: scope 0 at $DIR/while-storage.rs:10:21: 10:22
- switchInt(_2) -> [false: bb2, otherwise: bb3]; // bb1[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+ StorageDead(_3); // scope 0 at $DIR/while-storage.rs:10:21: 10:22
+ switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
}
bb2: {
- _0 = const (); // bb2[0]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+ _0 = const (); // scope 0 at $DIR/while-storage.rs:10:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/while-storage.rs:10:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- goto -> bb7; // bb2[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+ goto -> bb7; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
}
bb3: {
- StorageLive(_4); // bb3[0]: scope 0 at $DIR/while-storage.rs:11:12: 11:23
- StorageLive(_5); // bb3[1]: scope 0 at $DIR/while-storage.rs:11:21: 11:22
- _5 = _1; // bb3[2]: scope 0 at $DIR/while-storage.rs:11:21: 11:22
- _4 = const get_bool(move _5) -> bb4; // bb3[3]: scope 0 at $DIR/while-storage.rs:11:12: 11:23
+ StorageLive(_4); // scope 0 at $DIR/while-storage.rs:11:12: 11:23
+ StorageLive(_5); // scope 0 at $DIR/while-storage.rs:11:21: 11:22
+ _5 = _1; // scope 0 at $DIR/while-storage.rs:11:21: 11:22
+ _4 = const get_bool(move _5) -> bb4; // scope 0 at $DIR/while-storage.rs:11:12: 11:23
// ty::Const
// + ty: fn(bool) -> bool {get_bool}
// + val: Value(Scalar(<ZST>))
}
bb4: {
- StorageDead(_5); // bb4[0]: scope 0 at $DIR/while-storage.rs:11:22: 11:23
- switchInt(_4) -> [false: bb5, otherwise: bb6]; // bb4[1]: scope 0 at $DIR/while-storage.rs:11:9: 13:10
+ StorageDead(_5); // scope 0 at $DIR/while-storage.rs:11:22: 11:23
+ switchInt(_4) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10
}
bb5: {
- StorageDead(_4); // bb5[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
- StorageDead(_2); // bb5[1]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
- goto -> bb0; // bb5[2]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+ StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+ StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+ goto -> bb0; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
}
bb6: {
- _0 = const (); // bb6[0]: scope 0 at $DIR/while-storage.rs:12:13: 12:18
+ _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/while-storage.rs:12:13: 12:18
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
- StorageDead(_4); // bb6[1]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
- goto -> bb7; // bb6[2]: scope 0 at $DIR/while-storage.rs:12:13: 12:18
+ StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+ goto -> bb7; // scope 0 at $DIR/while-storage.rs:12:13: 12:18
}
bb7: {
- StorageDead(_2); // bb7[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
- return; // bb7[1]: scope 0 at $DIR/while-storage.rs:15:2: 15:2
+ StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+ return; // scope 0 at $DIR/while-storage.rs:15:2: 15:2
}
}
// error-pattern:attempt to divide by zero
-
+#[allow(unconditional_panic)]
fn main() {
let y = 0;
let _z = 1 / y;
// Test bounds checking for DST raw slices
// error-pattern:index out of bounds
-
+#[allow(unconditional_panic)]
fn main() {
let a: *const [_] = &[1, 2, 3];
unsafe {
// error-pattern:attempt to calculate the remainder with a divisor of zero
-
+#[allow(unconditional_panic)]
fn main() {
let y = 0;
let _z = 1 % y;
pub fn main() {
unsafe {
let path = Path::new("libdylib.so");
- let a = DynamicLibrary::open(Some(&path)).unwrap();
+ let a = DynamicLibrary::open(&path).unwrap();
assert!(a.symbol::<isize>("fun1").is_ok());
assert!(a.symbol::<isize>("fun2").is_ok());
assert!(a.symbol::<isize>("fun3").is_ok());
# are compiled with address sanitizer, and we assert that a fault in the cdylib
# is correctly detected.
-# See comment in sanitizer-address/Makefile for why this is here
-EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
-
all:
- $(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
- $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
+ $(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs
+ $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
# are compiled with address sanitizer, and we assert that a fault in the dylib
# is correctly detected.
-# See comment in sanitizer-address/Makefile for why this is here
-EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
-
all:
- $(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
- $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
+ $(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) library.rs
+ $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
all:
$(RUSTC) err.rs -Z treat-err-as-bug 2>&1 \
| $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
+ $(RUSTC) delay_span_bug.rs -Z treat-err-as-bug 2>&1 \
+ | $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
--- /dev/null
+#![feature(rustc_attrs)]
+
+#[rustc_error(delay_span_bug_from_inside_query)]
+fn main() {}
+++ /dev/null
-// ignore-musl - dlsym doesn't see symbols without "-C link-arg=-Wl,--export-dynamic"
-
-#![feature(rustc_private)]
-
-extern crate rustc_metadata;
-
-use rustc_metadata::dynamic_lib::DynamicLibrary;
-
-#[no_mangle]
-pub fn foo() {
- bar();
-}
-
-pub fn foo2<T>() {
- fn bar2() {
- bar();
- }
- bar2();
-}
-
-#[no_mangle]
-fn bar() {}
-
-#[allow(dead_code)]
-#[no_mangle]
-fn baz() {}
-
-pub fn test() {
- let lib = DynamicLibrary::open(None).unwrap();
- unsafe {
- assert!(lib.symbol::<isize>("foo").is_ok());
- assert!(lib.symbol::<isize>("baz").is_ok());
- assert!(lib.symbol::<isize>("bar").is_ok());
- }
-}
+++ /dev/null
-// run-pass
-// aux-build:linkage-visibility.rs
-// ignore-android: FIXME(#10356)
-// ignore-windows: std::dynamic_lib does not work on Windows well
-// ignore-emscripten no dynamic linking
-
-extern crate linkage_visibility as foo;
-
-pub fn main() {
- foo::test();
- foo::foo2::<isize>();
- foo::foo();
-}
#![warn(anonymous_parameters)]
// Test for the anonymous_parameters deprecation lint (RFC 1685)
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2015
// run-rustfix
#![warn(anonymous_parameters)]
// Test for the anonymous_parameters deprecation lint (RFC 1685)
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2015
// run-rustfix
--- /dev/null
+// Check for recursion involving references to impl-associated const.
+
+trait Foo {
+ const BAR: u32;
+}
+
+const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; //~ ERROR E0391
+
+struct GlobalImplRef;
+
+impl GlobalImplRef {
+ const BAR: u32 = IMPL_REF_BAR;
+}
+
+fn main() {}
--- /dev/null
+error[E0391]: cycle detected when const-evaluating + checking `IMPL_REF_BAR`
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+ |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+ |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `IMPL_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+ |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+ |
+LL | const BAR: u32 = IMPL_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+ |
+LL | const BAR: u32 = IMPL_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+ |
+LL | const BAR: u32 = IMPL_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+ |
+LL | const BAR: u32 = IMPL_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `IMPL_REF_BAR`...
+ = note: ...which again requires const-evaluating + checking `IMPL_REF_BAR`, completing the cycle
+ = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
--- /dev/null
+// Check for recursion involving references to trait-associated const default.
+
+trait Foo {
+ const BAR: u32;
+}
+
+trait FooDefault {
+ const BAR: u32 = DEFAULT_REF_BAR;
+}
+
+const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR; //~ ERROR E0391
+
+struct GlobalDefaultRef;
+
+impl FooDefault for GlobalDefaultRef {}
+
+fn main() {}
--- /dev/null
+error[E0391]: cycle detected when const-evaluating + checking `DEFAULT_REF_BAR`
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+ |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+ |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `DEFAULT_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+ |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `<GlobalDefaultRef as FooDefault>::BAR`...
+note: ...which requires const-evaluating + checking `FooDefault::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+ |
+LL | const BAR: u32 = DEFAULT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `FooDefault::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+ |
+LL | const BAR: u32 = DEFAULT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `FooDefault::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+ |
+LL | const BAR: u32 = DEFAULT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `FooDefault::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+ |
+LL | const BAR: u32 = DEFAULT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `DEFAULT_REF_BAR`...
+ = note: ...which again requires const-evaluating + checking `DEFAULT_REF_BAR`, completing the cycle
+ = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
--- /dev/null
+// Check for recursion involving references to trait-associated const.
+
+trait Foo {
+ const BAR: u32;
+}
+
+const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR; //~ ERROR E0391
+
+struct GlobalTraitRef;
+
+impl Foo for GlobalTraitRef {
+ const BAR: u32 = TRAIT_REF_BAR;
+}
+
+fn main() {}
--- /dev/null
+error[E0391]: cycle detected when const-evaluating + checking `TRAIT_REF_BAR`
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+ |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+ |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `TRAIT_REF_BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+ |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `<GlobalTraitRef as Foo>::BAR`...
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+ |
+LL | const BAR: u32 = TRAIT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+ |
+LL | const BAR: u32 = TRAIT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+ |
+LL | const BAR: u32 = TRAIT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+ --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+ |
+LL | const BAR: u32 = TRAIT_REF_BAR;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires normalizing `TRAIT_REF_BAR`...
+ = note: ...which again requires const-evaluating + checking `TRAIT_REF_BAR`, completing the cycle
+ = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![allow(unused)]
// edition:2018
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
// edition:2018
// aux-build:arc_wake.rs
// edition:2018
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![allow(unused_variables)]
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
// edition:2018
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![allow(unused_variables)]
// Test the drop order for parameters relative to local variables and
// edition:2018
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
// parameters (used or unused) are not dropped until the async fn is cancelled.
// This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2018
use std::future::Future;
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2018
struct Xyz {
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2018
use std::future::Future;
// Test that opaque `impl Trait` types are allowed to contain late-bound regions.
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// edition:2018
#![feature(type_alias_impl_trait)]
// for completeness since .rs files linked from .rc files support this
// notation to specify their module's attributes
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(rustc_attrs)]
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// Bastion of the Turbofish
// ------------------------
--- /dev/null
+// ignore-tidy-linelength
+#![feature(box_into_boxed_slice)]
+
+use std::boxed::Box;
+use std::fmt::Debug;
+fn main() {
+ let boxed_slice = Box::new([1,2,3]) as Box<[u8]>;
+ let _ = Box::into_boxed_slice(boxed_slice);
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+ //~^^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+ let boxed_trait: Box<dyn Debug> = Box::new(5u8);
+ let _ = Box::into_boxed_slice(boxed_trait);
+ //~^ ERROR the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+ //~^^ ERROR the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+}
--- /dev/null
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/box-into-boxed-slice-fail.rs:8:35
+ |
+LL | let _ = Box::into_boxed_slice(boxed_slice);
+ | ^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+ = note: required by `std::boxed::Box::<T>::into_boxed_slice`
+
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/box-into-boxed-slice-fail.rs:8:13
+ |
+LL | let _ = Box::into_boxed_slice(boxed_slice);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+ = note: slice and array elements must have `Sized` type
+
+error[E0277]: the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+ --> $DIR/box-into-boxed-slice-fail.rs:12:35
+ |
+LL | let _ = Box::into_boxed_slice(boxed_trait);
+ | ^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `std::marker::Sized` is not implemented for `dyn std::fmt::Debug`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+ = note: required by `std::boxed::Box::<T>::into_boxed_slice`
+
+error[E0277]: the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+ --> $DIR/box-into-boxed-slice-fail.rs:12:13
+ |
+LL | let _ = Box::into_boxed_slice(boxed_trait);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `std::marker::Sized` is not implemented for `dyn std::fmt::Debug`
+ = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+ = note: slice and array elements must have `Sized` type
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
--- /dev/null
+// run-pass
+#![feature(box_into_boxed_slice)]
+
+use std::boxed::Box;
+fn main() {
+ assert_eq!(Box::into_boxed_slice(Box::new(5u8)), Box::new([5u8]) as Box<[u8]>);
+ assert_eq!(Box::into_boxed_slice(Box::new([25u8])), Box::new([[25u8]]) as Box<[[u8; 1]]>);
+ let a: Box<[Box<[u8; 1]>]> = Box::into_boxed_slice(Box::new(Box::new([5u8])));
+ let b: Box<[Box<[u8; 1]>]> = Box::new([Box::new([5u8])]);
+ assert_eq!(a, b);
+}
LL | impl Bar for Baz { }
| ^^^ type aliases cannot be used as traits
|
- = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ --> $DIR/two_files_data.rs:5:1
+ |
+LL | type Bar = dyn Foo;
+ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
fn main() {
let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; } //~ WARNING while_true
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
--- /dev/null
+#![feature(const_generics)]
+#![allow(incomplete_features)]
+
+trait Bar<O> {}
+impl<O> Bar<O> for [u8; O] {}
+//~^ ERROR expected value, found type parameter `O`
+
+struct Foo<const O: usize> {}
+impl<const O: usize> Foo<O>
+where
+ [u8; O]: Bar<[(); O]>,
+{
+ fn foo() {}
+}
+
+fn main() {
+ Foo::foo();
+}
--- /dev/null
+error[E0423]: expected value, found type parameter `O`
+ --> $DIR/issue-69654.rs:5:25
+ |
+LL | impl<O> Bar<O> for [u8; O] {}
+ | ^ help: a tuple variant with a similar name exists: `Ok`
+ |
+ ::: $SRC_DIR/libcore/result.rs:LL:COL
+ |
+LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | --------------------------------------------------- similarly named tuple variant `Ok` defined here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0423`.
--- /dev/null
+// run-pass
+
+#![warn(indirect_structural_match)]
+
+// This test is checking our logic for structural match checking by enumerating
+// the different kinds of const expressions. This test is collecting cases where
+// we have accepted the const expression as a pattern in the past and wish to
+// continue doing so.
+//
+// Even if a non-structural-match type is part of an expression in a const's
+// definition, that does not necessarily disqualify the const from being a match
+// pattern: in principle, we just need the types involved in the final value to
+// be structurally matchable.
+
+// See also RFC 1445
+
+#![feature(type_ascription)]
+
+#[derive(Copy, Clone, Debug)]
+struct NoPartialEq(u32);
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive(u32);
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+impl Eq for NoDerive { }
+
+type OND = Option<NoDerive>;
+
+fn main() {
+ const FIELD1: u32 = NoPartialEq(1).0;
+ match 1 { FIELD1 => dbg!(FIELD1), _ => panic!("whoops"), };
+ const FIELD2: u32 = NoDerive(1).0;
+ match 1 { FIELD2 => dbg!(FIELD2), _ => panic!("whoops"), };
+
+ enum CLike { One = 1, #[allow(dead_code)] Two = 2, }
+ const ONE_CAST: u32 = CLike::One as u32;
+ match 1 { ONE_CAST => dbg!(ONE_CAST), _ => panic!("whoops"), };
+
+ const NO_DERIVE_NONE: OND = None;
+ const INDIRECT: OND = NO_DERIVE_NONE;
+ match None { INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+
+ const TUPLE: (OND, OND) = (None, None);
+ match (None, None) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+
+ const TYPE_ASCRIPTION: OND = None: OND;
+ match None { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+
+ const ARRAY: [OND; 2] = [None, None];
+ match [None; 2] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+
+ const REPEAT: [OND; 2] = [None; 2];
+ match [None, None] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+
+ trait Trait: Sized { const ASSOC: Option<Self>; }
+ impl Trait for NoDerive { const ASSOC: Option<NoDerive> = None; }
+ match None { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+
+ const BLOCK: OND = { NoDerive(10); None };
+ match None { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+
+ const ADDR_OF: &OND = &None;
+ match &None { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
+}
--- /dev/null
+pub struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+ fn eq(&self, _: &Self) -> bool {
+ false
+ }
+}
+
+pub const NONE: Option<CustomEq> = None;
+pub const SOME: Option<CustomEq> = Some(CustomEq);
--- /dev/null
+// aux-build:consts.rs
+
+#![warn(indirect_structural_match)]
+
+extern crate consts;
+
+fn main() {
+ match None {
+ consts::SOME => panic!(),
+ //~^ must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| must be annotated with `#[derive(PartialEq, Eq)]`
+
+ _ => {}
+ }
+}
--- /dev/null
+error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/cross-crate-fail.rs:9:9
+ |
+LL | consts::SOME => panic!(),
+ | ^^^^^^^^^^^^
+
+error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/cross-crate-fail.rs:9:9
+ |
+LL | consts::SOME => panic!(),
+ | ^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
--- /dev/null
+// run-pass
+// aux-build:consts.rs
+
+#![warn(indirect_structural_match)]
+
+extern crate consts;
+use consts::CustomEq;
+
+fn main() {
+ match Some(CustomEq) {
+ consts::NONE => panic!(),
+ _ => {}
+ }
+}
--- /dev/null
+// run-pass
+
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+
+struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+ fn eq(&self, _: &Self) -> bool {
+ false
+ }
+}
+
+#[derive(PartialEq, Eq)]
+enum Foo {
+ Bar,
+ Baz,
+ Qux(CustomEq),
+}
+
+const BAR_BAZ: Foo = if 42 == 42 {
+ Foo::Bar
+} else {
+ Foo::Baz
+};
+
+fn main() {
+ match Foo::Qux(CustomEq) {
+ BAR_BAZ => panic!(),
+ _ => {}
+ }
+}
--- /dev/null
+// check-pass
+
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+//~^ NOTE lint level is defined here
+
+struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+ fn eq(&self, _: &Self) -> bool {
+ false
+ }
+}
+
+#[derive(PartialEq, Eq)]
+enum Foo {
+ Bar,
+ Baz,
+ Qux(CustomEq),
+}
+
+// We know that `BAR_BAZ` will always be `Foo::Bar` and thus eligible for structural matching, but
+// dataflow will be more conservative.
+const BAR_BAZ: Foo = if 42 == 42 {
+ Foo::Bar
+} else {
+ Foo::Qux(CustomEq)
+};
+
+fn main() {
+ match Foo::Qux(CustomEq) {
+ BAR_BAZ => panic!(),
+ //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN this was previously accepted
+ //~| NOTE see issue #62411
+ _ => {}
+ }
+}
--- /dev/null
+warning: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/custom-eq-branch-warn.rs:33:9
+ |
+LL | BAR_BAZ => panic!(),
+ | ^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/custom-eq-branch-warn.rs:4:9
+ |
+LL | #![warn(indirect_structural_match)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: 1 warning emitted
+
--- /dev/null
+// run-pass
+
+struct Sum(u32, u32);
+
+impl PartialEq for Sum {
+ fn eq(&self, other: &Self) -> bool { self.0 + self.1 == other.0 + other.1 }
+}
+
+impl Eq for Sum { }
+
+#[derive(PartialEq, Eq)]
+enum Eek {
+ TheConst,
+ UnusedByTheConst(Sum)
+}
+
+const THE_CONST: Eek = Eek::TheConst;
+
+pub fn main() {
+ match Eek::UnusedByTheConst(Sum(1,2)) {
+ THE_CONST => { panic!(); }
+ _ => {}
+ }
+}
--- /dev/null
+// FIXME: This still ICEs.
+//
+// ignore-test
+
+#![deny(indirect_structural_match)]
+
+#[derive(PartialEq, Eq)]
+enum O<T> {
+ Some(*const T), // Can also use PhantomData<T>
+ None,
+}
+
+struct B;
+
+const C: &[O<B>] = &[O::None];
+
+fn main() {
+ let x = O::None;
+ match &[x][..] {
+ C => (),
+ _ => (),
+ }
+}
--- /dev/null
+error[E0601]: `main` function not found in crate `issue_65466`
+ --> $DIR/issue-65466.rs:1:1
+ |
+LL | / #![deny(indirect_structural_match)]
+LL | |
+LL | | #[derive(PartialEq, Eq)]
+LL | | enum O<T> {
+... |
+LL | | }
+LL | | }
+ | |_^ consider adding a `main` function to `$DIR/issue-65466.rs`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0601`.
--- /dev/null
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+
+struct NoEq;
+
+enum Foo {
+ Bar,
+ Baz,
+ Qux(NoEq),
+}
+
+// Even though any of these values can be compared structurally, we still disallow it in a pattern
+// because `Foo` does not impl `PartialEq`.
+const BAR_BAZ: Foo = if 42 == 42 {
+ Foo::Baz
+} else {
+ Foo::Bar
+};
+
+fn main() {
+ match Foo::Qux(NoEq) {
+ BAR_BAZ => panic!(),
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ _ => {}
+ }
+}
--- /dev/null
+error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/no-eq-branch-fail.rs:22:9
+ |
+LL | BAR_BAZ => panic!(),
+ | ^^^^^^^
+
+error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/no-eq-branch-fail.rs:22:9
+ |
+LL | BAR_BAZ => panic!(),
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
--- /dev/null
+// This test is illustrating the difference between how failing to derive
+// `PartialEq` is handled compared to failing to implement it at all.
+
+// See also RFC 1445
+
+#[derive(PartialEq, Eq)]
+struct Structural(u32);
+
+struct NoPartialEq(u32);
+
+struct NoDerive(u32);
+
+// This impl makes NoDerive irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+
+impl Eq for NoDerive { }
+
+const NO_DERIVE_NONE: Option<NoDerive> = None;
+const NO_PARTIAL_EQ_NONE: Option<NoPartialEq> = None;
+
+fn main() {
+ match None {
+ NO_DERIVE_NONE => println!("NO_DERIVE_NONE"),
+ _ => panic!("whoops"),
+ }
+
+ match None {
+ NO_PARTIAL_EQ_NONE => println!("NO_PARTIAL_EQ_NONE"),
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ _ => panic!("whoops"),
+ }
+}
--- /dev/null
+error: to use a constant of type `NoPartialEq` in a pattern, `NoPartialEq` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_partial_eq.rs:28:9
+ |
+LL | NO_PARTIAL_EQ_NONE => println!("NO_PARTIAL_EQ_NONE"),
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// This test of structural match checking enumerates the different kinds of
+// const definitions, collecting cases where the const pattern is rejected.
+//
+// Note: Even if a non-structural-match type is part of an expression in a
+// const's definition, that does not necessarily disqualify the const from being
+// a match pattern: in principle, we just need the types involved in the final
+// value to be structurally matchable.
+
+// See also RFC 1445
+
+#![feature(type_ascription)]
+#![warn(indirect_structural_match)]
+//~^ NOTE lint level is defined here
+
+#[derive(Copy, Clone, Debug)]
+struct NoPartialEq;
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive;
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+
+impl Eq for NoDerive { }
+
+type OND = Option<NoDerive>;
+
+struct TrivialEq(OND);
+
+// This impl makes `TrivialEq` trivial.
+impl PartialEq for TrivialEq { fn eq(&self, _: &Self) -> bool { true } }
+
+impl Eq for TrivialEq { }
+
+fn main() {
+ #[derive(PartialEq, Eq, Debug)]
+ enum Derive<X> { Some(X), None, }
+
+ const ENUM: Derive<NoDerive> = Derive::Some(NoDerive);
+ match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const FIELD: OND = TrivialEq(Some(NoDerive)).0;
+ match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const NO_DERIVE_SOME: OND = Some(NoDerive);
+ const INDIRECT: OND = NO_DERIVE_SOME;
+ match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const TUPLE: (OND, OND) = (None, Some(NoDerive));
+ match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const TYPE_ASCRIPTION: OND = Some(NoDerive): OND;
+ match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const ARRAY: [OND; 2] = [None, Some(NoDerive)];
+ match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const REPEAT: [OND; 2] = [Some(NoDerive); 2];
+ match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ trait Trait: Sized { const ASSOC: Option<Self>; }
+ impl Trait for NoDerive { const ASSOC: Option<NoDerive> = Some(NoDerive); }
+ match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const BLOCK: OND = { NoDerive; Some(NoDerive) };
+ match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+ //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+ const ADDR_OF: &OND = &Some(NoDerive);
+ match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
+ //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN previously accepted by the compiler but is being phased out
+ //~| NOTE for more information, see issue #62411
+}
--- /dev/null
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:40:36
+ |
+LL | match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+ | ^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:45:28
+ |
+LL | match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:51:27
+ |
+LL | match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+ | ^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:56:36
+ |
+LL | match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:61:28
+ |
+LL | match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+ | ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:66:36
+ |
+LL | match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:71:33
+ |
+LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+ | ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:71:33
+ |
+LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+ | ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:79:28
+ |
+LL | match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+ | ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:84:28
+ |
+LL | match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+ | ^^^^^
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:89:29
+ |
+LL | match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
+ | ^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/reject_non_structural.rs:12:9
+ |
+LL | #![warn(indirect_structural_match)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:40:36
+ |
+LL | match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+ | ^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:45:28
+ |
+LL | match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:51:27
+ |
+LL | match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+ | ^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:56:36
+ |
+LL | match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:61:28
+ |
+LL | match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+ | ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:66:36
+ |
+LL | match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:71:33
+ |
+LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+ | ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:71:33
+ |
+LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+ | ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:79:28
+ |
+LL | match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+ | ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/reject_non_structural.rs:84:28
+ |
+LL | match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+ | ^^^^^
+
+error: aborting due to 20 previous errors; 1 warning emitted
+
--- /dev/null
+// run-pass
+
+// This test is checking our logic for structural match checking by enumerating
+// the different kinds of const expressions. This test is collecting cases where
+// we have accepted the const expression as a pattern in the past but we want
+// to begin warning the user that a future version of Rust may start rejecting
+// such const expressions.
+
+// The specific corner cases we are exploring here are instances where the
+// const-evaluator computes a value that *does* meet the conditions for
+// structural-match, but the const expression itself has abstractions (like
+// calls to const functions) that may fit better with a type-based analysis
+// rather than a committment to a specific value.
+
+#![warn(indirect_structural_match)]
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive(u32);
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+impl Eq for NoDerive { }
+
+fn main() {
+ const INDEX: Option<NoDerive> = [None, Some(NoDerive(10))][0];
+ match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
+ //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN this was previously accepted
+
+ const fn build() -> Option<NoDerive> { None }
+ const CALL: Option<NoDerive> = build();
+ match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
+ //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN this was previously accepted
+
+ impl NoDerive { const fn none() -> Option<NoDerive> { None } }
+ const METHOD_CALL: Option<NoDerive> = NoDerive::none();
+ match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), };
+ //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN this was previously accepted
+}
--- /dev/null
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/warn_corner_cases.rs:26:47
+ |
+LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
+ | ^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/warn_corner_cases.rs:15:9
+ |
+LL | #![warn(indirect_structural_match)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/warn_corner_cases.rs:32:47
+ |
+LL | match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
+ | ^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/warn_corner_cases.rs:38:47
+ |
+LL | match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), };
+ | ^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: 3 warnings emitted
+
fn foo<'a>() -> &'a () {
Hash([0; HASH_LEN]);
init_hash(&mut [0; HASH_LEN]);
+ let (_array,) = ([0; HASH_LEN],);
&()
}
--- /dev/null
+error[E0391]: cycle detected when const-evaluating `FOO`
+ --> $DIR/recursive-zst-static.rs:10:18
+ |
+LL | static FOO: () = FOO;
+ | ^^^
+ |
+note: ...which requires const-evaluating `FOO`...
+ --> $DIR/recursive-zst-static.rs:10:1
+ |
+LL | static FOO: () = FOO;
+ | ^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which again requires const-evaluating `FOO`, completing the cycle
+note: cycle used when const-evaluating + checking `FOO`
+ --> $DIR/recursive-zst-static.rs:10:1
+ |
+LL | static FOO: () = FOO;
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
+// revisions: default unleash
+//[unleash]compile-flags: -Zunleash-the-miri-inside-of-you
+
// This test ensures that we do not allow ZST statics to initialize themselves without ever
// actually creating a value of that type. This is important, as the ZST may have private fields
// that users can reasonably expect to only get initialized by their own code. Thus unsafe code
+++ /dev/null
-error[E0391]: cycle detected when const-evaluating `FOO`
- --> $DIR/recursive-zst-static.rs:7:18
- |
-LL | static FOO: () = FOO;
- | ^^^
- |
-note: ...which requires const-evaluating `FOO`...
- --> $DIR/recursive-zst-static.rs:7:1
- |
-LL | static FOO: () = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^
- = note: ...which again requires const-evaluating `FOO`, completing the cycle
-note: cycle used when const-evaluating + checking `FOO`
- --> $DIR/recursive-zst-static.rs:7:1
- |
-LL | static FOO: () = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0391`.
--- /dev/null
+error[E0391]: cycle detected when const-evaluating `FOO`
+ --> $DIR/recursive-zst-static.rs:10:18
+ |
+LL | static FOO: () = FOO;
+ | ^^^
+ |
+note: ...which requires const-evaluating `FOO`...
+ --> $DIR/recursive-zst-static.rs:10:1
+ |
+LL | static FOO: () = FOO;
+ | ^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which again requires const-evaluating `FOO`, completing the cycle
+note: cycle used when const-evaluating + checking `FOO`
+ --> $DIR/recursive-zst-static.rs:10:1
+ |
+LL | static FOO: () = FOO;
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
// run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#[allow(deprecated, unused_imports)]
use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT};
// run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#[allow(deprecated, unused_imports)]
use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT};
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// compile-flags: -Wunused
// ensure there are no special warnings about uninhabited types
// aux-build:edition-extern-crate-allowed.rs
// edition:2015
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(rust_2018_idioms)]
// edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(rust_2018_preview)]
//~^ WARN the feature `rust_2018_preview` is included in the Rust 2018 edition
// compile-flags:--emit=metadata --error-format=json --json artifacts
-// build-pass (FIXME(62277): could be check-pass?)
+// build-pass
// ignore-pass
// ^-- needed because `--pass check` does not emit the output needed.
--> $DIR/E0423.rs:14:8
|
LL | if T {} == T {} { println!("Ok"); }
- | ^---
- | |
- | help: surround the struct literal with parenthesis: `(T {})`
+ | ^
+ |
+help: surround the struct literal with parentheses
+ |
+LL | if (T {}) == T {} { println!("Ok"); }
+ | ^ ^
error: aborting due to 5 previous errors
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// This is a stub feature that doesn't control anything, so to make tidy happy,
// gate-test-test_2018_feature
// compile-flags: --explain E0591
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(unused_must_use)]
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![feature(generators, generator_trait)]
use std::ops::Generator;
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![feature(generators, generator_trait)]
use std::marker::Unpin;
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![feature(generators, generator_trait)]
use std::ops::Generator;
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
#![feature(generators, generator_trait)]
use std::fmt::Debug;
// run-pass
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
// ignore-emscripten no threads support
// compile-flags: --test
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
fn macros() {
macro_rules! foo{
error[E0277]: `?` couldn't convert the error to `()`
--> $DIR/issue-32709.rs:4:11
|
+LL | fn a() -> Result<i32, ()> {
+ | --------------- expected `()` because of this
LL | Err(5)?;
| ^ the trait `std::convert::From<{integer}>` is not implemented for `()`
|
//~^ ERROR `a` does not live long enough [E0597]
match b {
<() as Foo<'static>>::C => { }
- //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
- //~| WARN will become a hard error in a future release
_ => { }
}
}
-warning: to use a constant of type `std::cell::Cell` in a pattern, `std::cell::Cell` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/issue-55511.rs:16:9
- |
-LL | <() as Foo<'static>>::C => { }
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/issue-55511.rs:1:9
- |
-LL | #![warn(indirect_structural_match)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
-
error[E0597]: `a` does not live long enough
--> $DIR/issue-55511.rs:13:28
|
LL | }
| - `a` dropped here while still borrowed
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.
--- /dev/null
+use std::sync::mpsc;
+
+fn main() {
+ let (tx, rx) = mpsc::channel::new(1);
+ //~^ ERROR expected type, found function `channel` in `mpsc`
+}
--- /dev/null
+error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc`
+ --> $DIR/issue-71406.rs:4:26
+ |
+LL | let (tx, rx) = mpsc::channel::new(1);
+ | ^^^^^^^ expected type, found function `channel` in `mpsc`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
--- /dev/null
+// run-pass
+//! This snippet causes the type length to blowup exponentially,
+//! so check that we don't accidentially exceed the type length limit.
+// FIXME: Once the size of iterator adaptors is further reduced,
+// increase the complexity of this test.
+
+fn main() {
+ let c = 2;
+ let bv = vec![2];
+ let b = bv
+ .iter()
+ .filter(|a| **a == c);
+
+ let _a = vec![1, 2, 3]
+ .into_iter()
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .filter(|a| b.clone().any(|b| *b == *a))
+ .collect::<Vec<_>>();
+}
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// ignore-tidy-linelength
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// ignore-tidy-linelength
// Issue #21633: reject duplicate loop labels in function bodies.
// This is testing interaction between lifetime-params and labels.
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![allow(dead_code, unused_variables)]
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![allow(dead_code, unused_variables)]
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// compile-flags: -Wunused
// make sure write!() can't hide its unused Result
--- /dev/null
+// build-fail
+
+fn main() {
+ divide_by_zero();
+ mod_by_zero();
+ oob_error_for_slices();
+}
+
+fn divide_by_zero() {
+ let y = 0;
+ let _z = 1 / y; //~ ERROR this operation will panic at runtime [unconditional_panic]
+}
+
+fn mod_by_zero() {
+ let y = 0;
+ let _z = 1 % y; //~ ERROR this operation will panic at runtime [unconditional_panic]
+}
+
+fn oob_error_for_slices() {
+ let a: *const [_] = &[1, 2, 3];
+ unsafe {
+ let _b = (*a)[3]; //~ ERROR this operation will panic at runtime [unconditional_panic]
+ }
+}
--- /dev/null
+error: this operation will panic at runtime
+ --> $DIR/mir_detects_invalid_ops.rs:11:14
+ |
+LL | let _z = 1 / y;
+ | ^^^^^ attempt to divide by zero
+ |
+ = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+ --> $DIR/mir_detects_invalid_ops.rs:16:14
+ |
+LL | let _z = 1 % y;
+ | ^^^^^ attempt to calculate the remainder with a divisor of zero
+
+error: this operation will panic at runtime
+ --> $DIR/mir_detects_invalid_ops.rs:22:18
+ |
+LL | let _b = (*a)[3];
+ | ^^^^^^^ index out of bounds: the len is 3 but the index is 3
+
+error: aborting due to 3 previous errors
+
LL | ;
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | D("other").next(&_thing1);
+ | ^
error: aborting due to previous error
| `counter` dropped here while still borrowed
| ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<MutexGuard<'_>, ()>`
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | if let Ok(_) = counter.lock() { };
+ | ^
error: aborting due to previous error
| `stmt` dropped here while still borrowed
| ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::iter::Map<Rows<'_>, [closure@$DIR/issue-54556-stephaneyfx.rs:28:14: 28:23]>`
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | let x = rows.map(|row| row).next(); x
+ | ^^^^^^^ ^^^
error: aborting due to previous error
LL | ;
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | D(&_thing1).end();
+ | ^
error: aborting due to previous error
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } } ; // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; } // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } ; // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | let _x = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
+ | ^^^^^^^ ^^^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | _y = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
+ | ^^^^^^^ ^^^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+ |
+LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } // suggest `;`
+ | ^
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } // `let x = ...; x`
+ | ^^^^^^^ ^^^
error: aborting due to 9 previous errors
--> $DIR/numeric-cast-2.rs:7:18
|
LL | let y: i64 = x + x;
- | --- ^^^^^ expected `i64`, found `u16`
- | |
+ | --- ^^^^^
+ | | |
+ | | expected `i64`, found `u16`
+ | | help: you can convert an `u16` to `i64`: `(x + x).into()`
| expected due to this
- |
-help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
- |
-LL | let y: i64 = (x + x).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/numeric-cast-2.rs:9:18
|
LL | let z: i32 = x + x;
- | --- ^^^^^ expected `i32`, found `u16`
- | |
+ | --- ^^^^^
+ | | |
+ | | expected `i32`, found `u16`
+ | | help: you can convert an `u16` to `i32`: `(x + x).into()`
| expected due to this
- |
-help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
- |
-LL | let z: i32 = (x + x).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
//~^ ERROR mismatched types
foo::<isize>(x_u16.try_into().unwrap());
//~^ ERROR mismatched types
- foo::<isize>(x_u8.try_into().unwrap());
+ foo::<isize>(x_u8.into());
//~^ ERROR mismatched types
foo::<isize>(x_isize);
foo::<isize>(x_i64.try_into().unwrap());
//~^ ERROR mismatched types
foo::<i64>(x_u64.try_into().unwrap());
//~^ ERROR mismatched types
- foo::<i64>(x_u32.try_into().unwrap());
+ foo::<i64>(x_u32.into());
//~^ ERROR mismatched types
- foo::<i64>(x_u16.try_into().unwrap());
+ foo::<i64>(x_u16.into());
//~^ ERROR mismatched types
- foo::<i64>(x_u8.try_into().unwrap());
+ foo::<i64>(x_u8.into());
//~^ ERROR mismatched types
foo::<i64>(x_isize.try_into().unwrap());
//~^ ERROR mismatched types
//~^ ERROR mismatched types
foo::<i32>(x_u32.try_into().unwrap());
//~^ ERROR mismatched types
- foo::<i32>(x_u16.try_into().unwrap());
+ foo::<i32>(x_u16.into());
//~^ ERROR mismatched types
- foo::<i32>(x_u8.try_into().unwrap());
+ foo::<i32>(x_u8.into());
//~^ ERROR mismatched types
foo::<i32>(x_isize.try_into().unwrap());
//~^ ERROR mismatched types
//~^ ERROR mismatched types
foo::<i16>(x_u16.try_into().unwrap());
//~^ ERROR mismatched types
- foo::<i16>(x_u8.try_into().unwrap());
+ foo::<i16>(x_u8.into());
//~^ ERROR mismatched types
foo::<i16>(x_isize.try_into().unwrap());
//~^ ERROR mismatched types
--> $DIR/numeric-cast.rs:52:18
|
LL | foo::<isize>(x_u8);
- | ^^^^ expected `isize`, found `u8`
- |
-help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit
- |
-LL | foo::<isize>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^
+ | |
+ | expected `isize`, found `u8`
+ | help: you can convert an `u8` to `isize`: `x_u8.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:55:18
--> $DIR/numeric-cast.rs:92:16
|
LL | foo::<i64>(x_u32);
- | ^^^^^ expected `i64`, found `u32`
- |
-help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit
- |
-LL | foo::<i64>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^
+ | |
+ | expected `i64`, found `u32`
+ | help: you can convert an `u32` to `i64`: `x_u32.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:94:16
|
LL | foo::<i64>(x_u16);
- | ^^^^^ expected `i64`, found `u16`
- |
-help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
- |
-LL | foo::<i64>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^
+ | |
+ | expected `i64`, found `u16`
+ | help: you can convert an `u16` to `i64`: `x_u16.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:96:16
|
LL | foo::<i64>(x_u8);
- | ^^^^ expected `i64`, found `u8`
- |
-help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit
- |
-LL | foo::<i64>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^
+ | |
+ | expected `i64`, found `u8`
+ | help: you can convert an `u8` to `i64`: `x_u8.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:98:16
--> $DIR/numeric-cast.rs:138:16
|
LL | foo::<i32>(x_u16);
- | ^^^^^ expected `i32`, found `u16`
- |
-help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
- |
-LL | foo::<i32>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^
+ | |
+ | expected `i32`, found `u16`
+ | help: you can convert an `u16` to `i32`: `x_u16.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:140:16
|
LL | foo::<i32>(x_u8);
- | ^^^^ expected `i32`, found `u8`
- |
-help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit
- |
-LL | foo::<i32>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^
+ | |
+ | expected `i32`, found `u8`
+ | help: you can convert an `u8` to `i32`: `x_u8.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:142:16
--> $DIR/numeric-cast.rs:184:16
|
LL | foo::<i16>(x_u8);
- | ^^^^ expected `i16`, found `u8`
- |
-help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit
- |
-LL | foo::<i16>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^
+ | |
+ | expected `i16`, found `u8`
+ | help: you can convert an `u8` to `i16`: `x_u8.into()`
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:186:16
error[E0277]: `?` couldn't convert the error to `()`
--> $DIR/option-to-result.rs:5:6
|
+LL | fn test_result() -> Result<(),()> {
+ | ------------- expected `()` because of this
+LL | let a:Option<()> = Some(());
LL | a?;
| ^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
|
error[E0277]: `?` couldn't convert the error to `std::option::NoneError`
--> $DIR/option-to-result.rs:11:6
|
+LL | fn test_option() -> Option<i32>{
+ | ----------- expected `std::option::NoneError` because of this
+LL | let a:Result<i32, i32> = Ok(5);
LL | a?;
| ^ the trait `std::convert::From<i32>` is not implemented for `std::option::NoneError`
|
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
fn main() {
let _ = "Foo"_;
// aux-build:attributes-included.rs
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(unused)]
// no-prefer-dynamic
#![feature(proc_macro_hygiene)]
-#![feature(proc_macro_mixed_site)]
#![feature(proc_macro_quote)]
#![crate_type = "proc-macro"]
LL | impl Foo for S {
| ^^^ type aliases cannot be used as traits
|
- = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ --> $DIR/issue-3907.rs:5:1
+ |
+LL | type Foo = dyn issue_3907::Foo;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: possible better candidate is found in another module, you can import it into scope
|
LL | use issue_3907::Foo;
| type aliases cannot be used as traits
| help: a trait with a similar name exists: `I`
|
- = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ --> $DIR/issue-5035.rs:2:1
+ |
+LL | type K = dyn I;
+ | ^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
LL | fn g<F:Typedef(isize) -> isize>(x: F) {}
| ^^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits
|
- = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ --> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:4:1
+ |
+LL | type Typedef = isize;
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
// aux-build:macro-use-warned-against.rs
// aux-build:macro-use-warned-against2.rs
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(macro_use_extern_crate, unused)]
// run-rustfix
// edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// aux-build:remove-extern-crate.rs
// compile-flags:--extern remove_extern_crate
// run-rustfix
// edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// aux-build:remove-extern-crate.rs
// compile-flags:--extern remove_extern_crate
// edition:2015
// run-rustfix
// rustfix-only-machine-applicable
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(rust_2018_preview)]
#![warn(rust_2018_compatibility)]
// edition:2015
// run-rustfix
// rustfix-only-machine-applicable
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(rust_2018_preview)]
#![warn(rust_2018_compatibility)]
// run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(rust_2018_compatibility)]
// run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(rust_2018_compatibility)]
| |
| `*a` dropped here while still borrowed
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | let x = *a.borrow() + 1; x
+ | ^^^^^^^ ^^^
error: aborting due to previous error
| `y` dropped here while still borrowed
| ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>`
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | let x = y.borrow().clone(); x
+ | ^^^^^^^ ^^^
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:17:9
| |
| `y` dropped here while still borrowed
|
- = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+ = note: the temporary is part of an expression at the end of a block;
+ consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+ |
+LL | let x = y.borrow().clone(); x
+ | ^^^^^^^ ^^^
error: aborting due to 2 previous errors
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(unused)]
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![warn(unused)]
--> $DIR/struct-literal-variant-in-if.rs:10:13
|
LL | if x == E::V { field } {}
- | ^^^^----------
- | |
- | help: surround the struct literal with parenthesis: `(E::V { field })`
+ | ^^^^
+ |
+help: surround the struct literal with parentheses
+ |
+LL | if x == (E::V { field }) {}
+ | ^ ^
error[E0308]: mismatched types
--> $DIR/struct-literal-variant-in-if.rs:10:20
--- /dev/null
+fn f<A>() -> A { unimplemented!() }
+fn foo() {
+ let _ = f; //~ ERROR type annotations needed for `fn() -> A`
+}
+fn main() {}
--- /dev/null
+error[E0282]: type annotations needed for `fn() -> A`
+ --> $DIR/fn-needing-specified-return-type-param.rs:3:13
+ |
+LL | let _ = f;
+ | - ^ cannot infer type for type parameter `A` declared on the function `f`
+ | |
+ | consider giving this pattern the explicit type `fn() -> A`, where the type parameter `A` is specified
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// compile-flags: --test
#[test]
error[E0277]: `?` couldn't convert the error to `()`
--> $DIR/try-on-option.rs:7:6
|
+LL | fn foo() -> Result<u32, ()> {
+ | --------------- expected `()` because of this
+LL | let x: Option<u32> = None;
LL | x?;
| ^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
|
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// aux-build:underscore-imports.rs
#![warn(unused_imports, unused_extern_crates)]
-Subproject commit 8751eb3010d4cdb5329b5a6bd2b6d765c95b0dca
+Subproject commit 90931d9b31e8b854522fed00916504a3ac6d8619
-Subproject commit 891e1a859b52486936e021235fdc36fbdd9b4100
+Subproject commit b7c802b5e33f5a402de3780bc5a8b05e7ebad409
|| self.config.target.contains("wasm32")
|| self.config.target.contains("nvptx")
|| self.is_vxworks_pure_static()
+ || self.config.target.contains("sgx")
{
// We primarily compile all auxiliary libraries as dynamic libraries
// to avoid code size bloat and large binaries as much as possible
}
fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Option<PathBuf> {
- // Ignore none HTML files.
+ // Ignore non-HTML files.
if file.extension().and_then(|s| s.to_str()) != Some("html") {
return None;
}
-Subproject commit 7de2a1f299f8744ffe109139f9f1fdf28bfec909
+Subproject commit 75491db0bff74a14dc6392b1491043bc7c924c65
// Some error codes don't have any tests apparently...
const IGNORE_EXPLANATION_CHECK: &[&str] =
- &["E0570", "E0601", "E0602", "E0639", "E0729", "E0749", "E0750", "E0751"];
+ &["E0570", "E0601", "E0602", "E0639", "E0729", "E0749", "E0750"];
fn check_error_code_explanation(
f: &str,